diff options
Diffstat (limited to 'test/Transforms/Inline')
41 files changed, 621 insertions, 702 deletions
diff --git a/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll b/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll index 6934562..a0ddacd 100644 --- a/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll +++ b/test/Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll @@ -214,7 +214,7 @@ bb: ; preds = %cond_true br label %bb3 bb3: ; preds = %bb, %entry - %tmp5 = load i8** null ; <i8*> [#uses=1] + %tmp5 = load i8*, i8** null ; <i8*> [#uses=1] %tmp = icmp ne i8* null, %tmp5 ; <i1> [#uses=1] br i1 %tmp, label %cond_true, label %cond_false diff --git a/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll b/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll index db2a799..1bfb551 100644 --- a/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll +++ b/test/Transforms/Inline/2009-01-08-NoInlineDynamicAlloca.ll @@ -10,15 +10,15 @@ entry: %p = alloca i8* ; <i8**> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i32 %i, i32* %i_addr - %0 = load i32* %i_addr, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* %i_addr, align 4 ; <i32> [#uses=1] %1 = alloca i8, i32 %0 ; <i8*> [#uses=1] store i8* %1, i8** %p, align 4 - %2 = load i8** %p, align 4 ; <i8*> [#uses=1] + %2 = load i8*, i8** %p, align 4 ; <i8*> [#uses=1] store i8* %2, i8** @q, align 4 br label %return return: ; preds = %entry - %retval1 = load i8** %retval ; <i8*> [#uses=1] + %retval1 = load i8*, i8** %retval ; <i8*> [#uses=1] ret i8* %retval1 } @@ -27,7 +27,7 @@ entry: %i_addr = alloca i32 ; <i32*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i32 %i, i32* %i_addr - %0 = load i32* %i_addr, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* %i_addr, align 4 ; <i32> [#uses=1] %1 = call i8* @a(i32 %0) nounwind ; <i8*> [#uses=0] br label %return diff --git a/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll b/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll index 7d8d16b..8d8f20f 100644 --- a/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll +++ b/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll @@ -75,23 +75,23 @@ entry: ] bb: ; preds = %entry - %0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1] - %1 = load %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=1] + %0 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1] + %1 = load %struct.quad_struct*, %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=1] ret %struct.quad_struct* %1 bb1: ; preds = %entry - %2 = getelementptr %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1] - %3 = load %struct.quad_struct** %2, align 4 ; <%struct.quad_struct*> [#uses=1] + %2 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1] + %3 = load %struct.quad_struct*, %struct.quad_struct** %2, align 4 ; <%struct.quad_struct*> [#uses=1] ret %struct.quad_struct* %3 bb2: ; preds = %entry - %4 = getelementptr %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1] - %5 = load %struct.quad_struct** %4, align 4 ; <%struct.quad_struct*> [#uses=1] + %4 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1] + %5 = load %struct.quad_struct*, %struct.quad_struct** %4, align 4 ; <%struct.quad_struct*> [#uses=1] ret %struct.quad_struct* %5 bb3: ; preds = %entry - %6 = getelementptr %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1] - %7 = load %struct.quad_struct** %6, align 4 ; <%struct.quad_struct*> [#uses=1] + %6 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1] + %7 = load %struct.quad_struct*, %struct.quad_struct** %6, align 4 ; <%struct.quad_struct*> [#uses=1] ret %struct.quad_struct* %7 bb5: ; preds = %entry @@ -100,10 +100,10 @@ bb5: ; preds = %entry define internal fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* nocapture %tree, i32 %d) nounwind readonly { entry: - %0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 6 ; <%struct.quad_struct**> [#uses=1] - %1 = load %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=4] - %2 = getelementptr %struct.quad_struct* %tree, i32 0, i32 1 ; <i32*> [#uses=1] - %3 = load i32* %2, align 4 ; <i32> [#uses=2] + %0 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 6 ; <%struct.quad_struct**> [#uses=1] + %1 = load %struct.quad_struct*, %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=4] + %2 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 1 ; <i32*> [#uses=1] + %3 = load i32, i32* %2, align 4 ; <i32> [#uses=2] %4 = icmp eq %struct.quad_struct* %1, null ; <i1> [#uses=1] br i1 %4, label %bb3, label %bb @@ -122,8 +122,8 @@ bb3: ; preds = %bb1, %bb, %entry br i1 %8, label %bb7, label %bb4 bb4: ; preds = %bb3 - %9 = getelementptr %struct.quad_struct* %q.0, i32 0, i32 0 ; <i32*> [#uses=1] - %10 = load i32* %9, align 4 ; <i32> [#uses=1] + %9 = getelementptr %struct.quad_struct, %struct.quad_struct* %q.0, i32 0, i32 0 ; <i32*> [#uses=1] + %10 = load i32, i32* %9, align 4 ; <i32> [#uses=1] %11 = icmp eq i32 %10, 2 ; <i1> [#uses=1] br i1 %11, label %bb5, label %bb7 @@ -140,36 +140,36 @@ declare fastcc i32 @sum_adjacent(%struct.quad_struct* nocapture, i32, i32, i32) define i32 @perimeter(%struct.quad_struct* nocapture %tree, i32 %size) nounwind readonly { entry: - %0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1] - %1 = load i32* %0, align 4 ; <i32> [#uses=1] + %0 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1] + %1 = load i32, i32* %0, align 4 ; <i32> [#uses=1] %2 = icmp eq i32 %1, 2 ; <i1> [#uses=1] br i1 %2, label %bb, label %bb2 bb: ; preds = %entry - %3 = getelementptr %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1] - %4 = load %struct.quad_struct** %3, align 4 ; <%struct.quad_struct*> [#uses=1] + %3 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1] + %4 = load %struct.quad_struct*, %struct.quad_struct** %3, align 4 ; <%struct.quad_struct*> [#uses=1] %5 = sdiv i32 %size, 2 ; <i32> [#uses=1] %6 = call i32 @perimeter(%struct.quad_struct* %4, i32 %5) nounwind ; <i32> [#uses=1] - %7 = getelementptr %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1] - %8 = load %struct.quad_struct** %7, align 4 ; <%struct.quad_struct*> [#uses=1] + %7 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1] + %8 = load %struct.quad_struct*, %struct.quad_struct** %7, align 4 ; <%struct.quad_struct*> [#uses=1] %9 = sdiv i32 %size, 2 ; <i32> [#uses=1] %10 = call i32 @perimeter(%struct.quad_struct* %8, i32 %9) nounwind ; <i32> [#uses=1] %11 = add i32 %10, %6 ; <i32> [#uses=1] - %12 = getelementptr %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1] - %13 = load %struct.quad_struct** %12, align 4 ; <%struct.quad_struct*> [#uses=1] + %12 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1] + %13 = load %struct.quad_struct*, %struct.quad_struct** %12, align 4 ; <%struct.quad_struct*> [#uses=1] %14 = sdiv i32 %size, 2 ; <i32> [#uses=1] %15 = call i32 @perimeter(%struct.quad_struct* %13, i32 %14) nounwind ; <i32> [#uses=1] %16 = add i32 %15, %11 ; <i32> [#uses=1] - %17 = getelementptr %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1] - %18 = load %struct.quad_struct** %17, align 4 ; <%struct.quad_struct*> [#uses=1] + %17 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1] + %18 = load %struct.quad_struct*, %struct.quad_struct** %17, align 4 ; <%struct.quad_struct*> [#uses=1] %19 = sdiv i32 %size, 2 ; <i32> [#uses=1] %20 = call i32 @perimeter(%struct.quad_struct* %18, i32 %19) nounwind ; <i32> [#uses=1] %21 = add i32 %20, %16 ; <i32> [#uses=1] ret i32 %21 bb2: ; preds = %entry - %22 = getelementptr %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1] - %23 = load i32* %22, align 4 ; <i32> [#uses=1] + %22 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1] + %23 = load i32, i32* %22, align 4 ; <i32> [#uses=1] %24 = icmp eq i32 %23, 0 ; <i1> [#uses=1] br i1 %24, label %bb3, label %bb23 @@ -179,14 +179,14 @@ bb3: ; preds = %bb2 br i1 %26, label %bb8, label %bb4 bb4: ; preds = %bb3 - %27 = getelementptr %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1] - %28 = load i32* %27, align 4 ; <i32> [#uses=1] + %27 = getelementptr %struct.quad_struct, %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1] + %28 = load i32, i32* %27, align 4 ; <i32> [#uses=1] %29 = icmp eq i32 %28, 1 ; <i1> [#uses=1] br i1 %29, label %bb8, label %bb6 bb6: ; preds = %bb4 - %30 = getelementptr %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1] - %31 = load i32* %30, align 4 ; <i32> [#uses=1] + %30 = getelementptr %struct.quad_struct, %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1] + %31 = load i32, i32* %30, align 4 ; <i32> [#uses=1] %32 = icmp eq i32 %31, 2 ; <i1> [#uses=1] br i1 %32, label %bb7, label %bb8 @@ -201,8 +201,8 @@ bb8: ; preds = %bb7, %bb6, %bb4, %bb3 br i1 %35, label %bb10, label %bb9 bb9: ; preds = %bb8 - %36 = getelementptr %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1] - %37 = load i32* %36, align 4 ; <i32> [#uses=1] + %36 = getelementptr %struct.quad_struct, %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1] + %37 = load i32, i32* %36, align 4 ; <i32> [#uses=1] %38 = icmp eq i32 %37, 1 ; <i1> [#uses=1] br i1 %38, label %bb10, label %bb11 @@ -211,8 +211,8 @@ bb10: ; preds = %bb9, %bb8 br label %bb13 bb11: ; preds = %bb9 - %40 = getelementptr %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1] - %41 = load i32* %40, align 4 ; <i32> [#uses=1] + %40 = getelementptr %struct.quad_struct, %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1] + %41 = load i32, i32* %40, align 4 ; <i32> [#uses=1] %42 = icmp eq i32 %41, 2 ; <i1> [#uses=1] br i1 %42, label %bb12, label %bb13 @@ -228,8 +228,8 @@ bb13: ; preds = %bb12, %bb11, %bb10 br i1 %46, label %bb15, label %bb14 bb14: ; preds = %bb13 - %47 = getelementptr %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1] - %48 = load i32* %47, align 4 ; <i32> [#uses=1] + %47 = getelementptr %struct.quad_struct, %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1] + %48 = load i32, i32* %47, align 4 ; <i32> [#uses=1] %49 = icmp eq i32 %48, 1 ; <i1> [#uses=1] br i1 %49, label %bb15, label %bb16 @@ -238,8 +238,8 @@ bb15: ; preds = %bb14, %bb13 br label %bb18 bb16: ; preds = %bb14 - %51 = getelementptr %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1] - %52 = load i32* %51, align 4 ; <i32> [#uses=1] + %51 = getelementptr %struct.quad_struct, %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1] + %52 = load i32, i32* %51, align 4 ; <i32> [#uses=1] %53 = icmp eq i32 %52, 2 ; <i1> [#uses=1] br i1 %53, label %bb17, label %bb18 @@ -255,8 +255,8 @@ bb18: ; preds = %bb17, %bb16, %bb15 br i1 %57, label %bb20, label %bb19 bb19: ; preds = %bb18 - %58 = getelementptr %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1] - %59 = load i32* %58, align 4 ; <i32> [#uses=1] + %58 = getelementptr %struct.quad_struct, %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1] + %59 = load i32, i32* %58, align 4 ; <i32> [#uses=1] %60 = icmp eq i32 %59, 1 ; <i1> [#uses=1] br i1 %60, label %bb20, label %bb21 @@ -265,8 +265,8 @@ bb20: ; preds = %bb19, %bb18 ret i32 %61 bb21: ; preds = %bb19 - %62 = getelementptr %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1] - %63 = load i32* %62, align 4 ; <i32> [#uses=1] + %62 = getelementptr %struct.quad_struct, %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1] + %63 = load i32, i32* %62, align 4 ; <i32> [#uses=1] %64 = icmp eq i32 %63, 2 ; <i1> [#uses=1] br i1 %64, label %bb22, label %bb23 diff --git a/test/Transforms/Inline/align.ll b/test/Transforms/Inline/align.ll index 9ac6d54..c91fe80 100644 --- a/test/Transforms/Inline/align.ll +++ b/test/Transforms/Inline/align.ll @@ -4,8 +4,8 @@ target triple = "x86_64-unknown-linux-gnu" define void @hello(float* align 128 nocapture %a, float* nocapture readonly %c) #0 { entry: - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 5 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 5 store float %0, float* %arrayidx, align 4 ret void } @@ -13,8 +13,8 @@ entry: define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 { entry: tail call void @hello(float* %a, float* %c) - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %0, float* %arrayidx, align 4 ret void } @@ -25,11 +25,11 @@ entry: ; CHECK: %maskedptr = and i64 %ptrint, 127 ; CHECK: %maskcond = icmp eq i64 %maskedptr, 0 ; CHECK: call void @llvm.assume(i1 %maskcond) -; CHECK: %0 = load float* %c, align 4 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i, align 4 -; CHECK: %1 = load float* %c, align 4 -; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx, align 4 ; CHECK: ret void ; CHECK: } @@ -37,29 +37,29 @@ entry: define void @fooa(float* nocapture align 128 %a, float* nocapture readonly %c) #0 { entry: tail call void @hello(float* %a, float* %c) - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %0, float* %arrayidx, align 4 ret void } ; CHECK: define void @fooa(float* nocapture align 128 %a, float* nocapture readonly %c) #0 { ; CHECK: entry: -; CHECK: %0 = load float* %c, align 4 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i, align 4 -; CHECK: %1 = load float* %c, align 4 -; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx, align 4 ; CHECK: ret void ; CHECK: } define void @hello2(float* align 128 nocapture %a, float* align 128 nocapture %b, float* nocapture readonly %c) #0 { entry: - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 5 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 5 store float %0, float* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds float* %b, i64 8 + %arrayidx1 = getelementptr inbounds float, float* %b, i64 8 store float %0, float* %arrayidx1, align 4 ret void } @@ -67,8 +67,8 @@ entry: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { entry: tail call void @hello2(float* %a, float* %b, float* %c) - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %0, float* %arrayidx, align 4 ret void } @@ -83,13 +83,13 @@ entry: ; CHECK: %maskedptr2 = and i64 %ptrint1, 127 ; CHECK: %maskcond3 = icmp eq i64 %maskedptr2, 0 ; CHECK: call void @llvm.assume(i1 %maskcond3) -; CHECK: %0 = load float* %c, align 4 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i, align 4 -; CHECK: %arrayidx1.i = getelementptr inbounds float* %b, i64 8 +; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8 ; CHECK: store float %0, float* %arrayidx1.i, align 4 -; CHECK: %1 = load float* %c, align 4 -; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx, align 4 ; CHECK: ret void ; CHECK: } diff --git a/test/Transforms/Inline/alloca-bonus.ll b/test/Transforms/Inline/alloca-bonus.ll index 3c5052b..649fac9 100644 --- a/test/Transforms/Inline/alloca-bonus.ll +++ b/test/Transforms/Inline/alloca-bonus.ll @@ -15,10 +15,10 @@ define void @outer1() { } define void @inner1(i32 *%ptr) { - %A = load i32* %ptr + %A = load i32, i32* %ptr store i32 0, i32* %ptr - %C = getelementptr inbounds i32* %ptr, i32 0 - %D = getelementptr inbounds i32* %ptr, i32 1 + %C = getelementptr inbounds i32, i32* %ptr, i32 0 + %D = getelementptr inbounds i32, i32* %ptr, i32 1 %E = bitcast i32* %ptr to i8* %F = select i1 false, i32* %ptr, i32* @glbl call void @llvm.lifetime.start(i64 0, i8* %E) @@ -35,10 +35,10 @@ define void @outer2() { ; %D poisons this call, scalar-repl can't handle that instruction. define void @inner2(i32 *%ptr) { - %A = load i32* %ptr + %A = load i32, i32* %ptr store i32 0, i32* %ptr - %C = getelementptr inbounds i32* %ptr, i32 0 - %D = getelementptr inbounds i32* %ptr, i32 %A + %C = getelementptr inbounds i32, i32* %ptr, i32 0 + %D = getelementptr inbounds i32, i32* %ptr, i32 %A %E = bitcast i32* %ptr to i8* %F = select i1 false, i32* %ptr, i32* @glbl call void @llvm.lifetime.start(i64 0, i8* %E) @@ -59,7 +59,7 @@ define void @inner3(i32 *%ptr, i1 %x) { br i1 %A, label %bb.true, label %bb.false bb.true: ; This block musn't be counted in the inline cost. - %t1 = load i32* %ptr + %t1 = load i32, i32* %ptr %t2 = add i32 %t1, 1 %t3 = add i32 %t2, 1 %t4 = add i32 %t3, 1 @@ -95,12 +95,12 @@ define void @outer4(i32 %A) { ; %B poisons this call, scalar-repl can't handle that instruction. However, we ; still want to detect that the icmp and branch *can* be handled. define void @inner4(i32 *%ptr, i32 %A) { - %B = getelementptr inbounds i32* %ptr, i32 %A + %B = getelementptr inbounds i32, i32* %ptr, i32 %A %C = icmp eq i32* %ptr, null br i1 %C, label %bb.true, label %bb.false bb.true: ; This block musn't be counted in the inline cost. - %t1 = load i32* %ptr + %t1 = load i32, i32* %ptr %t2 = add i32 %t1, 1 %t3 = add i32 %t2, 1 %t4 = add i32 %t3, 1 @@ -137,13 +137,13 @@ define void @outer5() { ; the flag is set appropriately, the poisoning instruction is inside of dead ; code, and so shouldn't be counted. define void @inner5(i1 %flag, i32 *%ptr) { - %A = load i32* %ptr + %A = load i32, i32* %ptr store i32 0, i32* %ptr - %C = getelementptr inbounds i32* %ptr, i32 0 + %C = getelementptr inbounds i32, i32* %ptr, i32 0 br i1 %flag, label %if.then, label %exit if.then: - %D = getelementptr inbounds i32* %ptr, i32 %A + %D = getelementptr inbounds i32, i32* %ptr, i32 %A %E = bitcast i32* %ptr to i8* %F = select i1 false, i32* %ptr, i32* @glbl call void @llvm.lifetime.start(i64 0, i8* %E) diff --git a/test/Transforms/Inline/alloca-dbgdeclare.ll b/test/Transforms/Inline/alloca-dbgdeclare.ll index 6809e41..eb912f5 100644 --- a/test/Transforms/Inline/alloca-dbgdeclare.ll +++ b/test/Transforms/Inline/alloca-dbgdeclare.ll @@ -43,17 +43,17 @@ entry: ; CHECK-NEXT: call void @llvm.dbg.declare(metadata [20 x i8]* %agg.tmp.sroa.3.i, %agg.tmp.sroa.3 = alloca [20 x i8], align 4 tail call void @llvm.dbg.declare(metadata [20 x i8]* %agg.tmp.sroa.3, metadata !46, metadata !48), !dbg !49 - %agg.tmp.sroa.0.0.copyload = load i32* getelementptr inbounds (%struct.A* @b, i64 0, i32 0), align 8, !dbg !50 + %agg.tmp.sroa.0.0.copyload = load i32, i32* getelementptr inbounds (%struct.A, %struct.A* @b, i64 0, i32 0), align 8, !dbg !50 tail call void @llvm.dbg.value(metadata i32 %agg.tmp.sroa.0.0.copyload, i64 0, metadata !46, metadata !51), !dbg !49 - %agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds [20 x i8]* %agg.tmp.sroa.3, i64 0, i64 0, !dbg !50 - call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.3.0..sroa_idx, i8* getelementptr (i8* bitcast (%struct.A* @b to i8*), i64 4), i64 20, i32 4, i1 false), !dbg !50 + %agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds [20 x i8], [20 x i8]* %agg.tmp.sroa.3, i64 0, i64 0, !dbg !50 + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.3.0..sroa_idx, i8* getelementptr (i8, i8* bitcast (%struct.A* @b to i8*), i64 4), i64 20, i32 4, i1 false), !dbg !50 tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !46, metadata !31) #2, !dbg !49 %tobool.i = icmp eq i32 %agg.tmp.sroa.0.0.copyload, 0, !dbg !52 br i1 %tobool.i, label %_Z3fn31A.exit, label %if.then.i, !dbg !53 if.then.i: ; preds = %entry - store i32 %agg.tmp.sroa.0.0.copyload, i32* getelementptr inbounds (%struct.A* @a, i64 0, i32 0), align 8, !dbg !54 - call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr (i8* bitcast (%struct.A* @a to i8*), i64 4), i8* %agg.tmp.sroa.3.0..sroa_idx, i64 20, i32 4, i1 false), !dbg !54 + store i32 %agg.tmp.sroa.0.0.copyload, i32* getelementptr inbounds (%struct.A, %struct.A* @a, i64 0, i32 0), align 8, !dbg !54 + call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr (i8, i8* bitcast (%struct.A* @a to i8*), i64 4), i8* %agg.tmp.sroa.3.0..sroa_idx, i64 20, i32 4, i1 false), !dbg !54 br label %_Z3fn31A.exit, !dbg !54 _Z3fn31A.exit: ; preds = %entry, %if.then.i @@ -82,41 +82,41 @@ attributes #3 = { noreturn nounwind } !llvm.module.flags = !{!28, !29} !llvm.ident = !{!30} -!0 = !{!"0x11\004\00clang version 3.7.0 (trunk 227480) (llvm/trunk 227517)\001\00\000\00\001", !1, !2, !3, !14, !25, !2} ; [ DW_TAG_compile_unit ] [/<stdin>] [DW_LANG_C_plus_plus] -!1 = !{!"<stdin>", !""} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227480) (llvm/trunk 227517)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !25, imports: !2) +!1 = !MDFile(filename: "<stdin>", directory: "") !2 = !{} !3 = !{!4} -!4 = !{!"0x13\00A\001\00192\0064\000\000\000", !5, null, null, !6, null, null, !"_ZTS1A"} ; [ DW_TAG_structure_type ] [A] [line 1, size 192, align 64, offset 0] [def] [from ] -!5 = !{!"test.cpp", !""} +!4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 192, align: 64, file: !5, elements: !6, identifier: "_ZTS1A") +!5 = !MDFile(filename: "test.cpp", directory: "") !6 = !{!7, !9} -!7 = !{!"0xd\00arg0\002\0032\0032\000\000", !5, !"_ZTS1A", !8} ; [ DW_TAG_member ] [arg0] [line 2, size 32, align 32, offset 0] [from int] -!8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] -!9 = !{!"0xd\00arg1\003\00128\0064\0064\000", !5, !"_ZTS1A", !10} ; [ DW_TAG_member ] [arg1] [line 3, size 128, align 64, offset 64] [from ] -!10 = !{!"0x1\00\000\00128\0064\000\000\000", null, null, !11, !12, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 128, align 64, offset 0] [from double] -!11 = !{!"0x24\00double\000\0064\0064\000\000\004", null, null} ; [ DW_TAG_base_type ] [double] [line 0, size 64, align 64, offset 0, enc DW_ATE_float] +!7 = !MDDerivedType(tag: DW_TAG_member, name: "arg0", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS1A", baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDDerivedType(tag: DW_TAG_member, name: "arg1", line: 3, size: 128, align: 64, offset: 64, file: !5, scope: !"_ZTS1A", baseType: !10) +!10 = !MDCompositeType(tag: DW_TAG_array_type, size: 128, align: 64, baseType: !11, elements: !12) +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) !12 = !{!13} -!13 = !{!"0x21\000\002"} ; [ DW_TAG_subrange_type ] [0, 1] +!13 = !MDSubrange(count: 2) !14 = !{!15, !21, !24} -!15 = !{!"0x2e\00fn3\00fn3\00_Z3fn31A\006\000\001\000\000\00256\001\006", !5, !16, !17, null, void (%struct.A*)* @_Z3fn31A, null, null, !19} ; [ DW_TAG_subprogram ] [line 6] [def] [fn3] -!16 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/test.cpp] -!17 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!15 = !MDSubprogram(name: "fn3", linkageName: "_Z3fn31A", line: 6, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !5, scope: !16, type: !17, function: void (%struct.A*)* @_Z3fn31A, variables: !19) +!16 = !MDFile(filename: "test.cpp", directory: "") +!17 = !MDSubroutineType(types: !18) !18 = !{null, !"_ZTS1A"} !19 = !{!20} -!20 = !{!"0x101\00p1\0016777222\000", !15, !16, !"_ZTS1A"} ; [ DW_TAG_arg_variable ] [p1] [line 6] -!21 = !{!"0x2e\00fn4\00fn4\00_Z3fn4v\0011\000\001\000\000\00256\001\0011", !5, !16, !22, null, void ()* @_Z3fn4v, null, null, !2} ; [ DW_TAG_subprogram ] [line 11] [def] [fn4] -!22 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !23, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 6, arg: 1, scope: !15, file: !16, type: !"_ZTS1A") +!21 = !MDSubprogram(name: "fn4", linkageName: "_Z3fn4v", line: 11, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !5, scope: !16, type: !22, function: void ()* @_Z3fn4v, variables: !2) +!22 = !MDSubroutineType(types: !23) !23 = !{null} -!24 = !{!"0x2e\00fn5\00fn5\00_Z3fn5v\0013\000\001\000\000\00256\001\0013", !5, !16, !22, null, void ()* @_Z3fn5v, null, null, !2} ; [ DW_TAG_subprogram ] [line 13] [def] [fn5] +!24 = !MDSubprogram(name: "fn5", linkageName: "_Z3fn5v", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !16, type: !22, function: void ()* @_Z3fn5v, variables: !2) !25 = !{!26, !27} -!26 = !{!"0x34\00a\00a\00\004\000\001", null, !16, !"_ZTS1A", %struct.A* @a, null} ; [ DW_TAG_variable ] [a] [line 4] [def] -!27 = !{!"0x34\00b\00b\00\004\000\001", null, !16, !"_ZTS1A", %struct.A* @b, null} ; [ DW_TAG_variable ] [b] [line 4] [def] +!26 = !MDGlobalVariable(name: "a", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !"_ZTS1A", variable: %struct.A* @a) +!27 = !MDGlobalVariable(name: "b", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !"_ZTS1A", variable: %struct.A* @b) !28 = !{i32 2, !"Dwarf Version", i32 4} -!29 = !{i32 2, !"Debug Info Version", i32 2} +!29 = !{i32 2, !"Debug Info Version", i32 3} !30 = !{!"clang version 3.7.0 (trunk 227480) (llvm/trunk 227517)"} -!31 = !{!"0x102\006"} ; [ DW_TAG_expression ] [DW_OP_deref] +!31 = !MDExpression(DW_OP_deref) !32 = !MDLocation(line: 6, scope: !15) !33 = !MDLocation(line: 7, scope: !34) -!34 = !{!"0xb\007\000\000", !5, !15} ; [ DW_TAG_lexical_block ] [/test.cpp] +!34 = distinct !MDLexicalBlock(line: 7, column: 0, file: !5, scope: !15) !35 = !{!36, !37, i64 0} !36 = !{!"_ZTS1A", !37, i64 0, !38, i64 8} !37 = !{!"int", !38, i64 0} @@ -128,12 +128,12 @@ attributes #3 = { noreturn nounwind } !43 = !{!37, !37, i64 0} !44 = !{!38, !38, i64 0} !45 = !MDLocation(line: 9, scope: !15) -!46 = !{!"0x101\00p1\0016777222\000", !15, !16, !"_ZTS1A", !47} ; [ DW_TAG_arg_variable ] [p1] [line 6] +!46 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 6, arg: 1, scope: !15, file: !16, type: !"_ZTS1A", inlinedAt: !47) !47 = distinct !MDLocation(line: 11, scope: !21) -!48 = !{!"0x102\00147\004\0020"} ; [ DW_TAG_expression ] [DW_OP_piece offset=4, size=20] +!48 = !MDExpression(DW_OP_bit_piece, 32, 160) !49 = !MDLocation(line: 6, scope: !15, inlinedAt: !47) !50 = !MDLocation(line: 11, scope: !21) -!51 = !{!"0x102\00147\000\004"} ; [ DW_TAG_expression ] [DW_OP_piece offset=0, size=4] +!51 = !MDExpression(DW_OP_bit_piece, 0, 32) !52 = !MDLocation(line: 7, scope: !34, inlinedAt: !47) !53 = !MDLocation(line: 7, scope: !15, inlinedAt: !47) !54 = !MDLocation(line: 8, scope: !34, inlinedAt: !47) diff --git a/test/Transforms/Inline/alloca-in-scc.ll b/test/Transforms/Inline/alloca-in-scc.ll index d539255..92649a6 100644 --- a/test/Transforms/Inline/alloca-in-scc.ll +++ b/test/Transforms/Inline/alloca-in-scc.ll @@ -12,7 +12,7 @@ entry: define internal fastcc void @a() nounwind ssp { entry: %al = alloca [3 x i32], align 4 - %0 = getelementptr inbounds [3 x i32]* %al, i32 0, i32 2 + %0 = getelementptr inbounds [3 x i32], [3 x i32]* %al, i32 0, i32 2 call fastcc void @c() nounwind unreachable diff --git a/test/Transforms/Inline/alloca-merge-align-nodl.ll b/test/Transforms/Inline/alloca-merge-align-nodl.ll deleted file mode 100644 index 301505f..0000000 --- a/test/Transforms/Inline/alloca-merge-align-nodl.ll +++ /dev/null @@ -1,88 +0,0 @@ -; RUN: opt < %s -inline -S | FileCheck %s -; This variant of the test has no data layout information. -target triple = "powerpc64-unknown-linux-gnu" - -%struct.s = type { i32, i32 } - -define void @foo(%struct.s* byval nocapture readonly %a) { -entry: - %x = alloca [2 x i32], align 4 - %a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0 - %0 = load i32* %a1, align 4 - %arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0 - store i32 %0, i32* %arrayidx, align 4 - %b = getelementptr inbounds %struct.s* %a, i64 0, i32 1 - %1 = load i32* %b, align 4 - %arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1 - store i32 %1, i32* %arrayidx2, align 4 - call void @bar(i32* %arrayidx) #2 - ret void -} - -define void @foo0(%struct.s* byval nocapture readonly %a) { -entry: - %x = alloca [2 x i32] - %a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0 - %0 = load i32* %a1, align 4 - %arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0 - store i32 %0, i32* %arrayidx, align 4 - %b = getelementptr inbounds %struct.s* %a, i64 0, i32 1 - %1 = load i32* %b, align 4 - %arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1 - store i32 %1, i32* %arrayidx2, align 4 - call void @bar(i32* %arrayidx) #2 - ret void -} - -declare void @bar(i32*) #1 - -define void @goo(%struct.s* byval nocapture readonly %a) { -entry: - %x = alloca [2 x i32], align 32 - %a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0 - %0 = load i32* %a1, align 4 - %arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0 - store i32 %0, i32* %arrayidx, align 32 - %b = getelementptr inbounds %struct.s* %a, i64 0, i32 1 - %1 = load i32* %b, align 4 - %arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1 - store i32 %1, i32* %arrayidx2, align 4 - call void @bar(i32* %arrayidx) #2 - ret void -} - -; CHECK-LABEL: @main -; CHECK: alloca [2 x i32], align 32 -; CHECK-NOT: alloca [2 x i32] -; CHECK: ret i32 0 - -define signext i32 @main() { -entry: - %a = alloca i64, align 8 - %tmpcast = bitcast i64* %a to %struct.s* - store i64 0, i64* %a, align 8 - %a1 = bitcast i64* %a to i32* - store i32 1, i32* %a1, align 8 - call void @foo(%struct.s* byval %tmpcast) - store i32 2, i32* %a1, align 8 - call void @goo(%struct.s* byval %tmpcast) - ret i32 0 -} - -; CHECK-LABEL: @test0 -; CHECK: alloca [2 x i32], align 32 -; CHECK: alloca [2 x i32] -; CHECK: ret i32 0 - -define signext i32 @test0() { -entry: - %a = alloca i64, align 8 - %tmpcast = bitcast i64* %a to %struct.s* - store i64 0, i64* %a, align 8 - %a1 = bitcast i64* %a to i32* - store i32 1, i32* %a1, align 8 - call void @foo0(%struct.s* byval %tmpcast) - store i32 2, i32* %a1, align 8 - call void @goo(%struct.s* byval %tmpcast) - ret i32 0 -} diff --git a/test/Transforms/Inline/alloca-merge-align.ll b/test/Transforms/Inline/alloca-merge-align.ll index d357b3c..70b94f7 100644 --- a/test/Transforms/Inline/alloca-merge-align.ll +++ b/test/Transforms/Inline/alloca-merge-align.ll @@ -8,13 +8,13 @@ target triple = "powerpc64-unknown-linux-gnu" define void @foo(%struct.s* byval nocapture readonly %a) { entry: %x = alloca [2 x i32], align 4 - %a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0 - %0 = load i32* %a1, align 4 - %arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0 + %a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0 + %0 = load i32, i32* %a1, align 4 + %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0 store i32 %0, i32* %arrayidx, align 4 - %b = getelementptr inbounds %struct.s* %a, i64 0, i32 1 - %1 = load i32* %b, align 4 - %arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1 + %b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1 + %1 = load i32, i32* %b, align 4 + %arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1 store i32 %1, i32* %arrayidx2, align 4 call void @bar(i32* %arrayidx) #2 ret void @@ -23,13 +23,13 @@ entry: define void @foo0(%struct.s* byval nocapture readonly %a) { entry: %x = alloca [2 x i32] - %a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0 - %0 = load i32* %a1, align 4 - %arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0 + %a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0 + %0 = load i32, i32* %a1, align 4 + %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0 store i32 %0, i32* %arrayidx, align 4 - %b = getelementptr inbounds %struct.s* %a, i64 0, i32 1 - %1 = load i32* %b, align 4 - %arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1 + %b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1 + %1 = load i32, i32* %b, align 4 + %arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1 store i32 %1, i32* %arrayidx2, align 4 call void @bar(i32* %arrayidx) #2 ret void @@ -38,13 +38,13 @@ entry: define void @foo1(%struct.s* byval nocapture readonly %a) { entry: %x = alloca [2 x i32], align 1 - %a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0 - %0 = load i32* %a1, align 4 - %arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0 + %a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0 + %0 = load i32, i32* %a1, align 4 + %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0 store i32 %0, i32* %arrayidx, align 4 - %b = getelementptr inbounds %struct.s* %a, i64 0, i32 1 - %1 = load i32* %b, align 4 - %arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1 + %b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1 + %1 = load i32, i32* %b, align 4 + %arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1 store i32 %1, i32* %arrayidx2, align 4 call void @bar(i32* %arrayidx) #2 ret void @@ -55,13 +55,13 @@ declare void @bar(i32*) #1 define void @goo(%struct.s* byval nocapture readonly %a) { entry: %x = alloca [2 x i32], align 32 - %a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0 - %0 = load i32* %a1, align 4 - %arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0 + %a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0 + %0 = load i32, i32* %a1, align 4 + %arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0 store i32 %0, i32* %arrayidx, align 32 - %b = getelementptr inbounds %struct.s* %a, i64 0, i32 1 - %1 = load i32* %b, align 4 - %arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1 + %b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1 + %1 = load i32, i32* %b, align 4 + %arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1 store i32 %1, i32* %arrayidx2, align 4 call void @bar(i32* %arrayidx) #2 ret void @@ -102,21 +102,3 @@ entry: call void @goo(%struct.s* byval %tmpcast) ret i32 0 } - -; CHECK-LABEL: @test1 -; CHECK: {{alloca \[2 x i32\]$}} -; CHECK-NOT: alloca [2 x i32] -; CHECK: ret i32 0 - -define signext i32 @test1() { -entry: - %a = alloca i64, align 8 - %tmpcast = bitcast i64* %a to %struct.s* - store i64 0, i64* %a, align 8 - %a1 = bitcast i64* %a to i32* - store i32 1, i32* %a1, align 8 - call void @foo0(%struct.s* byval %tmpcast) - store i32 2, i32* %a1, align 8 - call void @foo1(%struct.s* byval %tmpcast) - ret i32 0 -} diff --git a/test/Transforms/Inline/basictest.ll b/test/Transforms/Inline/basictest.ll index 085694f..8f0b3ea 100644 --- a/test/Transforms/Inline/basictest.ll +++ b/test/Transforms/Inline/basictest.ll @@ -25,7 +25,7 @@ define internal %T* @test2f(i1 %cond, %T* %P) { br i1 %cond, label %T, label %F T: - %A = getelementptr %T* %P, i32 0, i32 0 + %A = getelementptr %T, %T* %P, i32 0, i32 0 store i32 42, i32* %A ret %T* %P @@ -37,8 +37,8 @@ define i32 @test2(i1 %cond) { %A = alloca %T %B = call %T* @test2f(i1 %cond, %T* %A) - %C = getelementptr %T* %B, i32 0, i32 0 - %D = load i32* %C + %C = getelementptr %T, %T* %B, i32 0, i32 0 + %D = load i32, i32* %C ret i32 %D ; CHECK-LABEL: @test2( diff --git a/test/Transforms/Inline/byval-tail-call.ll b/test/Transforms/Inline/byval-tail-call.ll index 154f397..1e50463 100644 --- a/test/Transforms/Inline/byval-tail-call.ll +++ b/test/Transforms/Inline/byval-tail-call.ll @@ -31,7 +31,7 @@ define internal void @qux(i32* byval %x) { define void @frob(i32* %x) { ; CHECK-LABEL: define void @frob( ; CHECK: %[[POS:.*]] = alloca i32 -; CHECK: %[[VAL:.*]] = load i32* %x +; CHECK: %[[VAL:.*]] = load i32, i32* %x ; CHECK: store i32 %[[VAL]], i32* %[[POS]] ; CHECK: {{^ *}}call void @ext(i32* %[[POS]] ; CHECK: tail call void @ext(i32* null) diff --git a/test/Transforms/Inline/byval.ll b/test/Transforms/Inline/byval.ll index d7597ad..d4edf25 100644 --- a/test/Transforms/Inline/byval.ll +++ b/test/Transforms/Inline/byval.ll @@ -7,8 +7,8 @@ define internal void @f(%struct.ss* byval %b) nounwind { entry: - %tmp = getelementptr %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2] - %tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1] + %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2] + %tmp1 = load i32, i32* %tmp, align 4 ; <i32> [#uses=1] %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1] store i32 %tmp2, i32* %tmp, align 4 ret void @@ -19,9 +19,9 @@ declare i32 @printf(i8*, ...) nounwind define i32 @test1() nounwind { entry: %S = alloca %struct.ss ; <%struct.ss*> [#uses=4] - %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1] store i32 1, i32* %tmp1, align 8 - %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1] + %tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1] store i64 2, i64* %tmp4, align 4 call void @f( %struct.ss* byval %S ) nounwind ret i32 0 @@ -37,8 +37,8 @@ entry: define internal i32 @f2(%struct.ss* byval %b) nounwind readonly { entry: - %tmp = getelementptr %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2] - %tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1] + %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2] + %tmp1 = load i32, i32* %tmp, align 4 ; <i32> [#uses=1] %tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1] ret i32 %tmp2 } @@ -46,9 +46,9 @@ entry: define i32 @test2() nounwind { entry: %S = alloca %struct.ss ; <%struct.ss*> [#uses=4] - %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1] store i32 1, i32* %tmp1, align 8 - %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1] + %tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1] store i64 2, i64* %tmp4, align 4 %X = call i32 @f2( %struct.ss* byval %S ) nounwind ret i32 %X @@ -111,9 +111,9 @@ entry: define internal void @f5(%struct.S0* byval nocapture readonly align 4 %p) { entry: - store i32 0, i32* getelementptr inbounds (%struct.S0* @b, i64 0, i32 0), align 4 - %f2 = getelementptr inbounds %struct.S0* %p, i64 0, i32 0 - %0 = load i32* %f2, align 4 + store i32 0, i32* getelementptr inbounds (%struct.S0, %struct.S0* @b, i64 0, i32 0), align 4 + %f2 = getelementptr inbounds %struct.S0, %struct.S0* %p, i64 0, i32 0 + %0 = load i32, i32* %f2, align 4 store i32 %0, i32* @a, align 4 ret void } @@ -121,9 +121,9 @@ entry: define i32 @test5() { entry: tail call void @f5(%struct.S0* byval align 4 @b) - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 ret i32 %0 ; CHECK: @test5() -; CHECK: store i32 0, i32* getelementptr inbounds (%struct.S0* @b, i64 0, i32 0), align 4 -; CHECK-NOT: load i32* getelementptr inbounds (%struct.S0* @b, i64 0, i32 0), align 4 +; CHECK: store i32 0, i32* getelementptr inbounds (%struct.S0, %struct.S0* @b, i64 0, i32 0), align 4 +; CHECK-NOT: load i32, i32* getelementptr inbounds (%struct.S0, %struct.S0* @b, i64 0, i32 0), align 4 } diff --git a/test/Transforms/Inline/byval_lifetime.ll b/test/Transforms/Inline/byval_lifetime.ll index e8dff2a..b500eae 100644 --- a/test/Transforms/Inline/byval_lifetime.ll +++ b/test/Transforms/Inline/byval_lifetime.ll @@ -10,9 +10,9 @@ define i32 @foo(%struct.foo* byval align 8 %f, i32 %a) { entry: - %a1 = getelementptr inbounds %struct.foo* %f, i32 0, i32 1 - %arrayidx = getelementptr inbounds [16 x i32]* %a1, i32 0, i32 %a - %tmp2 = load i32* %arrayidx, align 1 + %a1 = getelementptr inbounds %struct.foo, %struct.foo* %f, i32 0, i32 1 + %arrayidx = getelementptr inbounds [16 x i32], [16 x i32]* %a1, i32 0, i32 %a + %tmp2 = load i32, i32* %arrayidx, align 1 ret i32 %tmp2 } diff --git a/test/Transforms/Inline/crash2.ll b/test/Transforms/Inline/crash2.ll index be634f6..4c0dfae 100644 --- a/test/Transforms/Inline/crash2.ll +++ b/test/Transforms/Inline/crash2.ll @@ -14,7 +14,7 @@ entry: %__f_addr = alloca void (i8*)*, align 8 store void (i8*)* %__f, void (i8*)** %__f_addr - %0 = load void (i8*)** %__f_addr, align 8 + %0 = load void (i8*)*, void (i8*)** %__f_addr, align 8 call void %0(i8* undef) call i8* @f1(i8* undef) ssp unreachable diff --git a/test/Transforms/Inline/debug-info-duplicate-calls.ll b/test/Transforms/Inline/debug-info-duplicate-calls.ll index 2363693..a67fac5 100644 --- a/test/Transforms/Inline/debug-info-duplicate-calls.ll +++ b/test/Transforms/Inline/debug-info-duplicate-calls.ll @@ -33,10 +33,10 @@ ; CHECK: call void @_Z2f1v(), !dbg [[fcs2_f4_f3cs1_f2:![0-9]+]] ; CHECK: call void @_Z2f1v(), !dbg [[fcs2_f4_f3cs2_f2:![0-9]+]] -; CHECK-DAG: [[F:![0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [f] -; CHECK-DAG: [[F2:![0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [f2] -; CHECK-DAG: [[F3:![0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [f3] -; CHECK-DAG: [[F4:![0-9]+]] = {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [f4] +; CHECK-DAG: [[F:![0-9]+]] = !MDSubprogram(name: "f" +; CHECK-DAG: [[F2:![0-9]+]] = !MDSubprogram(name: "f2" +; CHECK-DAG: [[F3:![0-9]+]] = !MDSubprogram(name: "f3" +; CHECK-DAG: [[F4:![0-9]+]] = !MDSubprogram(name: "f4" ; CHECK: [[fcs1_f4_f3cs1_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs1_f4_f3cs1:![0-9]+]]) ; CHECK: [[fcs1_f4_f3cs1]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs1_f4:![0-9]+]]) @@ -98,18 +98,18 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!10, !11} !llvm.ident = !{!12} -!0 = !{!"0x11\004\00clang version 3.7.0 (trunk 226474) (llvm/trunk 226478)\000\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/debug-info-duplicate-calls.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"debug-info-duplicate-calls.cpp", !"/tmp/dbginfo"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 226474) (llvm/trunk 226478)", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "debug-info-duplicate-calls.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !7, !8, !9} -!4 = !{!"0x2e\00f\00f\00\0013\000\001\000\000\00256\000\0013", !1, !5, !6, null, void ()* @_Z1fv, null, null, !2} ; [ DW_TAG_subprogram ] [line 13] [def] [f] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/tmp/dbginfo/debug-info-duplicate-calls.cpp] -!6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!7 = !{!"0x2e\00f4\00f4\00\0010\000\001\000\000\00256\000\0010", !1, !5, !6, null, void ()* @_Z2f4v, null, null, !2} ; [ DW_TAG_subprogram ] [line 10] [def] [f4] -!8 = !{!"0x2e\00f3\00f3\00\007\000\001\000\000\00256\000\007", !1, !5, !6, null, void ()* @_Z2f3v, null, null, !2} ; [ DW_TAG_subprogram ] [line 7] [def] [f3] -!9 = !{!"0x2e\00f2\00f2\00\004\000\001\000\000\00256\000\004", !1, !5, !6, null, void ()* @_Z2f2v, null, null, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [f2] +!4 = !MDSubprogram(name: "f", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !1, scope: !5, type: !6, function: void ()* @_Z1fv, variables: !2) +!5 = !MDFile(filename: "debug-info-duplicate-calls.cpp", directory: "/tmp/dbginfo") +!6 = !MDSubroutineType(types: !2) +!7 = !MDSubprogram(name: "f4", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, function: void ()* @_Z2f4v, variables: !2) +!8 = !MDSubprogram(name: "f3", line: 7, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !6, function: void ()* @_Z2f3v, variables: !2) +!9 = !MDSubprogram(name: "f2", line: 4, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: void ()* @_Z2f2v, variables: !2) !10 = !{i32 2, !"Dwarf Version", i32 4} -!11 = !{i32 2, !"Debug Info Version", i32 2} +!11 = !{i32 2, !"Debug Info Version", i32 3} !12 = !{!"clang version 3.7.0 (trunk 226474) (llvm/trunk 226478)"} !13 = !MDLocation(line: 14, column: 3, scope: !4) !14 = !MDLocation(line: 15, column: 1, scope: !4) diff --git a/test/Transforms/Inline/debug-invoke.ll b/test/Transforms/Inline/debug-invoke.ll index 74ba9dc..c35300c 100644 --- a/test/Transforms/Inline/debug-invoke.ll +++ b/test/Transforms/Inline/debug-invoke.ll @@ -4,9 +4,9 @@ ; CHECK: invoke void @test() ; CHECK-NEXT: to label {{.*}} unwind label {{.*}}, !dbg [[INL_LOC:!.*]] -; CHECK: [[EMPTY:.*]] = !{} -; CHECK: [[INL_LOC]] = !MDLocation(line: 1, scope: [[EMPTY]], inlinedAt: [[INL_AT:.*]]) -; CHECK: [[INL_AT]] = distinct !MDLocation(line: 2, scope: [[EMPTY]]) +; CHECK: [[SP:.*]] = !MDSubprogram( +; CHECK: [[INL_LOC]] = !MDLocation(line: 1, scope: [[SP]], inlinedAt: [[INL_AT:.*]]) +; CHECK: [[INL_AT]] = distinct !MDLocation(line: 2, scope: [[SP]]) declare void @test() declare i32 @__gxx_personality_v0(...) @@ -31,7 +31,7 @@ lpad: } !llvm.module.flags = !{!1} -!1 = !{i32 2, !"Debug Info Version", i32 2} -!2 = !{} +!1 = !{i32 2, !"Debug Info Version", i32 3} +!2 = !MDSubprogram() !3 = !MDLocation(line: 1, scope: !2) !4 = !MDLocation(line: 2, scope: !2) diff --git a/test/Transforms/Inline/devirtualize-3.ll b/test/Transforms/Inline/devirtualize-3.ll index 3f01967..76c8150 100644 --- a/test/Transforms/Inline/devirtualize-3.ll +++ b/test/Transforms/Inline/devirtualize-3.ll @@ -14,12 +14,12 @@ target triple = "x86_64-apple-darwin10.0.0" define i32 @main() nounwind ssp { entry: %cont = alloca %struct.cont_t, align 8 ; <%struct.cont_t*> [#uses=4] - %tmp = getelementptr inbounds %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] - %tmp1 = getelementptr inbounds %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=2] + %tmp = getelementptr inbounds %struct.cont_t, %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] + %tmp1 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=2] store void (i8*, i32)* bitcast (void (%struct.cont_t*, i32)* @quit to void (i8*, i32)*), void (i8*, i32)** %tmp1 - %tmp2 = load void (i8*, i32)** %tmp1 ; <void (i8*, i32)*> [#uses=1] + %tmp2 = load void (i8*, i32)*, void (i8*, i32)** %tmp1 ; <void (i8*, i32)*> [#uses=1] store void (i8*, i32)* %tmp2, void (i8*, i32)** %tmp - %tmp3 = getelementptr inbounds %struct.cont_t* %cont, i32 0, i32 1 ; <i8**> [#uses=1] + %tmp3 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %cont, i32 0, i32 1 ; <i8**> [#uses=1] store i8* null, i8** %tmp3 call void @foo(%struct.cont_t* %cont) ret i32 0 @@ -35,13 +35,13 @@ define internal void @foo(%struct.cont_t* %c) nounwind ssp { entry: %sf = alloca %struct.foo_sf_t, align 8 ; <%struct.foo_sf_t*> [#uses=3] %next = alloca %struct.cont_t, align 8 ; <%struct.cont_t*> [#uses=3] - %tmp = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1] + %tmp = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1] store %struct.cont_t* %c, %struct.cont_t** %tmp - %tmp2 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp2 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1] store i32 2, i32* %tmp2 - %tmp4 = getelementptr inbounds %struct.cont_t* %next, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] + %tmp4 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %next, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] store void (i8*, i32)* bitcast (void (%struct.foo_sf_t*, i32)* @foo2 to void (i8*, i32)*), void (i8*, i32)** %tmp4 - %tmp5 = getelementptr inbounds %struct.cont_t* %next, i32 0, i32 1 ; <i8**> [#uses=1] + %tmp5 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %next, i32 0, i32 1 ; <i8**> [#uses=1] %conv = bitcast %struct.foo_sf_t* %sf to i8* ; <i8*> [#uses=1] store i8* %conv, i8** %tmp5 call void @bar(%struct.cont_t* %next, i32 14) @@ -50,15 +50,15 @@ entry: define internal void @foo2(%struct.foo_sf_t* %sf, i32 %y) nounwind ssp { entry: - %tmp1 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1] - %tmp2 = load %struct.cont_t** %tmp1 ; <%struct.cont_t*> [#uses=1] - %tmp3 = getelementptr inbounds %struct.cont_t* %tmp2, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] - %tmp4 = load void (i8*, i32)** %tmp3 ; <void (i8*, i32)*> [#uses=1] - %tmp6 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1] - %tmp7 = load %struct.cont_t** %tmp6 ; <%struct.cont_t*> [#uses=1] + %tmp1 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1] + %tmp2 = load %struct.cont_t*, %struct.cont_t** %tmp1 ; <%struct.cont_t*> [#uses=1] + %tmp3 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %tmp2, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] + %tmp4 = load void (i8*, i32)*, void (i8*, i32)** %tmp3 ; <void (i8*, i32)*> [#uses=1] + %tmp6 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1] + %tmp7 = load %struct.cont_t*, %struct.cont_t** %tmp6 ; <%struct.cont_t*> [#uses=1] %conv = bitcast %struct.cont_t* %tmp7 to i8* ; <i8*> [#uses=1] - %tmp9 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp10 = load i32* %tmp9 ; <i32> [#uses=1] + %tmp9 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp10 = load i32, i32* %tmp9 ; <i32> [#uses=1] %mul = mul i32 %tmp10, %y ; <i32> [#uses=1] call void %tmp4(i8* %conv, i32 %mul) ret void @@ -66,10 +66,10 @@ entry: define internal void @bar(%struct.cont_t* %c, i32 %y) nounwind ssp { entry: - %tmp1 = getelementptr inbounds %struct.cont_t* %c, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] - %tmp2 = load void (i8*, i32)** %tmp1 ; <void (i8*, i32)*> [#uses=1] - %tmp4 = getelementptr inbounds %struct.cont_t* %c, i32 0, i32 1 ; <i8**> [#uses=1] - %tmp5 = load i8** %tmp4 ; <i8*> [#uses=1] + %tmp1 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %c, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1] + %tmp2 = load void (i8*, i32)*, void (i8*, i32)** %tmp1 ; <void (i8*, i32)*> [#uses=1] + %tmp4 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %c, i32 0, i32 1 ; <i8**> [#uses=1] + %tmp5 = load i8*, i8** %tmp4 ; <i8*> [#uses=1] %add = add nsw i32 %y, 5 ; <i32> [#uses=1] call void %tmp2(i8* %tmp5, i32 %add) ret void diff --git a/test/Transforms/Inline/devirtualize.ll b/test/Transforms/Inline/devirtualize.ll index 8948294..561bb62 100644 --- a/test/Transforms/Inline/devirtualize.ll +++ b/test/Transforms/Inline/devirtualize.ll @@ -9,7 +9,7 @@ define i32 @foo(i32 ()** noalias %p, i64* noalias %q) nounwind ssp { entry: store i32 ()* @bar, i32 ()** %p store i64 0, i64* %q - %tmp3 = load i32 ()** %p ; <i32 ()*> [#uses=1] + %tmp3 = load i32 ()*, i32 ()** %p ; <i32 ()*> [#uses=1] %call = call i32 %tmp3() ; <i32> [#uses=1] %X = add i32 %call, 4 ret i32 %X @@ -47,11 +47,11 @@ entry: @_ZTS1C = linkonce_odr constant [3 x i8] c"1C\00" ; <[3 x i8]*> [#uses=1] @_ZTVN10__cxxabiv117__class_type_infoE = external global i8* ; <i8**> [#uses=1] @_ZTS1A = linkonce_odr constant [3 x i8] c"1A\00" ; <[3 x i8]*> [#uses=1] -@_ZTI1A = linkonce_odr constant %0 { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8]* @_ZTS1A, i32 0, i32 0) } ; <%0*> [#uses=1] +@_ZTI1A = linkonce_odr constant %0 { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) } ; <%0*> [#uses=1] @_ZTS1B = linkonce_odr constant [3 x i8] c"1B\00" ; <[3 x i8]*> [#uses=1] -@_ZTI1B = linkonce_odr constant %0 { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8]* @_ZTS1B, i32 0, i32 0) } ; <%0*> [#uses=1] -@_ZTI1C = linkonce_odr constant %1 { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv121__vmi_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8]* @_ZTS1C, i32 0, i32 0), i32 0, i32 2, i8* bitcast (%0* @_ZTI1A to i8*), i64 2, i8* bitcast (%0* @_ZTI1B to i8*), i64 2050 } ; <%1*> [#uses=1] -@_ZTI1D = linkonce_odr constant %2 { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8]* @_ZTS1D, i32 0, i32 0), i8* bitcast (%1* @_ZTI1C to i8*) } ; <%2*> [#uses=1] +@_ZTI1B = linkonce_odr constant %0 { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1B, i32 0, i32 0) } ; <%0*> [#uses=1] +@_ZTI1C = linkonce_odr constant %1 { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv121__vmi_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1C, i32 0, i32 0), i32 0, i32 2, i8* bitcast (%0* @_ZTI1A to i8*), i64 2, i8* bitcast (%0* @_ZTI1B to i8*), i64 2050 } ; <%1*> [#uses=1] +@_ZTI1D = linkonce_odr constant %2 { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1D, i32 0, i32 0), i8* bitcast (%1* @_ZTI1C to i8*) } ; <%2*> [#uses=1] @_ZTV1C = linkonce_odr constant [6 x i8*] [i8* null, i8* bitcast (%1* @_ZTI1C to i8*), i8* bitcast (i32 (%struct.C*)* @_ZN1C1fEv to i8*), i8* inttoptr (i64 -8 to i8*), i8* bitcast (%1* @_ZTI1C to i8*), i8* bitcast (i32 (%struct.C*)* @_ZThn8_N1C1fEv to i8*)] ; <[6 x i8*]*> [#uses=2] @_ZTV1B = linkonce_odr constant [3 x i8*] [i8* null, i8* bitcast (%0* @_ZTI1B to i8*), i8* bitcast (i32 (%struct.A*)* @_ZN1B1fEv to i8*)] ; <[3 x i8*]*> [#uses=1] @_ZTV1A = linkonce_odr constant [3 x i8*] [i8* null, i8* bitcast (%0* @_ZTI1A to i8*), i8* bitcast (i32 (%struct.A*)* @_ZN1A1fEv to i8*)] ; <[3 x i8*]*> [#uses=1] @@ -78,16 +78,16 @@ entry: cast.notnull: ; preds = %entry %1 = bitcast %struct.C* %d to i8* ; <i8*> [#uses=1] - %add.ptr = getelementptr i8* %1, i64 8 ; <i8*> [#uses=1] + %add.ptr = getelementptr i8, i8* %1, i64 8 ; <i8*> [#uses=1] %2 = bitcast i8* %add.ptr to %struct.A* ; <%struct.A*> [#uses=1] br label %cast.end cast.end: ; preds = %entry, %cast.notnull %3 = phi %struct.A* [ %2, %cast.notnull ], [ null, %entry ] ; <%struct.A*> [#uses=2] %4 = bitcast %struct.A* %3 to i32 (%struct.A*)*** ; <i32 (%struct.A*)***> [#uses=1] - %5 = load i32 (%struct.A*)*** %4 ; <i32 (%struct.A*)**> [#uses=1] - %vfn = getelementptr inbounds i32 (%struct.A*)** %5, i64 0 ; <i32 (%struct.A*)**> [#uses=1] - %6 = load i32 (%struct.A*)** %vfn ; <i32 (%struct.A*)*> [#uses=1] + %5 = load i32 (%struct.A*)**, i32 (%struct.A*)*** %4 ; <i32 (%struct.A*)**> [#uses=1] + %vfn = getelementptr inbounds i32 (%struct.A*)*, i32 (%struct.A*)** %5, i64 0 ; <i32 (%struct.A*)**> [#uses=1] + %6 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vfn ; <i32 (%struct.A*)*> [#uses=1] %call = call i32 %6(%struct.A* %3) ; <i32> [#uses=1] ret i32 %call } @@ -100,7 +100,7 @@ entry: define linkonce_odr i32 @_ZThn8_N1D1fEv(%struct.C* %this) { entry: %0 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1] - %1 = getelementptr inbounds i8* %0, i64 -8 ; <i8*> [#uses=1] + %1 = getelementptr inbounds i8, i8* %0, i64 -8 ; <i8*> [#uses=1] %2 = bitcast i8* %1 to %struct.C* ; <%struct.C*> [#uses=1] %call = call i32 @_ZN1D1fEv(%struct.C* %2) ; <i32> [#uses=1] ret i32 %call @@ -110,13 +110,13 @@ define linkonce_odr void @_ZN1DC2Ev(%struct.C* %this) inlinehint ssp align 2 { entry: call void @_ZN1CC2Ev(%struct.C* %this) %0 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1] - %1 = getelementptr inbounds i8* %0, i64 0 ; <i8*> [#uses=1] + %1 = getelementptr inbounds i8, i8* %0, i64 0 ; <i8*> [#uses=1] %2 = bitcast i8* %1 to i8*** ; <i8***> [#uses=1] - store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1D, i64 0, i64 2), i8*** %2 + store i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @_ZTV1D, i64 0, i64 2), i8*** %2 %3 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1] - %4 = getelementptr inbounds i8* %3, i64 8 ; <i8*> [#uses=1] + %4 = getelementptr inbounds i8, i8* %3, i64 8 ; <i8*> [#uses=1] %5 = bitcast i8* %4 to i8*** ; <i8***> [#uses=1] - store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1D, i64 0, i64 5), i8*** %5 + store i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @_ZTV1D, i64 0, i64 5), i8*** %5 ret void } @@ -125,17 +125,17 @@ entry: %0 = bitcast %struct.C* %this to %struct.A* ; <%struct.A*> [#uses=1] call void @_ZN1AC2Ev(%struct.A* %0) %1 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1] - %2 = getelementptr inbounds i8* %1, i64 8 ; <i8*> [#uses=1] + %2 = getelementptr inbounds i8, i8* %1, i64 8 ; <i8*> [#uses=1] %3 = bitcast i8* %2 to %struct.A* ; <%struct.A*> [#uses=1] call void @_ZN1BC2Ev(%struct.A* %3) %4 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1] - %5 = getelementptr inbounds i8* %4, i64 0 ; <i8*> [#uses=1] + %5 = getelementptr inbounds i8, i8* %4, i64 0 ; <i8*> [#uses=1] %6 = bitcast i8* %5 to i8*** ; <i8***> [#uses=1] - store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1C, i64 0, i64 2), i8*** %6 + store i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @_ZTV1C, i64 0, i64 2), i8*** %6 %7 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1] - %8 = getelementptr inbounds i8* %7, i64 8 ; <i8*> [#uses=1] + %8 = getelementptr inbounds i8, i8* %7, i64 8 ; <i8*> [#uses=1] %9 = bitcast i8* %8 to i8*** ; <i8***> [#uses=1] - store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1C, i64 0, i64 5), i8*** %9 + store i8** getelementptr inbounds ([6 x i8*], [6 x i8*]* @_ZTV1C, i64 0, i64 5), i8*** %9 ret void } @@ -147,7 +147,7 @@ entry: define linkonce_odr i32 @_ZThn8_N1C1fEv(%struct.C* %this) { entry: %0 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1] - %1 = getelementptr inbounds i8* %0, i64 -8 ; <i8*> [#uses=1] + %1 = getelementptr inbounds i8, i8* %0, i64 -8 ; <i8*> [#uses=1] %2 = bitcast i8* %1 to %struct.C* ; <%struct.C*> [#uses=1] %call = call i32 @_ZN1C1fEv(%struct.C* %2) ; <i32> [#uses=1] ret i32 %call @@ -156,18 +156,18 @@ entry: define linkonce_odr void @_ZN1AC2Ev(%struct.A* %this) inlinehint ssp align 2 { entry: %0 = bitcast %struct.A* %this to i8* ; <i8*> [#uses=1] - %1 = getelementptr inbounds i8* %0, i64 0 ; <i8*> [#uses=1] + %1 = getelementptr inbounds i8, i8* %0, i64 0 ; <i8*> [#uses=1] %2 = bitcast i8* %1 to i8*** ; <i8***> [#uses=1] - store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2), i8*** %2 + store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1A, i64 0, i64 2), i8*** %2 ret void } define linkonce_odr void @_ZN1BC2Ev(%struct.A* %this) inlinehint ssp align 2 { entry: %0 = bitcast %struct.A* %this to i8* ; <i8*> [#uses=1] - %1 = getelementptr inbounds i8* %0, i64 0 ; <i8*> [#uses=1] + %1 = getelementptr inbounds i8, i8* %0, i64 0 ; <i8*> [#uses=1] %2 = bitcast i8* %1 to i8*** ; <i8***> [#uses=1] - store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1B, i64 0, i64 2), i8*** %2 + store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1B, i64 0, i64 2), i8*** %2 ret void } diff --git a/test/Transforms/Inline/ephemeral.ll b/test/Transforms/Inline/ephemeral.ll index d1135c6..7e5ae03 100644 --- a/test/Transforms/Inline/ephemeral.ll +++ b/test/Transforms/Inline/ephemeral.ll @@ -3,7 +3,7 @@ @a = global i32 4 define i1 @inner() { - %a1 = load volatile i32* @a + %a1 = load volatile i32, i32* @a %x1 = add i32 %a1, %a1 %c = icmp eq i32 %x1, 0 diff --git a/test/Transforms/Inline/gvn-inline-iteration.ll b/test/Transforms/Inline/gvn-inline-iteration.ll index 7916a13..b87c060 100644 --- a/test/Transforms/Inline/gvn-inline-iteration.ll +++ b/test/Transforms/Inline/gvn-inline-iteration.ll @@ -8,7 +8,7 @@ define i32 @foo(i32 ()** noalias nocapture %p, i64* noalias nocapture %q) nounwi entry: store i32 ()* @bar, i32 ()** %p store i64 0, i64* %q - %tmp3 = load i32 ()** %p ; <i32 ()*> [#uses=1] + %tmp3 = load i32 ()*, i32 ()** %p ; <i32 ()*> [#uses=1] %call = tail call i32 %tmp3() nounwind ; <i32> [#uses=1] ret i32 %call } diff --git a/test/Transforms/Inline/ignore-debug-info.ll b/test/Transforms/Inline/ignore-debug-info.ll index 8bd6e7c..3e83229 100644 --- a/test/Transforms/Inline/ignore-debug-info.ll +++ b/test/Transforms/Inline/ignore-debug-info.ll @@ -12,11 +12,11 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 define <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b) { entry: - call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{}) + call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()) %mul = fmul <4 x float> %a, <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00> - call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{}) + call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()) %mul1 = fmul <4 x float> %b, <float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00> - call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{}) + call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()) %add = fadd <4 x float> %mul, %mul1 ret <4 x float> %add } @@ -27,10 +27,10 @@ define float @outer_vectors(<4 x float> %a, <4 x float> %b) { ; CHECK: ret float entry: - call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{}) - call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{}) + call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()) + call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()) %call = call <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b) - call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{}, metadata !{}) + call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()) %vecext = extractelement <4 x float> %call, i32 0 %vecext1 = extractelement <4 x float> %call, i32 1 %add = fadd float %vecext, %vecext1 @@ -47,9 +47,10 @@ attributes #0 = { nounwind readnone } !llvm.module.flags = !{!3, !4} !llvm.ident = !{!5} -!0 = !{!"0x11\004\00\000\00\000\00\000", !1, !2, !2, !{}, !2, !2} ; [ DW_TAG_compile_unit ] -!1 = !{!"", !""} -!2 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !6, globals: !2, imports: !2) +!1 = !MDFile(filename: "test.c", directory: "") +!2 = !{} !3 = !{i32 2, !"Dwarf Version", i32 4} -!4 = !{i32 1, !"Debug Info Version", i32 2} +!4 = !{i32 1, !"Debug Info Version", i32 3} !5 = !{!""} +!6 = !MDSubprogram() diff --git a/test/Transforms/Inline/inline-byval-bonus.ll b/test/Transforms/Inline/inline-byval-bonus.ll index 052a5f1..7f0c0e1 100644 --- a/test/Transforms/Inline/inline-byval-bonus.ll +++ b/test/Transforms/Inline/inline-byval-bonus.ll @@ -29,37 +29,37 @@ define i32 @caller(%struct.sphere* %i) { declare void @fix(%struct.ray*) define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture byval align 8 %ray, %struct.spoint* %sp) nounwind uwtable ssp { - %1 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 0 - %2 = load double* %1, align 8 + %1 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 1, i32 0 + %2 = load double, double* %1, align 8 %3 = fmul double %2, %2 - %4 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 1 - %5 = load double* %4, align 8 + %4 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 1, i32 1 + %5 = load double, double* %4, align 8 %6 = fmul double %5, %5 %7 = fadd double %3, %6 - %8 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 2 - %9 = load double* %8, align 8 + %8 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 1, i32 2 + %9 = load double, double* %8, align 8 %10 = fmul double %9, %9 %11 = fadd double %7, %10 %12 = fmul double %2, 2.000000e+00 - %13 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 0 - %14 = load double* %13, align 8 - %15 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 0 - %16 = load double* %15, align 8 + %13 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 0, i32 0 + %14 = load double, double* %13, align 8 + %15 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 0, i32 0 + %16 = load double, double* %15, align 8 %17 = fsub double %14, %16 %18 = fmul double %12, %17 %19 = fmul double %5, 2.000000e+00 - %20 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 1 - %21 = load double* %20, align 8 - %22 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 1 - %23 = load double* %22, align 8 + %20 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 0, i32 1 + %21 = load double, double* %20, align 8 + %22 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 0, i32 1 + %23 = load double, double* %22, align 8 %24 = fsub double %21, %23 %25 = fmul double %19, %24 %26 = fadd double %18, %25 %27 = fmul double %9, 2.000000e+00 - %28 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 2 - %29 = load double* %28, align 8 - %30 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 2 - %31 = load double* %30, align 8 + %28 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 0, i32 2 + %29 = load double, double* %28, align 8 + %30 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 0, i32 2 + %31 = load double, double* %30, align 8 %32 = fsub double %29, %31 %33 = fmul double %27, %32 %34 = fadd double %26, %33 @@ -82,8 +82,8 @@ define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture by %51 = fsub double %49, %50 %52 = fmul double %51, 2.000000e+00 %53 = fadd double %52, %45 - %54 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 1 - %55 = load double* %54, align 8 + %54 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 1 + %55 = load double, double* %54, align 8 %56 = fmul double %55, %55 %57 = fsub double %53, %56 %58 = fmul double %34, %34 @@ -121,37 +121,37 @@ define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture by %t2.0 = select i1 %72, double %t1.0, double %70 %79 = fcmp olt double %t1.0, %t2.0 %80 = select i1 %79, double %t1.0, double %t2.0 - %81 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 3 + %81 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 3 store double %80, double* %81, align 8 %82 = fmul double %80, %2 %83 = fadd double %14, %82 - %84 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 0 + %84 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 0, i32 0 store double %83, double* %84, align 8 %85 = fmul double %5, %80 %86 = fadd double %21, %85 - %87 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 1 + %87 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 0, i32 1 store double %86, double* %87, align 8 %88 = fmul double %9, %80 %89 = fadd double %29, %88 - %90 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 2 + %90 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 0, i32 2 store double %89, double* %90, align 8 - %91 = load double* %15, align 8 + %91 = load double, double* %15, align 8 %92 = fsub double %83, %91 - %93 = load double* %54, align 8 + %93 = load double, double* %54, align 8 %94 = fdiv double %92, %93 - %95 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 0 + %95 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 1, i32 0 store double %94, double* %95, align 8 - %96 = load double* %22, align 8 + %96 = load double, double* %22, align 8 %97 = fsub double %86, %96 - %98 = load double* %54, align 8 + %98 = load double, double* %54, align 8 %99 = fdiv double %97, %98 - %100 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 1 + %100 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 1, i32 1 store double %99, double* %100, align 8 - %101 = load double* %30, align 8 + %101 = load double, double* %30, align 8 %102 = fsub double %89, %101 - %103 = load double* %54, align 8 + %103 = load double, double* %54, align 8 %104 = fdiv double %102, %103 - %105 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 2 + %105 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 1, i32 2 store double %104, double* %105, align 8 %106 = fmul double %2, %94 %107 = fmul double %5, %99 @@ -168,9 +168,9 @@ define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture by %118 = fmul double %104, %111 %119 = fsub double %118, %9 %120 = fsub double -0.000000e+00, %119 - %.06 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 0 - %.18 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 1 - %.210 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 2 + %.06 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 2, i32 0 + %.18 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 2, i32 1 + %.210 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 2, i32 2 %121 = fmul double %113, %113 %122 = fmul double %116, %116 %123 = fadd double %121, %122 diff --git a/test/Transforms/Inline/inline-cold.ll b/test/Transforms/Inline/inline-cold.ll index 5743377..b3c1345 100644 --- a/test/Transforms/Inline/inline-cold.ll +++ b/test/Transforms/Inline/inline-cold.ll @@ -17,29 +17,29 @@ ; Function Attrs: nounwind readnone uwtable define i32 @simpleFunction(i32 %a) #0 { entry: - %a1 = load volatile i32* @a + %a1 = load volatile i32, i32* @a %x1 = add i32 %a1, %a1 - %a2 = load volatile i32* @a + %a2 = load volatile i32, i32* @a %x2 = add i32 %x1, %a2 - %a3 = load volatile i32* @a + %a3 = load volatile i32, i32* @a %x3 = add i32 %x2, %a3 - %a4 = load volatile i32* @a + %a4 = load volatile i32, i32* @a %x4 = add i32 %x3, %a4 - %a5 = load volatile i32* @a + %a5 = load volatile i32, i32* @a %x5 = add i32 %x4, %a5 - %a6 = load volatile i32* @a + %a6 = load volatile i32, i32* @a %x6 = add i32 %x5, %a6 - %a7 = load volatile i32* @a + %a7 = load volatile i32, i32* @a %x7 = add i32 %x6, %a6 - %a8 = load volatile i32* @a + %a8 = load volatile i32, i32* @a %x8 = add i32 %x7, %a8 - %a9 = load volatile i32* @a + %a9 = load volatile i32, i32* @a %x9 = add i32 %x8, %a9 - %a10 = load volatile i32* @a + %a10 = load volatile i32, i32* @a %x10 = add i32 %x9, %a10 - %a11 = load volatile i32* @a + %a11 = load volatile i32, i32* @a %x11 = add i32 %x10, %a11 - %a12 = load volatile i32* @a + %a12 = load volatile i32, i32* @a %x12 = add i32 %x11, %a12 %add = add i32 %x12, %a ret i32 %add @@ -54,29 +54,29 @@ define i32 @ColdFunction(i32 %a) #1 { ; DEFAULT-LABEL: @ColdFunction ; DEFAULT: ret entry: - %a1 = load volatile i32* @a + %a1 = load volatile i32, i32* @a %x1 = add i32 %a1, %a1 - %a2 = load volatile i32* @a + %a2 = load volatile i32, i32* @a %x2 = add i32 %x1, %a2 - %a3 = load volatile i32* @a + %a3 = load volatile i32, i32* @a %x3 = add i32 %x2, %a3 - %a4 = load volatile i32* @a + %a4 = load volatile i32, i32* @a %x4 = add i32 %x3, %a4 - %a5 = load volatile i32* @a + %a5 = load volatile i32, i32* @a %x5 = add i32 %x4, %a5 - %a6 = load volatile i32* @a + %a6 = load volatile i32, i32* @a %x6 = add i32 %x5, %a6 - %a7 = load volatile i32* @a + %a7 = load volatile i32, i32* @a %x7 = add i32 %x6, %a6 - %a8 = load volatile i32* @a + %a8 = load volatile i32, i32* @a %x8 = add i32 %x7, %a8 - %a9 = load volatile i32* @a + %a9 = load volatile i32, i32* @a %x9 = add i32 %x8, %a9 - %a10 = load volatile i32* @a + %a10 = load volatile i32, i32* @a %x10 = add i32 %x9, %a10 - %a11 = load volatile i32* @a + %a11 = load volatile i32, i32* @a %x11 = add i32 %x10, %a11 - %a12 = load volatile i32* @a + %a12 = load volatile i32, i32* @a %x12 = add i32 %x11, %a12 %add = add i32 %x12, %a ret i32 %add @@ -91,79 +91,79 @@ define i32 @ColdFunction2(i32 %a) #1 { ; DEFAULT-LABEL: @ColdFunction2 ; DEFAULT: ret entry: - %a1 = load volatile i32* @a + %a1 = load volatile i32, i32* @a %x1 = add i32 %a1, %a1 - %a2 = load volatile i32* @a + %a2 = load volatile i32, i32* @a %x2 = add i32 %x1, %a2 - %a3 = load volatile i32* @a + %a3 = load volatile i32, i32* @a %x3 = add i32 %x2, %a3 - %a4 = load volatile i32* @a + %a4 = load volatile i32, i32* @a %x4 = add i32 %x3, %a4 - %a5 = load volatile i32* @a + %a5 = load volatile i32, i32* @a %x5 = add i32 %x4, %a5 - %a6 = load volatile i32* @a + %a6 = load volatile i32, i32* @a %x6 = add i32 %x5, %a6 - %a7 = load volatile i32* @a + %a7 = load volatile i32, i32* @a %x7 = add i32 %x6, %a7 - %a8 = load volatile i32* @a + %a8 = load volatile i32, i32* @a %x8 = add i32 %x7, %a8 - %a9 = load volatile i32* @a + %a9 = load volatile i32, i32* @a %x9 = add i32 %x8, %a9 - %a10 = load volatile i32* @a + %a10 = load volatile i32, i32* @a %x10 = add i32 %x9, %a10 - %a11 = load volatile i32* @a + %a11 = load volatile i32, i32* @a %x11 = add i32 %x10, %a11 - %a12 = load volatile i32* @a + %a12 = load volatile i32, i32* @a %x12 = add i32 %x11, %a12 - %a21 = load volatile i32* @a + %a21 = load volatile i32, i32* @a %x21 = add i32 %x12, %a21 - %a22 = load volatile i32* @a + %a22 = load volatile i32, i32* @a %x22 = add i32 %x21, %a22 - %a23 = load volatile i32* @a + %a23 = load volatile i32, i32* @a %x23 = add i32 %x22, %a23 - %a24 = load volatile i32* @a + %a24 = load volatile i32, i32* @a %x24 = add i32 %x23, %a24 - %a25 = load volatile i32* @a + %a25 = load volatile i32, i32* @a %x25 = add i32 %x24, %a25 - %a26 = load volatile i32* @a + %a26 = load volatile i32, i32* @a %x26 = add i32 %x25, %a26 - %a27 = load volatile i32* @a + %a27 = load volatile i32, i32* @a %x27 = add i32 %x26, %a27 - %a28 = load volatile i32* @a + %a28 = load volatile i32, i32* @a %x28 = add i32 %x27, %a28 - %a29 = load volatile i32* @a + %a29 = load volatile i32, i32* @a %x29 = add i32 %x28, %a29 - %a30 = load volatile i32* @a + %a30 = load volatile i32, i32* @a %x30 = add i32 %x29, %a30 - %a31 = load volatile i32* @a + %a31 = load volatile i32, i32* @a %x31 = add i32 %x30, %a31 - %a32 = load volatile i32* @a + %a32 = load volatile i32, i32* @a %x32 = add i32 %x31, %a32 - %a41 = load volatile i32* @a + %a41 = load volatile i32, i32* @a %x41 = add i32 %x32, %a41 - %a42 = load volatile i32* @a + %a42 = load volatile i32, i32* @a %x42 = add i32 %x41, %a42 - %a43 = load volatile i32* @a + %a43 = load volatile i32, i32* @a %x43 = add i32 %x42, %a43 - %a44 = load volatile i32* @a + %a44 = load volatile i32, i32* @a %x44 = add i32 %x43, %a44 - %a45 = load volatile i32* @a + %a45 = load volatile i32, i32* @a %x45 = add i32 %x44, %a45 - %a46 = load volatile i32* @a + %a46 = load volatile i32, i32* @a %x46 = add i32 %x45, %a46 - %a47 = load volatile i32* @a + %a47 = load volatile i32, i32* @a %x47 = add i32 %x46, %a47 - %a48 = load volatile i32* @a + %a48 = load volatile i32, i32* @a %x48 = add i32 %x47, %a48 - %a49 = load volatile i32* @a + %a49 = load volatile i32, i32* @a %x49 = add i32 %x48, %a49 - %a50 = load volatile i32* @a + %a50 = load volatile i32, i32* @a %x50 = add i32 %x49, %a50 - %a51 = load volatile i32* @a + %a51 = load volatile i32, i32* @a %x51 = add i32 %x50, %a51 - %a52 = load volatile i32* @a + %a52 = load volatile i32, i32* @a %x52 = add i32 %x51, %a52 %add = add i32 %x52, %a diff --git a/test/Transforms/Inline/inline-fast-math-flags.ll b/test/Transforms/Inline/inline-fast-math-flags.ll index c6a1487..e5ff8f7 100644 --- a/test/Transforms/Inline/inline-fast-math-flags.ll +++ b/test/Transforms/Inline/inline-fast-math-flags.ll @@ -8,15 +8,15 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" define float @foo(float* %a, float %b) { entry: - %a0 = load float* %a, align 4 + %a0 = load float, float* %a, align 4 %mul = fmul fast float %a0, %b %tobool = fcmp une float %mul, 0.000000e+00 br i1 %tobool, label %if.then, label %if.end if.then: ; preds = %entry - %a1 = load float* %a, align 8 - %arrayidx1 = getelementptr inbounds float* %a, i64 1 - %a2 = load float* %arrayidx1, align 4 + %a1 = load float, float* %a, align 8 + %arrayidx1 = getelementptr inbounds float, float* %a, i64 1 + %a2 = load float, float* %arrayidx1, align 4 %add = fadd fast float %a1, %a2 br label %if.end diff --git a/test/Transforms/Inline/inline-fp.ll b/test/Transforms/Inline/inline-fp.ll index 4d18ce8..cf42d82 100644 --- a/test/Transforms/Inline/inline-fp.ll +++ b/test/Transforms/Inline/inline-fp.ll @@ -18,19 +18,19 @@ entry: call void @getY(i32* %responseY, i8* %valueY) call void @getZ(i32* %responseZ, i8* %valueZ) - %0 = load i32* %responseX - %1 = load i8* %valueX + %0 = load i32, i32* %responseX + %1 = load i8, i8* %valueX %call = call float @f_nofp(i32 %0, i8 zeroext %1) - %2 = load i32* %responseZ - %3 = load i8* %valueZ + %2 = load i32, i32* %responseZ + %3 = load i8, i8* %valueZ %call2 = call float @f_nofp(i32 %2, i8 zeroext %3) %call3 = call float @fabsf(float %call) %cmp = fcmp ogt float %call3, 0x3FC1EB8520000000 br i1 %cmp, label %if.end12, label %if.else if.else: ; preds = %entry - %4 = load i32* %responseY - %5 = load i8* %valueY + %4 = load i32, i32* %responseY + %5 = load i8, i8* %valueY %call1 = call float @f_nofp(i32 %4, i8 zeroext %5) %call4 = call float @fabsf(float %call1) %cmp5 = fcmp ogt float %call4, 0x3FC1EB8520000000 @@ -65,19 +65,19 @@ entry: call void @getY(i32* %responseY, i8* %valueY) call void @getZ(i32* %responseZ, i8* %valueZ) - %0 = load i32* %responseX - %1 = load i8* %valueX + %0 = load i32, i32* %responseX + %1 = load i8, i8* %valueX %call = call float @f_hasfp(i32 %0, i8 zeroext %1) - %2 = load i32* %responseZ - %3 = load i8* %valueZ + %2 = load i32, i32* %responseZ + %3 = load i8, i8* %valueZ %call2 = call float @f_hasfp(i32 %2, i8 zeroext %3) %call3 = call float @fabsf(float %call) %cmp = fcmp ogt float %call3, 0x3FC1EB8520000000 br i1 %cmp, label %if.end12, label %if.else if.else: ; preds = %entry - %4 = load i32* %responseY - %5 = load i8* %valueY + %4 = load i32, i32* %responseY + %5 = load i8, i8* %valueY %call1 = call float @f_hasfp(i32 %4, i8 zeroext %5) %call4 = call float @fabsf(float %call1) %cmp5 = fcmp ogt float %call4, 0x3FC1EB8520000000 diff --git a/test/Transforms/Inline/inline-invoke-tail.ll b/test/Transforms/Inline/inline-invoke-tail.ll index e077523..5fef4ba 100644 --- a/test/Transforms/Inline/inline-invoke-tail.ll +++ b/test/Transforms/Inline/inline-invoke-tail.ll @@ -19,7 +19,7 @@ define i32 @main() { to label %invcont unwind label %lpad invcont: - %retval = load i32* %a, align 4 + %retval = load i32, i32* %a, align 4 ret i32 %retval lpad: diff --git a/test/Transforms/Inline/inline-musttail-varargs.ll b/test/Transforms/Inline/inline-musttail-varargs.ll index 7a89574..e9ce660 100644 --- a/test/Transforms/Inline/inline-musttail-varargs.ll +++ b/test/Transforms/Inline/inline-musttail-varargs.ll @@ -6,7 +6,7 @@ declare void @ext_method(i8*, i32) define linkonce_odr void @thunk(i8* %this, ...) { - %this_adj = getelementptr i8* %this, i32 4 + %this_adj = getelementptr i8, i8* %this, i32 4 musttail call void (i8*, ...)* bitcast (void (i8*, i32)* @ext_method to void (i8*, ...)*)(i8* %this_adj, ...) ret void } diff --git a/test/Transforms/Inline/inline-optsize.ll b/test/Transforms/Inline/inline-optsize.ll index 3ad573a..820e56f 100644 --- a/test/Transforms/Inline/inline-optsize.ll +++ b/test/Transforms/Inline/inline-optsize.ll @@ -11,15 +11,15 @@ ; This function should be larger than the inline threshold for -Oz (25), but ; smaller than the inline threshold for optsize (75). define i32 @inner() { - %a1 = load volatile i32* @a + %a1 = load volatile i32, i32* @a %x1 = add i32 %a1, %a1 - %a2 = load volatile i32* @a + %a2 = load volatile i32, i32* @a %x2 = add i32 %x1, %a2 - %a3 = load volatile i32* @a + %a3 = load volatile i32, i32* @a %x3 = add i32 %x2, %a3 - %a4 = load volatile i32* @a + %a4 = load volatile i32, i32* @a %x4 = add i32 %x3, %a4 - %a5 = load volatile i32* @a + %a5 = load volatile i32, i32* @a %x5 = add i32 %x3, %a5 ret i32 %x5 } diff --git a/test/Transforms/Inline/inline-vla.ll b/test/Transforms/Inline/inline-vla.ll index 7da448b..df21b3f 100644 --- a/test/Transforms/Inline/inline-vla.ll +++ b/test/Transforms/Inline/inline-vla.ll @@ -10,9 +10,9 @@ define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 { entry: %data = alloca [2 x i8], align 1 - %arraydecay = getelementptr inbounds [2 x i8]* %data, i64 0, i64 0 - call fastcc void @memcpy2(i8* %arraydecay, i8* getelementptr inbounds ([2 x i8]* @.str, i64 0, i64 0), i64 1) - call fastcc void @memcpy2(i8* %arraydecay, i8* getelementptr inbounds ([3 x i8]* @.str1, i64 0, i64 0), i64 2) + %arraydecay = getelementptr inbounds [2 x i8], [2 x i8]* %data, i64 0, i64 0 + call fastcc void @memcpy2(i8* %arraydecay, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 1) + call fastcc void @memcpy2(i8* %arraydecay, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str1, i64 0, i64 0), i64 2) ret i32 0 } diff --git a/test/Transforms/Inline/inline_constprop.ll b/test/Transforms/Inline/inline_constprop.ll index b59a270..de23b61 100644 --- a/test/Transforms/Inline/inline_constprop.ll +++ b/test/Transforms/Inline/inline_constprop.ll @@ -267,8 +267,8 @@ entry: br i1 %cmp, label %if.then, label %if.end3 if.then: - %0 = load i32* %a - %1 = load i32* %b + %0 = load i32, i32* %a + %1 = load i32, i32* %b %cmp1 = icmp eq i32 %0, %1 br i1 %cmp1, label %return, label %if.end3 diff --git a/test/Transforms/Inline/inline_dbg_declare.ll b/test/Transforms/Inline/inline_dbg_declare.ll index d296678..4dc1028 100644 --- a/test/Transforms/Inline/inline_dbg_declare.ll +++ b/test/Transforms/Inline/inline_dbg_declare.ll @@ -1,97 +1,99 @@ -; RUN: opt < %s -S -inline | FileCheck %s
-;
-; The purpose of this test is to check that inline pass preserves debug info
-; for variable using the dbg.declare intrinsic.
-;
-;; This test was generated by running this command:
-;; clang.exe -S -O0 -emit-llvm -g foo.c
-;;
-;; foo.c
-;; ==========================
-;; float foo(float x)
-;; {
-;; return x;
-;; }
-;;
-;; void bar(float *dst)
-;; {
-;; dst[0] = foo(dst[0]);
-;; }
-;; ==========================
-
-target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
-target triple = "i686-pc-windows-msvc"
-
-; Function Attrs: nounwind
-define float @foo(float %x) #0 {
-entry:
- %x.addr = alloca float, align 4
- store float %x, float* %x.addr, align 4
- call void @llvm.dbg.declare(metadata float* %x.addr, metadata !16, metadata !17), !dbg !18
- %0 = load float* %x.addr, align 4, !dbg !19
- ret float %0, !dbg !19
-}
-
-; Function Attrs: nounwind readnone
-declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
-
-; CHECK: define void @bar
-
-; Function Attrs: nounwind
-define void @bar(float* %dst) #0 {
-entry:
-
-; CHECK: [[x_addr_i:%[a-zA-Z0-9.]+]] = alloca float, align 4
-
- %dst.addr = alloca float*, align 4
- store float* %dst, float** %dst.addr, align 4
- call void @llvm.dbg.declare(metadata float** %dst.addr, metadata !20, metadata !17), !dbg !21
- %0 = load float** %dst.addr, align 4, !dbg !22
- %arrayidx = getelementptr inbounds float* %0, i32 0, !dbg !22
- %1 = load float* %arrayidx, align 4, !dbg !22
- %call = call float @foo(float %1), !dbg !22
-
-; CHECK-NOT: call float @foo
-; CHECK: void @llvm.dbg.declare(metadata float* [[x_addr_i]], metadata [[m23:![0-9]+]], metadata !17), !dbg [[m24:![0-9]+]]
-
- %2 = load float** %dst.addr, align 4, !dbg !22
- %arrayidx1 = getelementptr inbounds float* %2, i32 0, !dbg !22
- store float %call, float* %arrayidx1, align 4, !dbg !22
- ret void, !dbg !23
-}
-
-attributes #0 = { nounwind }
-attributes #1 = { nounwind readnone }
-
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!13, !14}
-!llvm.ident = !{!15}
-
-!0 = !{!"0x11\0012\00clang version 3.6.0 (trunk)\000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [foo.c] [DW_LANG_C99]
-!1 = !{!"foo.c", !""}
-!2 = !{}
-!3 = !{!4, !9}
-!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\000\00256\000\002", !1, !5, !6, null, float (float)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [scope 2] [foo]
-!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [foo.c]
-!6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
-!7 = !{!8, !8}
-!8 = !{!"0x24\00float\000\0032\0032\000\000\004", null, null} ; [ DW_TAG_base_type ] [float] [line 0, size 32, align 32, offset 0, enc DW_ATE_float]
-!9 = !{!"0x2e\00bar\00bar\00\006\000\001\000\000\00256\000\007", !1, !5, !10, null, void (float*)* @bar, null, null, !2} ; [ DW_TAG_subprogram ] [line 6] [def] [scope 7] [bar]
-!10 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !11, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
-!11 = !{null, !12}
-!12 = !{!"0xf\00\000\0032\0032\000\000", null, null, !8} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from float]
-!13 = !{i32 2, !"Dwarf Version", i32 4}
-!14 = !{i32 2, !"Debug Info Version", i32 2}
-!15 = !{!"clang version 3.6.0 (trunk)"}
-!16 = !{!"0x101\00x\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [x] [line 1]
-!17 = !{!"0x102"} ; [ DW_TAG_expression ]
-!18 = !MDLocation(line: 1, column: 17, scope: !4)
-!19 = !MDLocation(line: 3, column: 5, scope: !4)
-!20 = !{!"0x101\00dst\0016777222\000", !9, !5, !12} ; [ DW_TAG_arg_variable ] [dst] [line 6]
-!21 = !MDLocation(line: 6, column: 17, scope: !9)
-!22 = !MDLocation(line: 8, column: 14, scope: !9)
-!23 = !MDLocation(line: 9, column: 1, scope: !9)
-
-; CHECK: [[CALL_SITE:![0-9]+]] = distinct !MDLocation(line: 8, column: 14, scope: !9)
-; CHECK: [[m23]] = !{!"0x101\00x\0016777217\000", !4, !5, !8, [[CALL_SITE]]} ; [ DW_TAG_arg_variable ] [x] [line 1]
-; CHECK: [[m24]] = !MDLocation(line: 1, column: 17, scope: !4, inlinedAt: [[CALL_SITE]])
+; RUN: opt < %s -S -inline | FileCheck %s +; +; The purpose of this test is to check that inline pass preserves debug info +; for variable using the dbg.declare intrinsic. +; +;; This test was generated by running this command: +;; clang.exe -S -O0 -emit-llvm -g foo.c +;; +;; foo.c +;; ========================== +;; float foo(float x) +;; { +;; return x; +;; } +;; +;; void bar(float *dst) +;; { +;; dst[0] = foo(dst[0]); +;; } +;; ========================== + +target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32" +target triple = "i686-pc-windows-msvc" + +; Function Attrs: nounwind +define float @foo(float %x) #0 { +entry: + %x.addr = alloca float, align 4 + store float %x, float* %x.addr, align 4 + call void @llvm.dbg.declare(metadata float* %x.addr, metadata !16, metadata !17), !dbg !18 + %0 = load float, float* %x.addr, align 4, !dbg !19 + ret float %0, !dbg !19 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 + +; CHECK: define void @bar + +; Function Attrs: nounwind +define void @bar(float* %dst) #0 { +entry: + +; CHECK: [[x_addr_i:%[a-zA-Z0-9.]+]] = alloca float, align 4 + + %dst.addr = alloca float*, align 4 + store float* %dst, float** %dst.addr, align 4 + call void @llvm.dbg.declare(metadata float** %dst.addr, metadata !20, metadata !17), !dbg !21 + %0 = load float*, float** %dst.addr, align 4, !dbg !22 + %arrayidx = getelementptr inbounds float, float* %0, i32 0, !dbg !22 + %1 = load float, float* %arrayidx, align 4, !dbg !22 + %call = call float @foo(float %1), !dbg !22 + +; CHECK-NOT: call float @foo +; CHECK: void @llvm.dbg.declare(metadata float* [[x_addr_i]], metadata [[m23:![0-9]+]], metadata !{{[0-9]+}}), !dbg [[m24:![0-9]+]] + + %2 = load float*, float** %dst.addr, align 4, !dbg !22 + %arrayidx1 = getelementptr inbounds float, float* %2, i32 0, !dbg !22 + store float %call, float* %arrayidx1, align 4, !dbg !22 + ret void, !dbg !23 +} + +attributes #0 = { nounwind } +attributes #1 = { nounwind readnone } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!13, !14} +!llvm.ident = !{!15} + +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "foo.c", directory: "") +!2 = !{} +!3 = !{!4, !9} +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: float (float)* @foo, variables: !2) +!5 = !MDFile(filename: "foo.c", directory: "") +!6 = !MDSubroutineType(types: !7) +!7 = !{!8, !8} +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) +!9 = !MDSubprogram(name: "bar", line: 6, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !10, function: void (float*)* @bar, variables: !2) +!10 = !MDSubroutineType(types: !11) +!11 = !{null, !12} +!12 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !8) +!13 = !{i32 2, !"Dwarf Version", i32 4} +!14 = !{i32 2, !"Debug Info Version", i32 3} +!15 = !{!"clang version 3.6.0 (trunk)"} +!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!17 = !MDExpression() +!18 = !MDLocation(line: 1, column: 17, scope: !4) +!19 = !MDLocation(line: 3, column: 5, scope: !4) +!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "dst", line: 6, arg: 1, scope: !9, file: !5, type: !12) +!21 = !MDLocation(line: 6, column: 17, scope: !9) +!22 = !MDLocation(line: 8, column: 14, scope: !9) +!23 = !MDLocation(line: 9, column: 1, scope: !9) + +; CHECK: [[FOO:![0-9]+]] = !MDSubprogram(name: "foo", +; CHECK: [[BAR:![0-9]+]] = !MDSubprogram(name: "bar", +; CHECK: [[CALL_SITE:![0-9]+]] = distinct !MDLocation(line: 8, column: 14, scope: [[BAR]]) +; CHECK: [[m23]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1, scope: [[FOO]],{{.*}} inlinedAt: [[CALL_SITE]]) +; CHECK: [[m24]] = !MDLocation(line: 1, column: 17, scope: [[FOO]], inlinedAt: [[CALL_SITE]]) diff --git a/test/Transforms/Inline/inline_minisize.ll b/test/Transforms/Inline/inline_minisize.ll index b9aad60..0bf75d7 100644 --- a/test/Transforms/Inline/inline_minisize.ll +++ b/test/Transforms/Inline/inline_minisize.ll @@ -8,17 +8,17 @@ entry: %res = alloca i32, align 4 %i = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 - %tmp = load i32* %a.addr, align 4 + %tmp = load i32, i32* %a.addr, align 4 %idxprom = sext i32 %tmp to i64 - %tmp1 = load i32** @data, align 8 - %arrayidx = getelementptr inbounds i32* %tmp1, i64 %idxprom - %tmp2 = load i32* %arrayidx, align 4 - %tmp3 = load i32* %a.addr, align 4 + %tmp1 = load i32*, i32** @data, align 8 + %arrayidx = getelementptr inbounds i32, i32* %tmp1, i64 %idxprom + %tmp2 = load i32, i32* %arrayidx, align 4 + %tmp3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %tmp3, 1 %idxprom1 = sext i32 %add to i64 - %tmp4 = load i32** @data, align 8 - %arrayidx2 = getelementptr inbounds i32* %tmp4, i64 %idxprom1 - %tmp5 = load i32* %arrayidx2, align 4 + %tmp4 = load i32*, i32** @data, align 8 + %arrayidx2 = getelementptr inbounds i32, i32* %tmp4, i64 %idxprom1 + %tmp5 = load i32, i32* %arrayidx2, align 4 %mul = mul nsw i32 %tmp2, %tmp5 store i32 %mul, i32* %res, align 4 store i32 0, i32* %i, align 4 @@ -26,21 +26,21 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %tmp6 = load i32* %i, align 4 - %tmp7 = load i32* %res, align 4 + %tmp6 = load i32, i32* %i, align 4 + %tmp7 = load i32, i32* %res, align 4 %cmp = icmp slt i32 %tmp6, %tmp7 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %tmp8 = load i32* %i, align 4 + %tmp8 = load i32, i32* %i, align 4 %idxprom3 = sext i32 %tmp8 to i64 - %tmp9 = load i32** @data, align 8 - %arrayidx4 = getelementptr inbounds i32* %tmp9, i64 %idxprom3 + %tmp9 = load i32*, i32** @data, align 8 + %arrayidx4 = getelementptr inbounds i32, i32* %tmp9, i64 %idxprom3 call void @fct0(i32* %arrayidx4) br label %for.inc for.inc: ; preds = %for.body - %tmp10 = load i32* %i, align 4 + %tmp10 = load i32, i32* %i, align 4 %inc = add nsw i32 %tmp10, 1 store i32 %inc, i32* %i, align 4 br label %for.cond @@ -50,21 +50,21 @@ for.end: ; preds = %for.cond br label %for.cond5 for.cond5: ; preds = %for.inc10, %for.end - %tmp11 = load i32* %i, align 4 - %tmp12 = load i32* %res, align 4 + %tmp11 = load i32, i32* %i, align 4 + %tmp12 = load i32, i32* %res, align 4 %cmp6 = icmp slt i32 %tmp11, %tmp12 br i1 %cmp6, label %for.body7, label %for.end12 for.body7: ; preds = %for.cond5 - %tmp13 = load i32* %i, align 4 + %tmp13 = load i32, i32* %i, align 4 %idxprom8 = sext i32 %tmp13 to i64 - %tmp14 = load i32** @data, align 8 - %arrayidx9 = getelementptr inbounds i32* %tmp14, i64 %idxprom8 + %tmp14 = load i32*, i32** @data, align 8 + %arrayidx9 = getelementptr inbounds i32, i32* %tmp14, i64 %idxprom8 call void @fct0(i32* %arrayidx9) br label %for.inc10 for.inc10: ; preds = %for.body7 - %tmp15 = load i32* %i, align 4 + %tmp15 = load i32, i32* %i, align 4 %inc11 = add nsw i32 %tmp15, 1 store i32 %inc11, i32* %i, align 4 br label %for.cond5 @@ -74,27 +74,27 @@ for.end12: ; preds = %for.cond5 br label %for.cond13 for.cond13: ; preds = %for.inc18, %for.end12 - %tmp16 = load i32* %i, align 4 - %tmp17 = load i32* %res, align 4 + %tmp16 = load i32, i32* %i, align 4 + %tmp17 = load i32, i32* %res, align 4 %cmp14 = icmp slt i32 %tmp16, %tmp17 br i1 %cmp14, label %for.body15, label %for.end20 for.body15: ; preds = %for.cond13 - %tmp18 = load i32* %i, align 4 + %tmp18 = load i32, i32* %i, align 4 %idxprom16 = sext i32 %tmp18 to i64 - %tmp19 = load i32** @data, align 8 - %arrayidx17 = getelementptr inbounds i32* %tmp19, i64 %idxprom16 + %tmp19 = load i32*, i32** @data, align 8 + %arrayidx17 = getelementptr inbounds i32, i32* %tmp19, i64 %idxprom16 call void @fct0(i32* %arrayidx17) br label %for.inc18 for.inc18: ; preds = %for.body15 - %tmp20 = load i32* %i, align 4 + %tmp20 = load i32, i32* %i, align 4 %inc19 = add nsw i32 %tmp20, 1 store i32 %inc19, i32* %i, align 4 br label %for.cond13 for.end20: ; preds = %for.cond13 - %tmp21 = load i32* %res, align 4 + %tmp21 = load i32, i32* %res, align 4 ret i32 %tmp21 } @@ -106,19 +106,19 @@ entry: %res = alloca i32, align 4 %i = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 - %tmp = load i32* %a.addr, align 4 + %tmp = load i32, i32* %a.addr, align 4 %shl = shl i32 %tmp, 1 %idxprom = sext i32 %shl to i64 - %tmp1 = load i32** @data, align 8 - %arrayidx = getelementptr inbounds i32* %tmp1, i64 %idxprom - %tmp2 = load i32* %arrayidx, align 4 - %tmp3 = load i32* %a.addr, align 4 + %tmp1 = load i32*, i32** @data, align 8 + %arrayidx = getelementptr inbounds i32, i32* %tmp1, i64 %idxprom + %tmp2 = load i32, i32* %arrayidx, align 4 + %tmp3 = load i32, i32* %a.addr, align 4 %shl1 = shl i32 %tmp3, 1 %add = add nsw i32 %shl1, 13 %idxprom2 = sext i32 %add to i64 - %tmp4 = load i32** @data, align 8 - %arrayidx3 = getelementptr inbounds i32* %tmp4, i64 %idxprom2 - %tmp5 = load i32* %arrayidx3, align 4 + %tmp4 = load i32*, i32** @data, align 8 + %arrayidx3 = getelementptr inbounds i32, i32* %tmp4, i64 %idxprom2 + %tmp5 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %tmp2, %tmp5 store i32 %mul, i32* %res, align 4 store i32 0, i32* %i, align 4 @@ -126,21 +126,21 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %tmp6 = load i32* %i, align 4 - %tmp7 = load i32* %res, align 4 + %tmp6 = load i32, i32* %i, align 4 + %tmp7 = load i32, i32* %res, align 4 %cmp = icmp slt i32 %tmp6, %tmp7 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %tmp8 = load i32* %i, align 4 + %tmp8 = load i32, i32* %i, align 4 %idxprom4 = sext i32 %tmp8 to i64 - %tmp9 = load i32** @data, align 8 - %arrayidx5 = getelementptr inbounds i32* %tmp9, i64 %idxprom4 + %tmp9 = load i32*, i32** @data, align 8 + %arrayidx5 = getelementptr inbounds i32, i32* %tmp9, i64 %idxprom4 call void @fct0(i32* %arrayidx5) br label %for.inc for.inc: ; preds = %for.body - %tmp10 = load i32* %i, align 4 + %tmp10 = load i32, i32* %i, align 4 %inc = add nsw i32 %tmp10, 1 store i32 %inc, i32* %i, align 4 br label %for.cond @@ -150,21 +150,21 @@ for.end: ; preds = %for.cond br label %for.cond6 for.cond6: ; preds = %for.inc11, %for.end - %tmp11 = load i32* %i, align 4 - %tmp12 = load i32* %res, align 4 + %tmp11 = load i32, i32* %i, align 4 + %tmp12 = load i32, i32* %res, align 4 %cmp7 = icmp slt i32 %tmp11, %tmp12 br i1 %cmp7, label %for.body8, label %for.end13 for.body8: ; preds = %for.cond6 - %tmp13 = load i32* %i, align 4 + %tmp13 = load i32, i32* %i, align 4 %idxprom9 = sext i32 %tmp13 to i64 - %tmp14 = load i32** @data, align 8 - %arrayidx10 = getelementptr inbounds i32* %tmp14, i64 %idxprom9 + %tmp14 = load i32*, i32** @data, align 8 + %arrayidx10 = getelementptr inbounds i32, i32* %tmp14, i64 %idxprom9 call void @fct0(i32* %arrayidx10) br label %for.inc11 for.inc11: ; preds = %for.body8 - %tmp15 = load i32* %i, align 4 + %tmp15 = load i32, i32* %i, align 4 %inc12 = add nsw i32 %tmp15, 1 store i32 %inc12, i32* %i, align 4 br label %for.cond6 @@ -174,27 +174,27 @@ for.end13: ; preds = %for.cond6 br label %for.cond14 for.cond14: ; preds = %for.inc19, %for.end13 - %tmp16 = load i32* %i, align 4 - %tmp17 = load i32* %res, align 4 + %tmp16 = load i32, i32* %i, align 4 + %tmp17 = load i32, i32* %res, align 4 %cmp15 = icmp slt i32 %tmp16, %tmp17 br i1 %cmp15, label %for.body16, label %for.end21 for.body16: ; preds = %for.cond14 - %tmp18 = load i32* %i, align 4 + %tmp18 = load i32, i32* %i, align 4 %idxprom17 = sext i32 %tmp18 to i64 - %tmp19 = load i32** @data, align 8 - %arrayidx18 = getelementptr inbounds i32* %tmp19, i64 %idxprom17 + %tmp19 = load i32*, i32** @data, align 8 + %arrayidx18 = getelementptr inbounds i32, i32* %tmp19, i64 %idxprom17 call void @fct0(i32* %arrayidx18) br label %for.inc19 for.inc19: ; preds = %for.body16 - %tmp20 = load i32* %i, align 4 + %tmp20 = load i32, i32* %i, align 4 %inc20 = add nsw i32 %tmp20, 1 store i32 %inc20, i32* %i, align 4 br label %for.cond14 for.end21: ; preds = %for.cond14 - %tmp21 = load i32* %res, align 4 + %tmp21 = load i32, i32* %res, align 4 ret i32 %tmp21 } @@ -206,9 +206,9 @@ entry: ;CHECK-NOT: call i32 @fct2 %c.addr = alloca i32, align 4 store i32 %c, i32* %c.addr, align 4 - %tmp = load i32* %c.addr, align 4 + %tmp = load i32, i32* %c.addr, align 4 %call = call i32 @fct1(i32 %tmp) - %tmp1 = load i32* %c.addr, align 4 + %tmp1 = load i32, i32* %c.addr, align 4 %call1 = call i32 @fct2(i32 %tmp1) %add = add nsw i32 %call, %call1 ret i32 %add @@ -223,9 +223,9 @@ entry: ;CHECK: call i32 @fct2 %c.addr = alloca i32, align 4 store i32 %c, i32* %c.addr, align 4 - %tmp = load i32* %c.addr, align 4 + %tmp = load i32, i32* %c.addr, align 4 %call = call i32 @fct1(i32 %tmp) - %tmp1 = load i32* %c.addr, align 4 + %tmp1 = load i32, i32* %c.addr, align 4 %call1 = call i32 @fct2(i32 %tmp1) %add = add nsw i32 %call, %call1 ret i32 %add diff --git a/test/Transforms/Inline/inline_ssp.ll b/test/Transforms/Inline/inline_ssp.ll index a4b43a7..c9675ab 100644 --- a/test/Transforms/Inline/inline_ssp.ll +++ b/test/Transforms/Inline/inline_ssp.ll @@ -13,25 +13,25 @@ ; sspreq > sspstrong > ssp > [no ssp] define internal void @fun_sspreq() nounwind sspreq uwtable { entry: - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str3, i32 0, i32 0)) + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str3, i32 0, i32 0)) ret void } define internal void @fun_sspstrong() nounwind sspstrong uwtable { entry: - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str2, i32 0, i32 0)) + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str2, i32 0, i32 0)) ret void } define internal void @fun_ssp() nounwind ssp uwtable { entry: - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8]* @.str1, i32 0, i32 0)) + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i32 0, i32 0)) ret void } define internal void @fun_nossp() nounwind uwtable { entry: - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0)) + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0)) ret void } diff --git a/test/Transforms/Inline/invoke-combine-clauses.ll b/test/Transforms/Inline/invoke-combine-clauses.ll index 5f06039..89a4cc9 100644 --- a/test/Transforms/Inline/invoke-combine-clauses.ll +++ b/test/Transforms/Inline/invoke-combine-clauses.ll @@ -20,7 +20,7 @@ cont: lpad: %lp = landingpad i32 personality i8* null catch i8* @exception_inner - %cond = load i1* @condition + %cond = load i1, i1* @condition br i1 %cond, label %resume1, label %resume2 resume1: resume i32 1 diff --git a/test/Transforms/Inline/lifetime-no-datalayout.ll b/test/Transforms/Inline/lifetime-no-datalayout.ll index 5abb77f..4307064 100644 --- a/test/Transforms/Inline/lifetime-no-datalayout.ll +++ b/test/Transforms/Inline/lifetime-no-datalayout.ll @@ -8,13 +8,13 @@ define void @helper() { ret void } -; Size in llvm.lifetime.X should be -1 (unknown). +; Size in llvm.lifetime.X should be 1 (default for i8). define void @test() { ; CHECK-LABEL: @test( ; CHECK-NOT: lifetime -; CHECK: llvm.lifetime.start(i64 -1 +; CHECK: llvm.lifetime.start(i64 1 ; CHECK-NOT: lifetime -; CHECK: llvm.lifetime.end(i64 -1 +; CHECK: llvm.lifetime.end(i64 1 call void @helper() ; CHECK-NOT: lifetime ; CHECK: ret void diff --git a/test/Transforms/Inline/noalias-cs.ll b/test/Transforms/Inline/noalias-cs.ll index da5ddd6..8528a39 100644 --- a/test/Transforms/Inline/noalias-cs.ll +++ b/test/Transforms/Inline/noalias-cs.ll @@ -5,13 +5,13 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { entry: - %0 = load float* %c, align 4, !noalias !3 - %arrayidx.i = getelementptr inbounds float* %a, i64 5 + %0 = load float, float* %c, align 4, !noalias !3 + %arrayidx.i = getelementptr inbounds float, float* %a, i64 5 store float %0, float* %arrayidx.i, align 4, !alias.scope !7, !noalias !8 - %arrayidx1.i = getelementptr inbounds float* %b, i64 8 + %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8 store float %0, float* %arrayidx1.i, align 4, !alias.scope !8, !noalias !7 - %1 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %1 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %1, float* %arrayidx, align 4 ret void } @@ -25,21 +25,21 @@ entry: ; CHECK: define void @foo(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { ; CHECK: entry: -; CHECK: %0 = load float* %c, align 4, !noalias !6 -; CHECK: %arrayidx.i.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4, !noalias !6 +; CHECK: %arrayidx.i.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i.i, align 4, !alias.scope !12, !noalias !13 -; CHECK: %arrayidx1.i.i = getelementptr inbounds float* %b, i64 8 +; CHECK: %arrayidx1.i.i = getelementptr inbounds float, float* %b, i64 8 ; CHECK: store float %0, float* %arrayidx1.i.i, align 4, !alias.scope !14, !noalias !15 -; CHECK: %1 = load float* %c, align 4, !noalias !16 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4, !noalias !16 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx.i, align 4, !noalias !16 -; CHECK: %2 = load float* %a, align 4, !alias.scope !16, !noalias !17 -; CHECK: %arrayidx.i.i1 = getelementptr inbounds float* %b, i64 5 +; CHECK: %2 = load float, float* %a, align 4, !alias.scope !16, !noalias !17 +; CHECK: %arrayidx.i.i1 = getelementptr inbounds float, float* %b, i64 5 ; CHECK: store float %2, float* %arrayidx.i.i1, align 4, !alias.scope !21, !noalias !22 -; CHECK: %arrayidx1.i.i2 = getelementptr inbounds float* %b, i64 8 +; CHECK: %arrayidx1.i.i2 = getelementptr inbounds float, float* %b, i64 8 ; CHECK: store float %2, float* %arrayidx1.i.i2, align 4, !alias.scope !23, !noalias !24 -; CHECK: %3 = load float* %a, align 4, !alias.scope !16 -; CHECK: %arrayidx.i3 = getelementptr inbounds float* %b, i64 7 +; CHECK: %3 = load float, float* %a, align 4, !alias.scope !16 +; CHECK: %arrayidx.i3 = getelementptr inbounds float, float* %b, i64 7 ; CHECK: store float %3, float* %arrayidx.i3, align 4, !alias.scope !16 ; CHECK: ret void ; CHECK: } diff --git a/test/Transforms/Inline/noalias.ll b/test/Transforms/Inline/noalias.ll index 674da1e..27e53af 100644 --- a/test/Transforms/Inline/noalias.ll +++ b/test/Transforms/Inline/noalias.ll @@ -4,8 +4,8 @@ target triple = "x86_64-unknown-linux-gnu" define void @hello(float* noalias nocapture %a, float* nocapture readonly %c) #0 { entry: - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 5 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 5 store float %0, float* %arrayidx, align 4 ret void } @@ -13,29 +13,29 @@ entry: define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 { entry: tail call void @hello(float* %a, float* %c) - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %0, float* %arrayidx, align 4 ret void } ; CHECK: define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 { ; CHECK: entry: -; CHECK: %0 = load float* %c, align 4, !noalias !0 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4, !noalias !0 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !0 -; CHECK: %1 = load float* %c, align 4 -; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx, align 4 ; CHECK: ret void ; CHECK: } define void @hello2(float* noalias nocapture %a, float* noalias nocapture %b, float* nocapture readonly %c) #0 { entry: - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 5 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 5 store float %0, float* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds float* %b, i64 8 + %arrayidx1 = getelementptr inbounds float, float* %b, i64 8 store float %0, float* %arrayidx1, align 4 ret void } @@ -43,21 +43,21 @@ entry: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { entry: tail call void @hello2(float* %a, float* %b, float* %c) - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %0, float* %arrayidx, align 4 ret void } ; CHECK: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { ; CHECK: entry: -; CHECK: %0 = load float* %c, align 4, !noalias !3 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4, !noalias !3 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !7, !noalias !8 -; CHECK: %arrayidx1.i = getelementptr inbounds float* %b, i64 8 +; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8 ; CHECK: store float %0, float* %arrayidx1.i, align 4, !alias.scope !8, !noalias !7 -; CHECK: %1 = load float* %c, align 4 -; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx, align 4 ; CHECK: ret void ; CHECK: } diff --git a/test/Transforms/Inline/noalias2.ll b/test/Transforms/Inline/noalias2.ll index 9c8f8e2..432fccf 100644 --- a/test/Transforms/Inline/noalias2.ll +++ b/test/Transforms/Inline/noalias2.ll @@ -4,8 +4,8 @@ target triple = "x86_64-unknown-linux-gnu" define void @hello(float* noalias nocapture %a, float* noalias nocapture readonly %c) #0 { entry: - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 5 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 5 store float %0, float* %arrayidx, align 4 ret void } @@ -13,29 +13,29 @@ entry: define void @foo(float* noalias nocapture %a, float* noalias nocapture readonly %c) #0 { entry: tail call void @hello(float* %a, float* %c) - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %0, float* %arrayidx, align 4 ret void } ; CHECK: define void @foo(float* noalias nocapture %a, float* noalias nocapture readonly %c) #0 { ; CHECK: entry: -; CHECK: %0 = load float* %c, align 4, !alias.scope !0, !noalias !3 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4, !alias.scope !0, !noalias !3 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !3, !noalias !0 -; CHECK: %1 = load float* %c, align 4 -; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx, align 4 ; CHECK: ret void ; CHECK: } define void @hello2(float* noalias nocapture %a, float* noalias nocapture %b, float* nocapture readonly %c) #0 { entry: - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 6 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 6 store float %0, float* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds float* %b, i64 8 + %arrayidx1 = getelementptr inbounds float, float* %b, i64 8 store float %0, float* %arrayidx1, align 4 ret void } @@ -46,27 +46,27 @@ define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture rea entry: tail call void @foo(float* %a, float* %c) tail call void @hello2(float* %a, float* %b, float* %c) - %0 = load float* %c, align 4 - %arrayidx = getelementptr inbounds float* %a, i64 7 + %0 = load float, float* %c, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 7 store float %0, float* %arrayidx, align 4 ret void } ; CHECK: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 { ; CHECK: entry: -; CHECK: %0 = load float* %c, align 4, !alias.scope !5, !noalias !10 -; CHECK: %arrayidx.i.i = getelementptr inbounds float* %a, i64 5 +; CHECK: %0 = load float, float* %c, align 4, !alias.scope !5, !noalias !10 +; CHECK: %arrayidx.i.i = getelementptr inbounds float, float* %a, i64 5 ; CHECK: store float %0, float* %arrayidx.i.i, align 4, !alias.scope !10, !noalias !5 -; CHECK: %1 = load float* %c, align 4, !alias.scope !13, !noalias !14 -; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 7 +; CHECK: %1 = load float, float* %c, align 4, !alias.scope !13, !noalias !14 +; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %1, float* %arrayidx.i, align 4, !alias.scope !14, !noalias !13 -; CHECK: %2 = load float* %c, align 4, !noalias !15 -; CHECK: %arrayidx.i1 = getelementptr inbounds float* %a, i64 6 +; CHECK: %2 = load float, float* %c, align 4, !noalias !15 +; CHECK: %arrayidx.i1 = getelementptr inbounds float, float* %a, i64 6 ; CHECK: store float %2, float* %arrayidx.i1, align 4, !alias.scope !19, !noalias !20 -; CHECK: %arrayidx1.i = getelementptr inbounds float* %b, i64 8 +; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8 ; CHECK: store float %2, float* %arrayidx1.i, align 4, !alias.scope !20, !noalias !19 -; CHECK: %3 = load float* %c, align 4 -; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7 +; CHECK: %3 = load float, float* %c, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7 ; CHECK: store float %3, float* %arrayidx, align 4 ; CHECK: ret void ; CHECK: } diff --git a/test/Transforms/Inline/optimization-remarks.ll b/test/Transforms/Inline/optimization-remarks.ll index fb1b047..8a3e4d1 100644 --- a/test/Transforms/Inline/optimization-remarks.ll +++ b/test/Transforms/Inline/optimization-remarks.ll @@ -12,8 +12,8 @@ entry: %y.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 store i32 %y, i32* %y.addr, align 4 - %0 = load i32* %x.addr, align 4 - %1 = load i32* %y.addr, align 4 + %0 = load i32, i32* %x.addr, align 4 + %1 = load i32, i32* %y.addr, align 4 %add = add nsw i32 %0, %1 ret i32 %add } @@ -25,8 +25,8 @@ entry: %y.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 store i32 %y, i32* %y.addr, align 4 - %0 = load i32* %x.addr, align 4 - %1 = load i32* %y.addr, align 4 + %0 = load i32, i32* %x.addr, align 4 + %1 = load i32, i32* %y.addr, align 4 %mul = mul nsw i32 %0, %1 %conv = sitofp i32 %mul to float ret float %conv @@ -37,14 +37,14 @@ define i32 @bar(i32 %j) #2 { entry: %j.addr = alloca i32, align 4 store i32 %j, i32* %j.addr, align 4 - %0 = load i32* %j.addr, align 4 - %1 = load i32* %j.addr, align 4 + %0 = load i32, i32* %j.addr, align 4 + %1 = load i32, i32* %j.addr, align 4 %sub = sub nsw i32 %1, 2 %call = call i32 @foo(i32 %0, i32 %sub) %conv = sitofp i32 %call to float - %2 = load i32* %j.addr, align 4 + %2 = load i32, i32* %j.addr, align 4 %sub1 = sub nsw i32 %2, 2 - %3 = load i32* %j.addr, align 4 + %3 = load i32, i32* %j.addr, align 4 %call2 = call float @foz(i32 %sub1, i32 %3) %mul = fmul float %conv, %call2 %conv3 = fptosi float %mul to i32 diff --git a/test/Transforms/Inline/ptr-diff.ll b/test/Transforms/Inline/ptr-diff.ll index 46c3bcd..728f379 100644 --- a/test/Transforms/Inline/ptr-diff.ll +++ b/test/Transforms/Inline/ptr-diff.ll @@ -8,8 +8,8 @@ define i32 @outer1() { ; CHECK: ret i32 %ptr = alloca i32 - %ptr1 = getelementptr inbounds i32* %ptr, i32 0 - %ptr2 = getelementptr inbounds i32* %ptr, i32 42 + %ptr1 = getelementptr inbounds i32, i32* %ptr, i32 0 + %ptr2 = getelementptr inbounds i32, i32* %ptr, i32 42 %result = call i32 @inner1(i32* %ptr1, i32* %ptr2) ret i32 %result } @@ -25,7 +25,7 @@ then: ret i32 3 else: - %t = load i32* %begin + %t = load i32, i32* %begin ret i32 %t } @@ -36,8 +36,8 @@ define i32 @outer2(i32* %ptr) { ; CHECK: call i32 @inner2 ; CHECK: ret i32 - %ptr1 = getelementptr i32* %ptr, i32 0 - %ptr2 = getelementptr i32* %ptr, i32 42 + %ptr1 = getelementptr i32, i32* %ptr, i32 0 + %ptr2 = getelementptr i32, i32* %ptr, i32 42 %result = call i32 @inner2(i32* %ptr1, i32* %ptr2) ret i32 %result } @@ -53,7 +53,7 @@ then: ret i32 3 else: - %t = load i32* %begin + %t = load i32, i32* %begin ret i32 %t } @@ -63,9 +63,9 @@ define i32 @inttoptr_free_cost(i32 %a, i32 %b, i32 %c) { %p1 = inttoptr i32 %a to i32 addrspace(1)* %p2 = inttoptr i32 %b to i32 addrspace(1)* %p3 = inttoptr i32 %c to i32 addrspace(1)* - %t1 = load i32 addrspace(1)* %p1 - %t2 = load i32 addrspace(1)* %p2 - %t3 = load i32 addrspace(1)* %p3 + %t1 = load i32, i32 addrspace(1)* %p1 + %t2 = load i32, i32 addrspace(1)* %p2 + %t3 = load i32, i32 addrspace(1)* %p3 %s = add i32 %t1, %t2 %s1 = add i32 %s, %t3 ret i32 %s1 @@ -84,9 +84,9 @@ define i32 @inttoptr_cost_smaller_ptr(i32 %a, i32 %b, i32 %c) { %p1 = inttoptr i32 %a to i32 addrspace(2)* %p2 = inttoptr i32 %b to i32 addrspace(2)* %p3 = inttoptr i32 %c to i32 addrspace(2)* - %t1 = load i32 addrspace(2)* %p1 - %t2 = load i32 addrspace(2)* %p2 - %t3 = load i32 addrspace(2)* %p3 + %t1 = load i32, i32 addrspace(2)* %p1 + %t2 = load i32, i32 addrspace(2)* %p2 + %t3 = load i32, i32 addrspace(2)* %p3 %s = add i32 %t1, %t2 %s1 = add i32 %s, %t3 ret i32 %s1 diff --git a/test/Transforms/Inline/store-sroa.ll b/test/Transforms/Inline/store-sroa.ll new file mode 100644 index 0000000..6b1ca96 --- /dev/null +++ b/test/Transforms/Inline/store-sroa.ll @@ -0,0 +1,22 @@ +; RUN: opt -S -O2 -inline-threshold=1 < %s | FileCheck %s + +%class.A = type { i32 } + +define void @_Z3barP1A(%class.A* %a) #0 { +entry: + %a1 = getelementptr inbounds %class.A, %class.A* %a, i64 0, i32 0 + %0 = load i32, i32* %a1, align 4 + %add = add nsw i32 %0, 10 + store i32 %add, i32* %a1, align 4 + ret void +} + +define void @_Z3foov() #0 { +; CHECK-LABEL: @_Z3foov( +; CHECK-NOT: call void @_Z3barP1A +; CHECK: ret +entry: + %a = alloca %class.A, align 4 + call void @_Z3barP1A(%class.A* %a) + ret void +} |