summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-02 05:37:12 +0000
committerChris Lattner <sabre@nondot.org>2006-04-02 05:37:12 +0000
commitebca476b274deb26fe8e598c95ea91a622b8bb32 (patch)
treee74c887d6dea68979baa89901f49a96ab281598b /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parentf42d0aeda16357403fff5729676fab2cb50008c7 (diff)
downloadbcm5719-llvm-ebca476b274deb26fe8e598c95ea91a622b8bb32.tar.gz
bcm5719-llvm-ebca476b274deb26fe8e598c95ea91a622b8bb32.zip
Allow transforming this:
%tmp = cast <4 x uint>* %testData to <4 x int>* ; <<4 x int>*> [#uses=1] %tmp = load <4 x int>* %tmp ; <<4 x int>> [#uses=1] to this: %tmp = load <4 x uint>* %testData ; <<4 x uint>> [#uses=1] %tmp = cast <4 x uint> %tmp to <4 x int> ; <<4 x int>> [#uses=1] llvm-svn: 27353
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 3697b2a5148..82e70073e83 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -6234,7 +6234,8 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI) {
if (const PointerType *SrcTy = dyn_cast<PointerType>(CastOp->getType())) {
const Type *SrcPTy = SrcTy->getElementType();
- if (DestPTy->isInteger() || isa<PointerType>(DestPTy)) {
+ if (DestPTy->isInteger() || isa<PointerType>(DestPTy) ||
+ isa<PackedType>(DestPTy)) {
// If the source is an array, the code below will not succeed. Check to
// see if a trivial 'gep P, 0, 0' will help matters. Only do this for
// constants.
@@ -6247,7 +6248,8 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI) {
SrcPTy = SrcTy->getElementType();
}
- if ((SrcPTy->isInteger() || isa<PointerType>(SrcPTy)) &&
+ if ((SrcPTy->isInteger() || isa<PointerType>(SrcPTy) ||
+ isa<PackedType>(SrcPTy)) &&
// Do not allow turning this into a load of an integer, which is then
// casted to a pointer, this pessimizes pointer analysis a lot.
(isa<PointerType>(SrcPTy) == isa<PointerType>(LI.getType())) &&
OpenPOWER on IntegriCloud