diff options
| author | Dan Gohman <gohman@apple.com> | 2009-05-01 17:07:43 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-05-01 17:07:43 +0000 |
| commit | 65dbe7874fc752fa1de536507ae68332660b00e7 (patch) | |
| tree | 50858edad1b9123fc4dd05a0828d894ff158b869 /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
| parent | 7227bc88f01820e27c80a4f3f32269eed3294534 (diff) | |
| download | bcm5719-llvm-65dbe7874fc752fa1de536507ae68332660b00e7.tar.gz bcm5719-llvm-65dbe7874fc752fa1de536507ae68332660b00e7.zip | |
Make RequiresTypeConversion canonicalize the types before calling the
target hooks canLosslesslyBitCastTo and isTruncateFree. This allows
targets to avoid worrying about handling all combinations of integer
and pointer types.
llvm-svn: 70555
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 7ba7ce8d0eb..29acfe8506e 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -1170,7 +1170,9 @@ bool LoopStrengthReduce::RequiresTypeConversion(const Type *Ty1, const Type *Ty2) { if (Ty1 == Ty2) return false; - if (SE->getEffectiveSCEVType(Ty1) == SE->getEffectiveSCEVType(Ty2)) + Ty1 = SE->getEffectiveSCEVType(Ty1); + Ty2 = SE->getEffectiveSCEVType(Ty2); + if (Ty1 == Ty2) return false; if (Ty1->canLosslesslyBitCastTo(Ty2)) return false; |

