From: Evandro Menezes Date: Wed, 24 Jul 2019 23:31:04 +0000 (+0000) Subject: [InstCombine] Swap order of checks to improve compile time (NFC) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cd5f9b65ddb6c1f3b79fd76df3ba6f2c182f004;p=platform%2Fupstream%2Fllvm.git [InstCombine] Swap order of checks to improve compile time (NFC) llvm-svn: 366962 --- diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index e0def81..2d218d6 100644 --- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -939,9 +939,9 @@ Value *LibCallSimplifier::optimizeMemCmp(CallInst *CI, IRBuilder<> &B) { return V; // memcmp(x, y, Len) == 0 -> bcmp(x, y, Len) == 0 - // `bcmp` can be more efficient than memcmp because it only has to know that - // there is a difference, not where it is. - if (isOnlyUsedInZeroEqualityComparison(CI) && TLI->has(LibFunc_bcmp)) { + // bcmp can be more efficient than memcmp because it only has to know that + // there is a difference, not how different one is to the other. + if (TLI->has(LibFunc_bcmp) && isOnlyUsedInZeroEqualityComparison(CI)) { Value *LHS = CI->getArgOperand(0); Value *RHS = CI->getArgOperand(1); Value *Size = CI->getArgOperand(2);