disable this transformation in the one obscure case that really pessimizes
authorChris Lattner <sabre@nondot.org>
Tue, 29 Mar 2005 06:37:47 +0000 (06:37 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 29 Mar 2005 06:37:47 +0000 (06:37 +0000)
pointer analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20916 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index e944672d262894e87ea7da561aaa6af283d4b3d2..40088ba06be00f0beeacdc5887435c69babd3457 100644 (file)
@@ -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)) {