summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-29 06:37:47 +0000
committerChris Lattner <sabre@nondot.org>2005-03-29 06:37:47 +0000
commitb1515fe52270506faf1cff3184606cf76ace892b (patch)
tree1eeedd9fc6db59fe4d7dff638ce703b1f2814f9e
parent0b77be8f0f56cfcd1d6c39760151caf34f96029a (diff)
disable this transformation in the one obscure case that really pessimizes
pointer analysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20916 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index e944672d262..40088ba06be 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -4646,6 +4646,9 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI) {
}
if ((SrcPTy->isInteger() || isa<PointerType>(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())) &&
IC.getTargetData().getTypeSize(SrcPTy) ==
IC.getTargetData().getTypeSize(DestPTy)) {