[llvm] [GlobalISel] Fold G_ICMP if possible (PR #86357)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 00:27:27 PDT 2024


================
@@ -3741,9 +3741,11 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned TypeIdx, LLT LowerHintTy) {
   }
   case TargetOpcode::G_ATOMIC_CMPXCHG_WITH_SUCCESS: {
     auto [OldValRes, SuccessRes, Addr, CmpVal, NewVal] = MI.getFirst5Regs();
-    MIRBuilder.buildAtomicCmpXchg(OldValRes, Addr, CmpVal, NewVal,
+    auto Tmp = MRI.createGenericVirtualRegister(MRI.getType(OldValRes));
----------------
arsenm wrote:

Should avoid creating temporary input regs like this 

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


More information about the llvm-commits mailing list