38 changes: 19 additions & 19 deletions llvm/test/Transforms/InstCombine/2006-12-15-Range-Test.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@

target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
@r = external global [17 x i32] ; <[17 x i32]*> [#uses=1]
@r = external global [17 x i32] ; <ptr> [#uses=1]

define i1 @print_pgm_cond_true(i32 %tmp12.reload, i32* %tmp16.out) {
define i1 @print_pgm_cond_true(i32 %tmp12.reload, ptr %tmp16.out) {
; CHECK-LABEL: @print_pgm_cond_true(
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label [[COND_TRUE:%.*]]
; CHECK: bb27.exitStub:
; CHECK-NEXT: store i32 [[TMP16:%.*]], i32* [[TMP16_OUT:%.*]], align 4
; CHECK-NEXT: store i32 [[TMP16:%.*]], ptr [[TMP16_OUT:%.*]], align 4
; CHECK-NEXT: ret i1 true
; CHECK: cond_next23.exitStub:
; CHECK-NEXT: store i32 [[TMP16]], i32* [[TMP16_OUT]], align 4
; CHECK-NEXT: store i32 [[TMP16]], ptr [[TMP16_OUT]], align 4
; CHECK-NEXT: ret i1 false
; CHECK: cond_true:
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr [17 x i32], [17 x i32]* @r, i32 0, i32 [[TMP12_RELOAD:%.*]]
; CHECK-NEXT: [[TMP16]] = load i32, i32* [[TMP15]], align 4
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr [17 x i32], ptr @r, i32 0, i32 [[TMP12_RELOAD:%.*]]
; CHECK-NEXT: [[TMP16]] = load i32, ptr [[TMP15]], align 4
; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[TMP16]], -32
; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[TMP0]], -63
; CHECK-NEXT: br i1 [[TMP1]], label [[BB27_EXITSTUB:%.*]], label [[COND_NEXT23_EXITSTUB:%.*]]
Expand All @@ -26,35 +26,35 @@ newFuncRoot:
br label %cond_true

bb27.exitStub: ; preds = %cond_true
store i32 %tmp16, i32* %tmp16.out
store i32 %tmp16, ptr %tmp16.out
ret i1 true

cond_next23.exitStub: ; preds = %cond_true
store i32 %tmp16, i32* %tmp16.out
store i32 %tmp16, ptr %tmp16.out
ret i1 false

cond_true: ; preds = %newFuncRoot
%tmp15 = getelementptr [17 x i32], [17 x i32]* @r, i32 0, i32 %tmp12.reload ; <i32*> [#uses=1]
%tmp16 = load i32, i32* %tmp15 ; <i32> [#uses=4]
%tmp15 = getelementptr [17 x i32], ptr @r, i32 0, i32 %tmp12.reload ; <ptr> [#uses=1]
%tmp16 = load i32, ptr %tmp15 ; <i32> [#uses=4]
%tmp18 = icmp slt i32 %tmp16, -31 ; <i1> [#uses=1]
%tmp21 = icmp sgt i32 %tmp16, 31 ; <i1> [#uses=1]
%bothcond = or i1 %tmp18, %tmp21 ; <i1> [#uses=1]
br i1 %bothcond, label %bb27.exitStub, label %cond_next23.exitStub
}

define i1 @print_pgm_cond_true_logical(i32 %tmp12.reload, i32* %tmp16.out) {
define i1 @print_pgm_cond_true_logical(i32 %tmp12.reload, ptr %tmp16.out) {
; CHECK-LABEL: @print_pgm_cond_true_logical(
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label [[COND_TRUE:%.*]]
; CHECK: bb27.exitStub:
; CHECK-NEXT: store i32 [[TMP16:%.*]], i32* [[TMP16_OUT:%.*]], align 4
; CHECK-NEXT: store i32 [[TMP16:%.*]], ptr [[TMP16_OUT:%.*]], align 4
; CHECK-NEXT: ret i1 true
; CHECK: cond_next23.exitStub:
; CHECK-NEXT: store i32 [[TMP16]], i32* [[TMP16_OUT]], align 4
; CHECK-NEXT: store i32 [[TMP16]], ptr [[TMP16_OUT]], align 4
; CHECK-NEXT: ret i1 false
; CHECK: cond_true:
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr [17 x i32], [17 x i32]* @r, i32 0, i32 [[TMP12_RELOAD:%.*]]
; CHECK-NEXT: [[TMP16]] = load i32, i32* [[TMP15]], align 4
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr [17 x i32], ptr @r, i32 0, i32 [[TMP12_RELOAD:%.*]]
; CHECK-NEXT: [[TMP16]] = load i32, ptr [[TMP15]], align 4
; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[TMP16]], -32
; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[TMP0]], -63
; CHECK-NEXT: br i1 [[TMP1]], label [[BB27_EXITSTUB:%.*]], label [[COND_NEXT23_EXITSTUB:%.*]]
Expand All @@ -63,16 +63,16 @@ newFuncRoot:
br label %cond_true

bb27.exitStub: ; preds = %cond_true
store i32 %tmp16, i32* %tmp16.out
store i32 %tmp16, ptr %tmp16.out
ret i1 true

cond_next23.exitStub: ; preds = %cond_true
store i32 %tmp16, i32* %tmp16.out
store i32 %tmp16, ptr %tmp16.out
ret i1 false

cond_true: ; preds = %newFuncRoot
%tmp15 = getelementptr [17 x i32], [17 x i32]* @r, i32 0, i32 %tmp12.reload ; <i32*> [#uses=1]
%tmp16 = load i32, i32* %tmp15 ; <i32> [#uses=4]
%tmp15 = getelementptr [17 x i32], ptr @r, i32 0, i32 %tmp12.reload ; <ptr> [#uses=1]
%tmp16 = load i32, ptr %tmp15 ; <i32> [#uses=4]
%tmp18 = icmp slt i32 %tmp16, -31 ; <i1> [#uses=1]
%tmp21 = icmp sgt i32 %tmp16, 31 ; <i1> [#uses=1]
%bothcond = select i1 %tmp18, i1 true, i1 %tmp21 ; <i1> [#uses=1]
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
%struct.internal_state = type { i32 }
%struct.mng_data = type { i32, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i32, i32, i8, i32, i32, i32, i32, i16, i16, i16, i8, i8, double, double, double, i8, i8, i8, i8, i32, i32, i32, i32, i32, i8, i32, i32, i8*, i8* (i32)*, void (i8*, i32)*, void (i8*, i8*, i32)*, i8 (%struct.mng_data*)*, i8 (%struct.mng_data*)*, i8 (%struct.mng_data*, i8*, i32, i32*)*, i8 (%struct.mng_data*, i8*, i32, i32*)*, i8 (%struct.mng_data*, i32, i8, i32, i32, i32, i32, i8*)*, i8 (%struct.mng_data*, i32, i32, i8*)*, i8 (%struct.mng_data*, i32, i32)*, i8 (%struct.mng_data*, i8, i8*, i8*, i8*, i8*)*, i8 (%struct.mng_data*)*, i8 (%struct.mng_data*, i8*)*, i8 (%struct.mng_data*, i8*)*, i8 (%struct.mng_data*, i32, i32)*, i8 (%struct.mng_data*, i32, i32, i8*)*, i8 (%struct.mng_data*, i8, i8, i32, i32)*, i8* (%struct.mng_data*, i32)*, i8* (%struct.mng_data*, i32)*, i8* (%struct.mng_data*, i32)*, i8 (%struct.mng_data*, i32, i32, i32, i32)*, i32 (%struct.mng_data*)*, i8 (%struct.mng_data*, i32)*, i8 (%struct.mng_data*, i32)*, i8 (%struct.mng_data*, i32, i32, i32, i32, i32, i32, i32, i32)*, i8 (%struct.mng_data*, i8)*, i8 (%struct.mng_data*, i32, i8*)*, i8 (%struct.mng_data*, i32, i8, i8*)*, i8, i32, i32, i8*, i8*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, i8, i8, i8, i8, i32, i8, i8, i8, i32, i8*, i32, i8*, i32, i8, i8, i8, i32, i8*, i8*, i32, i32, i8*, i8*, %struct.mng_pushdata*, %struct.mng_pushdata*, %struct.mng_pushdata*, %struct.mng_pushdata*, i8, i8, i32, i32, i8*, i8, i8, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i32, i32, i8*, i32, i32, i32, i8, i8, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i8*, i8*, i8*, i32, i8*, i8*, i8*, i8*, i8*, %struct.mng_savedata*, i32, i32, i32, i32, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, [256 x i8], double, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, i16, i8, i8, i8, i8, i8, i32, i32, i8, i32, i32, i32, i32, i16, i16, i16, i8, i16, i8, i32, i32, i32, i32, i8, i32, i32, i8, i32, i32, i32, i32, i8, i32, i32, i8, i32, i32, i32, i32, i32, i8, i32, i8, i16, i16, i16, i16, i32, [256 x %struct.mng_palette8e], i32, [256 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i8*, i16, i16, i16, i8*, i8, i8, i32, i32, i32, i32, i8, void ()*, void ()*, void ()*, void ()*, void ()*, void ()*, i8*, i8, i8, i8, i32, i8*, i8*, i16, i16, i16, i16, i32, i32, i8*, %struct.z_stream, i32, i32, i32, i32, i32, i32, i8, i8, [256 x i32], i8 }
%struct.mng_data = type { i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i32, i32, i8, i32, i32, i32, i32, i16, i16, i16, i8, i8, double, double, double, i8, i8, i8, i8, i32, i32, i32, i32, i32, i8, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, i8, i8, i8, i8, i32, i8, i8, i8, i32, ptr, i32, ptr, i32, i8, i8, i8, i32, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, ptr, i8, i8, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i32, i32, ptr, i32, i32, i32, i8, i8, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, [256 x i8], double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i16, i8, i8, i8, i8, i8, i32, i32, i8, i32, i32, i32, i32, i16, i16, i16, i8, i16, i8, i32, i32, i32, i32, i8, i32, i32, i8, i32, i32, i32, i32, i8, i32, i32, i8, i32, i32, i32, i32, i32, i8, i32, i8, i16, i16, i16, i16, i32, [256 x %struct.mng_palette8e], i32, [256 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, ptr, i16, i16, i16, ptr, i8, i8, i32, i32, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i32, ptr, ptr, i16, i16, i16, i16, i32, i32, ptr, %struct.z_stream, i32, i32, i32, i32, i32, i32, i8, i8, [256 x i32], i8 }
%struct.mng_palette8e = type { i8, i8, i8 }
%struct.mng_pushdata = type { i8*, i8*, i32, i8, i8*, i32 }
%struct.mng_savedata = type { i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i8, i16, i8, i8, i32, i32, i8, i32, i32, i32, i32, i32, [256 x %struct.mng_palette8e], i32, [256 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i8*, i16, i16, i16 }
%struct.z_stream = type { i8*, i32, i32, i8*, i32, i32, i8*, %struct.internal_state*, i8* (i8*, i32, i32)*, void (i8*, i8*)*, i8*, i32, i32, i32 }
%struct.mng_pushdata = type { ptr, ptr, i32, i8, ptr, i32 }
%struct.mng_savedata = type { i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i8, i16, i8, i8, i32, i32, i8, i32, i32, i32, i32, i32, [256 x %struct.mng_palette8e], i32, [256 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, ptr, i16, i16, i16 }
%struct.z_stream = type { ptr, i32, i32, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, i32 }

define void @mng_write_basi(i8* %src1, i16* %src2) {
define void @mng_write_basi(ptr %src1, ptr %src2) {
entry:
%tmp = load i8, i8* %src1 ; <i8> [#uses=1]
%tmp = load i8, ptr %src1 ; <i8> [#uses=1]
%tmp.upgrd.1 = icmp ugt i8 %tmp, 8 ; <i1> [#uses=1]
%tmp.upgrd.2 = load i16, i16* %src2; <i16> [#uses=2]
%tmp.upgrd.2 = load i16, ptr %src2; <i16> [#uses=2]
%tmp3 = icmp eq i16 %tmp.upgrd.2, 255 ; <i1> [#uses=1]
%tmp7 = icmp eq i16 %tmp.upgrd.2, -1 ; <i1> [#uses=1]
%bOpaque.0.in = select i1 %tmp.upgrd.1, i1 %tmp7, i1 %tmp3 ; <i1> [#uses=1]
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ define i32 @test2(i32 %C) {
entry:
%A = alloca i32
%B = alloca i32
%tmp = call i32 (...) @bar( i32* %A ) ; <i32> [#uses=0]
%T = load i32, i32* %A ; <i32> [#uses=1]
%tmp = call i32 (...) @bar( ptr %A ) ; <i32> [#uses=0]
%T = load i32, ptr %A ; <i32> [#uses=1]
%tmp2 = icmp eq i32 %C, 0 ; <i1> [#uses=1]
br i1 %tmp2, label %cond_next, label %cond_true

cond_true: ; preds = %entry
store i32 123, i32* %B
store i32 123, ptr %B
call i32 @test2( i32 123 ) ; <i32>:0 [#uses=0]
%T1 = load i32, i32* %B ; <i32> [#uses=1]
%T1 = load i32, ptr %B ; <i32> [#uses=1]
br label %cond_next

cond_next: ; preds = %cond_true, %entry
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
; compile a kernel though...

target datalayout = "e-p:32:32"
@str = internal constant [6 x i8] c"%llx\0A\00" ; <[6 x i8]*> [#uses=1]
@str = internal constant [6 x i8] c"%llx\0A\00" ; <ptr> [#uses=1]

declare i32 @printf(i8*, ...)
declare i32 @printf(ptr, ...)

define i32 @main(i32 %x, i8** %a) {
define i32 @main(i32 %x, ptr %a) {
entry:
%tmp = getelementptr [6 x i8], [6 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1]
%tmp1 = load i8*, i8** %a ; <i8*> [#uses=1]
%tmp2 = ptrtoint i8* %tmp1 to i32 ; <i32> [#uses=1]
%tmp = getelementptr [6 x i8], ptr @str, i32 0, i64 0 ; <ptr> [#uses=1]
%tmp1 = load ptr, ptr %a ; <ptr> [#uses=1]
%tmp2 = ptrtoint ptr %tmp1 to i32 ; <i32> [#uses=1]
%tmp3 = zext i32 %tmp2 to i64 ; <i64> [#uses=1]
%tmp.upgrd.1 = call i32 (i8*, ...) @printf( i8* %tmp, i64 %tmp3 ) ; <i32> [#uses=0]
%tmp.upgrd.1 = call i32 (ptr, ...) @printf( ptr %tmp, i64 %tmp3 ) ; <i32> [#uses=0]
ret i32 0
}

4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
%struct.termbox = type { %struct.termbox*, i32, i32, i32, i32, i32 }
%struct.termbox = type { ptr, i32, i32, i32, i32, i32 }


define void @ggenorien() {
entry:
%tmp68 = icmp eq %struct.termbox* null, null ; <i1> [#uses=1]
%tmp68 = icmp eq ptr null, null ; <i1> [#uses=1]
br i1 %tmp68, label %cond_next448, label %bb80

bb80: ; preds = %entry
Expand Down
17 changes: 6 additions & 11 deletions llvm/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ define i32 @main() {
; CHECK-LABEL: @main(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[U:%.*]] = alloca %struct..1anon, align 8
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds %struct..1anon, %struct..1anon* [[U]], i64 0, i32 0
; CHECK-NEXT: store double 0x7FF0000000000000, double* [[TMP1]], align 8
; CHECK-NEXT: [[TMP34:%.*]] = bitcast %struct..1anon* [[U]] to %struct..0anon*
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds %struct..0anon, %struct..0anon* [[TMP34]], i64 0, i32 1
; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[TMP5]], align 4
; CHECK-NEXT: store double 0x7FF0000000000000, ptr [[U]], align 8
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds %struct..0anon, ptr [[U]], i64 0, i32 1
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP5]], align 4
; CHECK-NEXT: [[TMP89:%.*]] = and i32 [[TMP6]], 2146435072
; CHECK-NEXT: [[TMP0:%.*]] = icmp eq i32 [[TMP89]], 2146435072
; CHECK-NEXT: br i1 [[TMP0]], label %cond_false, label %cond_true
Expand All @@ -24,12 +22,9 @@ define i32 @main() {
;
entry:
%u = alloca %struct..1anon, align 8
%tmp1 = getelementptr %struct..1anon, %struct..1anon* %u, i32 0, i32 0
store double 0x7FF0000000000000, double* %tmp1
%tmp3 = getelementptr %struct..1anon, %struct..1anon* %u, i32 0, i32 0
%tmp34 = bitcast double* %tmp3 to %struct..0anon*
%tmp5 = getelementptr %struct..0anon, %struct..0anon* %tmp34, i32 0, i32 1
%tmp6 = load i32, i32* %tmp5
store double 0x7FF0000000000000, ptr %u
%tmp5 = getelementptr %struct..0anon, ptr %u, i32 0, i32 1
%tmp6 = load i32, ptr %tmp5
%tmp7 = shl i32 %tmp6, 1
%tmp8 = lshr i32 %tmp7, 21
%tmp89 = trunc i32 %tmp8 to i16
Expand Down
16 changes: 8 additions & 8 deletions llvm/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
target triple = "i686-pc-linux-gnu"


define i1 @test(i32* %tmp141, i32* %tmp145,
i32 %b8, i32 %iftmp.430.0, i32* %tmp134.out, i32* %tmp137.out)
define i1 @test(ptr %tmp141, ptr %tmp145,
i32 %b8, i32 %iftmp.430.0, ptr %tmp134.out, ptr %tmp137.out)
{
newFuncRoot:
%tmp133 = and i32 %b8, 1 ; <i32> [#uses=1]
%tmp134 = shl i32 %tmp133, 3 ; <i32> [#uses=3]
%tmp136 = ashr i32 %b8, 1 ; <i32> [#uses=1]
%tmp137 = shl i32 %tmp136, 3 ; <i32> [#uses=3]
%tmp139 = ashr i32 %tmp134, 2 ; <i32> [#uses=1]
store i32 %tmp139, i32* %tmp141
store i32 %tmp139, ptr %tmp141
%tmp143 = ashr i32 %tmp137, 2 ; <i32> [#uses=1]
store i32 %tmp143, i32* %tmp145
store i32 %tmp143, ptr %tmp145
icmp eq i32 %iftmp.430.0, 0 ; <i1>:0 [#uses=1]
zext i1 %0 to i8 ; <i8>:1 [#uses=1]
icmp ne i8 %1, 0 ; <i1>:2 [#uses=1]
br i1 %2, label %cond_true147.exitStub, label %cond_false252.exitStub

cond_true147.exitStub: ; preds = %newFuncRoot
store i32 %tmp134, i32* %tmp134.out
store i32 %tmp137, i32* %tmp137.out
store i32 %tmp134, ptr %tmp134.out
store i32 %tmp137, ptr %tmp137.out
ret i1 true

cond_false252.exitStub: ; preds = %newFuncRoot
store i32 %tmp134, i32* %tmp134.out
store i32 %tmp137, i32* %tmp137.out
store i32 %tmp134, ptr %tmp134.out
store i32 %tmp137, ptr %tmp137.out
ret i1 false
}
10 changes: 4 additions & 6 deletions llvm/test/Transforms/InstCombine/2007-05-14-Crash.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
target triple = "powerpc-unknown-linux-gnu"

%struct.abc = type { i32, [32 x i8] }
%struct.def = type { i8**, %struct.abc }
%struct.def = type { ptr, %struct.abc }
%struct.anon = type <{ }>

define i8* @foo(%struct.anon* %deviceRef, %struct.abc* %pCap) {
define ptr @foo(ptr %deviceRef, ptr %pCap) {
entry:
%tmp1 = bitcast %struct.anon* %deviceRef to %struct.def*
%tmp3 = getelementptr %struct.def, %struct.def* %tmp1, i32 0, i32 1
%tmp35 = bitcast %struct.abc* %tmp3 to i8*
ret i8* %tmp35
%tmp3 = getelementptr %struct.def, ptr %deviceRef, i32 0, i32 1
ret ptr %tmp3
}


6 changes: 3 additions & 3 deletions llvm/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
; RUN: opt < %s -passes=instcombine -S | grep "call.*sret"
; Make sure instcombine doesn't drop the sret attribute.

define void @blah(i16* %tmp10) {
define void @blah(ptr %tmp10) {
entry:
call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend_stret to void (i16*)*)(i16* sret(i16) %tmp10)
call void @objc_msgSend_stret(ptr sret(i16) %tmp10)
ret void
}

declare i8* @objc_msgSend_stret(i8*, i8*, ...)
declare ptr @objc_msgSend_stret(ptr, ptr, ...)
10 changes: 5 additions & 5 deletions llvm/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
; RUN: opt < %s -passes=instcombine -S | grep "ashr"
; PR1499

define void @av_cmp_q_cond_true(i32* %retval, i32* %tmp9, i64* %tmp10) {
define void @av_cmp_q_cond_true(ptr %retval, ptr %tmp9, ptr %tmp10) {
newFuncRoot:
br label %cond_true

return.exitStub: ; preds = %cond_true
ret void

cond_true: ; preds = %newFuncRoot
%tmp30 = load i64, i64* %tmp10 ; <i64> [#uses=1]
%tmp30 = load i64, ptr %tmp10 ; <i64> [#uses=1]
%.cast = zext i32 63 to i64 ; <i64> [#uses=1]
%tmp31 = ashr i64 %tmp30, %.cast ; <i64> [#uses=1]
%tmp3132 = trunc i64 %tmp31 to i32 ; <i32> [#uses=1]
%tmp33 = or i32 %tmp3132, 1 ; <i32> [#uses=1]
store i32 %tmp33, i32* %tmp9
%tmp34 = load i32, i32* %tmp9 ; <i32> [#uses=1]
store i32 %tmp34, i32* %retval
store i32 %tmp33, ptr %tmp9
%tmp34 = load i32, ptr %tmp9 ; <i32> [#uses=1]
store i32 %tmp34, ptr %retval
br label %return.exitStub
}

8 changes: 4 additions & 4 deletions llvm/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
; RUN: opt < %s -passes=instcombine -S | grep icmp
; PR1646

@__gthrw_pthread_cancel = weak alias i32 (i32), i32 (i32)* @pthread_cancel ; <i32 (i32)*> [#uses=1]
@__gthread_active_ptr.5335 = internal constant i8* bitcast (i32 (i32)* @__gthrw_pthread_cancel to i8*) ; <i8**> [#uses=1]
@__gthrw_pthread_cancel = weak alias i32 (i32), ptr @pthread_cancel ; <ptr> [#uses=1]
@__gthread_active_ptr.5335 = internal constant ptr @__gthrw_pthread_cancel ; <ptr> [#uses=1]
define weak i32 @pthread_cancel(i32) {
ret i32 0
}

define i1 @__gthread_active_p() {
entry:
%tmp1 = load i8*, i8** @__gthread_active_ptr.5335, align 4 ; <i8*> [#uses=1]
%tmp2 = icmp ne i8* %tmp1, null ; <i1> [#uses=1]
%tmp1 = load ptr, ptr @__gthread_active_ptr.5335, align 4 ; <ptr> [#uses=1]
%tmp2 = icmp ne ptr %tmp1, null ; <i1> [#uses=1]
ret i1 %tmp2
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; RUN: opt < %s -passes=instcombine -S | grep icmp
; PR1678

@A = weak alias void (), void ()* @B ; <void ()*> [#uses=1]
@A = weak alias void (), ptr @B ; <ptr> [#uses=1]

define weak void @B() {
ret void
Expand All @@ -10,7 +10,7 @@ define weak void @B() {
define i32 @active() {
entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%tmp1 = icmp ne void ()* @A, null ; <i1> [#uses=1]
%tmp1 = icmp ne ptr @A, null ; <i1> [#uses=1]
%tmp12 = zext i1 %tmp1 to i32 ; <i32> [#uses=1]
ret i32 %tmp12
}
15 changes: 7 additions & 8 deletions llvm/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
; RUN: opt < %s -O3 -S | not grep xyz
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"

@.str = internal constant [4 x i8] c"xyz\00" ; <[4 x i8]*> [#uses=1]
@.str = internal constant [4 x i8] c"xyz\00" ; <ptr> [#uses=1]

define void @foo(i8* %P) {
define void @foo(ptr %P) {
entry:
%P_addr = alloca i8*
store i8* %P, i8** %P_addr
%tmp = load i8*, i8** %P_addr, align 4
%tmp1 = getelementptr [4 x i8], [4 x i8]* @.str, i32 0, i32 0
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* %tmp1, i32 4, i1 false)
%P_addr = alloca ptr
store ptr %P, ptr %P_addr
%tmp = load ptr, ptr %P_addr, align 4
call void @llvm.memcpy.p0.p0.i32(ptr %tmp, ptr @.str, i32 4, i1 false)
br label %return

return: ; preds = %entry
ret void
}

declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind
15 changes: 7 additions & 8 deletions llvm/test/Transforms/InstCombine/2007-10-12-Crash.ll
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
; RUN: opt < %s -passes=instcombine -disable-output

%struct.Ray = type { %struct.Vec, %struct.Vec }
%struct.Scene = type { i32 (...)** }
%struct.Scene = type { ptr }
%struct.Vec = type { double, double, double }

declare double @_Z9ray_traceRK3VecRK3RayRK5Scene(%struct.Vec*, %struct.Ray*, %struct.Scene*)
declare double @_Z9ray_traceRK3VecRK3RayRK5Scene(ptr, ptr, ptr)

define i32 @main(i32 %argc, i8** %argv) {
define i32 @main(i32 %argc, ptr %argv) {
entry:
%tmp3 = alloca %struct.Ray, align 4 ; <%struct.Ray*> [#uses=2]
%tmp3 = alloca %struct.Ray, align 4 ; <ptr> [#uses=2]
%tmp97 = icmp slt i32 0, 512 ; <i1> [#uses=1]
br i1 %tmp97, label %bb71, label %bb108

bb29: ; preds = %bb62
%tmp322 = bitcast %struct.Ray* %tmp3 to %struct.Vec* ; <%struct.Vec*> [#uses=1]
%tmp322.0 = getelementptr %struct.Vec, %struct.Vec* %tmp322, i32 0, i32 0 ; <double*> [#uses=1]
store double 0.000000e+00, double* %tmp322.0
%tmp57 = call double @_Z9ray_traceRK3VecRK3RayRK5Scene( %struct.Vec* null, %struct.Ray* %tmp3, %struct.Scene* null ) ; <double> [#uses=0]
%tmp322.0 = getelementptr %struct.Vec, ptr %tmp3, i32 0, i32 0 ; <ptr> [#uses=1]
store double 0.000000e+00, ptr %tmp322.0
%tmp57 = call double @_Z9ray_traceRK3VecRK3RayRK5Scene( ptr null, ptr %tmp3, ptr null ) ; <double> [#uses=0]
br label %bb62

bb62: ; preds = %bb71, %bb29
Expand Down
22 changes: 10 additions & 12 deletions llvm/test/Transforms/InstCombine/2007-10-28-stacksave.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; PR1745
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i686-apple-darwin8"
@p = weak global i8* null ; <i8**> [#uses=1]
@p = weak global ptr null ; <ptr> [#uses=1]

define i32 @main() {
entry:
Expand All @@ -11,7 +11,7 @@ entry:

lab: ; preds = %cleanup31, %entry
%n.0 = phi i32 [ 0, %entry ], [ %tmp25, %cleanup31 ] ; <i32> [#uses=2]
%tmp2 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=2]
%tmp2 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=2]
%tmp4 = srem i32 %n.0, 47 ; <i32> [#uses=1]
%tmp5 = add i32 %tmp4, 1 ; <i32> [#uses=5]
%tmp7 = sub i32 %tmp5, 1 ; <i32> [#uses=0]
Expand All @@ -21,27 +21,25 @@ lab: ; preds = %cleanup31, %entry
%tmp1314 = zext i32 %tmp5 to i64 ; <i64> [#uses=1]
%tmp15 = mul i64 %tmp1314, 32 ; <i64> [#uses=0]
%tmp17 = mul i32 %tmp5, 4 ; <i32> [#uses=1]
%tmp18 = alloca i8, i32 %tmp17 ; <i8*> [#uses=1]
%tmp1819 = bitcast i8* %tmp18 to i32* ; <i32*> [#uses=2]
%tmp21 = getelementptr i32, i32* %tmp1819, i32 0 ; <i32*> [#uses=1]
store i32 1, i32* %tmp21, align 4
%tmp2223 = bitcast i32* %tmp1819 to i8* ; <i8*> [#uses=1]
store volatile i8* %tmp2223, i8** @p, align 4
%tmp18 = alloca i8, i32 %tmp17 ; <ptr> [#uses=1]
%tmp21 = getelementptr i32, ptr %tmp18, i32 0 ; <ptr> [#uses=1]
store i32 1, ptr %tmp21, align 4
store volatile ptr %tmp18, ptr @p, align 4
%tmp25 = add i32 %n.0, 1 ; <i32> [#uses=2]
%tmp27 = icmp sle i32 %tmp25, 999999 ; <i1> [#uses=1]
%tmp2728 = zext i1 %tmp27 to i8 ; <i8> [#uses=1]
%toBool = icmp ne i8 %tmp2728, 0 ; <i1> [#uses=1]
br i1 %toBool, label %cleanup31, label %cond_next

cond_next: ; preds = %lab
call void @llvm.stackrestore( i8* %tmp2 )
call void @llvm.stackrestore( ptr %tmp2 )
ret i32 0

cleanup31: ; preds = %lab
call void @llvm.stackrestore( i8* %tmp2 )
call void @llvm.stackrestore( ptr %tmp2 )
br label %lab
}

declare i8* @llvm.stacksave()
declare ptr @llvm.stacksave()

declare void @llvm.stackrestore(i8*)
declare void @llvm.stackrestore(ptr)
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bb.i: ; preds = %entry
br label %bb51.i.i

bb27.i.i: ; preds = %bb51.i.i
%tmp31.i.i = load i16, i16* null, align 2 ; <i16> [#uses=2]
%tmp31.i.i = load i16, ptr null, align 2 ; <i16> [#uses=2]
%tmp35.i.i = icmp ult i16 %tmp31.i.i, 1 ; <i1> [#uses=1]
%tmp41.i.i = icmp ugt i16 %tmp31.i.i, -1 ; <i1> [#uses=1]
%bothcond.i.i = or i1 %tmp35.i.i, %tmp41.i.i ; <i1> [#uses=1]
Expand Down
5 changes: 2 additions & 3 deletions llvm/test/Transforms/InstCombine/2007-10-31-StringCrash.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ target triple = "i686-apple-darwin8"

declare void @__darwin_gcc3_preregister_frame_info()

define void @_start(i32 %argc, i8** %argv, i8** %envp) {
define void @_start(i32 %argc, ptr %argv, ptr %envp) {
entry:
%tmp1 = bitcast void ()* @__darwin_gcc3_preregister_frame_info to i32* ; <i32*> [#uses=1]
%tmp2 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1]
%tmp2 = load i32, ptr @__darwin_gcc3_preregister_frame_info, align 4 ; <i32> [#uses=1]
%tmp3 = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1]
%tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1]
%toBool = icmp ne i8 %tmp34, 0 ; <i1> [#uses=1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ target triple = "i686-pc-linux-gnu"

define i32 @foo() {
entry:
%x = load i8, i8* bitcast (%opaque_t* @g to i8*)
%y = load i32, i32* bitcast (%op_ts* @h to i32*)
%x = load i8, ptr @g
%y = load i32, ptr @h
%z = zext i8 %x to i32
%r = add i32 %y, %z
ret i32 %r
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
; RUN: opt < %s -passes=instcombine -S | not grep bitcast
; PR1716

@.str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
@.str = internal constant [4 x i8] c"%d\0A\00" ; <ptr> [#uses=1]

define i32 @main(i32 %argc, i8** %argv) {
define i32 @main(i32 %argc, ptr %argv) {
entry:
%tmp32 = tail call i32 (i8* , ...) bitcast (i32 (i8*, ...) * @printf to i32 (i8* , ...) *)( i8* getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0) , i32 0 ) nounwind ; <i32> [#uses=0]
%tmp32 = tail call i32 (ptr , ...) @printf( ptr @.str , i32 0 ) nounwind ; <i32> [#uses=0]
ret i32 undef
}

declare i32 @printf(i8*, ...) nounwind
declare i32 @printf(ptr, ...) nounwind
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ target triple = "i686-pc-linux-gnu"
; PR1850

define i1 @test() {
%cond = icmp ule i8* inttoptr (i64 4294967297 to i8*), inttoptr (i64 5 to i8*)
%cond = icmp ule ptr inttoptr (i64 4294967297 to ptr), inttoptr (i64 5 to ptr)
ret i1 %cond
}
7 changes: 3 additions & 4 deletions llvm/test/Transforms/InstCombine/2007-12-12-GEPScale.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"

define i8* @foo([100 x {i8,i8,i8}]* %x) {
define ptr @foo(ptr %x) {
entry:
%p = bitcast [100 x {i8,i8,i8}]* %x to i8*
%q = getelementptr i8, i8* %p, i32 -4
ret i8* %q
%q = getelementptr i8, ptr %x, i32 -4
ret ptr %q
}
32 changes: 16 additions & 16 deletions llvm/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
define i32 @test1() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp ule i32 %sub, 0
%retval = select i1 %cmp, i32 0, i32 1
Expand All @@ -14,8 +14,8 @@ entry:
define i32 @test2() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp ugt i32 %sub, 0
%retval = select i1 %cmp, i32 1, i32 0
Expand All @@ -25,8 +25,8 @@ entry:
define i32 @test3() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp slt i32 %sub, 0
%retval = select i1 %cmp, i32 1, i32 0
Expand All @@ -36,8 +36,8 @@ entry:
define i32 @test4() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp sle i32 %sub, 0
%retval = select i1 %cmp, i32 1, i32 0
Expand All @@ -47,8 +47,8 @@ entry:
define i32 @test5() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp sge i32 %sub, 0
%retval = select i1 %cmp, i32 0, i32 1
Expand All @@ -58,8 +58,8 @@ entry:
define i32 @test6() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp sgt i32 %sub, 0
%retval = select i1 %cmp, i32 0, i32 1
Expand All @@ -69,8 +69,8 @@ entry:
define i32 @test7() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp eq i32 %sub, 0
%retval = select i1 %cmp, i32 0, i32 1
Expand All @@ -80,8 +80,8 @@ entry:
define i32 @test8() {
entry:
%z = alloca i32
store i32 0, i32* %z
%tmp = load i32, i32* %z
store i32 0, ptr %z
%tmp = load i32, ptr %z
%sub = sub i32 %tmp, 1
%cmp = icmp ne i32 %sub, 0
%retval = select i1 %cmp, i32 1, i32 0
Expand Down
16 changes: 8 additions & 8 deletions llvm/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ define void @a() {
ret void
}

define signext i32 @b(i32* inreg %x) {
define signext i32 @b(ptr inreg %x) {
ret i32 0
}

define void @c(...) {
ret void
}

define void @g(i32* %y) {
define void @g(ptr %y) {
; CHECK-LABEL: @g(
; CHECK: call i64 bitcast (i32 (i32*)* @b to i64 (i32)*)(i32 0)
%x = call i64 bitcast (i32 (i32*)* @b to i64 (i32)*)( i32 0 ) ; <i64> [#uses=0]
; CHECK: call i64 @b(i32 0)
%x = call i64 @b( i32 0 ) ; <i64> [#uses=0]

; The rest should not have bitcasts remaining
; CHECK-NOT: bitcast
call void bitcast (void ()* @a to void (i32*)*)( i32* noalias %y )
call <2 x i32> bitcast (i32 (i32*)* @b to <2 x i32> (i32*)*)( i32* inreg null ) ; <<2 x i32>>:1 [#uses=0]
call void bitcast (void (...)* @c to void (i32)*)( i32 0 )
call void bitcast (void (...)* @c to void (i32)*)( i32 zeroext 0 )
call void @a( ptr noalias %y )
call <2 x i32> @b( ptr inreg null ) ; <<2 x i32>>:1 [#uses=0]
call void @c( i32 0 )
call void @c( i32 zeroext 0 )
ret void
}
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstCombine/2008-01-06-CastCrash.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ define <2 x i32> @f() {
}

define i32 @g() {
%x = call i32 bitcast (<2 x i32> ()* @f to i32 ()*)( ) ; <i32> [#uses=1]
%x = call i32 @f( ) ; <i32> [#uses=1]
ret i32 %x
}
30 changes: 14 additions & 16 deletions llvm/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
; RUN: opt < %s -passes=instcombine -S | grep zeroext

%struct.FRAME.nest = type { i32, i32 (...)* }
%struct.FRAME.nest = type { i32, ptr }
%struct.__builtin_trampoline = type { [10 x i8] }

declare void @llvm.init.trampoline(i8*, i8*, i8*) nounwind
declare i8* @llvm.adjust.trampoline(i8*) nounwind
declare void @llvm.init.trampoline(ptr, ptr, ptr) nounwind
declare ptr @llvm.adjust.trampoline(ptr) nounwind

declare i32 @f(%struct.FRAME.nest* nest , ...)
declare i32 @f(ptr nest , ...)

define i32 @nest(i32 %n) {
entry:
%FRAME.0 = alloca %struct.FRAME.nest, align 8 ; <%struct.FRAME.nest*> [#uses=3]
%TRAMP.216 = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1]
%TRAMP.216.sub = getelementptr [10 x i8], [10 x i8]* %TRAMP.216, i32 0, i32 0 ; <i8*> [#uses=1]
%tmp3 = getelementptr %struct.FRAME.nest, %struct.FRAME.nest* %FRAME.0, i32 0, i32 0 ; <i32*> [#uses=1]
store i32 %n, i32* %tmp3, align 8
%FRAME.06 = bitcast %struct.FRAME.nest* %FRAME.0 to i8* ; <i8*> [#uses=1]
call void @llvm.init.trampoline( i8* %TRAMP.216.sub, i8* bitcast (i32 (%struct.FRAME.nest*, ...)* @f to i8*), i8* %FRAME.06 ) ; <i8*> [#uses=1]
%tramp = call i8* @llvm.adjust.trampoline( i8* %TRAMP.216.sub)
%tmp7 = getelementptr %struct.FRAME.nest, %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (...)**> [#uses=1]
%tmp89 = bitcast i8* %tramp to i32 (...)* ; <i32 (...)*> [#uses=2]
store i32 (...)* %tmp89, i32 (...)** %tmp7, align 8
%tmp2.i = call i32 (...) %tmp89( i32 zeroext 0 ) ; <i32> [#uses=1]
%FRAME.0 = alloca %struct.FRAME.nest, align 8 ; <ptr> [#uses=3]
%TRAMP.216 = alloca [10 x i8], align 16 ; <ptr> [#uses=1]
%TRAMP.216.sub = getelementptr [10 x i8], ptr %TRAMP.216, i32 0, i32 0 ; <ptr> [#uses=1]
%tmp3 = getelementptr %struct.FRAME.nest, ptr %FRAME.0, i32 0, i32 0 ; <ptr> [#uses=1]
store i32 %n, ptr %tmp3, align 8
call void @llvm.init.trampoline( ptr %TRAMP.216.sub, ptr @f, ptr %FRAME.0 ) ; <ptr> [#uses=1]
%tramp = call ptr @llvm.adjust.trampoline( ptr %TRAMP.216.sub)
%tmp7 = getelementptr %struct.FRAME.nest, ptr %FRAME.0, i32 0, i32 1 ; <ptr> [#uses=1]
store ptr %tramp, ptr %tmp7, align 8
%tmp2.i = call i32 (...) %tramp( i32 zeroext 0 ) ; <i32> [#uses=1]
ret i32 %tmp2.i
}
10 changes: 5 additions & 5 deletions llvm/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
; RUN: opt < %s -passes=instcombine -S | grep "16" | count 1

define i8* @bork(i8** %qux) {
%tmp275 = load i8*, i8** %qux, align 1
%tmp275276 = ptrtoint i8* %tmp275 to i32
define ptr @bork(ptr %qux) {
%tmp275 = load ptr, ptr %qux, align 1
%tmp275276 = ptrtoint ptr %tmp275 to i32
%tmp277 = add i32 %tmp275276, 16
%tmp277278 = inttoptr i32 %tmp277 to i8*
ret i8* %tmp277278
%tmp277278 = inttoptr i32 %tmp277 to ptr
ret ptr %tmp277278
}
4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; RUN: opt < %s -passes=instcombine -S | grep "store volatile"

define void @test() {
%votf = alloca <4 x float> ; <<4 x float>*> [#uses=1]
store volatile <4 x float> zeroinitializer, <4 x float>* %votf, align 16
%votf = alloca <4 x float> ; <ptr> [#uses=1]
store volatile <4 x float> zeroinitializer, ptr %votf, align 16
ret void
}

Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
; RUN: opt < %s -passes=instcombine -S | grep "load volatile" | count 2
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin8"
@g_1 = internal global i32 0 ; <i32*> [#uses=3]
@g_1 = internal global i32 0 ; <ptr> [#uses=3]

define i32 @main() nounwind {
entry:
%tmp93 = icmp slt i32 0, 10 ; <i1> [#uses=0]
%tmp34 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1]
%tmp34 = load volatile i32, ptr @g_1, align 4 ; <i32> [#uses=1]
br label %bb

bb: ; preds = %bb, %entry
%b.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %tmp6, %bb ] ; <i32> [#uses=1]
%tmp3.reg2mem.0 = phi i32 [ %tmp34, %entry ], [ %tmp3, %bb ] ; <i32> [#uses=1]
%tmp4 = add i32 %tmp3.reg2mem.0, 5 ; <i32> [#uses=1]
store volatile i32 %tmp4, i32* @g_1, align 4
store volatile i32 %tmp4, ptr @g_1, align 4
%tmp6 = add i32 %b.0.reg2mem.0, 1 ; <i32> [#uses=2]
%tmp9 = icmp slt i32 %tmp6, 10 ; <i1> [#uses=1]
%tmp3 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1]
%tmp3 = load volatile i32, ptr @g_1, align 4 ; <i32> [#uses=1]
br i1 %tmp9, label %bb, label %bb11

bb11: ; preds = %bb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
; PR2262
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin8"
@g_1 = internal global i32 0 ; <i32*> [#uses=3]
@g_1 = internal global i32 0 ; <ptr> [#uses=3]

define i32 @main(i32 %i) nounwind {
entry:
%tmp93 = icmp slt i32 %i, 10 ; <i1> [#uses=0]
%tmp34 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1]
%tmp34 = load volatile i32, ptr @g_1, align 4 ; <i32> [#uses=1]
br i1 %tmp93, label %bb11, label %bb

bb: ; preds = %bb, %entry
%tmp3 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1]
%tmp3 = load volatile i32, ptr @g_1, align 4 ; <i32> [#uses=1]
br label %bb11

bb11: ; preds = %bb
Expand Down
22 changes: 11 additions & 11 deletions llvm/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ target triple = "i386-apple-darwin8"
define i32 @a() nounwind {
entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%tmp1 = call i8* @malloc( i32 10 ) nounwind ; <i8*> [#uses=5]
%tmp3 = getelementptr i8, i8* %tmp1, i32 1 ; <i8*> [#uses=1]
store i8 0, i8* %tmp3, align 1
%tmp5 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1]
store i8 1, i8* %tmp5, align 1
%tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1]
%tmp9 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1]
store i8 0, i8* %tmp9, align 1
%tmp11 = call i32 (...) @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
%tmp1 = call ptr @malloc( i32 10 ) nounwind ; <ptr> [#uses=5]
%tmp3 = getelementptr i8, ptr %tmp1, i32 1 ; <ptr> [#uses=1]
store i8 0, ptr %tmp3, align 1
%tmp5 = getelementptr i8, ptr %tmp1, i32 0 ; <ptr> [#uses=1]
store i8 1, ptr %tmp5, align 1
%tmp7 = call i32 @strlen( ptr %tmp1 ) nounwind readonly ; <i32> [#uses=1]
%tmp9 = getelementptr i8, ptr %tmp1, i32 0 ; <ptr> [#uses=1]
store i8 0, ptr %tmp9, align 1
%tmp11 = call i32 (...) @b( ptr %tmp1 ) nounwind ; <i32> [#uses=0]
ret i32 %tmp7
}

declare i8* @malloc(i32) nounwind
declare ptr @malloc(i32) nounwind

declare i32 @strlen(i8*) nounwind readonly
declare i32 @strlen(ptr) nounwind readonly

declare i32 @b(...)
22 changes: 11 additions & 11 deletions llvm/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ target triple = "i386-apple-darwin8"
define i32 @a() nounwind {
entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%tmp1 = call i8* @malloc( i32 10 ) nounwind ; <i8*> [#uses=5]
%tmp3 = getelementptr i8, i8* %tmp1, i32 1 ; <i8*> [#uses=1]
store i8 0, i8* %tmp3, align 1
%tmp5 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1]
store i8 1, i8* %tmp5, align 1
%tmp1 = call ptr @malloc( i32 10 ) nounwind ; <ptr> [#uses=5]
%tmp3 = getelementptr i8, ptr %tmp1, i32 1 ; <ptr> [#uses=1]
store i8 0, ptr %tmp3, align 1
%tmp5 = getelementptr i8, ptr %tmp1, i32 0 ; <ptr> [#uses=1]
store i8 1, ptr %tmp5, align 1
; CHECK: store
; CHECK: store
; CHECK-NEXT: strlen
; CHECK-NEXT: store
%tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1]
%tmp9 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1]
store i8 0, i8* %tmp9, align 1
%tmp11 = call i32 (...) @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
%tmp7 = call i32 @strlen( ptr %tmp1 ) nounwind readonly ; <i32> [#uses=1]
%tmp9 = getelementptr i8, ptr %tmp1, i32 0 ; <ptr> [#uses=1]
store i8 0, ptr %tmp9, align 1
%tmp11 = call i32 (...) @b( ptr %tmp1 ) nounwind ; <i32> [#uses=0]
br label %return

return: ; preds = %entry
ret i32 %tmp7
}

declare i8* @malloc(i32) nounwind
declare ptr @malloc(i32) nounwind

declare i32 @strlen(i8*) nounwind readonly
declare i32 @strlen(ptr) nounwind readonly

declare i32 @b(...)
32 changes: 16 additions & 16 deletions llvm/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
; RUN: opt < %s -passes=instcombine -disable-output
; PR2303
%"struct.std::ctype<char>" = type { %"struct.std::locale::facet", i32*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 }
%"struct.std::locale::facet" = type { i32 (...)**, i32 }
%"struct.std::ctype<char>" = type { %"struct.std::locale::facet", ptr, i8, ptr, ptr, ptr, i8, [256 x i8], [256 x i8], i8 }
%"struct.std::locale::facet" = type { ptr, i32 }

declare i32* @_ZNSt6locale5facet15_S_get_c_localeEv()
declare ptr @_ZNSt6locale5facet15_S_get_c_localeEv()

declare i32** @__ctype_toupper_loc() readnone
declare ptr @__ctype_toupper_loc() readnone

declare i32** @__ctype_tolower_loc() readnone
declare ptr @__ctype_tolower_loc() readnone

define void @_ZNSt5ctypeIcEC2EPiPKtbm(%"struct.std::ctype<char>"* %this, i32* %unnamed_arg, i16* %__table, i8 zeroext %__del, i64 %__refs) personality i32 (...)* @__gxx_personality_v0 {
define void @_ZNSt5ctypeIcEC2EPiPKtbm(ptr %this, ptr %unnamed_arg, ptr %__table, i8 zeroext %__del, i64 %__refs) personality ptr @__gxx_personality_v0 {
entry:
%tmp8 = invoke i32* @_ZNSt6locale5facet15_S_get_c_localeEv( )
to label %invcont unwind label %lpad ; <i32*> [#uses=0]
%tmp8 = invoke ptr @_ZNSt6locale5facet15_S_get_c_localeEv( )
to label %invcont unwind label %lpad ; <ptr> [#uses=0]

invcont: ; preds = %entry
%tmp32 = invoke i32** @__ctype_toupper_loc( ) readnone
to label %invcont31 unwind label %lpad ; <i32**> [#uses=0]
%tmp32 = invoke ptr @__ctype_toupper_loc( ) readnone
to label %invcont31 unwind label %lpad ; <ptr> [#uses=0]

invcont31: ; preds = %invcont
%tmp38 = invoke i32** @__ctype_tolower_loc( ) readnone
to label %invcont37 unwind label %lpad ; <i32**> [#uses=1]
%tmp38 = invoke ptr @__ctype_tolower_loc( ) readnone
to label %invcont37 unwind label %lpad ; <ptr> [#uses=1]

invcont37: ; preds = %invcont31
%tmp39 = load i32*, i32** %tmp38, align 8 ; <i32*> [#uses=1]
%tmp41 = getelementptr %"struct.std::ctype<char>", %"struct.std::ctype<char>"* %this, i32 0, i32 4 ; <i32**> [#uses=1]
store i32* %tmp39, i32** %tmp41, align 8
%tmp39 = load ptr, ptr %tmp38, align 8 ; <ptr> [#uses=1]
%tmp41 = getelementptr %"struct.std::ctype<char>", ptr %this, i32 0, i32 4 ; <ptr> [#uses=1]
store ptr %tmp39, ptr %tmp41, align 8
ret void

lpad: ; preds = %invcont31, %invcont, %entry
%exn = landingpad {i8*, i32}
%exn = landingpad {ptr, i32}
cleanup
unreachable
}
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/Transforms/InstCombine/2008-05-17-InfLoop.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ declare void @BZALLOC(i32)

define void @f(i32) {
entry:
%blockSize100k = alloca i32 ; <i32*> [#uses=2]
store i32 %0, i32* %blockSize100k
%n = alloca i32 ; <i32*> [#uses=2]
load i32, i32* %blockSize100k ; <i32>:1 [#uses=1]
store i32 %1, i32* %n
load i32, i32* %n ; <i32>:2 [#uses=1]
%blockSize100k = alloca i32 ; <ptr> [#uses=2]
store i32 %0, ptr %blockSize100k
%n = alloca i32 ; <ptr> [#uses=2]
load i32, ptr %blockSize100k ; <i32>:1 [#uses=1]
store i32 %1, ptr %n
load i32, ptr %n ; <i32>:2 [#uses=1]
add i32 %2, 2 ; <i32>:3 [#uses=1]
mul i32 %3, ptrtoint (i32* getelementptr (i32, i32* null, i32 1) to i32) ; <i32>:4 [#uses=1]
mul i32 %3, ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i32) ; <i32>:4 [#uses=1]
call void @BZALLOC( i32 %4 )
br label %return

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
target triple = "i386-pc-linux-gnu"

define i1 @f1() {
ret i1 icmp eq (i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32 2 to i8*))
ret i1 icmp eq (ptr inttoptr (i32 1 to ptr), ptr inttoptr (i32 2 to ptr))
}

define i1 @f2() {
ret i1 icmp eq (i8* inttoptr (i16 1 to i8*), i8* inttoptr (i16 2 to i8*))
ret i1 icmp eq (ptr inttoptr (i16 1 to ptr), ptr inttoptr (i16 2 to ptr))
}
4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/2008-05-23-CompareFold.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

; CHECK-LABEL: @f(
; CHECK: ret i1 false
define i1 @f(i8* %x) {
define i1 @f(ptr %x) {
entry:
%tmp462 = load i8, i8* %x, align 1 ; <i8> [#uses=1]
%tmp462 = load i8, ptr %x, align 1 ; <i8> [#uses=1]
%tmp462463 = sitofp i8 %tmp462 to float ; <float> [#uses=1]
%tmp464 = fcmp ugt float %tmp462463, 0x47EFFFFFE0000000 ; <i1>
ret i1 %tmp464
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
; RUN: opt < %s -passes=instcombine -S | grep "store i32" | count 2

@g_139 = global i32 0 ; <i32*> [#uses=2]
@g_139 = global i32 0 ; <ptr> [#uses=2]

define void @func_56(i32 %p_60) nounwind {
entry:
store i32 1, i32* @g_139, align 4
store i32 1, ptr @g_139, align 4
%tmp1 = icmp ne i32 %p_60, 0 ; <i1> [#uses=1]
%tmp12 = zext i1 %tmp1 to i8 ; <i8> [#uses=1]
%toBool = icmp ne i8 %tmp12, 0 ; <i1> [#uses=1]
br i1 %toBool, label %bb, label %return

bb: ; preds = %bb, %entry
store i32 1, i32* @g_139, align 4
store i32 1, ptr @g_139, align 4
br label %bb

return: ; preds = %entry
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Transforms/InstCombine/2008-06-13-ReadOnlyCallStore.ll
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
; RUN: opt < %s -passes=instcombine -S | grep "store i8" | count 2

define i32 @a(i8* %s) nounwind {
define i32 @a(ptr %s) nounwind {
entry:
store i8 0, i8* %s, align 1 ; This store cannot be eliminated!
%tmp3 = call i32 @strlen( i8* %s ) nounwind readonly
store i8 0, ptr %s, align 1 ; This store cannot be eliminated!
%tmp3 = call i32 @strlen( ptr %s ) nounwind readonly
%tmp5 = icmp ne i32 %tmp3, 0
br i1 %tmp5, label %bb, label %bb8

bb: ; preds = %entry
store i8 0, i8* %s, align 1
store i8 0, ptr %s, align 1
br label %bb8

bb8:
ret i32 %tmp3
}

declare i32 @strlen(i8*) nounwind readonly
declare i32 @strlen(ptr) nounwind readonly

14 changes: 7 additions & 7 deletions llvm/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
; RUN: opt < %s -passes=instcombine -S | grep load | count 3
; PR2471

declare i32 @x(i32*)
define i32 @b(i32* %a, i32* %b) {
declare i32 @x(ptr)
define i32 @b(ptr %a, ptr %b) {
entry:
%tmp1 = load i32, i32* %a
%tmp3 = load i32, i32* %b
%tmp1 = load i32, ptr %a
%tmp3 = load i32, ptr %b
%add = add i32 %tmp1, %tmp3
%call = call i32 @x( i32* %a )
%call = call i32 @x( ptr %a )
%tobool = icmp ne i32 %add, 0
; not safe to turn into an uncond load
%cond = select i1 %tobool, i32* %b, i32* %a
%tmp8 = load i32, i32* %cond
%cond = select i1 %tobool, ptr %b, ptr %a
%tmp8 = load i32, ptr %cond
ret i32 %tmp8
}
32 changes: 15 additions & 17 deletions llvm/test/Transforms/InstCombine/2008-06-24-StackRestore.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,36 @@
; PR2488
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
@p = weak global i8* null ; <i8**> [#uses=2]
@p = weak global ptr null ; <ptr> [#uses=2]

define i32 @main() nounwind {
entry:
%tmp248 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
%tmp2752 = alloca i32 ; <i32*> [#uses=2]
%tmpcast53 = bitcast i32* %tmp2752 to i8* ; <i8*> [#uses=1]
store i32 2, i32* %tmp2752, align 4
store volatile i8* %tmpcast53, i8** @p, align 4
%tmp248 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
%tmp2752 = alloca i32 ; <ptr> [#uses=2]
store i32 2, ptr %tmp2752, align 4
store volatile ptr %tmp2752, ptr @p, align 4
br label %bb44

bb: ; preds = %bb44
ret i32 0

bb44: ; preds = %bb44, %entry
%indvar = phi i32 [ 0, %entry ], [ %tmp3857, %bb44 ] ; <i32> [#uses=1]
%tmp249 = phi i8* [ %tmp248, %entry ], [ %tmp2, %bb44 ] ; <i8*> [#uses=1]
%tmp249 = phi ptr [ %tmp248, %entry ], [ %tmp2, %bb44 ] ; <ptr> [#uses=1]
%tmp3857 = add i32 %indvar, 1 ; <i32> [#uses=3]
call void @llvm.stackrestore( i8* %tmp249 )
%tmp2 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1]
call void @llvm.stackrestore( ptr %tmp249 )
%tmp2 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
%tmp4 = srem i32 %tmp3857, 1000 ; <i32> [#uses=2]
%tmp5 = add i32 %tmp4, 1 ; <i32> [#uses=1]
%tmp27 = alloca i32, i32 %tmp5 ; <i32*> [#uses=3]
%tmpcast = bitcast i32* %tmp27 to i8* ; <i8*> [#uses=1]
store i32 1, i32* %tmp27, align 4
%tmp34 = getelementptr i32, i32* %tmp27, i32 %tmp4 ; <i32*> [#uses=1]
store i32 2, i32* %tmp34, align 4
store volatile i8* %tmpcast, i8** @p, align 4
%tmp27 = alloca i32, i32 %tmp5 ; <ptr> [#uses=3]
store i32 1, ptr %tmp27, align 4
%tmp34 = getelementptr i32, ptr %tmp27, i32 %tmp4 ; <ptr> [#uses=1]
store i32 2, ptr %tmp34, align 4
store volatile ptr %tmp27, ptr @p, align 4
%exitcond = icmp eq i32 %tmp3857, 999999 ; <i1> [#uses=1]
br i1 %exitcond, label %bb, label %bb44
}

declare i8* @llvm.stacksave() nounwind
declare ptr @llvm.stacksave() nounwind

declare void @llvm.stackrestore(i8*) nounwind
declare void @llvm.stackrestore(ptr) nounwind
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
; PR2496
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin8"
@g_1 = internal global i32 0 ; <i32*> [#uses=3]
@g_1 = internal global i32 0 ; <ptr> [#uses=3]

define i32 @main() nounwind {
entry:
%tmp93 = icmp slt i32 0, 10 ; <i1> [#uses=0]
%tmp34 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1]
%tmp34 = load volatile i32, ptr @g_1, align 4 ; <i32> [#uses=1]
br label %bb

bb: ; preds = %bb, %entry
%b.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %tmp6, %bb ] ; <i32> [#uses=1]
%tmp3.reg2mem.0 = phi i32 [ %tmp3, %bb ], [ %tmp34, %entry ]
%tmp4 = add i32 %tmp3.reg2mem.0, 5 ; <i32> [#uses=1]
store volatile i32 %tmp4, i32* @g_1, align 4
store volatile i32 %tmp4, ptr @g_1, align 4
%tmp6 = add i32 %b.0.reg2mem.0, 1 ; <i32> [#uses=2]
%tmp9 = icmp slt i32 %tmp6, 10 ; <i1> [#uses=1]
%tmp3 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1]
%tmp3 = load volatile i32, ptr @g_1, align 4 ; <i32> [#uses=1]
br i1 %tmp9, label %bb, label %bb11

bb11: ; preds = %bb
Expand Down
14 changes: 6 additions & 8 deletions llvm/test/Transforms/InstCombine/2008-08-05-And.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; PR2629

define void @f(i8* %x) nounwind {
define void @f(ptr %x) nounwind {
; CHECK-LABEL: @f(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[BB:%.*]]
; CHECK: bb:
; CHECK-NEXT: [[L1:%.*]] = load i8, i8* [[X:%.*]], align 1
; CHECK-NEXT: [[L1:%.*]] = load i8, ptr [[X:%.*]], align 1
; CHECK-NEXT: [[TMP0:%.*]] = add i8 [[L1]], -9
; CHECK-NEXT: [[C1:%.*]] = icmp ult i8 [[TMP0]], -3
; CHECK-NEXT: [[TMP1:%.*]] = add i8 [[L1]], -13
Expand All @@ -23,8 +23,7 @@ entry:
br label %bb

bb:
%g1 = getelementptr i8, i8* %x, i32 0
%l1 = load i8, i8* %g1, align 1
%l1 = load i8, ptr %x, align 1
%s1 = sub i8 %l1, 6
%c1 = icmp ugt i8 %s1, 2
%s2 = sub i8 %l1, 10
Expand All @@ -39,12 +38,12 @@ incompatible:
ret void
}

define void @f_logical(i8* %x) nounwind {
define void @f_logical(ptr %x) nounwind {
; CHECK-LABEL: @f_logical(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[BB:%.*]]
; CHECK: bb:
; CHECK-NEXT: [[L1:%.*]] = load i8, i8* [[X:%.*]], align 1
; CHECK-NEXT: [[L1:%.*]] = load i8, ptr [[X:%.*]], align 1
; CHECK-NEXT: [[TMP0:%.*]] = add i8 [[L1]], -9
; CHECK-NEXT: [[C1:%.*]] = icmp ult i8 [[TMP0]], -3
; CHECK-NEXT: [[TMP1:%.*]] = add i8 [[L1]], -13
Expand All @@ -60,8 +59,7 @@ entry:
br label %bb

bb:
%g1 = getelementptr i8, i8* %x, i32 0
%l1 = load i8, i8* %g1, align 1
%l1 = load i8, ptr %x, align 1
%s1 = sub i8 %l1, 6
%c1 = icmp ugt i8 %s1, 2
%s2 = sub i8 %l1, 10
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ define void @entry(i32 %m_task_id, i32 %start_x, i32 %end_x, i32 %start_y, i32 %
%11 = extractelement <2 x i32> %10, i32 1 ; <i32> [#uses=1]
%12 = insertelement <4 x i32> zeroinitializer, i32 %11, i32 3 ; <<4 x i32>> [#uses=1]
%13 = sitofp <4 x i32> %12 to <4 x float> ; <<4 x float>> [#uses=1]
store <4 x float> %13, <4 x float>* null
store <4 x float> %13, ptr null
br label %4
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; PR2940

define i32 @tstid() {
%var0 = inttoptr i32 1 to i8* ; <i8*> [#uses=1]
%var2 = ptrtoint i8* %var0 to i32 ; <i32> [#uses=1]
%var0 = inttoptr i32 1 to ptr ; <ptr> [#uses=1]
%var2 = ptrtoint ptr %var0 to i32 ; <i32> [#uses=1]
ret i32 %var2
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9.6"

define i32 @test(i32* %P) nounwind {
define i32 @test(ptr %P) nounwind {
entry:
%Q = addrspacecast i32* %P to i32 addrspace(1)*
store i32 0, i32 addrspace(1)* %Q, align 4
%Q = addrspacecast ptr %P to ptr addrspace(1)
store i32 0, ptr addrspace(1) %Q, align 4
ret i32 0
}

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions llvm/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,68 @@ target triple = "i386-apple-darwin9.6"

define float @test1() nounwind {
entry:
%retval = alloca float ; <float*> [#uses=2]
%0 = alloca float ; <float*> [#uses=2]
%retval = alloca float ; <ptr> [#uses=2]
%0 = alloca float ; <ptr> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%1 = frem double 1.000000e-01, 1.000000e+00 ; <double> [#uses=1]
%2 = fptrunc double %1 to float ; <float> [#uses=1]
store float %2, float* %0, align 4
%3 = load float, float* %0, align 4 ; <float> [#uses=1]
store float %3, float* %retval, align 4
store float %2, ptr %0, align 4
%3 = load float, ptr %0, align 4 ; <float> [#uses=1]
store float %3, ptr %retval, align 4
br label %return

return: ; preds = %entry
%retval1 = load float, float* %retval ; <float> [#uses=1]
%retval1 = load float, ptr %retval ; <float> [#uses=1]
ret float %retval1
}

define float @test2() nounwind {
entry:
%retval = alloca float ; <float*> [#uses=2]
%0 = alloca float ; <float*> [#uses=2]
%retval = alloca float ; <ptr> [#uses=2]
%0 = alloca float ; <ptr> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%1 = frem double -1.000000e-01, 1.000000e+00 ; <double> [#uses=1]
%2 = fptrunc double %1 to float ; <float> [#uses=1]
store float %2, float* %0, align 4
%3 = load float, float* %0, align 4 ; <float> [#uses=1]
store float %3, float* %retval, align 4
store float %2, ptr %0, align 4
%3 = load float, ptr %0, align 4 ; <float> [#uses=1]
store float %3, ptr %retval, align 4
br label %return

return: ; preds = %entry
%retval1 = load float, float* %retval ; <float> [#uses=1]
%retval1 = load float, ptr %retval ; <float> [#uses=1]
ret float %retval1
}

define float @test3() nounwind {
entry:
%retval = alloca float ; <float*> [#uses=2]
%0 = alloca float ; <float*> [#uses=2]
%retval = alloca float ; <ptr> [#uses=2]
%0 = alloca float ; <ptr> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%1 = frem double 1.000000e-01, -1.000000e+00 ; <double> [#uses=1]
%2 = fptrunc double %1 to float ; <float> [#uses=1]
store float %2, float* %0, align 4
%3 = load float, float* %0, align 4 ; <float> [#uses=1]
store float %3, float* %retval, align 4
store float %2, ptr %0, align 4
%3 = load float, ptr %0, align 4 ; <float> [#uses=1]
store float %3, ptr %retval, align 4
br label %return

return: ; preds = %entry
%retval1 = load float, float* %retval ; <float> [#uses=1]
%retval1 = load float, ptr %retval ; <float> [#uses=1]
ret float %retval1
}

define float @test4() nounwind {
entry:
%retval = alloca float ; <float*> [#uses=2]
%0 = alloca float ; <float*> [#uses=2]
%retval = alloca float ; <ptr> [#uses=2]
%0 = alloca float ; <ptr> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%1 = frem double -1.000000e-01, -1.000000e+00 ; <double> [#uses=1]
%2 = fptrunc double %1 to float ; <float> [#uses=1]
store float %2, float* %0, align 4
%3 = load float, float* %0, align 4 ; <float> [#uses=1]
store float %3, float* %retval, align 4
store float %2, ptr %0, align 4
%3 = load float, ptr %0, align 4 ; <float> [#uses=1]
store float %3, ptr %retval, align 4
br label %return

return: ; preds = %entry
%retval1 = load float, float* %retval ; <float> [#uses=1]
%retval1 = load float, ptr %retval ; <float> [#uses=1]
ret float %retval1
}
9 changes: 4 additions & 5 deletions llvm/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
target triple = "x86_64-unknown-linux-gnu"
%struct.atomic_t = type { i32 }
%struct.inode = type { i32, %struct.mutex }
%struct.list_head = type { %struct.list_head*, %struct.list_head* }
%struct.list_head = type { ptr, ptr }
%struct.lock_class_key = type { }
%struct.mutex = type { %struct.atomic_t, %struct.rwlock_t, %struct.list_head }
%struct.rwlock_t = type { %struct.lock_class_key }

define void @handle_event(%struct.inode* %bar) nounwind {
define void @handle_event(ptr %bar) nounwind {
entry:
%0 = getelementptr %struct.inode, %struct.inode* %bar, i64 -1, i32 1, i32 1 ; <%struct.rwlock_t*> [#uses=1]
%1 = bitcast %struct.rwlock_t* %0 to i32* ; <i32*> [#uses=1]
store i32 1, i32* %1, align 4
%0 = getelementptr %struct.inode, ptr %bar, i64 -1, i32 1, i32 1 ; <ptr> [#uses=1]
store i32 1, ptr %0, align 4
ret void
}
6 changes: 3 additions & 3 deletions llvm/test/Transforms/InstCombine/2009-01-31-InfIterate.ll
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
; RUN: opt < %s -passes=instcombine | llvm-dis
; PR3452
define i128 @test(i64 %A, i64 %B, i1 %C, i128 %Z, i128 %Y, i64* %P, i64* %Q) {
define i128 @test(i64 %A, i64 %B, i1 %C, i128 %Z, i128 %Y, ptr %P, ptr %Q) {
entry:
%tmp2 = trunc i128 %Z to i64
%tmp4 = trunc i128 %Y to i64
store i64 %tmp2, i64* %P
store i64 %tmp4, i64* %Q
store i64 %tmp2, ptr %P
store i64 %tmp4, ptr %Q
%x = sub i64 %tmp2, %tmp4
%c = sub i64 %tmp2, %tmp4
%tmp137 = zext i1 %C to i64
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Transforms/InstCombine/2009-02-11-NotInitialized.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
; Check that nocapture attributes are added when run after an SCC pass.
; PR3520

define i32 @use(i8* %x) nounwind readonly {
; CHECK: @use(i8* nocapture %x)
%1 = tail call i64 @strlen(i8* %x) nounwind readonly
define i32 @use(ptr %x) nounwind readonly {
; CHECK: @use(ptr nocapture %x)
%1 = tail call i64 @strlen(ptr %x) nounwind readonly
%2 = trunc i64 %1 to i32
ret i32 %2
}

declare i64 @strlen(i8*) nounwind readonly
; CHECK: declare i64 @strlen(i8* nocapture) nounwind readonly
declare i64 @strlen(ptr) nounwind readonly
; CHECK: declare i64 @strlen(ptr nocapture) nounwind readonly
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstCombine/2009-02-21-LoadCST.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ target triple = "i386-pc-linux-gnu"
@.str1 = internal constant [4 x i8] c"\B5%8\00"

define i32 @test() {
%rhsv = load i32, i32* bitcast ([4 x i8]* @.str1 to i32*), align 1
%rhsv = load i32, ptr @.str1, align 1
ret i32 %rhsv
}
16 changes: 6 additions & 10 deletions llvm/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"

define void @_ada_c32001b(i32 %tmp5, i32* %src) {
define void @_ada_c32001b(i32 %tmp5, ptr %src) {
entry:
%max289 = select i1 false, i32 %tmp5, i32 0 ; <i32> [#uses=1]
%tmp6 = mul i32 %max289, 4 ; <i32> [#uses=1]
%tmp7 = alloca i8, i32 0 ; <i8*> [#uses=1]
%tmp8 = bitcast i8* %tmp7 to [0 x [0 x i32]]* ; <[0 x [0 x i32]]*> [#uses=1]
%tmp11 = load i32, i32* %src, align 1 ; <i32> [#uses=1]
%tmp7 = alloca i8, i32 0 ; <ptr> [#uses=1]
%tmp11 = load i32, ptr %src, align 1 ; <i32> [#uses=1]
%tmp12 = icmp eq i32 %tmp11, 3 ; <i1> [#uses=1]
%tmp13 = zext i1 %tmp12 to i8 ; <i8> [#uses=1]
%tmp14 = ashr i32 %tmp6, 2 ; <i32> [#uses=1]
%tmp15 = bitcast [0 x [0 x i32]]* %tmp8 to i8* ; <i8*> [#uses=1]
%tmp16 = mul i32 %tmp14, 4 ; <i32> [#uses=1]
%tmp17 = mul i32 1, %tmp16 ; <i32> [#uses=1]
%tmp18 = getelementptr i8, i8* %tmp15, i32 %tmp17 ; <i8*> [#uses=1]
%tmp19 = bitcast i8* %tmp18 to [0 x i32]* ; <[0 x i32]*> [#uses=1]
%tmp20 = bitcast [0 x i32]* %tmp19 to i32* ; <i32*> [#uses=1]
%tmp21 = getelementptr i32, i32* %tmp20, i32 0 ; <i32*> [#uses=1]
%tmp22 = load i32, i32* %tmp21, align 1 ; <i32> [#uses=1]
%tmp18 = getelementptr i8, ptr %tmp7, i32 %tmp17 ; <ptr> [#uses=1]
%tmp21 = getelementptr i32, ptr %tmp18, i32 0 ; <ptr> [#uses=1]
%tmp22 = load i32, ptr %tmp21, align 1 ; <i32> [#uses=1]
%tmp23 = icmp eq i32 %tmp22, 4 ; <i1> [#uses=1]
%tmp24 = zext i1 %tmp23 to i8 ; <i8> [#uses=1]
%toBool709 = icmp ne i8 %tmp13, 0 ; <i1> [#uses=1]
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
; RUN: opt < %s -passes=instcombine | llvm-dis
; PR3826

define void @0(<4 x i16>*, <4 x i16>*) {
%3 = alloca <4 x i16>* ; <<4 x i16>**> [#uses=1]
%4 = load <4 x i16>, <4 x i16>* null, align 1 ; <<4 x i16>> [#uses=1]
define void @0(ptr, ptr) {
%3 = alloca ptr ; <ptr> [#uses=1]
%4 = load <4 x i16>, ptr null, align 1 ; <<4 x i16>> [#uses=1]
%5 = ashr <4 x i16> %4, <i16 5, i16 5, i16 5, i16 5> ; <<4 x i16>> [#uses=1]
%6 = load <4 x i16>*, <4 x i16>** %3 ; <<4 x i16>*> [#uses=1]
store <4 x i16> %5, <4 x i16>* %6, align 1
%6 = load ptr, ptr %3 ; <ptr> [#uses=1]
store <4 x i16> %5, ptr %6, align 1
ret void
}
4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; RUN: opt < %s -passes=instcombine -S | not grep cmp
; rdar://6903175

define i1 @f0(i32 *%a) nounwind {
%b = load i32, i32* %a, align 4
define i1 @f0(ptr %a) nounwind {
%b = load i32, ptr %a, align 4
%c = uitofp i32 %b to double
%d = fcmp ogt double %c, 0x41EFFFFFFFE00000
ret i1 %d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
; PR4366

define void @a() {
store i32 0, i32 addrspace(1)* null
store i32 0, ptr addrspace(1) null
ret void
}
12 changes: 6 additions & 6 deletions llvm/test/Transforms/InstCombine/2009-12-17-CmpSelectNull.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
@.str254 = internal constant [2 x i8] c".\00"
@.str557 = internal constant [3 x i8] c"::\00"

define i8* @demangle_qualified(i32 %isfuncname) nounwind {
define ptr @demangle_qualified(i32 %isfuncname) nounwind {
entry:
%tobool272 = icmp ne i32 %isfuncname, 0
%cond276 = select i1 %tobool272, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str254, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str557, i32 0, i32 0) ; <i8*> [#uses=4]
%cmp.i504 = icmp eq i8* %cond276, null
%rval = getelementptr i8, i8* %cond276, i1 %cmp.i504
ret i8* %rval
%cond276 = select i1 %tobool272, ptr @.str254, ptr @.str557 ; <ptr> [#uses=4]
%cmp.i504 = icmp eq ptr %cond276, null
%rval = getelementptr i8, ptr %cond276, i1 %cmp.i504
ret ptr %rval
}

; CHECK: %cond276 = select i1
; CHECK: ret i8* %cond276
; CHECK: ret ptr %cond276
12 changes: 6 additions & 6 deletions llvm/test/Transforms/InstCombine/2010-03-03-ExtElim.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-unknown-linux-gnu"

@g_92 = common global [2 x i32*] zeroinitializer, align 4 ; <[2 x i32*]*> [#uses=1]
@g_177 = constant i32** bitcast (i8* getelementptr (i8, i8* bitcast ([2 x i32*]* @g_92 to i8*), i64 4) to i32**), align 4 ; <i32***> [#uses=1]
@g_92 = common global [2 x ptr] zeroinitializer, align 4 ; <ptr> [#uses=1]
@g_177 = constant ptr getelementptr (i8, ptr @g_92, i64 4), align 4 ; <ptr> [#uses=1]

define i1 @PR6486() nounwind {
; CHECK-LABEL: @PR6486(
%tmp = load i32**, i32*** @g_177 ; <i32**> [#uses=1]
%cmp = icmp ne i32** null, %tmp ; <i1> [#uses=1]
%tmp = load ptr, ptr @g_177 ; <ptr> [#uses=1]
%cmp = icmp ne ptr null, %tmp ; <i1> [#uses=1]
%conv = zext i1 %cmp to i32 ; <i32> [#uses=1]
%cmp1 = icmp sle i32 0, %conv ; <i1> [#uses=1]
ret i1 %cmp1
Expand All @@ -21,12 +21,12 @@ define i1 @PR6486() nounwind {

define i1 @PR16462_1() nounwind {
; CHECK-LABEL: @PR16462_1(
ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32], [1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 65535)
ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (ptr @a, ptr @d), i32 0, i32 1) to i16) to i32), i32 65535)
; CHECK: ret i1 false
}

define i1 @PR16462_2() nounwind {
; CHECK-LABEL: @PR16462_2(
ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32], [1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 42)
ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (ptr @a, ptr @d), i32 0, i32 1) to i16) to i32), i32 42)
; CHECK: ret i1 false
}
9 changes: 4 additions & 5 deletions llvm/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ target triple = "x86_64-unknown-linux-gnu"

@.str = private constant [3 x i8] c"%s\00"

define void @CopyEventArg(%union.anon* %ev, i8* %src) nounwind {
define void @CopyEventArg(ptr %ev, ptr %src) nounwind {
; CHECK-LABEL: @CopyEventArg(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CSTR:%.*]] = bitcast %union.anon* [[EV:%.*]] to i8*
; CHECK-NEXT: [[STRCPY:%.*]] = call i8* @strcpy(i8* noundef nonnull dereferenceable(1) [[SRC:%.*]], i8* noundef nonnull dereferenceable(1) [[CSTR]])
; CHECK-NEXT: [[STRCPY:%.*]] = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) [[SRC:%.*]], ptr noundef nonnull dereferenceable(1) [[EV:%.*]])
; CHECK-NEXT: ret void
;
entry:
%call = call i32 (i8*, i8*, ...) @sprintf(i8* %src, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %union.anon* %ev) nounwind
%call = call i32 (ptr, ptr, ...) @sprintf(ptr %src, ptr @.str, ptr %ev) nounwind
ret void
}

declare i32 @sprintf(i8*, i8*, ...)
declare i32 @sprintf(ptr, ptr, ...)

12 changes: 6 additions & 6 deletions llvm/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"

define {}* @foo({}* %x, i32 %n) {
define ptr @foo(ptr %x, i32 %n) {
; CHECK-LABEL: @foo(
; CHECK-NOT: getelementptr
%p = getelementptr {}, {}* %x, i32 %n
ret {}* %p
%p = getelementptr {}, ptr %x, i32 %n
ret ptr %p
}

define i8* @bar(i64 %n, {{}, [0 x {[0 x i8]}]}* %p) {
define ptr @bar(i64 %n, ptr %p) {
; CHECK-LABEL: @bar(
%g = getelementptr {{}, [0 x {[0 x i8]}]}, {{}, [0 x {[0 x i8]}]}* %p, i64 %n, i32 1, i64 %n, i32 0, i64 %n
%g = getelementptr {{}, [0 x {[0 x i8]}]}, ptr %p, i64 %n, i32 1, i64 %n, i32 0, i64 %n
; CHECK: %p, i64 0, i32 1, i64 0, i32 0, i64 %n
ret i8* %g
ret ptr %g
}
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstCombine/2011-02-14-InfLoop.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

target triple = "x86_64-unknown-linux-gnu"

define <4 x float> @m_387(i8* noalias nocapture %A, i8* nocapture %B, <4 x i1> %C) nounwind {
define <4 x float> @m_387(ptr noalias nocapture %A, ptr nocapture %B, <4 x i1> %C) nounwind {
entry:
%movcsext20 = sext <4 x i1> %C to <4 x i32>
%tmp2389 = xor <4 x i32> %movcsext20, <i32 -1, i32 -1, i32 -1, i32 -1>
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Transforms/InstCombine/2011-05-02-VectorBoolean.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ define <2 x i16> @entry(<2 x i16> %a) nounwind {
entry:
%a.addr = alloca <2 x i16>, align 4
%.compoundliteral = alloca <2 x i16>, align 4
store <2 x i16> %a, <2 x i16>* %a.addr, align 4
%tmp = load <2 x i16>, <2 x i16>* %a.addr, align 4
store <2 x i16> zeroinitializer, <2 x i16>* %.compoundliteral
%tmp1 = load <2 x i16>, <2 x i16>* %.compoundliteral
store <2 x i16> %a, ptr %a.addr, align 4
%tmp = load <2 x i16>, ptr %a.addr, align 4
store <2 x i16> zeroinitializer, ptr %.compoundliteral
%tmp1 = load <2 x i16>, ptr %.compoundliteral
%cmp = icmp uge <2 x i16> %tmp, %tmp1
%sext = sext <2 x i1> %cmp to <2 x i16>
ret <2 x i16> %sext
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/InstCombine/2011-05-13-InBoundsGEP.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ entry:
%tmp2 = add i32 %argc, 1879048192
%p = alloca i8
; CHECK: getelementptr
%p1 = getelementptr i8, i8* %p, i32 %tmp1
%p1 = getelementptr i8, ptr %p, i32 %tmp1
; CHECK: getelementptr
%p2 = getelementptr i8, i8* %p, i32 %tmp2
%cmp = icmp ult i8* %p1, %p2
%p2 = getelementptr i8, ptr %p, i32 %tmp2
%cmp = icmp ult ptr %p1, %p2
br i1 %cmp, label %bbtrue, label %bbfalse
bbtrue: ; preds = %entry
ret i32 -1
Expand Down
28 changes: 14 additions & 14 deletions llvm/test/Transforms/InstCombine/2011-05-28-swapmulsub.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ define zeroext i16 @foo1(i32 %on_off) {
;
%on_off.addr = alloca i32, align 4
%a = alloca i32, align 4
store i32 %on_off, i32* %on_off.addr, align 4
%tmp = load i32, i32* %on_off.addr, align 4
store i32 %on_off, ptr %on_off.addr, align 4
%tmp = load i32, ptr %on_off.addr, align 4
%sub = sub i32 1, %tmp
%mul = mul i32 %sub, -2
store i32 %mul, i32* %a, align 4
%tmp1 = load i32, i32* %a, align 4
store i32 %mul, ptr %a, align 4
%tmp1 = load i32, ptr %a, align 4
%conv = trunc i32 %tmp1 to i16
ret i16 %conv
}
Expand All @@ -31,14 +31,14 @@ define zeroext i16 @foo2(i32 %on_off, i32 %q) {
%on_off.addr = alloca i32, align 4
%q.addr = alloca i32, align 4
%a = alloca i32, align 4
store i32 %on_off, i32* %on_off.addr, align 4
store i32 %q, i32* %q.addr, align 4
%tmp = load i32, i32* %q.addr, align 4
%tmp1 = load i32, i32* %on_off.addr, align 4
store i32 %on_off, ptr %on_off.addr, align 4
store i32 %q, ptr %q.addr, align 4
%tmp = load i32, ptr %q.addr, align 4
%tmp1 = load i32, ptr %on_off.addr, align 4
%sub = sub i32 %tmp, %tmp1
%mul = mul i32 %sub, -4
store i32 %mul, i32* %a, align 4
%tmp2 = load i32, i32* %a, align 4
store i32 %mul, ptr %a, align 4
%tmp2 = load i32, ptr %a, align 4
%conv = trunc i32 %tmp2 to i16
ret i16 %conv
}
Expand All @@ -52,12 +52,12 @@ define zeroext i16 @foo3(i32 %on_off) {
;
%on_off.addr = alloca i32, align 4
%a = alloca i32, align 4
store i32 %on_off, i32* %on_off.addr, align 4
%tmp = load i32, i32* %on_off.addr, align 4
store i32 %on_off, ptr %on_off.addr, align 4
%tmp = load i32, ptr %on_off.addr, align 4
%sub = sub i32 7, %tmp
%mul = mul i32 %sub, -4
store i32 %mul, i32* %a, align 4
%tmp1 = load i32, i32* %a, align 4
store i32 %mul, ptr %a, align 4
%tmp1 = load i32, ptr %a, align 4
%conv = trunc i32 %tmp1 to i16
ret i16 %conv
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

@G = external global [0 x %opaque_struct]

declare void @foo(%opaque_struct*)
declare void @foo(ptr)

define void @bar() {
call void @foo(%opaque_struct* bitcast ([0 x %opaque_struct]* @G to %opaque_struct*))
call void @foo(ptr @G)
ret void
}
6 changes: 3 additions & 3 deletions llvm/test/Transforms/InstCombine/2012-02-13-FCmp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
@.str = private unnamed_addr constant [35 x i8] c"\0Ain_range input (should be 0): %f\0A\00", align 1
@.str1 = external hidden unnamed_addr constant [35 x i8], align 1

declare i32 @printf(i8*, ...)
declare i32 @printf(ptr, ...)
define i64 @_Z8tempCastj(i32 %val) uwtable ssp {
entry:
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str1, i64 0, i64 0), i32 %val)
%call = call i32 (ptr, ...) @printf(ptr @.str1, i32 %val)
%conv = uitofp i32 %val to double
%call.i = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %conv)
%call.i = call i32 (ptr, ...) @printf(ptr @.str, double %conv)
%cmp.i = fcmp oge double %conv, -1.000000e+00
br i1 %cmp.i, label %land.rhs.i, label %if.end.critedge
; CHECK: br i1 true, label %land.rhs.i, label %if.end.critedge
Expand Down
52 changes: 26 additions & 26 deletions llvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@

; Derived from gcc.c-torture/execute/frame-address.c

define i32 @func(i8* %c, i8* %f) nounwind uwtable readnone noinline ssp {
define i32 @func(ptr %c, ptr %f) nounwind uwtable readnone noinline ssp {
; CHECK-LABEL: @func(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = alloca i8, align 1
; CHECK-NEXT: store i8 0, i8* [[D]], align 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8* [[D]], [[C:%.*]]
; CHECK-NEXT: store i8 0, ptr [[D]], align 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt ptr [[D]], [[C:%.*]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8* [[D]], [[F:%.*]]
; CHECK-NEXT: [[NOT_CMP1:%.*]] = icmp uge i8* [[C]], [[F]]
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule ptr [[D]], [[F:%.*]]
; CHECK-NEXT: [[NOT_CMP1:%.*]] = icmp uge ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP2:%.*]] = and i1 [[CMP2]], [[NOT_CMP1]]
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.else:
; CHECK-NEXT: [[CMP5:%.*]] = icmp uge i8* [[D]], [[F]]
; CHECK-NEXT: [[NOT_CMP3:%.*]] = icmp ule i8* [[C]], [[F]]
; CHECK-NEXT: [[CMP5:%.*]] = icmp uge ptr [[D]], [[F]]
; CHECK-NEXT: [[NOT_CMP3:%.*]] = icmp ule ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP5:%.*]] = and i1 [[CMP5]], [[NOT_CMP3]]
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
Expand All @@ -27,20 +27,20 @@ define i32 @func(i8* %c, i8* %f) nounwind uwtable readnone noinline ssp {
;
entry:
%d = alloca i8, align 1
store i8 0, i8* %d, align 1
%cmp = icmp ugt i8* %d, %c
store i8 0, ptr %d, align 1
%cmp = icmp ugt ptr %d, %c
br i1 %cmp, label %if.else, label %if.then

if.then: ; preds = %entry
%cmp2 = icmp ule i8* %d, %f
%not.cmp1 = icmp uge i8* %c, %f
%cmp2 = icmp ule ptr %d, %f
%not.cmp1 = icmp uge ptr %c, %f
%.cmp2 = and i1 %cmp2, %not.cmp1
%land.ext = zext i1 %.cmp2 to i32
br label %return

if.else: ; preds = %entry
%cmp5 = icmp uge i8* %d, %f
%not.cmp3 = icmp ule i8* %c, %f
%cmp5 = icmp uge ptr %d, %f
%not.cmp3 = icmp ule ptr %c, %f
%.cmp5 = and i1 %cmp5, %not.cmp3
%land.ext7 = zext i1 %.cmp5 to i32
br label %return
Expand All @@ -50,21 +50,21 @@ return: ; preds = %if.else, %if.then
ret i32 %retval.0
}

define i32 @func_logical(i8* %c, i8* %f) nounwind uwtable readnone noinline ssp {
define i32 @func_logical(ptr %c, ptr %f) nounwind uwtable readnone noinline ssp {
; CHECK-LABEL: @func_logical(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = alloca i8, align 1
; CHECK-NEXT: store i8 0, i8* [[D]], align 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8* [[D]], [[C:%.*]]
; CHECK-NEXT: store i8 0, ptr [[D]], align 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt ptr [[D]], [[C:%.*]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i8* [[D]], [[F:%.*]]
; CHECK-NEXT: [[NOT_CMP1:%.*]] = icmp uge i8* [[C]], [[F]]
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule ptr [[D]], [[F:%.*]]
; CHECK-NEXT: [[NOT_CMP1:%.*]] = icmp uge ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP2:%.*]] = select i1 [[CMP2]], i1 [[NOT_CMP1]], i1 false
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.else:
; CHECK-NEXT: [[CMP5:%.*]] = icmp uge i8* [[D]], [[F]]
; CHECK-NEXT: [[NOT_CMP3:%.*]] = icmp ule i8* [[C]], [[F]]
; CHECK-NEXT: [[CMP5:%.*]] = icmp uge ptr [[D]], [[F]]
; CHECK-NEXT: [[NOT_CMP3:%.*]] = icmp ule ptr [[C]], [[F]]
; CHECK-NEXT: [[DOTCMP5:%.*]] = select i1 [[CMP5]], i1 [[NOT_CMP3]], i1 false
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
Expand All @@ -74,20 +74,20 @@ define i32 @func_logical(i8* %c, i8* %f) nounwind uwtable readnone noinline ssp
;
entry:
%d = alloca i8, align 1
store i8 0, i8* %d, align 1
%cmp = icmp ugt i8* %d, %c
store i8 0, ptr %d, align 1
%cmp = icmp ugt ptr %d, %c
br i1 %cmp, label %if.else, label %if.then

if.then: ; preds = %entry
%cmp2 = icmp ule i8* %d, %f
%not.cmp1 = icmp uge i8* %c, %f
%cmp2 = icmp ule ptr %d, %f
%not.cmp1 = icmp uge ptr %c, %f
%.cmp2 = select i1 %cmp2, i1 %not.cmp1, i1 false
%land.ext = zext i1 %.cmp2 to i32
br label %return

if.else: ; preds = %entry
%cmp5 = icmp uge i8* %d, %f
%not.cmp3 = icmp ule i8* %c, %f
%cmp5 = icmp uge ptr %d, %f
%not.cmp3 = icmp ule ptr %c, %f
%.cmp5 = select i1 %cmp5, i1 %not.cmp3, i1 false
%land.ext7 = zext i1 %.cmp5 to i32
br label %return
Expand Down
10 changes: 5 additions & 5 deletions llvm/test/Transforms/InstCombine/2012-05-28-select-hang.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

define void @func() nounwind uwtable ssp {
entry:
%0 = load i8, i8* @c, align 1
%0 = load i8, ptr @c, align 1
%conv = zext i8 %0 to i32
%or = or i32 %conv, 1
%conv1 = trunc i32 %or to i8
store i8 %conv1, i8* @a, align 1
store i8 %conv1, ptr @a, align 1
%conv2 = zext i8 %conv1 to i32
%neg = xor i32 %conv2, -1
%and = and i32 1, %neg
%conv3 = trunc i32 %and to i8
store i8 %conv3, i8* @b, align 1
%1 = load i8, i8* @a, align 1
store i8 %conv3, ptr @b, align 1
%1 = load i8, ptr @a, align 1
%conv4 = zext i8 %1 to i32
%conv5 = zext i8 %conv3 to i32
%tobool = icmp ne i32 %conv4, 0
Expand All @@ -31,7 +31,7 @@ land.end: ; preds = %land.rhs, %entry
%land.ext = zext i1 %2 to i32
%mul = mul nsw i32 3, %land.ext
%conv9 = trunc i32 %mul to i8
store i8 %conv9, i8* @a, align 1
store i8 %conv9, ptr @a, align 1
ret void

; CHECK-LABEL: @func(
Expand Down
86 changes: 43 additions & 43 deletions llvm/test/Transforms/InstCombine/2012-06-06-LoadOfPHIs.ll
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; <rdar://problem/10889741>

define void @func(double %r, double %g, double %b, double* %outH, double* %outS, double* %outL) nounwind uwtable ssp {
define void @func(double %r, double %g, double %b, ptr %outH, ptr %outS, ptr %outL) nounwind uwtable ssp {
bb:
%tmp = alloca double, align 8
%tmp1 = alloca double, align 8
%tmp2 = alloca double, align 8
store double %r, double* %tmp, align 8
store double %g, double* %tmp1, align 8
store double %b, double* %tmp2, align 8
store double %r, ptr %tmp, align 8
store double %g, ptr %tmp1, align 8
store double %b, ptr %tmp2, align 8
%tmp3 = fcmp ogt double %r, %g
br i1 %tmp3, label %bb4, label %bb8

Expand All @@ -33,17 +33,17 @@ bb11: ; preds = %bb8
br label %bb12

bb12: ; preds = %bb11, %bb10, %bb7, %bb6
%max.0 = phi double* [ %tmp, %bb6 ], [ %tmp2, %bb7 ], [ %tmp1, %bb10 ], [ %tmp2, %bb11 ]
; CHECK: %tmp13 = load double, double* %tmp, align 8
; CHECK: %tmp14 = load double, double* %tmp1, align 8
%max.0 = phi ptr [ %tmp, %bb6 ], [ %tmp2, %bb7 ], [ %tmp1, %bb10 ], [ %tmp2, %bb11 ]
; CHECK: %tmp13 = load double, ptr %tmp, align 8
; CHECK: %tmp14 = load double, ptr %tmp1, align 8
; CHECK: %tmp15 = fcmp olt double %tmp13, %tmp14
%tmp13 = load double, double* %tmp, align 8
%tmp14 = load double, double* %tmp1, align 8
%tmp13 = load double, ptr %tmp, align 8
%tmp14 = load double, ptr %tmp1, align 8
%tmp15 = fcmp olt double %tmp13, %tmp14
br i1 %tmp15, label %bb16, label %bb21

bb16: ; preds = %bb12
%tmp17 = load double, double* %tmp2, align 8
%tmp17 = load double, ptr %tmp2, align 8
%tmp18 = fcmp olt double %tmp13, %tmp17
br i1 %tmp18, label %bb19, label %bb20

Expand All @@ -54,7 +54,7 @@ bb20: ; preds = %bb16
br label %bb26

bb21: ; preds = %bb12
%tmp22 = load double, double* %tmp2, align 8
%tmp22 = load double, ptr %tmp2, align 8
%tmp23 = fcmp olt double %tmp14, %tmp22
br i1 %tmp23, label %bb24, label %bb25

Expand All @@ -65,23 +65,23 @@ bb25: ; preds = %bb21
br label %bb26

bb26: ; preds = %bb25, %bb24, %bb20, %bb19
%min.0 = phi double* [ %tmp, %bb19 ], [ %tmp2, %bb20 ], [ %tmp1, %bb24 ], [ %tmp2, %bb25 ]
; CHECK: %tmp27 = load double, double* %min.0, align 8
; CHECK: %tmp28 = load double, double* %max.0
%min.0 = phi ptr [ %tmp, %bb19 ], [ %tmp2, %bb20 ], [ %tmp1, %bb24 ], [ %tmp2, %bb25 ]
; CHECK: %tmp27 = load double, ptr %min.0, align 8
; CHECK: %tmp28 = load double, ptr %max.0
; CHECK: %tmp29 = fadd double %tmp27, %tmp28
%tmp27 = load double, double* %min.0, align 8
%tmp28 = load double, double* %max.0
%tmp27 = load double, ptr %min.0, align 8
%tmp28 = load double, ptr %max.0
%tmp29 = fadd double %tmp27, %tmp28
%tmp30 = fdiv double %tmp29, 2.000000e+00
store double %tmp30, double* %outL
%tmp31 = load double, double* %min.0
%tmp32 = load double, double* %max.0
store double %tmp30, ptr %outL
%tmp31 = load double, ptr %min.0
%tmp32 = load double, ptr %max.0
%tmp33 = fcmp oeq double %tmp31, %tmp32
br i1 %tmp33, label %bb34, label %bb35

bb34: ; preds = %bb26
store double 0.000000e+00, double* %outS
store double 0.000000e+00, double* %outH
store double 0.000000e+00, ptr %outS
store double 0.000000e+00, ptr %outH
br label %bb81

bb35: ; preds = %bb26
Expand All @@ -92,69 +92,69 @@ bb35: ; preds = %bb26
bb38: ; preds = %bb35
%tmp39 = fadd double %tmp32, %tmp31
%tmp40 = fdiv double %tmp37, %tmp39
store double %tmp40, double* %outS
store double %tmp40, ptr %outS
br label %bb45

bb41: ; preds = %bb35
%tmp42 = fsub double 2.000000e+00, %tmp32
%tmp43 = fsub double %tmp42, %tmp31
%tmp44 = fdiv double %tmp37, %tmp43
store double %tmp44, double* %outS
store double %tmp44, ptr %outS
br label %bb45

bb45: ; preds = %bb41, %bb38
%tmp46 = icmp eq double* %max.0, %tmp
%tmp46 = icmp eq ptr %max.0, %tmp
br i1 %tmp46, label %bb47, label %bb55

bb47: ; preds = %bb45
%tmp48 = load double, double* %tmp1, align 8
%tmp49 = load double, double* %tmp2, align 8
%tmp48 = load double, ptr %tmp1, align 8
%tmp49 = load double, ptr %tmp2, align 8
%tmp50 = fsub double %tmp48, %tmp49
%tmp51 = load double, double* %max.0
%tmp52 = load double, double* %min.0
%tmp51 = load double, ptr %max.0
%tmp52 = load double, ptr %min.0
%tmp53 = fsub double %tmp51, %tmp52
%tmp54 = fdiv double %tmp50, %tmp53
store double %tmp54, double* %outH
store double %tmp54, ptr %outH
br label %bb75

bb55: ; preds = %bb45
%tmp56 = icmp eq double* %max.0, %tmp1
%tmp56 = icmp eq ptr %max.0, %tmp1
br i1 %tmp56, label %bb57, label %bb66

bb57: ; preds = %bb55
%tmp58 = load double, double* %tmp2, align 8
%tmp59 = load double, double* %tmp, align 8
%tmp58 = load double, ptr %tmp2, align 8
%tmp59 = load double, ptr %tmp, align 8
%tmp60 = fsub double %tmp58, %tmp59
%tmp61 = load double, double* %max.0
%tmp62 = load double, double* %min.0
%tmp61 = load double, ptr %max.0
%tmp62 = load double, ptr %min.0
%tmp63 = fsub double %tmp61, %tmp62
%tmp64 = fdiv double %tmp60, %tmp63
%tmp65 = fadd double 2.000000e+00, %tmp64
store double %tmp65, double* %outH
store double %tmp65, ptr %outH
br label %bb75

bb66: ; preds = %bb55
%tmp67 = load double, double* %tmp, align 8
%tmp68 = load double, double* %tmp1, align 8
%tmp67 = load double, ptr %tmp, align 8
%tmp68 = load double, ptr %tmp1, align 8
%tmp69 = fsub double %tmp67, %tmp68
%tmp70 = load double, double* %max.0
%tmp71 = load double, double* %min.0
%tmp70 = load double, ptr %max.0
%tmp71 = load double, ptr %min.0
%tmp72 = fsub double %tmp70, %tmp71
%tmp73 = fdiv double %tmp69, %tmp72
%tmp74 = fadd double 4.000000e+00, %tmp73
store double %tmp74, double* %outH
store double %tmp74, ptr %outH
br label %bb75

bb75: ; preds = %bb66, %bb57, %bb47
%tmp76 = load double, double* %outH
%tmp76 = load double, ptr %outH
%tmp77 = fdiv double %tmp76, 6.000000e+00
store double %tmp77, double* %outH
store double %tmp77, ptr %outH
%tmp78 = fcmp olt double %tmp77, 0.000000e+00
br i1 %tmp78, label %bb79, label %bb81

bb79: ; preds = %bb75
%tmp80 = fadd double %tmp77, 1.000000e+00
store double %tmp80, double* %outH
store double %tmp80, ptr %outH
br label %bb81

bb81: ; preds = %bb79, %bb75, %bb34
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstCombine/2012-07-25-LoadPart.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@test = constant [4 x i32] [i32 1, i32 2, i32 3, i32 4]

define i64 @foo() {
%ret = load i64, i64* bitcast (i8* getelementptr (i8, i8* bitcast ([4 x i32]* @test to i8*), i64 2) to i64*), align 1
%ret = load i64, ptr getelementptr (i8, ptr @test, i64 2), align 1
ret i64 %ret
; 0x00030000_00020000 in [01 00/00 00 02 00 00 00 03 00/00 00 04 00 00 00]
; LE: ret i64 844424930263040
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
; CHECK: addrspacecast

@base = internal unnamed_addr addrspace(3) global [16 x i32] zeroinitializer, align 16
declare void @foo(i32*)
declare void @foo(ptr)

define void @test() nounwind {
call void @foo(i32* getelementptr (i32, i32* addrspacecast ([16 x i32] addrspace(3)* @base to i32*), i64 2147483647)) nounwind
call void @foo(ptr getelementptr (i32, ptr addrspacecast (ptr addrspace(3) @base to ptr), i64 2147483647)) nounwind
ret void
}
10 changes: 4 additions & 6 deletions llvm/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"

@x = global i8* null, align 8
@y = global i8* null, align 8
@x = global ptr null, align 8
@y = global ptr null, align 8

; CHECK-LABEL: @f(
; CHECK-NEXT: alloca [0 x i8], align 1024
Expand All @@ -16,9 +16,7 @@ target triple = "x86_64-apple-macosx10.8.0"
define void @f() {
%1 = alloca [0 x i8], align 1
%2 = alloca [0 x i8], align 1024
%3 = getelementptr inbounds [0 x i8], [0 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [0 x i8], [0 x i8]* %2, i64 0, i64 0
store i8* %3, i8** @x, align 8
store i8* %4, i8** @y, align 8
store ptr %1, ptr @x, align 8
store ptr %2, ptr @y, align 8
ret void
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"

%struct.hoge = type { double*, double*, double*, double** }
%struct.hoge = type { ptr, ptr, ptr, ptr }

define void @widget(%struct.hoge* nocapture %arg, i1 %c1, i1 %c2, i1 %c3, i1 %c4, i1 %c5) {
define void @widget(ptr nocapture %arg, i1 %c1, i1 %c2, i1 %c3, i1 %c4, i1 %c5) {
bb:
%tmp = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i64 0, i32 0
br i1 %c1, label %bb1, label %bb17

bb1: ; preds = %bb
Expand All @@ -19,9 +18,8 @@ bb2: ; preds = %bb1
br label %bb17

bb3: ; preds = %bb1
%tmp4 = bitcast double** %tmp to <2 x double*>*
%tmp5 = load <2 x double*>, <2 x double*>* %tmp4, align 8
%tmp6 = ptrtoint <2 x double*> %tmp5 to <2 x i64>
%tmp5 = load <2 x ptr>, ptr %arg, align 8
%tmp6 = ptrtoint <2 x ptr> %tmp5 to <2 x i64>
%tmp7 = sub <2 x i64> zeroinitializer, %tmp6
%tmp8 = ashr exact <2 x i64> %tmp7, <i64 3, i64 3>
%tmp9 = extractelement <2 x i64> %tmp8, i32 0
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Transforms/InstCombine/2012-12-14-simp-vgep.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"

define <4 x i32> @foo(<4 x i32*>* %in) {
%t17 = load <4 x i32*>, <4 x i32*>* %in, align 8
%t18 = icmp eq <4 x i32*> %t17, zeroinitializer
define <4 x i32> @foo(ptr %in) {
%t17 = load <4 x ptr>, ptr %in, align 8
%t18 = icmp eq <4 x ptr> %t17, zeroinitializer
%t19 = zext <4 x i1> %t18 to <4 x i32>
ret <4 x i32> %t19
}
4 changes: 2 additions & 2 deletions llvm/test/Transforms/InstCombine/2012-3-15-or-xor-constant.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
define i32 @function(i32 %x) nounwind {
entry:
%xor = xor i32 %x, 1
store volatile i32 %xor, i32* inttoptr (i64 1 to i32*), align 4
%or4 = or i32 or (i32 zext (i1 icmp eq (i32* @g, i32* null) to i32), i32 1), %xor
store volatile i32 %xor, ptr inttoptr (i64 1 to ptr), align 4
%or4 = or i32 or (i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), i32 1), %xor
ret i32 %or4
}
; CHECK-LABEL: define i32 @function(
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ define { i64, i64 } @function(i32 %x, i32 %y, i32 %z) nounwind {
; CHECK-LABEL: @function(
; CHECK-NEXT: entry:
; CHECK-NEXT: %retval = alloca %struct._my_struct, align 8
; CHECK-NOT: bitcast i96* %retval to %struct._my_struct*
; CHECK-NOT: bitcast ptr %retval to ptr
entry:
%retval = alloca %struct._my_struct, align 8
%k.sroa.0.0.copyload = load i96, i96* bitcast (%struct._my_struct* @initval to i96*), align 1
%k.sroa.1.12.copyload = load i32, i32* bitcast ([4 x i8]* getelementptr inbounds (%struct._my_struct, %struct._my_struct* @initval, i64 0, i32 1) to i32*), align 1
%k.sroa.0.0.copyload = load i96, ptr @initval, align 1
%k.sroa.1.12.copyload = load i32, ptr getelementptr inbounds (%struct._my_struct, ptr @initval, i64 0, i32 1), align 1
%0 = zext i32 %x to i96
%bf.value = shl nuw nsw i96 %0, 6
%bf.clear = and i96 %k.sroa.0.0.copyload, -288230376151711744
Expand All @@ -30,16 +30,13 @@ entry:
%bf.clear4 = or i96 %bf.shl3, %bf.value.masked
%bf.set5 = or i96 %bf.clear4, %bf.value8
%bf.set10 = or i96 %bf.set5, %bf.clear
%retval.0.cast7 = bitcast %struct._my_struct* %retval to i96*
store i96 %bf.set10, i96* %retval.0.cast7, align 8
%retval.12.idx8 = getelementptr inbounds %struct._my_struct, %struct._my_struct* %retval, i64 0, i32 1
%retval.12.cast9 = bitcast [4 x i8]* %retval.12.idx8 to i32*
store i32 %k.sroa.1.12.copyload, i32* %retval.12.cast9, align 4
store i96 %bf.set10, ptr %retval, align 8
%retval.12.idx8 = getelementptr inbounds %struct._my_struct, ptr %retval, i64 0, i32 1
store i32 %k.sroa.1.12.copyload, ptr %retval.12.idx8, align 4
%trunc = trunc i96 %bf.set10 to i64
%.fca.0.insert = insertvalue { i64, i64 } undef, i64 %trunc, 0
%retval.8.idx12 = getelementptr inbounds %struct._my_struct, %struct._my_struct* %retval, i64 0, i32 0, i64 8
%retval.8.cast13 = bitcast i8* %retval.8.idx12 to i64*
%retval.8.load14 = load i64, i64* %retval.8.cast13, align 8
%retval.8.idx12 = getelementptr inbounds %struct._my_struct, ptr %retval, i64 0, i32 0, i64 8
%retval.8.load14 = load i64, ptr %retval.8.idx12, align 8
%.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.8.load14, 1
ret { i64, i64 } %.fca.1.insert
}
20 changes: 10 additions & 10 deletions llvm/test/Transforms/InstCombine/AddOverFlow.ll
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ declare i32 @__gxx_personality_v0(...);
!0 = !{i16 0, i16 32768} ; [0, 32767]
!1 = !{i16 0, i16 32769} ; [0, 32768]

define i16 @add_bounded_values(i16 %a, i16 %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
define i16 @add_bounded_values(i16 %a, i16 %b) personality ptr @__gxx_personality_v0 {
; CHECK-LABEL: @add_bounded_values(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[C:%.*]] = call i16 @bounded(i16 [[A:%.*]]), !range [[RNG0:![0-9]+]]
Expand All @@ -56,8 +56,8 @@ define i16 @add_bounded_values(i16 %a, i16 %b) personality i8* bitcast (i32 (...
; CHECK-NEXT: [[E:%.*]] = add nuw i16 [[C]], [[D]]
; CHECK-NEXT: ret i16 [[E]]
; CHECK: lpad:
; CHECK-NEXT: [[TMP0:%.*]] = landingpad { i8*, i32 }
; CHECK-NEXT: filter [0 x i8*] zeroinitializer
; CHECK-NEXT: [[TMP0:%.*]] = landingpad { ptr, i32 }
; CHECK-NEXT: filter [0 x ptr] zeroinitializer
; CHECK-NEXT: ret i16 42
;
entry:
Expand All @@ -68,12 +68,12 @@ cont:
%e = add i16 %c, %d
ret i16 %e
lpad:
%0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%0 = landingpad { ptr, i32 }
filter [0 x ptr] zeroinitializer
ret i16 42
}

define i16 @add_bounded_values_2(i16 %a, i16 %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
define i16 @add_bounded_values_2(i16 %a, i16 %b) personality ptr @__gxx_personality_v0 {
; CHECK-LABEL: @add_bounded_values_2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[C:%.*]] = call i16 @bounded(i16 [[A:%.*]]), !range [[RNG1:![0-9]+]]
Expand All @@ -83,8 +83,8 @@ define i16 @add_bounded_values_2(i16 %a, i16 %b) personality i8* bitcast (i32 (.
; CHECK-NEXT: [[E:%.*]] = add i16 [[C]], [[D]]
; CHECK-NEXT: ret i16 [[E]]
; CHECK: lpad:
; CHECK-NEXT: [[TMP0:%.*]] = landingpad { i8*, i32 }
; CHECK-NEXT: filter [0 x i8*] zeroinitializer
; CHECK-NEXT: [[TMP0:%.*]] = landingpad { ptr, i32 }
; CHECK-NEXT: filter [0 x ptr] zeroinitializer
; CHECK-NEXT: ret i16 42
;
entry:
Expand All @@ -96,8 +96,8 @@ cont:
%e = add i16 %c, %d
ret i16 %e
lpad:
%0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%0 = landingpad { ptr, i32 }
filter [0 x ptr] zeroinitializer
ret i16 42
}

Expand Down
40 changes: 20 additions & 20 deletions llvm/test/Transforms/InstCombine/CPP_min_max.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@
; Instcombine should propagate the load through the select instructions to
; allow elimination of the extra stuff by the mem2reg pass.

define void @_Z5test1RiS_(i32* %x, i32* %y) {
define void @_Z5test1RiS_(ptr %x, ptr %y) {
; CHECK-LABEL: @_Z5test1RiS_(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP_1_I:%.*]] = load i32, i32* [[Y:%.*]], align 4
; CHECK-NEXT: [[TMP_3_I:%.*]] = load i32, i32* [[X:%.*]], align 4
; CHECK-NEXT: [[TMP_1_I:%.*]] = load i32, ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[TMP_3_I:%.*]] = load i32, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.smin.i32(i32 [[TMP_1_I]], i32 [[TMP_3_I]])
; CHECK-NEXT: store i32 [[TMP0]], i32* [[X]], align 4
; CHECK-NEXT: store i32 [[TMP0]], ptr [[X]], align 4
; CHECK-NEXT: ret void
;
entry:
%tmp.1.i = load i32, i32* %y ; <i32> [#uses=1]
%tmp.3.i = load i32, i32* %x ; <i32> [#uses=1]
%tmp.1.i = load i32, ptr %y ; <i32> [#uses=1]
%tmp.3.i = load i32, ptr %x ; <i32> [#uses=1]
%tmp.4.i = icmp slt i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1]
%retval.i = select i1 %tmp.4.i, i32* %y, i32* %x ; <i32*> [#uses=1]
%tmp.4 = load i32, i32* %retval.i ; <i32> [#uses=1]
store i32 %tmp.4, i32* %x
%retval.i = select i1 %tmp.4.i, ptr %y, ptr %x ; <ptr> [#uses=1]
%tmp.4 = load i32, ptr %retval.i ; <i32> [#uses=1]
store i32 %tmp.4, ptr %x
ret void
}

define void @_Z5test2RiS_(i32* %x, i32* %y) {
define void @_Z5test2RiS_(ptr %x, ptr %y) {
; CHECK-LABEL: @_Z5test2RiS_(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP_2:%.*]] = load i32, i32* [[X:%.*]], align 4
; CHECK-NEXT: [[TMP_3_I:%.*]] = load i32, i32* [[Y:%.*]], align 4
; CHECK-NEXT: [[TMP_2:%.*]] = load i32, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[TMP_3_I:%.*]] = load i32, ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.smax.i32(i32 [[TMP_2]], i32 [[TMP_3_I]])
; CHECK-NEXT: store i32 [[TMP0]], i32* [[Y]], align 4
; CHECK-NEXT: store i32 [[TMP0]], ptr [[Y]], align 4
; CHECK-NEXT: ret void
;
entry:
%tmp.0 = alloca i32 ; <i32*> [#uses=2]
%tmp.2 = load i32, i32* %x ; <i32> [#uses=2]
store i32 %tmp.2, i32* %tmp.0
%tmp.3.i = load i32, i32* %y ; <i32> [#uses=1]
%tmp.0 = alloca i32 ; <ptr> [#uses=2]
%tmp.2 = load i32, ptr %x ; <i32> [#uses=2]
store i32 %tmp.2, ptr %tmp.0
%tmp.3.i = load i32, ptr %y ; <i32> [#uses=1]
%tmp.4.i = icmp slt i32 %tmp.2, %tmp.3.i ; <i1> [#uses=1]
%retval.i = select i1 %tmp.4.i, i32* %y, i32* %tmp.0 ; <i32*> [#uses=1]
%tmp.6 = load i32, i32* %retval.i ; <i32> [#uses=1]
store i32 %tmp.6, i32* %y
%retval.i = select i1 %tmp.4.i, ptr %y, ptr %tmp.0 ; <ptr> [#uses=1]
%tmp.6 = load i32, ptr %retval.i ; <i32> [#uses=1]
store i32 %tmp.6, ptr %y
ret void
}

58 changes: 29 additions & 29 deletions llvm/test/Transforms/InstCombine/InferAlignAttribute.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,48 @@
; RUN: opt -S -inline -instcombine %s | FileCheck %s --check-prefixes=CHECK,CHECK-INLINE
; RUN: opt -S -instcombine %s | FileCheck %s --check-prefixes=CHECK,CHECK-NOINLINE

define i8* @widen_align_from_allocalign_callsite() {
define ptr @widen_align_from_allocalign_callsite() {
; CHECK-LABEL: @widen_align_from_allocalign_callsite(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call align 64 i8* @my_aligned_alloc_2(i32 noundef 320, i32 allocalign noundef 64)
; CHECK-NEXT: ret i8* [[CALL]]
; CHECK-NEXT: [[CALL:%.*]] = tail call align 64 ptr @my_aligned_alloc_2(i32 noundef 320, i32 allocalign noundef 64)
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:

%call = tail call align 16 i8* @my_aligned_alloc_2(i32 noundef 320, i32 allocalign noundef 64)
ret i8* %call
%call = tail call align 16 ptr @my_aligned_alloc_2(i32 noundef 320, i32 allocalign noundef 64)
ret ptr %call
}

define i8* @widen_align_from_allocalign() {
define ptr @widen_align_from_allocalign() {
; CHECK-LABEL: @widen_align_from_allocalign(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call align 64 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef 64)
; CHECK-NEXT: ret i8* [[CALL]]
; CHECK-NEXT: [[CALL:%.*]] = tail call align 64 ptr @my_aligned_alloc(i32 noundef 320, i32 noundef 64)
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:

%call = tail call align 16 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef 64)
ret i8* %call
%call = tail call align 16 ptr @my_aligned_alloc(i32 noundef 320, i32 noundef 64)
ret ptr %call
}

define i8* @dont_narrow_align_from_allocalign() {
define ptr @dont_narrow_align_from_allocalign() {
; CHECK-LABEL: @dont_narrow_align_from_allocalign(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = tail call align 16 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef 8)
; CHECK-NEXT: ret i8* [[CALL]]
; CHECK-NEXT: [[CALL:%.*]] = tail call align 16 ptr @my_aligned_alloc(i32 noundef 320, i32 noundef 8)
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:
%call = tail call align 16 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef 8)
ret i8* %call
%call = tail call align 16 ptr @my_aligned_alloc(i32 noundef 320, i32 noundef 8)
ret ptr %call
}

define i8* @my_aligned_alloc_3(i32 noundef %foo, i32 allocalign %alignment) {
define ptr @my_aligned_alloc_3(i32 noundef %foo, i32 allocalign %alignment) {
; CHECK-LABEL: @my_aligned_alloc_3(
; CHECK-NEXT: [[CALL:%.*]] = tail call i8* @my_aligned_alloc_2(i32 noundef [[FOO:%.*]], i32 noundef [[ALIGNMENT:%.*]])
; CHECK-NEXT: ret i8* [[CALL]]
; CHECK-NEXT: [[CALL:%.*]] = tail call ptr @my_aligned_alloc_2(i32 noundef [[FOO:%.*]], i32 noundef [[ALIGNMENT:%.*]])
; CHECK-NEXT: ret ptr [[CALL]]
;
%call = tail call i8* @my_aligned_alloc_2(i32 noundef %foo, i32 noundef %alignment)
ret i8* %call
%call = tail call ptr @my_aligned_alloc_2(i32 noundef %foo, i32 noundef %alignment)
ret ptr %call
}

; -inline is able to make my_aligned_alloc_3's arguments disappear and directly
Expand All @@ -52,18 +52,18 @@ define i8* @my_aligned_alloc_3(i32 noundef %foo, i32 allocalign %alignment) {
; figure out the `align 128` on the return value once the call is directly on
; my_aligned_alloc_2. Note that this is a simplified version of what happens
; with _mm_malloc which calls posix_memalign.
define i8* @allocalign_disappears() {
define ptr @allocalign_disappears() {
; CHECK-INLINE-LABEL: @allocalign_disappears(
; CHECK-INLINE-NEXT: [[CALL_I:%.*]] = tail call i8* @my_aligned_alloc_2(i32 noundef 42, i32 noundef 128)
; CHECK-INLINE-NEXT: ret i8* [[CALL_I]]
; CHECK-INLINE-NEXT: [[CALL_I:%.*]] = tail call ptr @my_aligned_alloc_2(i32 noundef 42, i32 noundef 128)
; CHECK-INLINE-NEXT: ret ptr [[CALL_I]]
;
; CHECK-NOINLINE-LABEL: @allocalign_disappears(
; CHECK-NOINLINE-NEXT: [[CALL:%.*]] = tail call align 128 i8* @my_aligned_alloc_3(i32 42, i32 128)
; CHECK-NOINLINE-NEXT: ret i8* [[CALL]]
; CHECK-NOINLINE-NEXT: [[CALL:%.*]] = tail call align 128 ptr @my_aligned_alloc_3(i32 42, i32 128)
; CHECK-NOINLINE-NEXT: ret ptr [[CALL]]
;
%call = tail call i8* @my_aligned_alloc_3(i32 42, i32 128)
ret i8* %call
%call = tail call ptr @my_aligned_alloc_3(i32 42, i32 128)
ret ptr %call
}

declare i8* @my_aligned_alloc(i32 noundef, i32 allocalign noundef)
declare i8* @my_aligned_alloc_2(i32 noundef, i32 noundef)
declare ptr @my_aligned_alloc(i32 noundef, i32 allocalign noundef)
declare ptr @my_aligned_alloc_2(i32 noundef, i32 noundef)
10 changes: 5 additions & 5 deletions llvm/test/Transforms/InstCombine/IntPtrCast.ll
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
target datalayout = "e-p:32:32"

define i32* @test(i32* %P) {
%V = ptrtoint i32* %P to i32 ; <i32> [#uses=1]
%P2 = inttoptr i32 %V to i32* ; <i32*> [#uses=1]
ret i32* %P2
; CHECK: ret i32* %P
define ptr @test(ptr %P) {
%V = ptrtoint ptr %P to i32 ; <i32> [#uses=1]
%P2 = inttoptr i32 %V to ptr ; <ptr> [#uses=1]
ret ptr %P2
; CHECK: ret ptr %P
}

Loading