1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

InstCombine: Don't allow turning vector-of-pointer loads into vector-of-integer.

The code below can't handle any pointers. PR17293.

llvm-svn: 191036
This commit is contained in:
Benjamin Kramer 2013-09-19 20:59:04 +00:00
parent a8dfbd9e12
commit b681a45715
2 changed files with 12 additions and 1 deletions

View File

@ -318,7 +318,8 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
SrcPTy->isVectorTy()) &&
// Do not allow turning this into a load of an integer, which is then
// casted to a pointer, this pessimizes pointer analysis a lot.
(SrcPTy->isPointerTy() == LI.getType()->isPointerTy()) &&
(SrcPTy->isPtrOrPtrVectorTy() ==
LI.getType()->isPtrOrPtrVectorTy()) &&
IC.getDataLayout()->getTypeSizeInBits(SrcPTy) ==
IC.getDataLayout()->getTypeSizeInBits(DestPTy)) {

View File

@ -144,3 +144,13 @@ define <2 x i16> @BitcastInsert(i32 %a) {
; CHECK-LABEL: @BitcastInsert(
; CHECK: bitcast i32 %a to <2 x i16>
}
; PR17293
define <2 x i64> @test7(<2 x i8*>* %arg) nounwind {
%cast = bitcast <2 x i8*>* %arg to <2 x i64>*
%load = load <2 x i64>* %cast, align 16
ret <2 x i64> %load
; CHECK: @test7
; CHECK: bitcast
; CHECK: load
}