[llvm] [InstSimplify] Canonicalize predicates into strict versions in simplifyICmpInst (PR #196238)

Iris Shi via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 01:39:06 PDT 2026


================
@@ -8802,6 +8802,9 @@ llvm::getFlippedStrictnessPredicateAndConstant(CmpPredicate Pred, Constant *C) {
     return std::nullopt;
 
   Type *Type = C->getType();
+
+  if (Type->getScalarSizeInBits() == 1)
+    return std::nullopt;
----------------
el-ev wrote:

Otherwise it would trigger an assertion about an invalid signed i1 value:

# | opt: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/APInt.h:121: llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isIntN(BitWidth, val) && "Value is not an N-bit signed value"' failed.


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


More information about the llvm-commits mailing list