[llvm] [SystemZ] Drop regstate of SELRMux operand in selectSLRMux(). (PR #128555)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 06:51:51 PST 2025


================
@@ -114,7 +114,7 @@ void SystemZPostRewrite::selectSELRMux(MachineBasicBlock &MBB,
   if (Src1Reg == Src2Reg) {
     BuildMI(*MBBI->getParent(), MBBI, MBBI->getDebugLoc(),
             TII->get(SystemZ::COPY), DestReg)
-        .addReg(MBBI->getOperand(1).getReg(), getRegState(MBBI->getOperand(1)));
+        .addReg(MBBI->getOperand(1).getReg(), RegState::Renamable);
----------------
uweigand wrote:

Hard-coding the renamable looks odd to me.  It may be correct now, but who knows what's going on after possible future changes?

Since the same register is present as both source operands, but with differing regstate flags, can't we simply use the *intersection* of the flags from the two operands here?

https://github.com/llvm/llvm-project/pull/128555


More information about the llvm-commits mailing list