[llvm] f7ebdec - [InstCombine] visitAnd - remove unnecessary Value *X, *Y shadow variables. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 10:01:32 PST 2020


Author: Simon Pilgrim
Date: 2020-11-17T17:59:21Z
New Revision: f7ebdec987f52262fa3e2b0172f0881a9c4f224f

URL: https://github.com/llvm/llvm-project/commit/f7ebdec987f52262fa3e2b0172f0881a9c4f224f
DIFF: https://github.com/llvm/llvm-project/commit/f7ebdec987f52262fa3e2b0172f0881a9c4f224f.diff

LOG: [InstCombine] visitAnd - remove unnecessary Value *X, *Y shadow variables. NFCI.

Fixes a number of Wshadow warnings.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index bb8ace29931a..c8a45509e1dc 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -1922,7 +1922,6 @@ Instruction *InstCombinerImpl::visitAnd(BinaryOperator &I) {
 
     // TODO: Make this recursive; it's a little tricky because an arbitrary
     // number of 'and' instructions might have to be created.
-    Value *X, *Y;
     if (LHS && match(Op1, m_OneUse(m_And(m_Value(X), m_Value(Y))))) {
       if (auto *Cmp = dyn_cast<ICmpInst>(X))
         if (Value *Res = foldAndOfICmps(LHS, Cmp, I))


        


More information about the llvm-commits mailing list