[llvm] [InstSimplify] Avoid use of ConstantExpr::getICmp. NFC (PR #67873)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 30 09:31:20 PDT 2023


================
@@ -3916,12 +3916,12 @@ static Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
           // is non-negative then LHS <s RHS.
           case ICmpInst::ICMP_SGT:
           case ICmpInst::ICMP_SGE:
-            return ConstantExpr::getICmp(ICmpInst::ICMP_SLT, C,
-                                         Constant::getNullValue(C->getType()));
+            return ConstantFoldCompareInstruction(
----------------
nikic wrote:

Or possibly we can move the ConstantFolder implementation out-of-line, because that's the only reason ConstantFold.h is a public header at all.

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


More information about the llvm-commits mailing list