[llvm] db9057e - [Sched] Skip MemOp with unknown size when clustering (#118443)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 04:15:02 PST 2024
Author: Pengcheng Wang
Date: 2024-12-05T20:14:58+08:00
New Revision: db9057edca0fe14987fb892f52bc51441316892c
URL: https://github.com/llvm/llvm-project/commit/db9057edca0fe14987fb892f52bc51441316892c
DIFF: https://github.com/llvm/llvm-project/commit/db9057edca0fe14987fb892f52bc51441316892c.diff
LOG: [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.
Added:
Modified:
llvm/lib/CodeGen/MachineScheduler.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 23e5e4a4da6d9a..7da9b3a9c27651 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));
More information about the llvm-commits
mailing list