[llvm] [MachineSink] Allow readReg instead of isUse (PR #204610)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 22 07:36:42 PDT 2026
================
@@ -2223,12 +2223,7 @@ static bool hasRegisterDependency(MachineInstr *MI,
break;
}
DefedRegsInCopy.push_back(Reg);
-
- // FIXME: instead of isUse(), readsReg() would be a better fix here,
- // For example, we can ignore modifications in reg with undef. However,
- // it's not perfectly clear if skipping the internal read is safe in all
- // other targets.
- } else if (MO.isUse()) {
+ } else if (MO.readsReg()) {
----------------
AZero13 wrote:
Note that isDef and readsReg are not mutually exclusive. A subreg def "reads" the parts of reg that are not defined. So maybe the "else" here is not appropriate? I'm not sure what the effect would be of changing that.
Well, putting defs into the UsedOpsInCopy.push_back(i); would be bad it seems.
https://github.com/llvm/llvm-project/pull/204610
More information about the llvm-commits
mailing list