[PATCH] D65530: [InstCombine] foldXorOfICmps(): don't give up on non-single-use ICmp's if all users are freely invertible

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 10:30:59 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2654-2655
 
-Value *InstCombiner::foldXorOfICmps(ICmpInst *LHS, ICmpInst *RHS) {
+// Given i1 V, can every user of V can be freely adapted if V is changed to !V ?
+static bool CanFreelyInvertAllUsersOf(Value *V, Value *IgnoredUser) {
+  // Look at every user of V.
----------------
spatel wrote:
> spatel wrote:
> > Is there a way to share logic with the existing IsFreeToInvert()? Can we put them next to each other in 1 file, so it's easier to discover that both exist?
> 'V can be' -> 'V be'
Right, i should have put it next to `IsFreeToInvert()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65530





More information about the llvm-commits mailing list