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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 09:04:44 PDT 2020


spatel 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()) {
----------------
Is there a need to check for multiple users that are identical? Ie, doesn't CSE make this unlikely?


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