[PATCH] D64285: [InstCombine] Fold select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y) to ashr (X, Y))

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 06:26:22 PDT 2019


lebedev.ri added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:562
+    const auto *Ashr = dyn_cast<BinaryOperator>(FalseVal);
+    if (!cast<BinaryOperator>(TrueVal)->isExact() && Ashr->isExact()) {
+      // This new ashr must not be exact.
----------------
There is no legality reason for this check.
We won't (should not) get here in any other case other than when we **need** to produce the `exact`-less `ashr`.


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

https://reviews.llvm.org/D64285





More information about the llvm-commits mailing list