[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 05:57:56 PDT 2019


lebedev.ri added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:559
+         cast<BinaryOperator>(FalseVal)->isExact())) {
+      cast<BinaryOperator>(FalseVal)->setIsExact(false);
+      return FalseVal;
----------------
lebedev.ri wrote:
> I'd really recommend to create a new instruction.
> It will result in same source line count, but is that much more transparent to the pass,
> and is e.g. visible in `-debug` output.
Err
+
/// This new `ashr` must not be exact.


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

https://reviews.llvm.org/D64285





More information about the llvm-commits mailing list