[PATCH] D152067: [ConstraintElimination] Handle equality predicates

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 06:12:00 PDT 2023


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:1012
+  bool Changed = false;
+  bool IsConditionImplied = CSToUse.isConditionImplied(R.Coefficients);
+
----------------
Thanks for the latest update! I think it should even go further and be something like `ConstraintTy::isImpliedBy(CS)`, so that  all logic for querying `CSToUse.isConditionImplied` is done there.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:950
 
-  bool Changed = false;
-  if (CSToUse.isConditionImplied(R.Coefficients)) {
+  auto ReplaceCmpWithConstant = [&](CmpInst *Cmp, bool IsTrue) {
     if (!DebugCounter::shouldExecute(EliminatedCounter))
----------------
antoniofrighetto wrote:
> fhahn wrote:
> > The changes here are mostly to avoid having to duplicate the code to create True/false constants, and indepdent of the patch, right? Could you split them of into a separate NFC patch?
> (Opened a separate patch for it, [[ https://reviews.llvm.org/D152143 | D152143 ]])
Great, thanks! Can you rebase this patch on top of  D152143?


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

https://reviews.llvm.org/D152067



More information about the llvm-commits mailing list