aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorPengcheng Wang <wangpengcheng.pp@bytedance.com>2024-12-05 20:14:58 +0800
committerGitHub <noreply@github.com>2024-12-05 20:14:58 +0800
commitdb9057edca0fe14987fb892f52bc51441316892c (patch)
treef94510d84d1e469db6f1d748f82d8cefa754e224 /llvm/lib/CodeGen/MachineScheduler.cpp
parentb6217f67a422d2c0e24bcfa80cf663b610a0cfc4 (diff)
downloadllvm-db9057edca0fe14987fb892f52bc51441316892c.zip
llvm-db9057edca0fe14987fb892f52bc51441316892c.tar.gz
llvm-db9057edca0fe14987fb892f52bc51441316892c.tar.bz2
[Sched] Skip MemOp with unknown size when clustering (#118443)
In #83875, we changed the type of `Width` to `LocationSize`. To get the clsuter bytes, we use `LocationSize::getValue()` to calculate the value. But when `Width` is an unknown size `LocationSize`, an assertion "Getting value from an unknown LocationSize!" will be triggered. This patch simply skips MemOp with unknown size to fix this issue and keep the logic the same as before. This issue was found when implementing software pipeliner for RISC-V in #117546. The pipeliner may clone some memory operations with `BeforeOrAfterPointer` size.
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 23e5e4a..7da9b3a 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -1947,6 +1947,9 @@ void BaseMemOpClusterMutation::collectMemOpRecords(
LocationSize Width = 0;
if (TII->getMemOperandsWithOffsetWidth(MI, BaseOps, Offset,
OffsetIsScalable, Width, TRI)) {
+ if (!Width.hasValue())
+ continue;
+
MemOpRecords.push_back(
MemOpInfo(&SU, BaseOps, Offset, OffsetIsScalable, Width));