[PATCH] D118317: [InstCombine] Fold and-reduce idiom

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 12:20:39 PST 2022


spatel accepted this revision.
spatel added a comment.

LGTM - if you don't plan to extend the predicate match to `isEquality` soon, please put a TODO comment on it.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5915
+  // Make sure we don't increase the number of instructions.
+  if (!InnerICmp->hasOneUse() || !BitCast->hasOneUse())
+    return nullptr;
----------------
You could roll these checks into the match line above with `m_OneUse()`...and that removes the need to capture the bitcast and inner icmp?


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

https://reviews.llvm.org/D118317



More information about the llvm-commits mailing list