summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-28 13:46:26 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-28 13:46:26 +0000
commit9cd9624fb68db36835229ba5b08f9797b2f9d16b (patch)
treece8c03ccf79779860c4be8f245385aabafb01715 /llvm/lib
parent5d0e6b6755da38084809d38bf527164a7f285ecd (diff)
downloadbcm5719-llvm-9cd9624fb68db36835229ba5b08f9797b2f9d16b.tar.gz
bcm5719-llvm-9cd9624fb68db36835229ba5b08f9797b2f9d16b.zip
[DAG] LegalizeVectorTypes - reduce scope of local variables. NFCI.
Move the element index/count variables into the block where they are actually used - appeases cppcheck and helps avoid shadow variable warnings. llvm-svn: 361821
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 379ee00c90f..aefc2aabf64 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -2812,14 +2812,13 @@ static SDValue CollectOpsToWiden(SelectionDAG &DAG, const TargetLowering &TLI,
SDLoc dl(ConcatOps[0]);
EVT WidenEltVT = WidenVT.getVectorElementType();
- int Idx = 0;
// while (Some element of ConcatOps is not of type MaxVT) {
// From the end of ConcatOps, collect elements of the same type and put
// them into an op of the next larger supported type
// }
while (ConcatOps[ConcatEnd-1].getValueType() != MaxVT) {
- Idx = ConcatEnd - 1;
+ int Idx = ConcatEnd - 1;
VT = ConcatOps[Idx--].getValueType();
while (Idx >= 0 && ConcatOps[Idx].getValueType() == VT)
Idx--;
@@ -4378,10 +4377,9 @@ SDValue DAGTypeLegalizer::WidenVecOp_MSCATTER(SDNode *N, unsigned OpNo) {
SDValue Index = MSC->getIndex();
SDValue Scale = MSC->getScale();
- unsigned NumElts;
if (OpNo == 1) {
DataOp = GetWidenedVector(DataOp);
- NumElts = DataOp.getValueType().getVectorNumElements();
+ unsigned NumElts = DataOp.getValueType().getVectorNumElements();
// Widen index.
EVT IndexVT = Index.getValueType();
OpenPOWER on IntegriCloud