[PATCH] D67849: [InstCombine] (a+b) < a && (a+b) != 0 -> (0-b) < a iff a/b != 0 (PR43259)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 13:15:37 PDT 2019


lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1144-1145
                                     Instruction &CxtI) {
+  const SimplifyQuery Q = SQ.getWithInstruction(&CxtI);
+
   // Fold (!iszero(A & K1) & !iszero(A & K2)) ->  (A & (K1 | K2)) == (K1 | K2)
----------------
spatel wrote:
> Does this diff mean the existing code is buggy or somehow less powerful? Is there a path where the context instruction is not the 'and' or 'or'?
The current code is less powerful.
Without this, none of those folds happen.
In `SQ`, `CxtI` is `nullptr`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67849





More information about the llvm-commits mailing list