[llvm] 6315163 - [ARM] Pass 2 instead of 0 to PHINode::Create in MVEGatherScatterLowering. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 16:00:15 PDT 2021


Author: Craig Topper
Date: 2021-07-08T15:59:33-07:00
New Revision: 631516301ea34f5e16dc13134037f2d748248606

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

LOG: [ARM] Pass 2 instead of 0 to PHINode::Create in MVEGatherScatterLowering. NFC

This parameter controls how much space is reserved for incoming
values. There are always going to be 2 incoming values in this case.

While there remove the unused std::vector right below.

Found while looking at porting this code to RISCV.

Added: 
    

Modified: 
    llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
index b5442c9a2247..6a2bbc1ae8e2 100644
--- a/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
+++ b/llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
@@ -1018,8 +1018,7 @@ bool MVEGatherScatterLowering::optimiseOffsets(Value *Offsets, BasicBlock *BB,
     NewPhi = Phi;
   } else {
     // There are other users -> create a new phi
-    NewPhi = PHINode::Create(Phi->getType(), 0, "NewPhi", Phi);
-    std::vector<Value *> Increases;
+    NewPhi = PHINode::Create(Phi->getType(), 2, "NewPhi", Phi);
     // Copy the incoming values of the old phi
     NewPhi->addIncoming(Phi->getIncomingValue(IncrementingBlock == 1 ? 0 : 1),
                         Phi->getIncomingBlock(IncrementingBlock == 1 ? 0 : 1));


        


More information about the llvm-commits mailing list