diff options
author | Craig Topper <craig.topper@intel.com> | 2018-05-05 01:57:00 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-05-05 01:57:00 +0000 |
commit | 781aa181abddaa26c9f9bb06340f314d30095e50 (patch) | |
tree | e688ca627d6a38eb63f51d2ef61db02fc635866e /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | 00d83601b47dab3fb2893db2647964b568a045e3 (diff) | |
download | bcm5719-llvm-781aa181abddaa26c9f9bb06340f314d30095e50.tar.gz bcm5719-llvm-781aa181abddaa26c9f9bb06340f314d30095e50.zip |
Fix a bunch of places where operator-> was used directly on the return from dyn_cast.
Inspired by r331508, I did a grep and found these.
Mostly just change from dyn_cast to cast. Some cases also showed a dyn_cast result being converted to bool, so those I changed to isa.
llvm-svn: 331577
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 3f87fd913f4..639a0525624 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -2355,7 +2355,7 @@ int BoUpSLP::getEntryCost(TreeEntry *E) { } case Instruction::Load: { // Cost of wide load - cost of scalar loads. - unsigned alignment = dyn_cast<LoadInst>(VL0)->getAlignment(); + unsigned alignment = cast<LoadInst>(VL0)->getAlignment(); if (NeedToShuffleReuses) { ReuseShuffleCost -= (ReuseShuffleNumbers - VL.size()) * TTI->getMemoryOpCost(Instruction::Load, ScalarTy, @@ -2374,7 +2374,7 @@ int BoUpSLP::getEntryCost(TreeEntry *E) { } case Instruction::Store: { // We know that we can merge the stores. Calculate the cost. - unsigned alignment = dyn_cast<StoreInst>(VL0)->getAlignment(); + unsigned alignment = cast<StoreInst>(VL0)->getAlignment(); if (NeedToShuffleReuses) { ReuseShuffleCost -= (ReuseShuffleNumbers - VL.size()) * TTI->getMemoryOpCost(Instruction::Store, ScalarTy, @@ -5987,9 +5987,8 @@ static Value *getReductionValue(const DominatorTree *DT, PHINode *P, // reduction phi. Vectorizing such cases has been reported to cause // miscompiles. See PR25787. auto DominatedReduxValue = [&](Value *R) { - return ( - dyn_cast<Instruction>(R) && - DT->dominates(P->getParent(), dyn_cast<Instruction>(R)->getParent())); + return isa<Instruction>(R) && + DT->dominates(P->getParent(), cast<Instruction>(R)->getParent()); }; Value *Rdx = nullptr; |