[PATCH] D152067: [ConstraintElimination] Handle equality predicates

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 11 02:45:15 PDT 2023


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM with the additional nits addressed, thanks!



================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:130
+  /// Check whether the current constraint is implied by the given
+  /// ConstraintSystem.
+  std::optional<bool> isImpliedBy(const ConstraintSystem &CS) const;
----------------
nit: Would be good to also document the return value: std;:nullopt if iy couldn't prove the constraint is true or false, otherwise returns whether the constraint was prove true or false.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:580
+    auto Negated = ConstraintSystem::negate(Coefficients);
+    bool IsNegatedImplied = !Negated.empty() && CS.isConditionImplied(Negated);
+
----------------
Move this block and the next one after 
```
    if (IsConditionImplied && IsNegatedOrEqualImplied)
      return true;
```

to avoid unnecessary queries.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152067/new/

https://reviews.llvm.org/D152067



More information about the llvm-commits mailing list