[llvm] [GlobalISel] Fold G_ICMP if possible (PR #86357)
    Shilei Tian via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Mar 25 14:11:51 PDT 2024
    
    
  
================
@@ -7638,7 +7644,7 @@ LegalizerHelper::lowerSADDO_SSUBO(MachineInstr &MI) {
   // (LHS) if and only if the other operand (RHS) is (non-zero) positive,
   // otherwise there will be overflow.
   auto ResultLowerThanLHS =
-      MIRBuilder.buildICmp(CmpInst::ICMP_SLT, BoolTy, Dst0, LHS);
+      MIRBuilder.buildICmp(CmpInst::ICMP_SLT, BoolTy, Tmp, LHS);
----------------
shiltian wrote:
Does it also mean that it is generally not recommended to write like `Builder.buildInstr(MI.getOperand(0).getReg(), ...);`?
https://github.com/llvm/llvm-project/pull/86357
    
    
More information about the llvm-commits
mailing list