[PATCH] D60723: [EarlyCSE] detect equivalence of selects with inverse conditions and commuted operands (PR41101)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 15:05:29 PDT 2019


spatel marked 2 inline comments as done.
spatel added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/EarlyCSE.cpp:195
+      std::swap(TVal, FVal);
+    }
+    return hash_combine(Inst->getOpcode(), Cond, TVal, FVal);
----------------
nikic wrote:
> I think this check should be moved above the cmp handling: You can have a select(not(cmp(pred x, y)), t, f) where canonicalization is prevented both on the select and the not due to multiple uses. In this case we'd presumably still want to treat it exactly the same way as a select(cmp(pred x, y), f, t), including the predicate canonicalization above.
That seems like a good enhancement, but now I definitely will want to split things up when committing because we will have 3 independent changes in this review.


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

https://reviews.llvm.org/D60723





More information about the llvm-commits mailing list