summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-12-30 15:27:33 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-12-30 15:27:33 +0000
commitc7fc81e6595865296738fe0f8ffe692ea41b1ffc (patch)
tree9c14093b59b87a53d42ecbeb9c263c85f46f97e3 /llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
parent06f6d262f99d4bc13739eb224084d239f5445682 (diff)
downloadbcm5719-llvm-c7fc81e6595865296738fe0f8ffe692ea41b1ffc.tar.gz
bcm5719-llvm-c7fc81e6595865296738fe0f8ffe692ea41b1ffc.zip
Use phi ranges to simplify code. No functionality change intended.
llvm-svn: 321585
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
index fd602257934..2646d0bcbf4 100644
--- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
@@ -1050,14 +1050,11 @@ bool PolynomialMultiplyRecognize::promoteTypes(BasicBlock *LoopB,
// Check if the exit values have types that are no wider than the type
// that we want to promote to.
unsigned DestBW = DestTy->getBitWidth();
- for (Instruction &In : *ExitB) {
- PHINode *P = dyn_cast<PHINode>(&In);
- if (!P)
- break;
- if (P->getNumIncomingValues() != 1)
+ for (PHINode &P : ExitB->phis()) {
+ if (P.getNumIncomingValues() != 1)
return false;
- assert(P->getIncomingBlock(0) == LoopB);
- IntegerType *T = dyn_cast<IntegerType>(P->getType());
+ assert(P.getIncomingBlock(0) == LoopB);
+ IntegerType *T = dyn_cast<IntegerType>(P.getType());
if (!T || T->getBitWidth() > DestBW)
return false;
}
OpenPOWER on IntegriCloud