[llvm] [X86][CodeGen] Return true when MIR is changed after optimizeCompareInstr (PR #91723)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 19:16:09 PDT 2024


================
@@ -5169,7 +5169,7 @@ bool X86InstrInfo::optimizeCompareInstr(MachineInstr &CmpInstr, Register SrcReg,
     // Fall through to optimize Cmp if Cmp is CMPrr or CMPri.
     if (NewOpcode == X86::CMP64rm || NewOpcode == X86::CMP32rm ||
         NewOpcode == X86::CMP16rm || NewOpcode == X86::CMP8rm)
-      return false;
+      return true;
----------------
phoebewang wrote:

My concern was, if the following code is a further optimization, it should never reture false because we has the base one. Or it is not correct to return true here.

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


More information about the llvm-commits mailing list