Skip to content

Commit db9057e

Browse files
authored
[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.
1 parent b6217f6 commit db9057e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/CodeGen/MachineScheduler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,9 @@ void BaseMemOpClusterMutation::collectMemOpRecords(
19471947
LocationSize Width = 0;
19481948
if (TII->getMemOperandsWithOffsetWidth(MI, BaseOps, Offset,
19491949
OffsetIsScalable, Width, TRI)) {
1950+
if (!Width.hasValue())
1951+
continue;
1952+
19501953
MemOpRecords.push_back(
19511954
MemOpInfo(&SU, BaseOps, Offset, OffsetIsScalable, Width));
19521955

0 commit comments

Comments
 (0)