[llvm] ModuloSchedule: Fix using getVRegDef/getUniqueVRegDef on physregs (PR #216795)
Hua Tian via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 21 20:51:32 PDT 2026
================
@@ -949,6 +949,8 @@ bool ModuloScheduleExpander::computeDelta(MachineInstr &MI, unsigned &Delta) {
return false;
Register BaseReg = BaseOp->getReg();
+ if (!BaseReg.isVirtual())
+ return false;
----------------
huaatian wrote:
I think it's reasonable to add protection here, as the function itself might be dealing with physical registers. Since expander functions are exclusively used in the SSA phase and are subject to other preconditions, no issues were reported when using this computeDelta function.
Additionally, should we add an IsSSA check at the entry of those expander functions?
https://github.com/llvm/llvm-project/pull/216795
More information about the llvm-commits
mailing list