[PATCH] D129622: [InstCombine] add fold (X > C - 1) ^ (X < C + 1) --> X != C

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 10:49:08 PDT 2022


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:3224
 
+    // (X > C - 1) ^ (X < C + 1) --> X != C
+    // (X < C + 1) ^ (X > C - 1) --> X != C
----------------
Did you make a general proof for this on alive2? Please add a link to the patch summary. I don't think this will be correct if the "+2" overflows?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129622



More information about the llvm-commits mailing list