diff options
author | Devang Patel <dpatel@apple.com> | 2008-08-27 20:55:23 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-08-27 20:55:23 +0000 |
commit | d6adbb6a0f4ca6a2713cac5cac45e8c3ca2205bb (patch) | |
tree | 7c926c28202c8c581e7f722553ed2b26863f536c /llvm/lib | |
parent | d3a1b46aad8dc37e30ddd3f629a21badd1a2c071 (diff) | |
download | bcm5719-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.cpp | 11 |
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; |