diff options
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index e944672d26..40088ba06b 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)) { |