[PATCH] D75840: [ExpandMemCmp] Improve non-equality comparisons with zero.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 09:37:10 PDT 2020


courbet marked an inline comment as done.
courbet added inline comments.


================
Comment at: llvm/lib/CodeGen/ExpandMemCmp.cpp:680-684
+// If the memcmp is only used for a given comparison against zero,
+// return that predicate.
+static CmpInst::Predicate isOnlyUsedInZeroComparison(const Instruction *CxtI) {
+  CmpInst::Predicate CommonPred = CmpInst::BAD_ICMP_PREDICATE;
+  for (const User *U : CxtI->users()) {
----------------
spatel wrote:
> Is there a need to check for multiple users that are identical? Ie, doesn't CSE make this unlikely?
It might be unlikely, but it's not guaranteed.  I'm not sure how I would handle diverging users, did yo have anything specific in mind ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75840





More information about the llvm-commits mailing list