[llvm] 25b2126 - [NFC] Remove redundant variable

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 09:53:19 PDT 2021


Author: Arthur Eubanks
Date: 2021-06-15T09:53:11-07:00
New Revision: 25b2126b9e9c28e48ce4e6e40af624767e5fb146

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

LOG: [NFC] Remove redundant variable

Differential Revision: https://reviews.llvm.org/D103706

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index e7bebdb9628f2..e8c2ba93d643d 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
@@ -337,21 +337,16 @@ SmallVector<Bucket, 16> PPCLoopInstrFormPrep::collectCandidates(
   for (const auto &BB : L->blocks())
     for (auto &J : *BB) {
       Value *PtrValue;
-      Instruction *MemI;
 
       if (LoadInst *LMemI = dyn_cast<LoadInst>(&J)) {
-        MemI = LMemI;
         PtrValue = LMemI->getPointerOperand();
       } else if (StoreInst *SMemI = dyn_cast<StoreInst>(&J)) {
-        MemI = SMemI;
         PtrValue = SMemI->getPointerOperand();
       } else if (IntrinsicInst *IMemI = dyn_cast<IntrinsicInst>(&J)) {
         if (IMemI->getIntrinsicID() == Intrinsic::prefetch ||
             IMemI->getIntrinsicID() == Intrinsic::ppc_vsx_lxvp) {
-          MemI = IMemI;
           PtrValue = IMemI->getArgOperand(0);
         } else if (IMemI->getIntrinsicID() == Intrinsic::ppc_vsx_stxvp) {
-          MemI = IMemI;
           PtrValue = IMemI->getArgOperand(1);
         } else continue;
       } else continue;
@@ -369,7 +364,7 @@ SmallVector<Bucket, 16> PPCLoopInstrFormPrep::collectCandidates(
         continue;
 
       if (isValidCandidate(&J, PtrValue))
-        addOneCandidate(MemI, LSCEV, Buckets, MaxCandidateNum);
+        addOneCandidate(&J, LSCEV, Buckets, MaxCandidateNum);
     }
   return Buckets;
 }


        


More information about the llvm-commits mailing list