summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-08-27 20:55:23 +0000
committerDevang Patel <dpatel@apple.com>2008-08-27 20:55:23 +0000
commitd6adbb6a0f4ca6a2713cac5cac45e8c3ca2205bb (patch)
tree7c926c28202c8c581e7f722553ed2b26863f536c /llvm/lib
parentd3a1b46aad8dc37e30ddd3f629a21badd1a2c071 (diff)
downloadbcm5719-llvm-d6adbb6a0f4ca6a2713cac5cac45e8c3ca2205bb.tar.gz
bcm5719-llvm-d6adbb6a0f4ca6a2713cac5cac45e8c3ca2205bb.zip
Do not apply the transformation if the target does not support DestTy natively.
llvm-svn: 55433
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 19095a6acff..9c1a95331e3 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1735,8 +1735,15 @@ void LoopStrengthReduce::OptimizeShadowIV(Loop *L) {
DestTy = UCast->getDestTy();
else if (SIToFPInst *SCast = dyn_cast<SIToFPInst>(CandidateUI->User))
DestTy = SCast->getDestTy();
- if (!DestTy) continue;
-
+ if (!DestTy) continue;
+
+ if (TLI) {
+ /* If target does not support DestTy natively then do not apply
+ this transformation. */
+ MVT DVT = TLI->getValueType(DestTy);
+ if (!TLI->isTypeLegal(DVT)) continue;
+ }
+
PHINode *PH = dyn_cast<PHINode>(ShadowUse->getOperand(0));
if (!PH) continue;
if (PH->getNumIncomingValues() != 2) continue;
OpenPOWER on IntegriCloud