[PATCH] D52263: [InstCombine] Handle vector compares in foldGEPIcmp()
    Roman Lebedev via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep 19 06:54:37 PDT 2018
    
    
  
lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.
LG with a nit.
================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:979-980
         return replaceInstUsesWith(I, // No comparison is needed here.
-                             Builder.getInt1(ICmpInst::isTrueWhenEqual(Cond)));
+          Constant::getIntegerValue(I.getType(),
+                                    APInt(1, ICmpInst::isTrueWhenEqual(Cond))));
 
----------------
There are all these `Constant::get()`/`ConstantInt::get()` overloads that don't require `APInt`.
Have you checked they aren't sufficient?
https://reviews.llvm.org/D52263
    
    
More information about the llvm-commits
mailing list