[llvm] [ConstraintElimination] Add eq/ne facts to signed constraint system (PR #121423)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 23:51:48 PST 2025


================
@@ -636,8 +645,13 @@ static Decomposition decompose(Value *V,
 
 ConstraintTy
 ConstraintInfo::getConstraint(CmpInst::Predicate Pred, Value *Op0, Value *Op1,
-                              SmallVectorImpl<Value *> &NewVariables) const {
+                              SmallVectorImpl<Value *> &NewVariables,
+                              bool ForceSignedSystem) const {
   assert(NewVariables.empty() && "NewVariables must be empty when passed in");
+  assert((!ForceSignedSystem || Pred == CmpInst::ICMP_EQ ||
+          Pred == CmpInst::ICMP_NE) &&
+         "signed system can only be forced on eq/ne");
----------------
dtcxzyw wrote:

```suggestion
  assert((!ForceSignedSystem || ICmpInst::isEquality(Pred)) &&
         "signed system can only be forced on eq/ne");
```

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


More information about the llvm-commits mailing list