diff options
Diffstat (limited to 'test/Transforms')
1248 files changed, 15796 insertions, 12224 deletions
diff --git a/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll b/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll index 9407b5a..8d1beec 100644 --- a/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll +++ b/test/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll @@ -15,14 +15,14 @@ bb0: br label %bb1 bb1: ; preds = %bb0 - %reg107 = load %node_t** %nodelist.upgrd.1 ; <%node_t*> [#uses=2] + %reg107 = load %node_t*, %node_t** %nodelist.upgrd.1 ; <%node_t*> [#uses=2] %cond211 = icmp eq %node_t* %reg107, null ; <i1> [#uses=1] br i1 %cond211, label %bb3, label %bb2 bb2: ; preds = %bb2, %bb1 %reg109 = phi %node_t* [ %reg110, %bb2 ], [ %reg107, %bb1 ] ; <%node_t*> [#uses=1] - %reg212 = getelementptr %node_t* %reg109, i64 0, i32 1 ; <%node_t**> [#uses=1] - %reg110 = load %node_t** %reg212 ; <%node_t*> [#uses=2] + %reg212 = getelementptr %node_t, %node_t* %reg109, i64 0, i32 1 ; <%node_t**> [#uses=1] + %reg110 = load %node_t*, %node_t** %reg212 ; <%node_t*> [#uses=2] %cond213 = icmp ne %node_t* %reg110, null ; <i1> [#uses=1] br i1 %cond213, label %bb2, label %bb3 diff --git a/test/Transforms/ADCE/2002-05-28-Crash.ll b/test/Transforms/ADCE/2002-05-28-Crash.ll index 9bbbd05..d88580a 100644 --- a/test/Transforms/ADCE/2002-05-28-Crash.ll +++ b/test/Transforms/ADCE/2002-05-28-Crash.ll @@ -15,7 +15,7 @@ define i32 @rx_bitset_empty(i32 %size, i32* %set) { bb1: - %reg110 = load i32* %set ; <i32> [#uses=2] + %reg110 = load i32, i32* %set ; <i32> [#uses=2] store i32 1, i32* %set %cast112 = sext i32 %size to i64 ; <i64> [#uses=1] %reg113 = add i64 %cast112, 31 ; <i64> [#uses=1] @@ -25,8 +25,8 @@ bb1: %reg114-idxcast = trunc i64 %reg114 to i32 ; <i32> [#uses=1] %reg114-idxcast-offset = add i32 %reg114-idxcast, 1073741823 ; <i32> [#uses=1] %reg114-idxcast-offset.upgrd.1 = zext i32 %reg114-idxcast-offset to i64 ; <i64> [#uses=1] - %reg124 = getelementptr i32* %set, i64 %reg114-idxcast-offset.upgrd.1 ; <i32*> [#uses=1] - %reg125 = load i32* %reg124 ; <i32> [#uses=1] + %reg124 = getelementptr i32, i32* %set, i64 %reg114-idxcast-offset.upgrd.1 ; <i32*> [#uses=1] + %reg125 = load i32, i32* %reg124 ; <i32> [#uses=1] %cond232 = icmp ne i32 %reg125, 0 ; <i1> [#uses=1] br i1 %cond232, label %bb3, label %bb2 @@ -38,8 +38,8 @@ bb2: ; preds = %bb2, %bb1 %reg130-idxcast = bitcast i32 %reg130 to i32 ; <i32> [#uses=1] %reg130-idxcast-offset = add i32 %reg130-idxcast, 1073741823 ; <i32> [#uses=1] %reg130-idxcast-offset.upgrd.2 = zext i32 %reg130-idxcast-offset to i64 ; <i64> [#uses=1] - %reg118 = getelementptr i32* %set, i64 %reg130-idxcast-offset.upgrd.2 ; <i32*> [#uses=1] - %reg119 = load i32* %reg118 ; <i32> [#uses=1] + %reg118 = getelementptr i32, i32* %set, i64 %reg130-idxcast-offset.upgrd.2 ; <i32*> [#uses=1] + %reg119 = load i32, i32* %reg118 ; <i32> [#uses=1] %cond233 = icmp eq i32 %reg119, 0 ; <i1> [#uses=1] br i1 %cond233, label %bb2, label %bb3 diff --git a/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll b/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll index 8f8dadf..ff8bdb3 100644 --- a/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll +++ b/test/Transforms/ADCE/2002-07-17-AssertionFailure.ll @@ -7,7 +7,7 @@ define void @foo(i8* %reg5481) { %cast611 = bitcast i8* %reg5481 to i8** ; <i8**> [#uses=1] - %reg162 = load i8** %cast611 ; <i8*> [#uses=1] + %reg162 = load i8*, i8** %cast611 ; <i8*> [#uses=1] ptrtoint i8* %reg162 to i32 ; <i32>:1 [#uses=0] ret void } diff --git a/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll b/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll index 2f0df67..1bf79e8 100644 --- a/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll +++ b/test/Transforms/ADCE/2002-07-17-PHIAssertion.ll @@ -17,7 +17,7 @@ bb3: ; preds = %bb2 br label %UnifiedExitNode bb4: ; preds = %bb2 - %reg117 = load i32* @hufts ; <i32> [#uses=2] + %reg117 = load i32, i32* @hufts ; <i32> [#uses=2] %cond241 = icmp ule i32 %reg117, %reg128 ; <i1> [#uses=1] br i1 %cond241, label %bb6, label %bb5 @@ -29,12 +29,12 @@ bb6: ; preds = %bb5, %bb4 br i1 false, label %bb2, label %bb7 bb7: ; preds = %bb6 - %reg126 = load i32* @bk ; <i32> [#uses=1] + %reg126 = load i32, i32* @bk ; <i32> [#uses=1] %cond247 = icmp ule i32 %reg126, 7 ; <i1> [#uses=1] br i1 %cond247, label %bb9, label %bb8 bb8: ; preds = %bb8, %bb7 - %reg119 = load i32* @bk ; <i32> [#uses=1] + %reg119 = load i32, i32* @bk ; <i32> [#uses=1] %cond256 = icmp ugt i32 %reg119, 7 ; <i1> [#uses=1] br i1 %cond256, label %bb8, label %bb9 diff --git a/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll b/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll index 5206b24..7c7e238 100644 --- a/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll +++ b/test/Transforms/ADCE/2003-06-11-InvalidCFG.ll @@ -16,7 +16,7 @@ then.66: ; preds = %shortcirc_done.12 br label %endif.42 endif.65: ; preds = %endif.42 - %tmp.2846 = load i32** @G ; <i32*> [#uses=1] + %tmp.2846 = load i32*, i32** @G ; <i32*> [#uses=1] br i1 false, label %shortcirc_next.12, label %shortcirc_done.12 shortcirc_next.12: ; preds = %endif.65 diff --git a/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll b/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll index eb3ef1e..707e14a 100644 --- a/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll +++ b/test/Transforms/ADCE/2003-06-24-BadSuccessor.ll @@ -48,8 +48,8 @@ shortcirc_next.4: ; preds = %then.44 br i1 false, label %no_exit.2, label %loopexit.2 no_exit.2: ; preds = %shortcirc_next.4 - %tmp.897 = getelementptr i32* %SubArrays.10, i64 0 ; <i32*> [#uses=1] - %tmp.899 = load i32* %tmp.897 ; <i32> [#uses=1] + %tmp.897 = getelementptr i32, i32* %SubArrays.10, i64 0 ; <i32*> [#uses=1] + %tmp.899 = load i32, i32* %tmp.897 ; <i32> [#uses=1] store i32 %tmp.899, i32* null ret i32 0 @@ -79,7 +79,7 @@ shortcirc_next.8: ; preds = %shortcirc_next.7 then.53: ; preds = %shortcirc_next.7, %label.17 %SubArrays.8 = phi i32* [ %SubArrays.10, %shortcirc_next.7 ], [ %SubArrays.10, %label.17 ] ; <i32*> [#uses=1] - %tmp.1023 = load i32* null ; <i32> [#uses=1] + %tmp.1023 = load i32, i32* null ; <i32> [#uses=1] switch i32 %tmp.1023, label %loopentry.1 [ ] diff --git a/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll b/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll index 82fa5b2..f0de431 100644 --- a/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll +++ b/test/Transforms/ADCE/2003-06-24-BasicFunctionality.ll @@ -2,20 +2,20 @@ define void @dead_test8(i32* %data.1, i32 %idx.1) { entry: - %tmp.1 = load i32* %data.1 ; <i32> [#uses=2] + %tmp.1 = load i32, i32* %data.1 ; <i32> [#uses=2] %tmp.41 = icmp sgt i32 %tmp.1, 0 ; <i1> [#uses=1] br i1 %tmp.41, label %no_exit.preheader, label %return no_exit.preheader: ; preds = %entry - %tmp.11 = getelementptr i32* %data.1, i64 1 ; <i32*> [#uses=1] + %tmp.11 = getelementptr i32, i32* %data.1, i64 1 ; <i32*> [#uses=1] %tmp.22-idxcast = sext i32 %idx.1 to i64 ; <i64> [#uses=1] - %tmp.28 = getelementptr i32* %data.1, i64 %tmp.22-idxcast ; <i32*> [#uses=1] + %tmp.28 = getelementptr i32, i32* %data.1, i64 %tmp.22-idxcast ; <i32*> [#uses=1] br label %no_exit no_exit: ; preds = %endif, %no_exit.preheader %k.1 = phi i32 [ %k.0, %endif ], [ 0, %no_exit.preheader ] ; <i32> [#uses=3] %i.0 = phi i32 [ %inc.1, %endif ], [ 0, %no_exit.preheader ] ; <i32> [#uses=1] - %tmp.12 = load i32* %tmp.11 ; <i32> [#uses=1] + %tmp.12 = load i32, i32* %tmp.11 ; <i32> [#uses=1] %tmp.14 = sub i32 0, %tmp.12 ; <i32> [#uses=1] %tmp.161 = icmp ne i32 %k.1, %tmp.14 ; <i1> [#uses=1] br i1 %tmp.161, label %then, label %else diff --git a/test/Transforms/ADCE/basictest1.ll b/test/Transforms/ADCE/basictest1.ll index bbb8878..4d0d386 100644 --- a/test/Transforms/ADCE/basictest1.ll +++ b/test/Transforms/ADCE/basictest1.ll @@ -22,12 +22,12 @@ declare i32 @fwrite(i8*, i32, i32, %FILE*) declare void @perror(i8*) define i32 @spec_getc(i32 %fd) { - %reg109 = load i32* @dbglvl ; <i32> [#uses=1] + %reg109 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond266 = icmp sle i32 %reg109, 4 ; <i1> [#uses=1] br i1 %cond266, label %bb3, label %bb2 bb2: ; preds = %0 - %cast273 = getelementptr [17 x i8]* @.LC12, i64 0, i64 0 ; <i8*> [#uses=0] + %cast273 = getelementptr [17 x i8], [17 x i8]* @.LC12, i64 0, i64 0 ; <i8*> [#uses=0] br label %bb3 bb3: ; preds = %bb2, %0 @@ -35,8 +35,8 @@ bb3: ; preds = %bb2, %0 br i1 %cond267, label %bb5, label %bb4 bb4: ; preds = %bb3 - %reg111 = getelementptr [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; <i8*> [#uses=1] - %cast274 = getelementptr [34 x i8]* @.LC9, i64 0, i64 0 ; <i8*> [#uses=0] + %reg111 = getelementptr [20 x %FILE], [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; <i8*> [#uses=1] + %cast274 = getelementptr [34 x i8], [34 x i8]* @.LC9, i64 0, i64 0 ; <i8*> [#uses=0] %cast282 = bitcast i8* %reg111 to %FILE* ; <%FILE*> [#uses=0] call void @exit( i32 1 ) br label %UnifiedExitNode @@ -44,21 +44,21 @@ bb4: ; preds = %bb3 bb5: ; preds = %bb3 %reg107-idxcast1 = sext i32 %fd to i64 ; <i64> [#uses=2] %reg107-idxcast2 = sext i32 %fd to i64 ; <i64> [#uses=1] - %reg1311 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1] - %idx1 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] - %reg1321 = load i32* %idx1 ; <i32> [#uses=3] - %idx2 = getelementptr %spec_fd_t* %reg1311, i64 0, i32 1 ; <i32*> [#uses=1] - %reg1331 = load i32* %idx2 ; <i32> [#uses=1] + %reg1311 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1] + %idx1 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] + %reg1321 = load i32, i32* %idx1 ; <i32> [#uses=3] + %idx2 = getelementptr %spec_fd_t, %spec_fd_t* %reg1311, i64 0, i32 1 ; <i32*> [#uses=1] + %reg1331 = load i32, i32* %idx2 ; <i32> [#uses=1] %cond270 = icmp slt i32 %reg1321, %reg1331 ; <i1> [#uses=1] br i1 %cond270, label %bb9, label %bb6 bb6: ; preds = %bb5 - %reg134 = load i32* @dbglvl ; <i32> [#uses=1] + %reg134 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond271 = icmp sle i32 %reg134, 4 ; <i1> [#uses=1] br i1 %cond271, label %bb8, label %bb7 bb7: ; preds = %bb6 - %cast277 = getelementptr [4 x i8]* @.LC10, i64 0, i64 0 ; <i8*> [#uses=0] + %cast277 = getelementptr [4 x i8], [4 x i8]* @.LC10, i64 0, i64 0 ; <i8*> [#uses=0] br label %bb8 bb8: ; preds = %bb7, %bb6 @@ -66,21 +66,21 @@ bb8: ; preds = %bb7, %bb6 bb9: ; preds = %bb5 %reg107-idxcast3 = sext i32 %fd to i64 ; <i64> [#uses=1] - %idx3 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; <i8**> [#uses=1] - %reg1601 = load i8** %idx3 ; <i8*> [#uses=1] + %idx3 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; <i8**> [#uses=1] + %reg1601 = load i8*, i8** %idx3 ; <i8*> [#uses=1] %reg132-idxcast1 = sext i32 %reg1321 to i64 ; <i64> [#uses=1] - %idx4 = getelementptr i8* %reg1601, i64 %reg132-idxcast1 ; <i8*> [#uses=1] - %reg1621 = load i8* %idx4 ; <i8> [#uses=2] + %idx4 = getelementptr i8, i8* %reg1601, i64 %reg132-idxcast1 ; <i8*> [#uses=1] + %reg1621 = load i8, i8* %idx4 ; <i8> [#uses=2] %cast108 = zext i8 %reg1621 to i64 ; <i64> [#uses=0] %reg157 = add i32 %reg1321, 1 ; <i32> [#uses=1] - %idx5 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] + %idx5 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] store i32 %reg157, i32* %idx5 - %reg163 = load i32* @dbglvl ; <i32> [#uses=1] + %reg163 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond272 = icmp sle i32 %reg163, 4 ; <i1> [#uses=1] br i1 %cond272, label %bb11, label %bb10 bb10: ; preds = %bb9 - %cast279 = getelementptr [4 x i8]* @.LC11, i64 0, i64 0 ; <i8*> [#uses=0] + %cast279 = getelementptr [4 x i8], [4 x i8]* @.LC11, i64 0, i64 0 ; <i8*> [#uses=0] br label %bb11 bb11: ; preds = %bb10, %bb9 diff --git a/test/Transforms/ADCE/basictest2.ll b/test/Transforms/ADCE/basictest2.ll index a17795f..26b2e85 100644 --- a/test/Transforms/ADCE/basictest2.ll +++ b/test/Transforms/ADCE/basictest2.ll @@ -22,12 +22,12 @@ declare i32 @fwrite(i8*, i32, i32, %FILE*) declare void @perror(i8*) define i32 @spec_getc(i32 %fd) { - %reg109 = load i32* @dbglvl ; <i32> [#uses=1] + %reg109 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond266 = icmp sle i32 %reg109, 4 ; <i1> [#uses=1] br i1 %cond266, label %bb3, label %bb2 bb2: ; preds = %0 - %cast273 = getelementptr [17 x i8]* @.LC12, i64 0, i64 0 ; <i8*> [#uses=0] + %cast273 = getelementptr [17 x i8], [17 x i8]* @.LC12, i64 0, i64 0 ; <i8*> [#uses=0] br label %bb3 bb3: ; preds = %bb2, %0 @@ -35,8 +35,8 @@ bb3: ; preds = %bb2, %0 br label %bb5 bb4: ; No predecessors! - %reg111 = getelementptr [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; <i8*> [#uses=1] - %cast274 = getelementptr [34 x i8]* @.LC9, i64 0, i64 0 ; <i8*> [#uses=0] + %reg111 = getelementptr [20 x %FILE], [20 x %FILE]* @__iob, i64 0, i64 1, i32 3 ; <i8*> [#uses=1] + %cast274 = getelementptr [34 x i8], [34 x i8]* @.LC9, i64 0, i64 0 ; <i8*> [#uses=0] %cast282 = bitcast i8* %reg111 to %FILE* ; <%FILE*> [#uses=0] call void @exit( i32 1 ) br label %UnifiedExitNode @@ -44,21 +44,21 @@ bb4: ; No predecessors! bb5: ; preds = %bb3 %reg107-idxcast1 = sext i32 %fd to i64 ; <i64> [#uses=2] %reg107-idxcast2 = sext i32 %fd to i64 ; <i64> [#uses=1] - %reg1311 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1] - %idx1 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] - %reg1321 = load i32* %idx1 ; <i32> [#uses=3] - %idx2 = getelementptr %spec_fd_t* %reg1311, i64 0, i32 1 ; <i32*> [#uses=1] - %reg1331 = load i32* %idx2 ; <i32> [#uses=1] + %reg1311 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast2 ; <%spec_fd_t*> [#uses=1] + %idx1 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] + %reg1321 = load i32, i32* %idx1 ; <i32> [#uses=3] + %idx2 = getelementptr %spec_fd_t, %spec_fd_t* %reg1311, i64 0, i32 1 ; <i32*> [#uses=1] + %reg1331 = load i32, i32* %idx2 ; <i32> [#uses=1] %cond270 = icmp slt i32 %reg1321, %reg1331 ; <i1> [#uses=1] br i1 %cond270, label %bb9, label %bb6 bb6: ; preds = %bb5 - %reg134 = load i32* @dbglvl ; <i32> [#uses=1] + %reg134 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond271 = icmp sle i32 %reg134, 4 ; <i1> [#uses=1] br i1 %cond271, label %bb8, label %bb7 bb7: ; preds = %bb6 - %cast277 = getelementptr [4 x i8]* @.LC10, i64 0, i64 0 ; <i8*> [#uses=0] + %cast277 = getelementptr [4 x i8], [4 x i8]* @.LC10, i64 0, i64 0 ; <i8*> [#uses=0] br label %bb8 bb8: ; preds = %bb7, %bb6 @@ -66,21 +66,21 @@ bb8: ; preds = %bb7, %bb6 bb9: ; preds = %bb5 %reg107-idxcast3 = sext i32 %fd to i64 ; <i64> [#uses=1] - %idx3 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; <i8**> [#uses=1] - %reg1601 = load i8** %idx3 ; <i8*> [#uses=1] + %idx3 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast3, i32 3 ; <i8**> [#uses=1] + %reg1601 = load i8*, i8** %idx3 ; <i8*> [#uses=1] %reg132-idxcast1 = sext i32 %reg1321 to i64 ; <i64> [#uses=1] - %idx4 = getelementptr i8* %reg1601, i64 %reg132-idxcast1 ; <i8*> [#uses=1] - %reg1621 = load i8* %idx4 ; <i8> [#uses=2] + %idx4 = getelementptr i8, i8* %reg1601, i64 %reg132-idxcast1 ; <i8*> [#uses=1] + %reg1621 = load i8, i8* %idx4 ; <i8> [#uses=2] %cast108 = zext i8 %reg1621 to i64 ; <i64> [#uses=0] %reg157 = add i32 %reg1321, 1 ; <i32> [#uses=1] - %idx5 = getelementptr [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] + %idx5 = getelementptr [3 x %spec_fd_t], [3 x %spec_fd_t]* @spec_fd, i64 0, i64 %reg107-idxcast1, i32 2 ; <i32*> [#uses=1] store i32 %reg157, i32* %idx5 - %reg163 = load i32* @dbglvl ; <i32> [#uses=1] + %reg163 = load i32, i32* @dbglvl ; <i32> [#uses=1] %cond272 = icmp sle i32 %reg163, 4 ; <i1> [#uses=1] br i1 %cond272, label %bb11, label %bb10 bb10: ; preds = %bb9 - %cast279 = getelementptr [4 x i8]* @.LC11, i64 0, i64 0 ; <i8*> [#uses=0] + %cast279 = getelementptr [4 x i8], [4 x i8]* @.LC11, i64 0, i64 0 ; <i8*> [#uses=0] br label %bb11 bb11: ; preds = %bb10, %bb9 diff --git a/test/Transforms/AddDiscriminators/basic.ll b/test/Transforms/AddDiscriminators/basic.ll index 7c8b3d3..9ab0edf 100644 --- a/test/Transforms/AddDiscriminators/basic.ll +++ b/test/Transforms/AddDiscriminators/basic.ll @@ -16,22 +16,23 @@ entry: %i.addr = alloca i32, align 4 %x = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 - %0 = load i32* %i.addr, align 4, !dbg !10 + %0 = load i32, i32* %i.addr, align 4, !dbg !10 %cmp = icmp slt i32 %0, 10, !dbg !10 br i1 %cmp, label %if.then, label %if.end, !dbg !10 if.then: ; preds = %entry - %1 = load i32* %i.addr, align 4, !dbg !10 -; CHECK: %1 = load i32* %i.addr, align 4, !dbg !12 + %1 = load i32, i32* %i.addr, align 4, !dbg !10 +; CHECK: %1 = load i32, i32* %i.addr, align 4, !dbg ![[THEN:[0-9]+]] store i32 %1, i32* %x, align 4, !dbg !10 -; CHECK: store i32 %1, i32* %x, align 4, !dbg !12 +; CHECK: store i32 %1, i32* %x, align 4, !dbg ![[THEN]] br label %if.end, !dbg !10 -; CHECK: br label %if.end, !dbg !12 +; CHECK: br label %if.end, !dbg ![[THEN]] if.end: ; preds = %if.then, %entry ret void, !dbg !12 +; CHECK: ret void, !dbg ![[END:[0-9]+]] } attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } @@ -40,20 +41,22 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\0012\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [basic.c] [DW_LANG_C99] -!1 = !{!"basic.c", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "basic.c", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [basic.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32)* @foo, variables: !2) +!5 = !MDFile(filename: "basic.c", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 4} -!8 = !{i32 1, !"Debug Info Version", i32 2} +!8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5 "} !10 = !MDLocation(line: 3, scope: !11) -!11 = !{!"0xb\003\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [basic.c] +!11 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !4) !12 = !MDLocation(line: 4, scope: !4) -; CHECK: !12 = !MDLocation(line: 3, scope: !13) -; CHECK: !13 = !{!"0xb\001", !1, !11} ; [ DW_TAG_lexical_block ] [./basic.c] -; CHECK: !14 = !MDLocation(line: 4, scope: !4) +; CHECK: ![[FOO:[0-9]+]] = !MDSubprogram(name: "foo" +; CHECK: ![[BLOCK:[0-9]+]] = distinct !MDLexicalBlock(scope: ![[FOO]],{{.*}} line: 3) +; CHECK: ![[THEN]] = !MDLocation(line: 3, scope: ![[BLOCKFILE:[0-9]+]]) +; CHECK: ![[BLOCKFILE]] = !MDLexicalBlockFile(scope: ![[BLOCK]],{{.*}} discriminator: 1) +; CHECK: ![[END]] = !MDLocation(line: 4, scope: ![[FOO]]) diff --git a/test/Transforms/AddDiscriminators/first-only.ll b/test/Transforms/AddDiscriminators/first-only.ll index 153cfc8..59bcb05 100644 --- a/test/Transforms/AddDiscriminators/first-only.ll +++ b/test/Transforms/AddDiscriminators/first-only.ll @@ -19,29 +19,29 @@ entry: %x = alloca i32, align 4 %y = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 - %0 = load i32* %i.addr, align 4, !dbg !10 + %0 = load i32, i32* %i.addr, align 4, !dbg !10 %cmp = icmp slt i32 %0, 10, !dbg !10 br i1 %cmp, label %if.then, label %if.end, !dbg !10 if.then: ; preds = %entry - %1 = load i32* %i.addr, align 4, !dbg !12 + %1 = load i32, i32* %i.addr, align 4, !dbg !12 store i32 %1, i32* %x, align 4, !dbg !12 - %2 = load i32* %i.addr, align 4, !dbg !14 -; CHECK: %2 = load i32* %i.addr, align 4, !dbg !15 + %2 = load i32, i32* %i.addr, align 4, !dbg !14 +; CHECK: %2 = load i32, i32* %i.addr, align 4, !dbg ![[THEN:[0-9]+]] %sub = sub nsw i32 0, %2, !dbg !14 -; CHECK: %sub = sub nsw i32 0, %2, !dbg !15 +; CHECK: %sub = sub nsw i32 0, %2, !dbg ![[THEN]] store i32 %sub, i32* %y, align 4, !dbg !14 -; CHECK: store i32 %sub, i32* %y, align 4, !dbg !15 +; CHECK: store i32 %sub, i32* %y, align 4, !dbg ![[THEN]] br label %if.end, !dbg !15 -; CHECK: br label %if.end, !dbg !16 +; CHECK: br label %if.end, !dbg ![[BR:[0-9]+]] if.end: ; preds = %if.then, %entry ret void, !dbg !16 -; CHECK: ret void, !dbg !17 +; CHECK: ret void, !dbg ![[END:[0-9]+]] } attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } @@ -50,33 +50,34 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\0012\00clang version 3.5 (trunk 199750) (llvm/trunk 199751)\000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [first-only.c] [DW_LANG_C99] -!1 = !{!"first-only.c", !"."} -!2 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (trunk 199750) (llvm/trunk 199751)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "first-only.c", directory: ".") +!2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [first-only.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32)* @foo, variables: !2) +!5 = !MDFile(filename: "first-only.c", directory: ".") +!6 = !MDSubroutineType(types: !{null}) !7 = !{i32 2, !"Dwarf Version", i32 4} -!8 = !{i32 1, !"Debug Info Version", i32 2} +!8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5 (trunk 199750) (llvm/trunk 199751)"} !10 = !MDLocation(line: 3, scope: !11) -!11 = !{!"0xb\003\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [first-only.c] -; CHECK: !11 = !{!"0xb\003\000\000", !1, !4} +!11 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !4) +; CHECK: ![[FOO:[0-9]+]] = !MDSubprogram(name: "foo" +; CHECK: ![[BLOCK1:[0-9]+]] = distinct !MDLexicalBlock(scope: ![[FOO]],{{.*}} line: 3) !12 = !MDLocation(line: 3, scope: !13) -!13 = !{!"0xb\003\000\001", !1, !11} ; [ DW_TAG_lexical_block ] [first-only.c] -; CHECK: !13 = !{!"0xb\001", !1, !14} ; [ DW_TAG_lexical_block ] [./first-only.c] +!13 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !11) +; CHECK: !MDLexicalBlockFile(scope: ![[BLOCK2:[0-9]+]],{{.*}} discriminator: 1) !14 = !MDLocation(line: 4, scope: !13) -; CHECK: !14 = !{!"0xb\003\000\001", !1, !11} +; CHECK: ![[BLOCK2]] = distinct !MDLexicalBlock(scope: ![[BLOCK1]],{{.*}} line: 3) !15 = !MDLocation(line: 5, scope: !13) -; CHECK: !15 = !MDLocation(line: 4, scope: !14) +; CHECK: ![[THEN]] = !MDLocation(line: 4, scope: ![[BLOCK2]]) !16 = !MDLocation(line: 6, scope: !4) -; CHECK: !16 = !MDLocation(line: 5, scope: !14) -; CHECK: !17 = !MDLocation(line: 6, scope: !4) +; CHECK: ![[BR]] = !MDLocation(line: 5, scope: ![[BLOCK2]]) +; CHECK: ![[END]] = !MDLocation(line: 6, scope: ![[FOO]]) diff --git a/test/Transforms/AddDiscriminators/multiple.ll b/test/Transforms/AddDiscriminators/multiple.ll index 5e552a8..587baad 100644 --- a/test/Transforms/AddDiscriminators/multiple.ll +++ b/test/Transforms/AddDiscriminators/multiple.ll @@ -15,29 +15,29 @@ entry: %i.addr = alloca i32, align 4 %x = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 - %0 = load i32* %i.addr, align 4, !dbg !10 + %0 = load i32, i32* %i.addr, align 4, !dbg !10 %cmp = icmp slt i32 %0, 10, !dbg !10 br i1 %cmp, label %if.then, label %if.else, !dbg !10 if.then: ; preds = %entry - %1 = load i32* %i.addr, align 4, !dbg !10 -; CHECK: %1 = load i32* %i.addr, align 4, !dbg !12 + %1 = load i32, i32* %i.addr, align 4, !dbg !10 +; CHECK: %1 = load i32, i32* %i.addr, align 4, !dbg ![[THEN:[0-9]+]] store i32 %1, i32* %x, align 4, !dbg !10 -; CHECK: store i32 %1, i32* %x, align 4, !dbg !12 +; CHECK: store i32 %1, i32* %x, align 4, !dbg ![[THEN]] br label %if.end, !dbg !10 -; CHECK: br label %if.end, !dbg !12 +; CHECK: br label %if.end, !dbg ![[THEN]] if.else: ; preds = %entry - %2 = load i32* %i.addr, align 4, !dbg !10 -; CHECK: %2 = load i32* %i.addr, align 4, !dbg !14 + %2 = load i32, i32* %i.addr, align 4, !dbg !10 +; CHECK: %2 = load i32, i32* %i.addr, align 4, !dbg ![[ELSE:[0-9]+]] %sub = sub nsw i32 0, %2, !dbg !10 -; CHECK: %sub = sub nsw i32 0, %2, !dbg !14 +; CHECK: %sub = sub nsw i32 0, %2, !dbg ![[ELSE]] store i32 %sub, i32* %x, align 4, !dbg !10 -; CHECK: store i32 %sub, i32* %x, align 4, !dbg !14 +; CHECK: store i32 %sub, i32* %x, align 4, !dbg ![[ELSE]] br label %if.end @@ -51,21 +51,22 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\0012\00clang version 3.5 (trunk 199750) (llvm/trunk 199751)\000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [multiple.c] [DW_LANG_C99] -!1 = !{!"multiple.c", !"."} -!2 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (trunk 199750) (llvm/trunk 199751)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "multiple.c", directory: ".") +!2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [multiple.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32)* @foo, variables: !2) +!5 = !MDFile(filename: "multiple.c", directory: ".") +!6 = !MDSubroutineType(types: !{null, !13}) +!13 = !MDBasicType(encoding: DW_ATE_signed, name: "int", size: 32, align: 32) !7 = !{i32 2, !"Dwarf Version", i32 4} -!8 = !{i32 1, !"Debug Info Version", i32 2} +!8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5 (trunk 199750) (llvm/trunk 199751)"} !10 = !MDLocation(line: 3, scope: !11) -!11 = !{!"0xb\003\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [multiple.c] +!11 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !4) !12 = !MDLocation(line: 4, scope: !4) -; CHECK: !12 = !MDLocation(line: 3, scope: !13) -; CHECK: !13 = !{!"0xb\001", !1, !11} ; [ DW_TAG_lexical_block ] [./multiple.c] -; CHECK: !14 = !MDLocation(line: 3, scope: !15) -; CHECK: !15 = !{!"0xb\002", !1, !11} ; [ DW_TAG_lexical_block ] [./multiple.c] +; CHECK: ![[THEN]] = !MDLocation(line: 3, scope: ![[THENBLOCK:[0-9]+]]) +; CHECK: ![[THENBLOCK]] = !MDLexicalBlockFile(scope: ![[SCOPE:[0-9]+]],{{.*}} discriminator: 1) +; CHECK: ![[ELSE]] = !MDLocation(line: 3, scope: ![[ELSEBLOCK:[0-9]+]]) +; CHECK: ![[ELSEBLOCK]] = !MDLexicalBlockFile(scope: ![[SCOPE]],{{.*}} discriminator: 2) diff --git a/test/Transforms/AddDiscriminators/no-discriminators.ll b/test/Transforms/AddDiscriminators/no-discriminators.ll index dd7faf0..5ef0d00 100644 --- a/test/Transforms/AddDiscriminators/no-discriminators.ll +++ b/test/Transforms/AddDiscriminators/no-discriminators.ll @@ -17,13 +17,13 @@ entry: %retval = alloca i32, align 4 %i.addr = alloca i64, align 8 store i64 %i, i64* %i.addr, align 8 - call void @llvm.dbg.declare(metadata i64* %i.addr, metadata !13, metadata !{}), !dbg !14 - %0 = load i64* %i.addr, align 8, !dbg !15 -; CHECK: %0 = load i64* %i.addr, align 8, !dbg !15 + call void @llvm.dbg.declare(metadata i64* %i.addr, metadata !13, metadata !MDExpression()), !dbg !14 + %0 = load i64, i64* %i.addr, align 8, !dbg !15 +; CHECK: %0 = load i64, i64* %i.addr, align 8, !dbg ![[ENTRY:[0-9]+]] %cmp = icmp slt i64 %0, 5, !dbg !15 -; CHECK: %cmp = icmp slt i64 %0, 5, !dbg !15 +; CHECK: %cmp = icmp slt i64 %0, 5, !dbg ![[ENTRY:[0-9]+]] br i1 %cmp, label %if.then, label %if.else, !dbg !15 -; CHECK: br i1 %cmp, label %if.then, label %if.else, !dbg !15 +; CHECK: br i1 %cmp, label %if.then, label %if.else, !dbg ![[ENTRY:[0-9]+]] if.then: ; preds = %entry store i32 2, i32* %retval, !dbg !15 @@ -34,7 +34,7 @@ if.else: ; preds = %entry br label %return, !dbg !15 return: ; preds = %if.else, %if.then - %1 = load i32* %retval, !dbg !17 + %1 = load i32, i32* %retval, !dbg !17 ret i32 %1, !dbg !17 } @@ -48,24 +48,25 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!10, !11} !llvm.ident = !{!12} -!0 = !{!"0x11\0012\00clang version 3.5.0 \000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./no-discriminators] [DW_LANG_C99] -!1 = !{!"no-discriminators", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "no-discriminators", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, i32 (i64)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./no-discriminators] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i64)* @foo, variables: !2) +; CHECK: ![[FOO:[0-9]+]] = !MDSubprogram(name: "foo" +!5 = !MDFile(filename: "no-discriminators", directory: ".") +!6 = !MDSubroutineType(types: !7) !7 = !{!8, !9} -!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 = !{!"0x24\00long int\000\0064\0064\000\000\005", null, null} ; [ DW_TAG_base_type ] [long int] [line 0, size 64, align 64, offset 0, enc DW_ATE_signed] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed) !10 = !{i32 2, !"Dwarf Version", i32 2} -; CHECK: !10 = !{i32 2, !"Dwarf Version", i32 2} -!11 = !{i32 1, !"Debug Info Version", i32 2} +; CHECK: !{i32 2, !"Dwarf Version", i32 2} +!11 = !{i32 1, !"Debug Info Version", i32 3} !12 = !{!"clang version 3.5.0 "} -!13 = !{!"0x101\00i\0016777217\000", !4, !5, !9} ; [ DW_TAG_arg_variable ] [i] [line 1] +!13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !9) !14 = !MDLocation(line: 1, scope: !4) !15 = !MDLocation(line: 2, scope: !16) -; CHECK: !15 = !MDLocation(line: 2, scope: !16) -!16 = !{!"0xb\002\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [./no-discriminators] -; CHECK: !16 = !{!"0xb\002\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [./no-discriminators] +; CHECK: ![[ENTRY]] = !MDLocation(line: 2, scope: ![[BLOCK:[0-9]+]]) +!16 = distinct !MDLexicalBlock(line: 2, column: 0, file: !1, scope: !4) +; CHECK: ![[BLOCK]] = distinct !MDLexicalBlock(scope: ![[FOO]],{{.*}} line: 2) !17 = !MDLocation(line: 3, scope: !4) diff --git a/test/Transforms/AlignmentFromAssumptions/simple.ll b/test/Transforms/AlignmentFromAssumptions/simple.ll index 884c8ba..851e6dc 100644 --- a/test/Transforms/AlignmentFromAssumptions/simple.ll +++ b/test/Transforms/AlignmentFromAssumptions/simple.ll @@ -7,11 +7,11 @@ entry: %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %0 = load i32* %a, align 4 + %0 = load i32, i32* %a, align 4 ret i32 %0 ; CHECK-LABEL: @foo -; CHECK: load i32* {{[^,]+}}, align 32 +; CHECK: load i32, i32* {{[^,]+}}, align 32 ; CHECK: ret i32 } @@ -22,12 +22,12 @@ entry: %maskedptr = and i64 %offsetptr, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %arrayidx = getelementptr inbounds i32* %a, i64 2 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 2 + %0 = load i32, i32* %arrayidx, align 4 ret i32 %0 ; CHECK-LABEL: @foo2 -; CHECK: load i32* {{[^,]+}}, align 16 +; CHECK: load i32, i32* {{[^,]+}}, align 16 ; CHECK: ret i32 } @@ -38,12 +38,12 @@ entry: %maskedptr = and i64 %offsetptr, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %arrayidx = getelementptr inbounds i32* %a, i64 -1 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 -1 + %0 = load i32, i32* %arrayidx, align 4 ret i32 %0 ; CHECK-LABEL: @foo2a -; CHECK: load i32* {{[^,]+}}, align 32 +; CHECK: load i32, i32* {{[^,]+}}, align 32 ; CHECK: ret i32 } @@ -53,11 +53,11 @@ entry: %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %0 = load i32* %a, align 4 + %0 = load i32, i32* %a, align 4 ret i32 %0 ; CHECK-LABEL: @goo -; CHECK: load i32* {{[^,]+}}, align 32 +; CHECK: load i32, i32* {{[^,]+}}, align 32 ; CHECK: ret i32 } @@ -72,8 +72,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 8 %1 = trunc i64 %indvars.iv.next to i32 @@ -85,7 +85,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @hoo -; CHECK: load i32* %arrayidx, align 32 +; CHECK: load i32, i32* %arrayidx, align 32 ; CHECK: ret i32 %add.lcssa } @@ -100,8 +100,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 4, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 8 %1 = trunc i64 %indvars.iv.next to i32 @@ -113,7 +113,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @joo -; CHECK: load i32* %arrayidx, align 16 +; CHECK: load i32, i32* %arrayidx, align 16 ; CHECK: ret i32 %add.lcssa } @@ -128,8 +128,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 4 %1 = trunc i64 %indvars.iv.next to i32 @@ -141,7 +141,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @koo -; CHECK: load i32* %arrayidx, align 16 +; CHECK: load i32, i32* %arrayidx, align 16 ; CHECK: ret i32 %add.lcssa } @@ -156,8 +156,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ -4, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 4 %1 = trunc i64 %indvars.iv.next to i32 @@ -169,7 +169,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @koo2 -; CHECK: load i32* %arrayidx, align 16 +; CHECK: load i32, i32* %arrayidx, align 16 ; CHECK: ret i32 %add.lcssa } diff --git a/test/Transforms/AlignmentFromAssumptions/simple32.ll b/test/Transforms/AlignmentFromAssumptions/simple32.ll index 166e7ef..2edc2e9 100644 --- a/test/Transforms/AlignmentFromAssumptions/simple32.ll +++ b/test/Transforms/AlignmentFromAssumptions/simple32.ll @@ -7,11 +7,11 @@ entry: %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %0 = load i32* %a, align 4 + %0 = load i32, i32* %a, align 4 ret i32 %0 ; CHECK-LABEL: @foo -; CHECK: load i32* {{[^,]+}}, align 32 +; CHECK: load i32, i32* {{[^,]+}}, align 32 ; CHECK: ret i32 } @@ -22,12 +22,12 @@ entry: %maskedptr = and i64 %offsetptr, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %arrayidx = getelementptr inbounds i32* %a, i64 2 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 2 + %0 = load i32, i32* %arrayidx, align 4 ret i32 %0 ; CHECK-LABEL: @foo2 -; CHECK: load i32* {{[^,]+}}, align 16 +; CHECK: load i32, i32* {{[^,]+}}, align 16 ; CHECK: ret i32 } @@ -38,12 +38,12 @@ entry: %maskedptr = and i64 %offsetptr, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %arrayidx = getelementptr inbounds i32* %a, i64 -1 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 -1 + %0 = load i32, i32* %arrayidx, align 4 ret i32 %0 ; CHECK-LABEL: @foo2a -; CHECK: load i32* {{[^,]+}}, align 32 +; CHECK: load i32, i32* {{[^,]+}}, align 32 ; CHECK: ret i32 } @@ -53,11 +53,11 @@ entry: %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %0 = load i32* %a, align 4 + %0 = load i32, i32* %a, align 4 ret i32 %0 ; CHECK-LABEL: @goo -; CHECK: load i32* {{[^,]+}}, align 32 +; CHECK: load i32, i32* {{[^,]+}}, align 32 ; CHECK: ret i32 } @@ -72,8 +72,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 8 %1 = trunc i64 %indvars.iv.next to i32 @@ -85,7 +85,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @hoo -; CHECK: load i32* %arrayidx, align 32 +; CHECK: load i32, i32* %arrayidx, align 32 ; CHECK: ret i32 %add.lcssa } @@ -100,8 +100,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 4, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 8 %1 = trunc i64 %indvars.iv.next to i32 @@ -113,7 +113,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @joo -; CHECK: load i32* %arrayidx, align 16 +; CHECK: load i32, i32* %arrayidx, align 16 ; CHECK: ret i32 %add.lcssa } @@ -128,8 +128,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 4 %1 = trunc i64 %indvars.iv.next to i32 @@ -141,7 +141,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @koo -; CHECK: load i32* %arrayidx, align 16 +; CHECK: load i32, i32* %arrayidx, align 16 ; CHECK: ret i32 %add.lcssa } @@ -156,8 +156,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ -4, %entry ], [ %indvars.iv.next, %for.body ] %r.06 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.06 %indvars.iv.next = add i64 %indvars.iv, 4 %1 = trunc i64 %indvars.iv.next to i32 @@ -169,7 +169,7 @@ for.end: ; preds = %for.body ret i32 %add.lcssa ; CHECK-LABEL: @koo2 -; CHECK: load i32* %arrayidx, align 16 +; CHECK: load i32, i32* %arrayidx, align 16 ; CHECK: ret i32 %add.lcssa } diff --git a/test/Transforms/AlignmentFromAssumptions/start-unk.ll b/test/Transforms/AlignmentFromAssumptions/start-unk.ll index b7fe249..99533cf 100644 --- a/test/Transforms/AlignmentFromAssumptions/start-unk.ll +++ b/test/Transforms/AlignmentFromAssumptions/start-unk.ll @@ -79,13 +79,13 @@ if.then126: ; preds = %if.end123 %maskcond.i.i187 = icmp eq i64 %maskedptr.i.i186, 0 tail call void @llvm.assume(i1 %maskcond.i.i187) #0 %ret.0..sroa_cast.i.i188 = bitcast %type1* undef to i32* - %ret.0.copyload.i.i189 = load i32* %ret.0..sroa_cast.i.i188, align 2 + %ret.0.copyload.i.i189 = load i32, i32* %ret.0..sroa_cast.i.i188, align 2 ; CHECK: load {{.*}} align 2 %0 = tail call i32 @llvm.bswap.i32(i32 %ret.0.copyload.i.i189) #0 %conv131 = zext i32 %0 to i64 - %add.ptr132 = getelementptr inbounds i8* undef, i64 %conv131 + %add.ptr132 = getelementptr inbounds i8, i8* undef, i64 %conv131 %1 = bitcast i8* %add.ptr132 to %type1* br i1 undef, label %if.end150, label %if.end.i173 @@ -113,11 +113,11 @@ for.body137: ; preds = %test1b.exit, %for.b br i1 undef, label %for.body137.if.end146_crit_edge, label %if.then140 for.body137.if.end146_crit_edge: ; preds = %for.body137 - %incdec.ptr = getelementptr inbounds %type1* %ShndxTable.0309, i64 1 + %incdec.ptr = getelementptr inbounds %type1, %type1* %ShndxTable.0309, i64 1 br i1 undef, label %cond.false.i70, label %cond.end.i if.then140: ; preds = %for.body137 - %ret.0.copyload.i.i102 = load i32* %ret.0..sroa_cast.i.i106, align 2 + %ret.0.copyload.i.i102 = load i32, i32* %ret.0..sroa_cast.i.i106, align 2 ; CHECK: load {{.*}} align 2 diff --git a/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll index 1226b98..c988774 100644 --- a/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll +++ b/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll @@ -3,7 +3,7 @@ ; CHECK: define internal i32 @deref(i32 %x.val) #0 { define internal i32 @deref(i32* %x) nounwind { entry: - %tmp2 = load i32* %x, align 4 + %tmp2 = load i32, i32* %x, align 4 ret i32 %tmp2 } diff --git a/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll b/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll index 210eb97..267a6c0 100644 --- a/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll +++ b/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll @@ -7,14 +7,14 @@ define internal i32 @callee(i1 %C, i32* %A) { entry: ; Unconditonally load the element at %A - %A.0 = load i32* %A + %A.0 = load i32, i32* %A br i1 %C, label %T, label %F T: ret i32 %A.0 F: ; Load the element at offset two from %A. This should not be promoted! - %A.2 = getelementptr i32* %A, i32 2 - %R = load i32* %A.2 + %A.2 = getelementptr i32, i32* %A, i32 2 + %R = load i32, i32* %A.2 ret i32 %R } diff --git a/test/Transforms/ArgumentPromotion/aggregate-promote.ll b/test/Transforms/ArgumentPromotion/aggregate-promote.ll index 12de511..3f521ba 100644 --- a/test/Transforms/ArgumentPromotion/aggregate-promote.ll +++ b/test/Transforms/ArgumentPromotion/aggregate-promote.ll @@ -9,10 +9,10 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 i32 25 } ; <%QuadTy*> [#uses=1] define internal i32 @test(%QuadTy* %P) { - %A = getelementptr %QuadTy* %P, i64 0, i32 3 ; <i32*> [#uses=1] - %B = getelementptr %QuadTy* %P, i64 0, i32 2 ; <i32*> [#uses=1] - %a = load i32* %A ; <i32> [#uses=1] - %b = load i32* %B ; <i32> [#uses=1] + %A = getelementptr %QuadTy, %QuadTy* %P, i64 0, i32 3 ; <i32*> [#uses=1] + %B = getelementptr %QuadTy, %QuadTy* %P, i64 0, i32 2 ; <i32*> [#uses=1] + %a = load i32, i32* %A ; <i32> [#uses=1] + %b = load i32, i32* %B ; <i32> [#uses=1] %V = add i32 %a, %b ; <i32> [#uses=1] ret i32 %V } diff --git a/test/Transforms/ArgumentPromotion/attrs.ll b/test/Transforms/ArgumentPromotion/attrs.ll index 49c0750..46128f9 100644 --- a/test/Transforms/ArgumentPromotion/attrs.ll +++ b/test/Transforms/ArgumentPromotion/attrs.ll @@ -4,8 +4,8 @@ define internal void @f(%struct.ss* byval %b, i32* byval %X, i32 %i) nounwind { entry: - %tmp = getelementptr %struct.ss* %b, i32 0, i32 0 - %tmp1 = load i32* %tmp, align 4 + %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 + %tmp1 = load i32, i32* %tmp, align 4 %tmp2 = add i32 %tmp1, 1 store i32 %tmp2, i32* %tmp, align 4 @@ -16,9 +16,9 @@ entry: define i32 @test(i32* %X) { 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, i32* byval %X, i32 zeroext 0) ret i32 0 diff --git a/test/Transforms/ArgumentPromotion/basictest.ll b/test/Transforms/ArgumentPromotion/basictest.ll index 8f78b98..89888bb 100644 --- a/test/Transforms/ArgumentPromotion/basictest.ll +++ b/test/Transforms/ArgumentPromotion/basictest.ll @@ -3,8 +3,8 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 define internal i32 @test(i32* %X, i32* %Y) { ; CHECK-LABEL: define internal i32 @test(i32 %X.val, i32 %Y.val) - %A = load i32* %X - %B = load i32* %Y + %A = load i32, i32* %X + %B = load i32, i32* %Y %C = add i32 %A, %B ret i32 %C } diff --git a/test/Transforms/ArgumentPromotion/byval-2.ll b/test/Transforms/ArgumentPromotion/byval-2.ll index b412f5e..6c0288f 100644 --- a/test/Transforms/ArgumentPromotion/byval-2.ll +++ b/test/Transforms/ArgumentPromotion/byval-2.ll @@ -8,8 +8,8 @@ define internal void @f(%struct.ss* byval %b, i32* byval %X) nounwind { ; CHECK-LABEL: define internal void @f(i32 %b.0, i64 %b.1, i32* byval %X) entry: - %tmp = getelementptr %struct.ss* %b, i32 0, i32 0 - %tmp1 = load i32* %tmp, align 4 + %tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 + %tmp1 = load i32, i32* %tmp, align 4 %tmp2 = add i32 %tmp1, 1 store i32 %tmp2, i32* %tmp, align 4 @@ -21,9 +21,9 @@ define i32 @test(i32* %X) { ; CHECK-LABEL: define i32 @test entry: %S = alloca %struct.ss - %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 + %tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0 store i32 1, i32* %tmp1, align 8 - %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 + %tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1 store i64 2, i64* %tmp4, align 4 call void @f( %struct.ss* byval %S, i32* byval %X) ; CHECK: call void @f(i32 %{{.*}}, i64 %{{.*}}, i32* byval %{{.*}}) diff --git a/test/Transforms/ArgumentPromotion/byval.ll b/test/Transforms/ArgumentPromotion/byval.ll index 27305e9..b091b09 100644 --- a/test/Transforms/ArgumentPromotion/byval.ll +++ b/test/Transforms/ArgumentPromotion/byval.ll @@ -7,8 +7,8 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 define internal void @f(%struct.ss* byval %b) nounwind { ; CHECK-LABEL: define internal void @f(i32 %b.0, i64 %b.1) 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 @@ -18,9 +18,9 @@ define i32 @main() nounwind { ; CHECK-LABEL: define i32 @main 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 ; CHECK: call void @f(i32 %{{.*}}, i64 %{{.*}}) diff --git a/test/Transforms/ArgumentPromotion/chained.ll b/test/Transforms/ArgumentPromotion/chained.ll index c9a4538..6ba2e8d 100644 --- a/test/Transforms/ArgumentPromotion/chained.ll +++ b/test/Transforms/ArgumentPromotion/chained.ll @@ -5,8 +5,8 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 @G2 = constant i32* @G1 ; <i32**> [#uses=1] define internal i32 @test(i32** %X) { - %Y = load i32** %X ; <i32*> [#uses=1] - %X.upgrd.1 = load i32* %Y ; <i32> [#uses=1] + %Y = load i32*, i32** %X ; <i32*> [#uses=1] + %X.upgrd.1 = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %X.upgrd.1 } diff --git a/test/Transforms/ArgumentPromotion/control-flow.ll b/test/Transforms/ArgumentPromotion/control-flow.ll index e4a61da..cdff36e 100644 --- a/test/Transforms/ArgumentPromotion/control-flow.ll +++ b/test/Transforms/ArgumentPromotion/control-flow.ll @@ -8,7 +8,7 @@ T: ; preds = %0 ret i32 17 F: ; preds = %0 - %X = load i32* %P ; <i32> [#uses=1] + %X = load i32, i32* %P ; <i32> [#uses=1] ret i32 %X } diff --git a/test/Transforms/ArgumentPromotion/control-flow2.ll b/test/Transforms/ArgumentPromotion/control-flow2.ll index db63584..7413f46 100644 --- a/test/Transforms/ArgumentPromotion/control-flow2.ll +++ b/test/Transforms/ArgumentPromotion/control-flow2.ll @@ -1,6 +1,6 @@ ; RUN: opt < %s -argpromotion -S | FileCheck %s -; CHECK: load i32* %A +; CHECK: load i32, i32* %A target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" define internal i32 @callee(i1 %C, i32* %P) { @@ -10,7 +10,7 @@ T: ; preds = %0 ret i32 17 F: ; preds = %0 - %X = load i32* %P ; <i32> [#uses=1] + %X = load i32, i32* %P ; <i32> [#uses=1] ret i32 %X } diff --git a/test/Transforms/ArgumentPromotion/crash.ll b/test/Transforms/ArgumentPromotion/crash.ll index 5e1a037..dbd343a 100644 --- a/test/Transforms/ArgumentPromotion/crash.ll +++ b/test/Transforms/ArgumentPromotion/crash.ll @@ -50,10 +50,10 @@ init: define internal i32 @"clay_assign(Chain, Chain)"(%0* %c, %0* %d) { init: - %0 = getelementptr %0* %d, i32 0, i32 0 - %1 = load %0** %0 - %2 = getelementptr %0* %c, i32 0, i32 0 - %3 = load %0** %2 + %0 = getelementptr %0, %0* %d, i32 0, i32 0 + %1 = load %0*, %0** %0 + %2 = getelementptr %0, %0* %c, i32 0, i32 0 + %3 = load %0*, %0** %2 %4 = call i32 @"clay_assign(Chain, Chain)"(%0* %3, %0* %1) ret i32 0 } diff --git a/test/Transforms/ArgumentPromotion/dbg.ll b/test/Transforms/ArgumentPromotion/dbg.ll index 65cf367..69bd4d2 100644 --- a/test/Transforms/ArgumentPromotion/dbg.ll +++ b/test/Transforms/ArgumentPromotion/dbg.ll @@ -1,12 +1,12 @@ ; RUN: opt < %s -argpromotion -S | FileCheck %s ; CHECK: call void @test(i32 % -; CHECK: void (i32)* @test, {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [test] +; CHECK: !MDSubprogram(name: "test",{{.*}} function: void (i32)* @test declare void @sink(i32) define internal void @test(i32** %X) { - %1 = load i32** %X, align 8 - %2 = load i32* %1, align 8 + %1 = load i32*, i32** %X, align 8 + %2 = load i32, i32* %1, align 8 call void @sink(i32 %2) ret void } @@ -19,8 +19,9 @@ define void @caller(i32** %Y) { !llvm.module.flags = !{!0} !llvm.dbg.cu = !{!3} -!0 = !{i32 2, !"Debug Info Version", i32 2} +!0 = !{i32 2, !"Debug Info Version", i32 3} !1 = !MDLocation(line: 8, scope: !2) -!2 = !{!"0x2e\00test\00test\00\003\001\001\000\006\00256\000\003", null, null, null, null, void (i32**)* @test, null, null, null} ; [ DW_TAG_subprogram ] -!3 = !{!"0x11\004\00clang version 3.5.0 \000\00\000\00\002", null, null, null, !4, null, null} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/blaikie/dev/scratch/pr20038/reduce/<stdin>] [DW_LANG_C_plus_plus] +!2 = !MDSubprogram(name: "test", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, scope: null, function: void (i32**)* @test) +!3 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: !5, subprograms: !4) !4 = !{!2} +!5 = !MDFile(filename: "test.c", directory: "") diff --git a/test/Transforms/ArgumentPromotion/fp80.ll b/test/Transforms/ArgumentPromotion/fp80.ll index a770d60..84ef603 100644 --- a/test/Transforms/ArgumentPromotion/fp80.ll +++ b/test/Transforms/ArgumentPromotion/fp80.ll @@ -24,22 +24,22 @@ entry: define internal i8 @UseLongDoubleUnsafely(%union.u* byval align 16 %arg) { entry: %bitcast = bitcast %union.u* %arg to %struct.s* - %gep = getelementptr inbounds %struct.s* %bitcast, i64 0, i32 2 - %result = load i8* %gep + %gep = getelementptr inbounds %struct.s, %struct.s* %bitcast, i64 0, i32 2 + %result = load i8, i8* %gep ret i8 %result } ; CHECK: internal x86_fp80 @UseLongDoubleSafely(x86_fp80 {{%.*}}) { define internal x86_fp80 @UseLongDoubleSafely(%union.u* byval align 16 %arg) { - %gep = getelementptr inbounds %union.u* %arg, i64 0, i32 0 - %fp80 = load x86_fp80* %gep + %gep = getelementptr inbounds %union.u, %union.u* %arg, i64 0, i32 0 + %fp80 = load x86_fp80, x86_fp80* %gep ret x86_fp80 %fp80 } ; CHECK: define internal i64 @AccessPaddingOfStruct(%struct.Foo* byval %a) { define internal i64 @AccessPaddingOfStruct(%struct.Foo* byval %a) { %p = bitcast %struct.Foo* %a to i64* - %v = load i64* %p + %v = load i64, i64* %p ret i64 %v } @@ -53,6 +53,6 @@ loop: %phi = phi %struct.Foo* [ null, %entry ], [ %gep, %loop ] %0 = phi %struct.Foo* [ %a, %entry ], [ %0, %loop ] store %struct.Foo* %phi, %struct.Foo** %a_ptr - %gep = getelementptr %struct.Foo* %a, i64 0 + %gep = getelementptr %struct.Foo, %struct.Foo* %a, i64 0 br label %loop } diff --git a/test/Transforms/ArgumentPromotion/inalloca.ll b/test/Transforms/ArgumentPromotion/inalloca.ll index 089a78f..80bd6fd 100644 --- a/test/Transforms/ArgumentPromotion/inalloca.ll +++ b/test/Transforms/ArgumentPromotion/inalloca.ll @@ -7,10 +7,10 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 ; Argpromote + scalarrepl should change this to passing the two integers by value. define internal i32 @f(%struct.ss* inalloca %s) { entry: - %f0 = getelementptr %struct.ss* %s, i32 0, i32 0 - %f1 = getelementptr %struct.ss* %s, i32 0, i32 1 - %a = load i32* %f0, align 4 - %b = load i32* %f1, align 4 + %f0 = getelementptr %struct.ss, %struct.ss* %s, i32 0, i32 0 + %f1 = getelementptr %struct.ss, %struct.ss* %s, i32 0, i32 1 + %a = load i32, i32* %f0, align 4 + %b = load i32, i32* %f1, align 4 %r = add i32 %a, %b ret i32 %r } @@ -21,8 +21,8 @@ entry: define i32 @main() { entry: %S = alloca inalloca %struct.ss - %f0 = getelementptr %struct.ss* %S, i32 0, i32 0 - %f1 = getelementptr %struct.ss* %S, i32 0, i32 1 + %f0 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0 + %f1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1 store i32 1, i32* %f0, align 4 store i32 2, i32* %f1, align 4 %r = call i32 @f(%struct.ss* inalloca %S) diff --git a/test/Transforms/ArgumentPromotion/reserve-tbaa.ll b/test/Transforms/ArgumentPromotion/reserve-tbaa.ll index db9d70d..3c8ed79 100644 --- a/test/Transforms/ArgumentPromotion/reserve-tbaa.ll +++ b/test/Transforms/ArgumentPromotion/reserve-tbaa.ll @@ -14,9 +14,9 @@ define internal fastcc void @fn(i32* nocapture readonly %p1, i64* nocapture readonly %p2) { entry: - %0 = load i64* %p2, align 8, !tbaa !1 + %0 = load i64, i64* %p2, align 8, !tbaa !1 %conv = trunc i64 %0 to i32 - %1 = load i32* %p1, align 4, !tbaa !5 + %1 = load i32, i32* %p1, align 4, !tbaa !5 %conv1 = trunc i32 %1 to i8 store i8 %conv1, i8* @d, align 1, !tbaa !7 ret void @@ -26,11 +26,11 @@ define i32 @main() { entry: ; CHECK-LABEL: main ; CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa ![[I32:[0-9]+]] -; CHECK: %g.val = load i32* @g, align 4, !tbaa ![[I32]] -; CHECK: %c.val = load i64* @c, align 8, !tbaa ![[LONG:[0-9]+]] - %0 = load i32*** @e, align 8, !tbaa !8 +; CHECK: %g.val = load i32, i32* @g, align 4, !tbaa ![[I32]] +; CHECK: %c.val = load i64, i64* @c, align 8, !tbaa ![[LONG:[0-9]+]] + %0 = load i32**, i32*** @e, align 8, !tbaa !8 store i32* @g, i32** %0, align 8, !tbaa !8 - %1 = load i32** @a, align 8, !tbaa !8 + %1 = load i32*, i32** @a, align 8, !tbaa !8 store i32 1, i32* %1, align 4, !tbaa !5 call fastcc void @fn(i32* @g, i64* @c) diff --git a/test/Transforms/BBVectorize/X86/loop1.ll b/test/Transforms/BBVectorize/X86/loop1.ll index 4018084..c3c3045 100644 --- a/test/Transforms/BBVectorize/X86/loop1.ll +++ b/test/Transforms/BBVectorize/X86/loop1.ll @@ -12,10 +12,10 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds double* %in1, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 - %arrayidx2 = getelementptr inbounds double* %in2, i64 %indvars.iv - %1 = load double* %arrayidx2, align 8 + %arrayidx = getelementptr inbounds double, double* %in1, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 + %arrayidx2 = getelementptr inbounds double, double* %in2, i64 %indvars.iv + %1 = load double, double* %arrayidx2, align 8 %mul = fmul double %0, %0 %mul3 = fmul double %0, %1 %add = fadd double %mul, %mul3 @@ -28,7 +28,7 @@ for.body: ; preds = %for.body, %entry %add10 = fadd double %add9, %0 %mul11 = fmul double %mul8, %add10 %add12 = fadd double %add7, %mul11 - %arrayidx14 = getelementptr inbounds double* %out, i64 %indvars.iv + %arrayidx14 = getelementptr inbounds double, double* %out, i64 %indvars.iv store double %add12, double* %arrayidx14, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/BBVectorize/X86/pr15289.ll b/test/Transforms/BBVectorize/X86/pr15289.ll index 42bd0ff..a383a26 100644 --- a/test/Transforms/BBVectorize/X86/pr15289.ll +++ b/test/Transforms/BBVectorize/X86/pr15289.ll @@ -44,43 +44,43 @@ entry: %12 = fsub double undef, %7 %13 = fmul double %3, %12 %14 = fmul double %3, undef - %15 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 0, i32 0 + %15 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 0, i32 0 store double %13, double* %15, align 8 - %16 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 0, i32 1 + %16 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 0, i32 1 %17 = fmul double undef, %8 %18 = fmul double %17, undef %19 = fmul double undef, %18 %20 = fadd double undef, undef %21 = fmul double %3, %19 %22 = fsub double -0.000000e+00, %21 - %23 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 1, i32 0 + %23 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 1, i32 0 store double %22, double* %23, align 8 - %24 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 1, i32 1 + %24 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 1, i32 1 %25 = fmul double undef, 0x3FE42F601A8C6794 %26 = fmul double undef, 2.000000e+00 %27 = fsub double %26, %0 %28 = fmul double %6, undef %29 = fsub double undef, %28 - %30 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 2, i32 0 + %30 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 2, i32 0 store double undef, double* %30, align 8 - %31 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 2, i32 1 + %31 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 2, i32 1 %32 = fmul double undef, %17 %33 = fmul double undef, %17 %34 = fmul double undef, %32 %35 = fmul double undef, %33 %36 = fsub double undef, %35 %37 = fmul double %3, %34 - %38 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 3, i32 0 + %38 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 3, i32 0 store double %37, double* %38, align 8 - %39 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 3, i32 1 + %39 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 3, i32 1 %40 = fmul double undef, %8 %41 = fmul double undef, %40 %42 = fmul double undef, %41 %43 = fsub double undef, %42 %44 = fmul double %3, %43 - %45 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 4, i32 0 + %45 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 4, i32 0 store double %13, double* %45, align 8 - %46 = getelementptr inbounds [5 x { double, double }]* %c2ten, i64 0, i64 4, i32 1 + %46 = getelementptr inbounds [5 x { double, double }], [5 x { double, double }]* %c2ten, i64 0, i64 4, i32 1 %47 = fsub double -0.000000e+00, %14 store double %47, double* %16, align 8 store double undef, double* %24, align 8 diff --git a/test/Transforms/BBVectorize/X86/sh-rec.ll b/test/Transforms/BBVectorize/X86/sh-rec.ll index ad75fc9..2cb9dbd 100644 --- a/test/Transforms/BBVectorize/X86/sh-rec.ll +++ b/test/Transforms/BBVectorize/X86/sh-rec.ll @@ -8,39 +8,39 @@ entry: br i1 undef, label %return, label %if.end10 if.end10: ; preds = %entry - %incdec.ptr = getelementptr inbounds i8* %call, i64 undef + %incdec.ptr = getelementptr inbounds i8, i8* %call, i64 undef %call17 = call i32 @ptou() nounwind - %incdec.ptr26.1 = getelementptr inbounds i8* %incdec.ptr, i64 -2 + %incdec.ptr26.1 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -2 store i8 undef, i8* %incdec.ptr26.1, align 1 %div27.1 = udiv i32 %call17, 100 %rem.2 = urem i32 %div27.1, 10 %add2230.2 = or i32 %rem.2, 48 %conv25.2 = trunc i32 %add2230.2 to i8 - %incdec.ptr26.2 = getelementptr inbounds i8* %incdec.ptr, i64 -3 + %incdec.ptr26.2 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -3 store i8 %conv25.2, i8* %incdec.ptr26.2, align 1 - %incdec.ptr26.3 = getelementptr inbounds i8* %incdec.ptr, i64 -4 + %incdec.ptr26.3 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -4 store i8 undef, i8* %incdec.ptr26.3, align 1 %div27.3 = udiv i32 %call17, 10000 %rem.4 = urem i32 %div27.3, 10 %add2230.4 = or i32 %rem.4, 48 %conv25.4 = trunc i32 %add2230.4 to i8 - %incdec.ptr26.4 = getelementptr inbounds i8* %incdec.ptr, i64 -5 + %incdec.ptr26.4 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -5 store i8 %conv25.4, i8* %incdec.ptr26.4, align 1 %div27.4 = udiv i32 %call17, 100000 %rem.5 = urem i32 %div27.4, 10 %add2230.5 = or i32 %rem.5, 48 %conv25.5 = trunc i32 %add2230.5 to i8 - %incdec.ptr26.5 = getelementptr inbounds i8* %incdec.ptr, i64 -6 + %incdec.ptr26.5 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -6 store i8 %conv25.5, i8* %incdec.ptr26.5, align 1 - %incdec.ptr26.6 = getelementptr inbounds i8* %incdec.ptr, i64 -7 + %incdec.ptr26.6 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -7 store i8 0, i8* %incdec.ptr26.6, align 1 - %incdec.ptr26.7 = getelementptr inbounds i8* %incdec.ptr, i64 -8 + %incdec.ptr26.7 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -8 store i8 undef, i8* %incdec.ptr26.7, align 1 %div27.7 = udiv i32 %call17, 100000000 %rem.8 = urem i32 %div27.7, 10 %add2230.8 = or i32 %rem.8, 48 %conv25.8 = trunc i32 %add2230.8 to i8 - %incdec.ptr26.8 = getelementptr inbounds i8* %incdec.ptr, i64 -9 + %incdec.ptr26.8 = getelementptr inbounds i8, i8* %incdec.ptr, i64 -9 store i8 %conv25.8, i8* %incdec.ptr26.8, align 1 unreachable diff --git a/test/Transforms/BBVectorize/X86/sh-rec2.ll b/test/Transforms/BBVectorize/X86/sh-rec2.ll index d65ac1c..d7a004c 100644 --- a/test/Transforms/BBVectorize/X86/sh-rec2.ll +++ b/test/Transforms/BBVectorize/X86/sh-rec2.ll @@ -7,72 +7,72 @@ target triple = "x86_64-unknown-linux-gnu" define void @gsm_encode(%struct.gsm_state.2.8.14.15.16.17.19.22.23.25.26.28.29.31.32.33.35.36.37.38.40.41.42.44.45.47.48.50.52.53.54.56.57.58.59.60.61.62.63.66.73.83.84.89.90.91.92.93.94.95.96.99.100.101.102.103.104.106.107.114.116.121.122.129.130.135.136.137.138.139.140.141.142.143.144.147.148.149.158.159.160.161.164.165.166.167.168.169.172.179.181.182.183.188.195.200.201.202.203.204.205.208.209.210.212.213.214.215.222.223.225.226.230.231.232.233.234.235.236.237.238.239.240.241.242.243.244.352* %s, i16* %source, i8* %c) nounwind uwtable { entry: %xmc = alloca [52 x i16], align 16 - %arraydecay5 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 0 + %arraydecay5 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 0 call void @Gsm_Coder(%struct.gsm_state.2.8.14.15.16.17.19.22.23.25.26.28.29.31.32.33.35.36.37.38.40.41.42.44.45.47.48.50.52.53.54.56.57.58.59.60.61.62.63.66.73.83.84.89.90.91.92.93.94.95.96.99.100.101.102.103.104.106.107.114.116.121.122.129.130.135.136.137.138.139.140.141.142.143.144.147.148.149.158.159.160.161.164.165.166.167.168.169.172.179.181.182.183.188.195.200.201.202.203.204.205.208.209.210.212.213.214.215.222.223.225.226.230.231.232.233.234.235.236.237.238.239.240.241.242.243.244.352* %s, i16* %source, i16* undef, i16* null, i16* undef, i16* undef, i16* undef, i16* %arraydecay5) nounwind - %incdec.ptr136 = getelementptr inbounds i8* %c, i64 10 - %incdec.ptr157 = getelementptr inbounds i8* %c, i64 11 + %incdec.ptr136 = getelementptr inbounds i8, i8* %c, i64 10 + %incdec.ptr157 = getelementptr inbounds i8, i8* %c, i64 11 store i8 0, i8* %incdec.ptr136, align 1 - %arrayidx162 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 11 - %0 = load i16* %arrayidx162, align 2 + %arrayidx162 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 11 + %0 = load i16, i16* %arrayidx162, align 2 %conv1631 = trunc i16 %0 to i8 %and164 = shl i8 %conv1631, 3 %shl165 = and i8 %and164, 56 - %incdec.ptr172 = getelementptr inbounds i8* %c, i64 12 + %incdec.ptr172 = getelementptr inbounds i8, i8* %c, i64 12 store i8 %shl165, i8* %incdec.ptr157, align 1 - %1 = load i16* inttoptr (i64 2 to i16*), align 2 + %1 = load i16, i16* inttoptr (i64 2 to i16*), align 2 %conv1742 = trunc i16 %1 to i8 %and175 = shl i8 %conv1742, 1 - %incdec.ptr183 = getelementptr inbounds i8* %c, i64 13 + %incdec.ptr183 = getelementptr inbounds i8, i8* %c, i64 13 store i8 %and175, i8* %incdec.ptr172, align 1 - %incdec.ptr199 = getelementptr inbounds i8* %c, i64 14 + %incdec.ptr199 = getelementptr inbounds i8, i8* %c, i64 14 store i8 0, i8* %incdec.ptr183, align 1 - %arrayidx214 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 15 - %incdec.ptr220 = getelementptr inbounds i8* %c, i64 15 + %arrayidx214 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 15 + %incdec.ptr220 = getelementptr inbounds i8, i8* %c, i64 15 store i8 0, i8* %incdec.ptr199, align 1 - %2 = load i16* %arrayidx214, align 2 + %2 = load i16, i16* %arrayidx214, align 2 %conv2223 = trunc i16 %2 to i8 %and223 = shl i8 %conv2223, 6 - %incdec.ptr235 = getelementptr inbounds i8* %c, i64 16 + %incdec.ptr235 = getelementptr inbounds i8, i8* %c, i64 16 store i8 %and223, i8* %incdec.ptr220, align 1 - %arrayidx240 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 19 - %3 = load i16* %arrayidx240, align 2 + %arrayidx240 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 19 + %3 = load i16, i16* %arrayidx240, align 2 %conv2414 = trunc i16 %3 to i8 %and242 = shl i8 %conv2414, 2 %shl243 = and i8 %and242, 28 - %incdec.ptr251 = getelementptr inbounds i8* %c, i64 17 + %incdec.ptr251 = getelementptr inbounds i8, i8* %c, i64 17 store i8 %shl243, i8* %incdec.ptr235, align 1 - %incdec.ptr272 = getelementptr inbounds i8* %c, i64 18 + %incdec.ptr272 = getelementptr inbounds i8, i8* %c, i64 18 store i8 0, i8* %incdec.ptr251, align 1 - %arrayidx282 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 25 - %4 = load i16* %arrayidx282, align 2 + %arrayidx282 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 25 + %4 = load i16, i16* %arrayidx282, align 2 %conv2835 = trunc i16 %4 to i8 %and284 = and i8 %conv2835, 7 - %incdec.ptr287 = getelementptr inbounds i8* %c, i64 19 + %incdec.ptr287 = getelementptr inbounds i8, i8* %c, i64 19 store i8 %and284, i8* %incdec.ptr272, align 1 - %incdec.ptr298 = getelementptr inbounds i8* %c, i64 20 + %incdec.ptr298 = getelementptr inbounds i8, i8* %c, i64 20 store i8 0, i8* %incdec.ptr287, align 1 - %incdec.ptr314 = getelementptr inbounds i8* %c, i64 21 + %incdec.ptr314 = getelementptr inbounds i8, i8* %c, i64 21 store i8 0, i8* %incdec.ptr298, align 1 - %arrayidx319 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 26 - %5 = load i16* %arrayidx319, align 4 + %arrayidx319 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 26 + %5 = load i16, i16* %arrayidx319, align 4 %conv3206 = trunc i16 %5 to i8 %and321 = shl i8 %conv3206, 4 %shl322 = and i8 %and321, 112 - %incdec.ptr335 = getelementptr inbounds i8* %c, i64 22 + %incdec.ptr335 = getelementptr inbounds i8, i8* %c, i64 22 store i8 %shl322, i8* %incdec.ptr314, align 1 - %arrayidx340 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 29 - %6 = load i16* %arrayidx340, align 2 + %arrayidx340 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 29 + %6 = load i16, i16* %arrayidx340, align 2 %conv3417 = trunc i16 %6 to i8 %and342 = shl i8 %conv3417, 3 %shl343 = and i8 %and342, 56 - %incdec.ptr350 = getelementptr inbounds i8* %c, i64 23 + %incdec.ptr350 = getelementptr inbounds i8, i8* %c, i64 23 store i8 %shl343, i8* %incdec.ptr335, align 1 - %incdec.ptr366 = getelementptr inbounds i8* %c, i64 24 + %incdec.ptr366 = getelementptr inbounds i8, i8* %c, i64 24 store i8 0, i8* %incdec.ptr350, align 1 - %arrayidx381 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 36 - %incdec.ptr387 = getelementptr inbounds i8* %c, i64 25 + %arrayidx381 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 36 + %incdec.ptr387 = getelementptr inbounds i8, i8* %c, i64 25 store i8 0, i8* %incdec.ptr366, align 1 - %7 = load i16* %arrayidx381, align 8 + %7 = load i16, i16* %arrayidx381, align 8 %conv3898 = trunc i16 %7 to i8 %and390 = shl i8 %conv3898, 6 store i8 %and390, i8* %incdec.ptr387, align 1 diff --git a/test/Transforms/BBVectorize/X86/sh-rec3.ll b/test/Transforms/BBVectorize/X86/sh-rec3.ll index ad880ed..2096deb 100644 --- a/test/Transforms/BBVectorize/X86/sh-rec3.ll +++ b/test/Transforms/BBVectorize/X86/sh-rec3.ll @@ -7,153 +7,153 @@ target triple = "x86_64-unknown-linux-gnu" define void @gsm_encode(%struct.gsm_state.2.8.39.44.45.55.56.57.58.59.62.63.64.65.74.75.76.77.80.87.92.93.94.95.96.97.110.111.112.113.114.128.130.135.136.137.138.139.140.141.142.143.144.145.148.149.150.151.152.169.170.177.178.179.184.185.186.187.188.201.208.209.219.220.221.223.224.225.230.231.232.233.235.236.237.238.245.246.248.249.272.274.279.280.281.282.283.286.293.298.299.314.315.316.317.318.319.320.321.322.323.324.325.326.327.328.329.330.331.332.333.334.335.336.337.338.339.340.341.342.343.344.345.346.347.348.349.350.351.352.353.565* %s, i16* %source, i8* %c) nounwind uwtable { entry: %LARc28 = alloca [2 x i64], align 16 - %LARc28.sub = getelementptr inbounds [2 x i64]* %LARc28, i64 0, i64 0 + %LARc28.sub = getelementptr inbounds [2 x i64], [2 x i64]* %LARc28, i64 0, i64 0 %tmpcast = bitcast [2 x i64]* %LARc28 to [8 x i16]* %Nc = alloca [4 x i16], align 2 %Mc = alloca [4 x i16], align 2 %bc = alloca [4 x i16], align 2 %xmc = alloca [52 x i16], align 16 %arraydecay = bitcast [2 x i64]* %LARc28 to i16* - %arraydecay1 = getelementptr inbounds [4 x i16]* %Nc, i64 0, i64 0 - %arraydecay2 = getelementptr inbounds [4 x i16]* %bc, i64 0, i64 0 - %arraydecay3 = getelementptr inbounds [4 x i16]* %Mc, i64 0, i64 0 - %arraydecay5 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 0 + %arraydecay1 = getelementptr inbounds [4 x i16], [4 x i16]* %Nc, i64 0, i64 0 + %arraydecay2 = getelementptr inbounds [4 x i16], [4 x i16]* %bc, i64 0, i64 0 + %arraydecay3 = getelementptr inbounds [4 x i16], [4 x i16]* %Mc, i64 0, i64 0 + %arraydecay5 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 0 call void @Gsm_Coder(%struct.gsm_state.2.8.39.44.45.55.56.57.58.59.62.63.64.65.74.75.76.77.80.87.92.93.94.95.96.97.110.111.112.113.114.128.130.135.136.137.138.139.140.141.142.143.144.145.148.149.150.151.152.169.170.177.178.179.184.185.186.187.188.201.208.209.219.220.221.223.224.225.230.231.232.233.235.236.237.238.245.246.248.249.272.274.279.280.281.282.283.286.293.298.299.314.315.316.317.318.319.320.321.322.323.324.325.326.327.328.329.330.331.332.333.334.335.336.337.338.339.340.341.342.343.344.345.346.347.348.349.350.351.352.353.565* %s, i16* %source, i16* %arraydecay, i16* %arraydecay1, i16* %arraydecay2, i16* %arraydecay3, i16* undef, i16* %arraydecay5) nounwind - %0 = load i64* %LARc28.sub, align 16 + %0 = load i64, i64* %LARc28.sub, align 16 %1 = trunc i64 %0 to i32 %conv1 = lshr i32 %1, 2 %and = and i32 %conv1, 15 %or = or i32 %and, 208 %conv6 = trunc i32 %or to i8 - %incdec.ptr = getelementptr inbounds i8* %c, i64 1 + %incdec.ptr = getelementptr inbounds i8, i8* %c, i64 1 store i8 %conv6, i8* %c, align 1 %conv84 = trunc i64 %0 to i8 %and9 = shl i8 %conv84, 6 - %incdec.ptr15 = getelementptr inbounds i8* %c, i64 2 + %incdec.ptr15 = getelementptr inbounds i8, i8* %c, i64 2 store i8 %and9, i8* %incdec.ptr, align 1 %2 = lshr i64 %0, 50 %shr226.tr = trunc i64 %2 to i8 %conv25 = and i8 %shr226.tr, 7 - %incdec.ptr26 = getelementptr inbounds i8* %c, i64 3 + %incdec.ptr26 = getelementptr inbounds i8, i8* %c, i64 3 store i8 %conv25, i8* %incdec.ptr15, align 1 - %incdec.ptr42 = getelementptr inbounds i8* %c, i64 4 + %incdec.ptr42 = getelementptr inbounds i8, i8* %c, i64 4 store i8 0, i8* %incdec.ptr26, align 1 - %arrayidx52 = getelementptr inbounds [8 x i16]* %tmpcast, i64 0, i64 7 - %3 = load i16* %arrayidx52, align 2 + %arrayidx52 = getelementptr inbounds [8 x i16], [8 x i16]* %tmpcast, i64 0, i64 7 + %3 = load i16, i16* %arrayidx52, align 2 %conv537 = trunc i16 %3 to i8 %and54 = and i8 %conv537, 7 - %incdec.ptr57 = getelementptr inbounds i8* %c, i64 5 + %incdec.ptr57 = getelementptr inbounds i8, i8* %c, i64 5 store i8 %and54, i8* %incdec.ptr42, align 1 - %incdec.ptr68 = getelementptr inbounds i8* %c, i64 6 + %incdec.ptr68 = getelementptr inbounds i8, i8* %c, i64 6 store i8 0, i8* %incdec.ptr57, align 1 - %4 = load i16* %arraydecay3, align 2 + %4 = load i16, i16* %arraydecay3, align 2 %conv748 = trunc i16 %4 to i8 %and75 = shl i8 %conv748, 5 %shl76 = and i8 %and75, 96 - %incdec.ptr84 = getelementptr inbounds i8* %c, i64 7 + %incdec.ptr84 = getelementptr inbounds i8, i8* %c, i64 7 store i8 %shl76, i8* %incdec.ptr68, align 1 - %arrayidx94 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 1 - %5 = load i16* %arrayidx94, align 2 + %arrayidx94 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 1 + %5 = load i16, i16* %arrayidx94, align 2 %conv959 = trunc i16 %5 to i8 %and96 = shl i8 %conv959, 1 %shl97 = and i8 %and96, 14 %or103 = or i8 %shl97, 1 - %incdec.ptr105 = getelementptr inbounds i8* %c, i64 8 + %incdec.ptr105 = getelementptr inbounds i8, i8* %c, i64 8 store i8 %or103, i8* %incdec.ptr84, align 1 - %arrayidx115 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 4 + %arrayidx115 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 4 %6 = bitcast i16* %arrayidx115 to i32* - %7 = load i32* %6, align 8 + %7 = load i32, i32* %6, align 8 %conv11610 = trunc i32 %7 to i8 %and117 = and i8 %conv11610, 7 - %incdec.ptr120 = getelementptr inbounds i8* %c, i64 9 + %incdec.ptr120 = getelementptr inbounds i8, i8* %c, i64 9 store i8 %and117, i8* %incdec.ptr105, align 1 %8 = lshr i32 %7, 16 %and12330 = shl nuw nsw i32 %8, 5 %and123 = trunc i32 %and12330 to i8 - %incdec.ptr136 = getelementptr inbounds i8* %c, i64 10 + %incdec.ptr136 = getelementptr inbounds i8, i8* %c, i64 10 store i8 %and123, i8* %incdec.ptr120, align 1 - %incdec.ptr157 = getelementptr inbounds i8* %c, i64 11 + %incdec.ptr157 = getelementptr inbounds i8, i8* %c, i64 11 store i8 0, i8* %incdec.ptr136, align 1 - %incdec.ptr172 = getelementptr inbounds i8* %c, i64 12 + %incdec.ptr172 = getelementptr inbounds i8, i8* %c, i64 12 store i8 0, i8* %incdec.ptr157, align 1 - %arrayidx173 = getelementptr inbounds [4 x i16]* %Nc, i64 0, i64 1 - %9 = load i16* %arrayidx173, align 2 + %arrayidx173 = getelementptr inbounds [4 x i16], [4 x i16]* %Nc, i64 0, i64 1 + %9 = load i16, i16* %arrayidx173, align 2 %conv17412 = zext i16 %9 to i32 %and175 = shl nuw nsw i32 %conv17412, 1 - %arrayidx177 = getelementptr inbounds [4 x i16]* %bc, i64 0, i64 1 - %10 = load i16* %arrayidx177, align 2 + %arrayidx177 = getelementptr inbounds [4 x i16], [4 x i16]* %bc, i64 0, i64 1 + %10 = load i16, i16* %arrayidx177, align 2 %conv17826 = zext i16 %10 to i32 %shr17913 = lshr i32 %conv17826, 1 %and180 = and i32 %shr17913, 1 %or181 = or i32 %and175, %and180 %conv182 = trunc i32 %or181 to i8 - %incdec.ptr183 = getelementptr inbounds i8* %c, i64 13 + %incdec.ptr183 = getelementptr inbounds i8, i8* %c, i64 13 store i8 %conv182, i8* %incdec.ptr172, align 1 - %arrayidx188 = getelementptr inbounds [4 x i16]* %Mc, i64 0, i64 1 - %11 = load i16* %arrayidx188, align 2 + %arrayidx188 = getelementptr inbounds [4 x i16], [4 x i16]* %Mc, i64 0, i64 1 + %11 = load i16, i16* %arrayidx188, align 2 %conv18914 = trunc i16 %11 to i8 %and190 = shl i8 %conv18914, 5 %shl191 = and i8 %and190, 96 - %incdec.ptr199 = getelementptr inbounds i8* %c, i64 14 + %incdec.ptr199 = getelementptr inbounds i8, i8* %c, i64 14 store i8 %shl191, i8* %incdec.ptr183, align 1 - %arrayidx209 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 14 - %12 = load i16* %arrayidx209, align 4 + %arrayidx209 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 14 + %12 = load i16, i16* %arrayidx209, align 4 %conv21015 = trunc i16 %12 to i8 %and211 = shl i8 %conv21015, 1 %shl212 = and i8 %and211, 14 %or218 = or i8 %shl212, 1 - %incdec.ptr220 = getelementptr inbounds i8* %c, i64 15 + %incdec.ptr220 = getelementptr inbounds i8, i8* %c, i64 15 store i8 %or218, i8* %incdec.ptr199, align 1 - %arrayidx225 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 16 + %arrayidx225 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 16 %13 = bitcast i16* %arrayidx225 to i64* - %14 = load i64* %13, align 16 + %14 = load i64, i64* %13, align 16 %conv22616 = trunc i64 %14 to i8 %and227 = shl i8 %conv22616, 3 %shl228 = and i8 %and227, 56 - %incdec.ptr235 = getelementptr inbounds i8* %c, i64 16 + %incdec.ptr235 = getelementptr inbounds i8, i8* %c, i64 16 store i8 %shl228, i8* %incdec.ptr220, align 1 %15 = lshr i64 %14, 32 %and23832 = shl nuw nsw i64 %15, 5 %and238 = trunc i64 %and23832 to i8 - %incdec.ptr251 = getelementptr inbounds i8* %c, i64 17 + %incdec.ptr251 = getelementptr inbounds i8, i8* %c, i64 17 store i8 %and238, i8* %incdec.ptr235, align 1 - %arrayidx266 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 23 - %incdec.ptr272 = getelementptr inbounds i8* %c, i64 18 + %arrayidx266 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 23 + %incdec.ptr272 = getelementptr inbounds i8, i8* %c, i64 18 store i8 0, i8* %incdec.ptr251, align 1 - %16 = load i16* %arrayidx266, align 2 + %16 = load i16, i16* %arrayidx266, align 2 %conv27418 = trunc i16 %16 to i8 %and275 = shl i8 %conv27418, 6 - %incdec.ptr287 = getelementptr inbounds i8* %c, i64 19 + %incdec.ptr287 = getelementptr inbounds i8, i8* %c, i64 19 store i8 %and275, i8* %incdec.ptr272, align 1 - %arrayidx288 = getelementptr inbounds [4 x i16]* %Nc, i64 0, i64 2 - %17 = load i16* %arrayidx288, align 2 + %arrayidx288 = getelementptr inbounds [4 x i16], [4 x i16]* %Nc, i64 0, i64 2 + %17 = load i16, i16* %arrayidx288, align 2 %conv28919 = zext i16 %17 to i32 %and290 = shl nuw nsw i32 %conv28919, 1 - %arrayidx292 = getelementptr inbounds [4 x i16]* %bc, i64 0, i64 2 - %18 = load i16* %arrayidx292, align 2 + %arrayidx292 = getelementptr inbounds [4 x i16], [4 x i16]* %bc, i64 0, i64 2 + %18 = load i16, i16* %arrayidx292, align 2 %conv29327 = zext i16 %18 to i32 %shr29420 = lshr i32 %conv29327, 1 %and295 = and i32 %shr29420, 1 %or296 = or i32 %and290, %and295 %conv297 = trunc i32 %or296 to i8 - %incdec.ptr298 = getelementptr inbounds i8* %c, i64 20 + %incdec.ptr298 = getelementptr inbounds i8, i8* %c, i64 20 store i8 %conv297, i8* %incdec.ptr287, align 1 %conv30021 = trunc i16 %18 to i8 %and301 = shl i8 %conv30021, 7 - %incdec.ptr314 = getelementptr inbounds i8* %c, i64 21 + %incdec.ptr314 = getelementptr inbounds i8, i8* %c, i64 21 store i8 %and301, i8* %incdec.ptr298, align 1 - %incdec.ptr335 = getelementptr inbounds i8* %c, i64 22 + %incdec.ptr335 = getelementptr inbounds i8, i8* %c, i64 22 store i8 0, i8* %incdec.ptr314, align 1 - %arrayidx340 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 29 - %19 = load i16* %arrayidx340, align 2 + %arrayidx340 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 29 + %19 = load i16, i16* %arrayidx340, align 2 %conv34122 = trunc i16 %19 to i8 %and342 = shl i8 %conv34122, 3 %shl343 = and i8 %and342, 56 - %incdec.ptr350 = getelementptr inbounds i8* %c, i64 23 + %incdec.ptr350 = getelementptr inbounds i8, i8* %c, i64 23 store i8 %shl343, i8* %incdec.ptr335, align 1 - %arrayidx355 = getelementptr inbounds [52 x i16]* %xmc, i64 0, i64 32 + %arrayidx355 = getelementptr inbounds [52 x i16], [52 x i16]* %xmc, i64 0, i64 32 %20 = bitcast i16* %arrayidx355 to i32* - %21 = load i32* %20, align 16 + %21 = load i32, i32* %20, align 16 %conv35623 = shl i32 %21, 2 %shl358 = and i32 %conv35623, 28 %22 = lshr i32 %21, 17 diff --git a/test/Transforms/BBVectorize/X86/simple-ldstr.ll b/test/Transforms/BBVectorize/X86/simple-ldstr.ll index 1abbc34..2c05f30 100644 --- a/test/Transforms/BBVectorize/X86/simple-ldstr.ll +++ b/test/Transforms/BBVectorize/X86/simple-ldstr.ll @@ -4,23 +4,23 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Simple 3-pair chain with loads and stores define void @test1(double* %a, double* %b, double* %c) nounwind uwtable readonly { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void ; CHECK-LABEL: @test1( ; CHECK: %i0.v.i0 = bitcast double* %a to <2 x double>* ; CHECK: %i1.v.i0 = bitcast double* %b to <2 x double>* -; CHECK: %i0 = load <2 x double>* %i0.v.i0, align 8 -; CHECK: %i1 = load <2 x double>* %i1.v.i0, align 8 +; CHECK: %i0 = load <2 x double>, <2 x double>* %i0.v.i0, align 8 +; CHECK: %i1 = load <2 x double>, <2 x double>* %i1.v.i0, align 8 ; CHECK: %mul = fmul <2 x double> %i0, %i1 ; CHECK: %0 = bitcast double* %c to <2 x double>* ; CHECK: store <2 x double> %mul, <2 x double>* %0, align 8 diff --git a/test/Transforms/BBVectorize/X86/wr-aliases.ll b/test/Transforms/BBVectorize/X86/wr-aliases.ll index 34b1d4e..56448c0 100644 --- a/test/Transforms/BBVectorize/X86/wr-aliases.ll +++ b/test/Transforms/BBVectorize/X86/wr-aliases.ll @@ -27,27 +27,27 @@ arrayctor.cont.ret.exitStub: ; preds = %arrayctor.cont ; CHECK: <2 x double> ; CHECK: @_ZL12printQBezier7QBezier ; CHECK: store double %mul8.i, double* %x3.i, align 16 -; CHECK: load double* %x3.i, align 16 +; CHECK: load double, double* %x3.i, align 16 ; CHECK: ret arrayctor.cont: ; preds = %newFuncRoot - %ref.tmp.sroa.0.0.idx = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 0 + %ref.tmp.sroa.0.0.idx = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 0 store double 1.000000e+01, double* %ref.tmp.sroa.0.0.idx, align 16 - %ref.tmp.sroa.2.0.idx1 = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 1 + %ref.tmp.sroa.2.0.idx1 = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 1 store double 2.000000e+01, double* %ref.tmp.sroa.2.0.idx1, align 8 - %ref.tmp.sroa.3.0.idx2 = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 2 + %ref.tmp.sroa.3.0.idx2 = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 2 store double 3.000000e+01, double* %ref.tmp.sroa.3.0.idx2, align 16 - %ref.tmp.sroa.4.0.idx3 = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 3 + %ref.tmp.sroa.4.0.idx3 = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 3 store double 4.000000e+01, double* %ref.tmp.sroa.4.0.idx3, align 8 - %ref.tmp.sroa.5.0.idx4 = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 4 + %ref.tmp.sroa.5.0.idx4 = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 4 store double 5.000000e+01, double* %ref.tmp.sroa.5.0.idx4, align 16 - %ref.tmp.sroa.6.0.idx5 = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 5 + %ref.tmp.sroa.6.0.idx5 = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 5 store double 6.000000e+01, double* %ref.tmp.sroa.6.0.idx5, align 8 - %ref.tmp.sroa.7.0.idx6 = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 6 + %ref.tmp.sroa.7.0.idx6 = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 6 store double 7.000000e+01, double* %ref.tmp.sroa.7.0.idx6, align 16 - %ref.tmp.sroa.8.0.idx7 = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 7 + %ref.tmp.sroa.8.0.idx7 = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 7 store double 8.000000e+01, double* %ref.tmp.sroa.8.0.idx7, align 8 - %add.ptr = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1 + %add.ptr = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1 %v0 = bitcast %class.QBezier.15* %agg.tmp.i to i8* call void @llvm.lifetime.start(i64 64, i8* %v0) %v1 = bitcast %class.QBezier.15* %agg.tmp55.i to i8* @@ -57,77 +57,77 @@ arrayctor.cont: ; preds = %newFuncRoot %v3 = bitcast [10 x %class.QBezier.15]* %beziers to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %v0, i8* %v3, i64 64, i32 8, i1 false) call fastcc void @_ZL12printQBezier7QBezier(%class.QBezier.15* byval align 8 %agg.tmp.i) - %x2.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 2 - %v4 = load double* %x2.i, align 16 - %x3.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 4 - %v5 = load double* %x3.i, align 16 + %x2.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 2 + %v4 = load double, double* %x2.i, align 16 + %x3.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 4 + %v5 = load double, double* %x3.i, align 16 %add.i = fadd double %v4, %v5 %mul.i = fmul double 5.000000e-01, %add.i - %x1.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 0 - %v6 = load double* %x1.i, align 16 + %x1.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 0 + %v6 = load double, double* %x1.i, align 16 %add3.i = fadd double %v4, %v6 %mul4.i = fmul double 5.000000e-01, %add3.i - %x25.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 2 + %x25.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 2 store double %mul4.i, double* %x25.i, align 16 - %v7 = load double* %x3.i, align 16 - %x4.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 6 - %v8 = load double* %x4.i, align 16 + %v7 = load double, double* %x3.i, align 16 + %x4.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 6 + %v8 = load double, double* %x4.i, align 16 %add7.i = fadd double %v7, %v8 %mul8.i = fmul double 5.000000e-01, %add7.i store double %mul8.i, double* %x3.i, align 16 - %v9 = load double* %x1.i, align 16 - %x111.i = getelementptr inbounds %class.QBezier.15* %add.ptr, i64 0, i32 0 + %v9 = load double, double* %x1.i, align 16 + %x111.i = getelementptr inbounds %class.QBezier.15, %class.QBezier.15* %add.ptr, i64 0, i32 0 store double %v9, double* %x111.i, align 16 - %v10 = load double* %x25.i, align 16 + %v10 = load double, double* %x25.i, align 16 %add15.i = fadd double %mul.i, %v10 %mul16.i = fmul double 5.000000e-01, %add15.i - %x317.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 4 + %x317.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 4 store double %mul16.i, double* %x317.i, align 16 - %v11 = load double* %x3.i, align 16 + %v11 = load double, double* %x3.i, align 16 %add19.i = fadd double %mul.i, %v11 %mul20.i = fmul double 5.000000e-01, %add19.i store double %mul20.i, double* %x2.i, align 16 - %v12 = load double* %x317.i, align 16 + %v12 = load double, double* %x317.i, align 16 %add24.i = fadd double %v12, %mul20.i %mul25.i = fmul double 5.000000e-01, %add24.i store double %mul25.i, double* %x1.i, align 16 - %x427.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 6 + %x427.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 6 store double %mul25.i, double* %x427.i, align 16 - %y2.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 3 - %v13 = load double* %y2.i, align 8 - %y3.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 5 - %v14 = load double* %y3.i, align 8 + %y2.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 3 + %v13 = load double, double* %y2.i, align 8 + %y3.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 5 + %v14 = load double, double* %y3.i, align 8 %add28.i = fadd double %v13, %v14 %div.i = fmul double 5.000000e-01, %add28.i - %y1.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 1 - %v15 = load double* %y1.i, align 8 + %y1.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 1 + %v15 = load double, double* %y1.i, align 8 %add30.i = fadd double %v13, %v15 %mul31.i = fmul double 5.000000e-01, %add30.i - %y232.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 3 + %y232.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 3 store double %mul31.i, double* %y232.i, align 8 - %v16 = load double* %y3.i, align 8 - %y4.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 7 - %v17 = load double* %y4.i, align 8 + %v16 = load double, double* %y3.i, align 8 + %y4.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 0, i32 7 + %v17 = load double, double* %y4.i, align 8 %add34.i = fadd double %v16, %v17 %mul35.i = fmul double 5.000000e-01, %add34.i store double %mul35.i, double* %y3.i, align 8 - %v18 = load double* %y1.i, align 8 - %y138.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 1 + %v18 = load double, double* %y1.i, align 8 + %y138.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 1 store double %v18, double* %y138.i, align 8 - %v19 = load double* %y232.i, align 8 + %v19 = load double, double* %y232.i, align 8 %add42.i = fadd double %div.i, %v19 %mul43.i = fmul double 5.000000e-01, %add42.i - %y344.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 5 + %y344.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 5 store double %mul43.i, double* %y344.i, align 8 - %v20 = load double* %y3.i, align 8 + %v20 = load double, double* %y3.i, align 8 %add46.i = fadd double %div.i, %v20 %mul47.i = fmul double 5.000000e-01, %add46.i store double %mul47.i, double* %y2.i, align 8 - %v21 = load double* %y344.i, align 8 + %v21 = load double, double* %y344.i, align 8 %add51.i = fadd double %v21, %mul47.i %mul52.i = fmul double 5.000000e-01, %add51.i store double %mul52.i, double* %y1.i, align 8 - %y454.i = getelementptr inbounds [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 7 + %y454.i = getelementptr inbounds [10 x %class.QBezier.15], [10 x %class.QBezier.15]* %beziers, i64 0, i64 1, i32 7 store double %mul52.i, double* %y454.i, align 8 %v22 = bitcast %class.QBezier.15* %add.ptr to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %v1, i8* %v22, i64 64, i32 8, i1 false) diff --git a/test/Transforms/BBVectorize/func-alias.ll b/test/Transforms/BBVectorize/func-alias.ll index 9d0cc07..ab72ec0 100644 --- a/test/Transforms/BBVectorize/func-alias.ll +++ b/test/Transforms/BBVectorize/func-alias.ll @@ -47,99 +47,99 @@ codeRepl80.exitStub: ; preds = %"<bb 34>" ret i1 false "<bb 34>": ; preds = %newFuncRoot - %tmp128 = getelementptr inbounds %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 - %tmp129 = getelementptr inbounds %struct.__st_parameter_common* %tmp128, i32 0, i32 2 - store i8* getelementptr inbounds ([11 x i8]* @.cst4, i64 0, i64 0), i8** %tmp129, align 8 - %tmp130 = getelementptr inbounds %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 - %tmp131 = getelementptr inbounds %struct.__st_parameter_common* %tmp130, i32 0, i32 3 + %tmp128 = getelementptr inbounds %struct.__st_parameter_dt, %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 + %tmp129 = getelementptr inbounds %struct.__st_parameter_common, %struct.__st_parameter_common* %tmp128, i32 0, i32 2 + store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.cst4, i64 0, i64 0), i8** %tmp129, align 8 + %tmp130 = getelementptr inbounds %struct.__st_parameter_dt, %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 + %tmp131 = getelementptr inbounds %struct.__st_parameter_common, %struct.__st_parameter_common* %tmp130, i32 0, i32 3 store i32 31495, i32* %tmp131, align 4 - %tmp132 = getelementptr inbounds %struct.__st_parameter_dt* %memtmp3, i32 0, i32 5 - store i8* getelementptr inbounds ([214 x i8]* @.cst823, i64 0, i64 0), i8** %tmp132, align 8 - %tmp133 = getelementptr inbounds %struct.__st_parameter_dt* %memtmp3, i32 0, i32 6 + %tmp132 = getelementptr inbounds %struct.__st_parameter_dt, %struct.__st_parameter_dt* %memtmp3, i32 0, i32 5 + store i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.cst823, i64 0, i64 0), i8** %tmp132, align 8 + %tmp133 = getelementptr inbounds %struct.__st_parameter_dt, %struct.__st_parameter_dt* %memtmp3, i32 0, i32 6 store i32 214, i32* %tmp133, align 4 - %tmp134 = getelementptr inbounds %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 - %tmp135 = getelementptr inbounds %struct.__st_parameter_common* %tmp134, i32 0, i32 0 + %tmp134 = getelementptr inbounds %struct.__st_parameter_dt, %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 + %tmp135 = getelementptr inbounds %struct.__st_parameter_common, %struct.__st_parameter_common* %tmp134, i32 0, i32 0 store i32 4096, i32* %tmp135, align 4 - %iounit.8748_288 = load i32* @__main1_MOD_iounit, align 4 - %tmp136 = getelementptr inbounds %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 - %tmp137 = getelementptr inbounds %struct.__st_parameter_common* %tmp136, i32 0, i32 1 + %iounit.8748_288 = load i32, i32* @__main1_MOD_iounit, align 4 + %tmp136 = getelementptr inbounds %struct.__st_parameter_dt, %struct.__st_parameter_dt* %memtmp3, i32 0, i32 0 + %tmp137 = getelementptr inbounds %struct.__st_parameter_common, %struct.__st_parameter_common* %tmp136, i32 0, i32 1 store i32 %iounit.8748_288, i32* %tmp137, align 4 call void @_gfortran_st_write(%struct.__st_parameter_dt* %memtmp3) nounwind call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_integer_write to void (%struct.__st_parameter_dt*, i32*, i32)*)(%struct.__st_parameter_dt* %memtmp3, i32* @j.4580, i32 4) nounwind ; CHECK: @_gfortran_transfer_integer_write - %D.75807_289 = load i8** getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 0), align 8 - %j.8758_290 = load i32* @j.4580, align 4 + %D.75807_289 = load i8*, i8** getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 0), align 8 + %j.8758_290 = load i32, i32* @j.4580, align 4 %D.75760_291 = sext i32 %j.8758_290 to i64 - %iave.8736_292 = load i32* @__main1_MOD_iave, align 4 + %iave.8736_292 = load i32, i32* @__main1_MOD_iave, align 4 %D.75620_293 = sext i32 %iave.8736_292 to i64 - %D.75808_294 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 2, i32 0), align 8 + %D.75808_294 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 2, i32 0), align 8 %D.75809_295 = mul nsw i64 %D.75620_293, %D.75808_294 - %igrp.8737_296 = load i32* @__main1_MOD_igrp, align 4 + %igrp.8737_296 = load i32, i32* @__main1_MOD_igrp, align 4 %D.75635_297 = sext i32 %igrp.8737_296 to i64 - %D.75810_298 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 1, i32 0), align 8 + %D.75810_298 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 1, i32 0), align 8 %D.75811_299 = mul nsw i64 %D.75635_297, %D.75810_298 %D.75812_300 = add nsw i64 %D.75809_295, %D.75811_299 %D.75813_301 = add nsw i64 %D.75760_291, %D.75812_300 - %ityp.8750_302 = load i32* @__main1_MOD_ityp, align 4 + %ityp.8750_302 = load i32, i32* @__main1_MOD_ityp, align 4 %D.75704_303 = sext i32 %ityp.8750_302 to i64 - %D.75814_304 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 3, i32 0), align 8 + %D.75814_304 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 3, i32 0), align 8 %D.75815_305 = mul nsw i64 %D.75704_303, %D.75814_304 %D.75816_306 = add nsw i64 %D.75813_301, %D.75815_305 - %D.75817_307 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 1), align 8 + %D.75817_307 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 1), align 8 %D.75818_308 = add nsw i64 %D.75816_306, %D.75817_307 %tmp138 = bitcast i8* %D.75807_289 to [0 x float]* %tmp139 = bitcast [0 x float]* %tmp138 to float* - %D.75819_309 = getelementptr inbounds float* %tmp139, i64 %D.75818_308 + %D.75819_309 = getelementptr inbounds float, float* %tmp139, i64 %D.75818_308 call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_real_write to void (%struct.__st_parameter_dt*, float*, i32)*)(%struct.__st_parameter_dt* %memtmp3, float* %D.75819_309, i32 4) nounwind ; CHECK: @_gfortran_transfer_real_write - %D.75820_310 = load i8** getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 0), align 8 - %j.8758_311 = load i32* @j.4580, align 4 + %D.75820_310 = load i8*, i8** getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 0), align 8 + %j.8758_311 = load i32, i32* @j.4580, align 4 %D.75760_312 = sext i32 %j.8758_311 to i64 - %iave.8736_313 = load i32* @__main1_MOD_iave, align 4 + %iave.8736_313 = load i32, i32* @__main1_MOD_iave, align 4 %D.75620_314 = sext i32 %iave.8736_313 to i64 - %D.75821_315 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 2, i32 0), align 8 + %D.75821_315 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 2, i32 0), align 8 %D.75822_316 = mul nsw i64 %D.75620_314, %D.75821_315 - %igrp.8737_317 = load i32* @__main1_MOD_igrp, align 4 + %igrp.8737_317 = load i32, i32* @__main1_MOD_igrp, align 4 %D.75635_318 = sext i32 %igrp.8737_317 to i64 - %D.75823_319 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 1, i32 0), align 8 + %D.75823_319 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 1, i32 0), align 8 %D.75824_320 = mul nsw i64 %D.75635_318, %D.75823_319 %D.75825_321 = add nsw i64 %D.75822_316, %D.75824_320 %D.75826_322 = add nsw i64 %D.75760_312, %D.75825_321 - %ityp.8750_323 = load i32* @__main1_MOD_ityp, align 4 + %ityp.8750_323 = load i32, i32* @__main1_MOD_ityp, align 4 %D.75704_324 = sext i32 %ityp.8750_323 to i64 - %D.75827_325 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 3, i32 0), align 8 + %D.75827_325 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 3, i32 0), align 8 %D.75828_326 = mul nsw i64 %D.75704_324, %D.75827_325 %D.75829_327 = add nsw i64 %D.75826_322, %D.75828_326 - %D.75830_328 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 1), align 8 + %D.75830_328 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 1), align 8 %D.75831_329 = add nsw i64 %D.75829_327, %D.75830_328 %tmp140 = bitcast i8* %D.75820_310 to [0 x [1 x i8]]* %tmp141 = bitcast [0 x [1 x i8]]* %tmp140 to [1 x i8]* - %D.75832_330 = getelementptr inbounds [1 x i8]* %tmp141, i64 %D.75831_329 + %D.75832_330 = getelementptr inbounds [1 x i8], [1 x i8]* %tmp141, i64 %D.75831_329 call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_character_write to void (%struct.__st_parameter_dt*, [1 x i8]*, i32)*)(%struct.__st_parameter_dt* %memtmp3, [1 x i8]* %D.75832_330, i32 1) nounwind ; CHECK: @_gfortran_transfer_character_write - %D.75833_331 = load i8** getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 0), align 8 - %j.8758_332 = load i32* @j.4580, align 4 + %D.75833_331 = load i8*, i8** getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 0), align 8 + %j.8758_332 = load i32, i32* @j.4580, align 4 %D.75760_333 = sext i32 %j.8758_332 to i64 - %iave.8736_334 = load i32* @__main1_MOD_iave, align 4 + %iave.8736_334 = load i32, i32* @__main1_MOD_iave, align 4 %D.75620_335 = sext i32 %iave.8736_334 to i64 - %D.75834_336 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 2, i32 0), align 8 + %D.75834_336 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 2, i32 0), align 8 %D.75835_337 = mul nsw i64 %D.75620_335, %D.75834_336 - %igrp.8737_338 = load i32* @__main1_MOD_igrp, align 4 + %igrp.8737_338 = load i32, i32* @__main1_MOD_igrp, align 4 %D.75635_339 = sext i32 %igrp.8737_338 to i64 - %D.75836_340 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 1, i32 0), align 8 + %D.75836_340 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 1, i32 0), align 8 %D.75837_341 = mul nsw i64 %D.75635_339, %D.75836_340 %D.75838_342 = add nsw i64 %D.75835_337, %D.75837_341 %D.75839_343 = add nsw i64 %D.75760_333, %D.75838_342 - %ityp.8750_344 = load i32* @__main1_MOD_ityp, align 4 + %ityp.8750_344 = load i32, i32* @__main1_MOD_ityp, align 4 %D.75704_345 = sext i32 %ityp.8750_344 to i64 - %D.75840_346 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 3, i32 0), align 8 + %D.75840_346 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 3, i32 0), align 8 %D.75841_347 = mul nsw i64 %D.75704_345, %D.75840_346 %D.75842_348 = add nsw i64 %D.75839_343, %D.75841_347 - %D.75843_349 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 1), align 8 + %D.75843_349 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 1), align 8 %D.75844_350 = add nsw i64 %D.75842_348, %D.75843_349 %tmp142 = bitcast i8* %D.75833_331 to [0 x i32]* %tmp143 = bitcast [0 x i32]* %tmp142 to i32* - %D.75845_351 = getelementptr inbounds i32* %tmp143, i64 %D.75844_350 + %D.75845_351 = getelementptr inbounds i32, i32* %tmp143, i64 %D.75844_350 call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_integer_write to void (%struct.__st_parameter_dt*, i32*, i32)*)(%struct.__st_parameter_dt* %memtmp3, i32* %D.75845_351, i32 4) nounwind ; CHECK: @_gfortran_transfer_integer_write call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_real_write to void (%struct.__st_parameter_dt*, float*, i32)*)(%struct.__st_parameter_dt* %memtmp3, float* @xr1.4592, i32 4) nounwind @@ -150,79 +150,79 @@ codeRepl80.exitStub: ; preds = %"<bb 34>" ; CHECK: @_gfortran_transfer_character_write call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_integer_write to void (%struct.__st_parameter_dt*, i32*, i32)*)(%struct.__st_parameter_dt* %memtmp3, i32* @j1.4581, i32 4) nounwind ; CHECK: @_gfortran_transfer_integer_write - %D.75807_352 = load i8** getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 0), align 8 - %j1.8760_353 = load i32* @j1.4581, align 4 + %D.75807_352 = load i8*, i8** getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 0), align 8 + %j1.8760_353 = load i32, i32* @j1.4581, align 4 %D.75773_354 = sext i32 %j1.8760_353 to i64 - %iave.8736_355 = load i32* @__main1_MOD_iave, align 4 + %iave.8736_355 = load i32, i32* @__main1_MOD_iave, align 4 %D.75620_356 = sext i32 %iave.8736_355 to i64 - %D.75808_357 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 2, i32 0), align 8 + %D.75808_357 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 2, i32 0), align 8 %D.75809_358 = mul nsw i64 %D.75620_356, %D.75808_357 - %igrp.8737_359 = load i32* @__main1_MOD_igrp, align 4 + %igrp.8737_359 = load i32, i32* @__main1_MOD_igrp, align 4 %D.75635_360 = sext i32 %igrp.8737_359 to i64 - %D.75810_361 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 1, i32 0), align 8 + %D.75810_361 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 1, i32 0), align 8 %D.75811_362 = mul nsw i64 %D.75635_360, %D.75810_361 %D.75812_363 = add nsw i64 %D.75809_358, %D.75811_362 %D.75846_364 = add nsw i64 %D.75773_354, %D.75812_363 - %ityp.8750_365 = load i32* @__main1_MOD_ityp, align 4 + %ityp.8750_365 = load i32, i32* @__main1_MOD_ityp, align 4 %D.75704_366 = sext i32 %ityp.8750_365 to i64 - %D.75814_367 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 3, i32 0), align 8 + %D.75814_367 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 3, i64 3, i32 0), align 8 %D.75815_368 = mul nsw i64 %D.75704_366, %D.75814_367 %D.75847_369 = add nsw i64 %D.75846_364, %D.75815_368 - %D.75817_370 = load i64* getelementptr inbounds (%"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 1), align 8 + %D.75817_370 = load i64, i64* getelementptr inbounds (%"struct.array4_real(kind=4)", %"struct.array4_real(kind=4)"* @__main1_MOD_rmxval, i64 0, i32 1), align 8 %D.75848_371 = add nsw i64 %D.75847_369, %D.75817_370 %tmp144 = bitcast i8* %D.75807_352 to [0 x float]* %tmp145 = bitcast [0 x float]* %tmp144 to float* - %D.75849_372 = getelementptr inbounds float* %tmp145, i64 %D.75848_371 + %D.75849_372 = getelementptr inbounds float, float* %tmp145, i64 %D.75848_371 call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_real_write to void (%struct.__st_parameter_dt*, float*, i32)*)(%struct.__st_parameter_dt* %memtmp3, float* %D.75849_372, i32 4) nounwind ; CHECK: @_gfortran_transfer_real_write - %D.75820_373 = load i8** getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 0), align 8 - %j1.8760_374 = load i32* @j1.4581, align 4 + %D.75820_373 = load i8*, i8** getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 0), align 8 + %j1.8760_374 = load i32, i32* @j1.4581, align 4 %D.75773_375 = sext i32 %j1.8760_374 to i64 - %iave.8736_376 = load i32* @__main1_MOD_iave, align 4 + %iave.8736_376 = load i32, i32* @__main1_MOD_iave, align 4 %D.75620_377 = sext i32 %iave.8736_376 to i64 - %D.75821_378 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 2, i32 0), align 8 + %D.75821_378 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 2, i32 0), align 8 %D.75822_379 = mul nsw i64 %D.75620_377, %D.75821_378 - %igrp.8737_380 = load i32* @__main1_MOD_igrp, align 4 + %igrp.8737_380 = load i32, i32* @__main1_MOD_igrp, align 4 %D.75635_381 = sext i32 %igrp.8737_380 to i64 - %D.75823_382 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 1, i32 0), align 8 + %D.75823_382 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 1, i32 0), align 8 %D.75824_383 = mul nsw i64 %D.75635_381, %D.75823_382 %D.75825_384 = add nsw i64 %D.75822_379, %D.75824_383 %D.75850_385 = add nsw i64 %D.75773_375, %D.75825_384 - %ityp.8750_386 = load i32* @__main1_MOD_ityp, align 4 + %ityp.8750_386 = load i32, i32* @__main1_MOD_ityp, align 4 %D.75704_387 = sext i32 %ityp.8750_386 to i64 - %D.75827_388 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 3, i32 0), align 8 + %D.75827_388 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 3, i64 3, i32 0), align 8 %D.75828_389 = mul nsw i64 %D.75704_387, %D.75827_388 %D.75851_390 = add nsw i64 %D.75850_385, %D.75828_389 - %D.75830_391 = load i64* getelementptr inbounds (%struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 1), align 8 + %D.75830_391 = load i64, i64* getelementptr inbounds (%struct.array4_unknown, %struct.array4_unknown* @__main1_MOD_mclmsg, i64 0, i32 1), align 8 %D.75852_392 = add nsw i64 %D.75851_390, %D.75830_391 %tmp146 = bitcast i8* %D.75820_373 to [0 x [1 x i8]]* %tmp147 = bitcast [0 x [1 x i8]]* %tmp146 to [1 x i8]* - %D.75853_393 = getelementptr inbounds [1 x i8]* %tmp147, i64 %D.75852_392 + %D.75853_393 = getelementptr inbounds [1 x i8], [1 x i8]* %tmp147, i64 %D.75852_392 call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_character_write to void (%struct.__st_parameter_dt*, [1 x i8]*, i32)*)(%struct.__st_parameter_dt* %memtmp3, [1 x i8]* %D.75853_393, i32 1) nounwind ; CHECK: @_gfortran_transfer_character_write - %D.75833_394 = load i8** getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 0), align 8 - %j1.8760_395 = load i32* @j1.4581, align 4 + %D.75833_394 = load i8*, i8** getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 0), align 8 + %j1.8760_395 = load i32, i32* @j1.4581, align 4 %D.75773_396 = sext i32 %j1.8760_395 to i64 - %iave.8736_397 = load i32* @__main1_MOD_iave, align 4 + %iave.8736_397 = load i32, i32* @__main1_MOD_iave, align 4 %D.75620_398 = sext i32 %iave.8736_397 to i64 - %D.75834_399 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 2, i32 0), align 8 + %D.75834_399 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 2, i32 0), align 8 %D.75835_400 = mul nsw i64 %D.75620_398, %D.75834_399 - %igrp.8737_401 = load i32* @__main1_MOD_igrp, align 4 + %igrp.8737_401 = load i32, i32* @__main1_MOD_igrp, align 4 %D.75635_402 = sext i32 %igrp.8737_401 to i64 - %D.75836_403 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 1, i32 0), align 8 + %D.75836_403 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 1, i32 0), align 8 %D.75837_404 = mul nsw i64 %D.75635_402, %D.75836_403 %D.75838_405 = add nsw i64 %D.75835_400, %D.75837_404 %D.75854_406 = add nsw i64 %D.75773_396, %D.75838_405 - %ityp.8750_407 = load i32* @__main1_MOD_ityp, align 4 + %ityp.8750_407 = load i32, i32* @__main1_MOD_ityp, align 4 %D.75704_408 = sext i32 %ityp.8750_407 to i64 - %D.75840_409 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 3, i32 0), align 8 + %D.75840_409 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 3, i64 3, i32 0), align 8 %D.75841_410 = mul nsw i64 %D.75704_408, %D.75840_409 %D.75855_411 = add nsw i64 %D.75854_406, %D.75841_410 - %D.75843_412 = load i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 1), align 8 + %D.75843_412 = load i64, i64* getelementptr inbounds (%"struct.array4_integer(kind=4).73", %"struct.array4_integer(kind=4).73"* @__main1_MOD_mxdate, i64 0, i32 1), align 8 %D.75856_413 = add nsw i64 %D.75855_411, %D.75843_412 %tmp148 = bitcast i8* %D.75833_394 to [0 x i32]* %tmp149 = bitcast [0 x i32]* %tmp148 to i32* - %D.75857_414 = getelementptr inbounds i32* %tmp149, i64 %D.75856_413 + %D.75857_414 = getelementptr inbounds i32, i32* %tmp149, i64 %D.75856_413 call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_integer_write to void (%struct.__st_parameter_dt*, i32*, i32)*)(%struct.__st_parameter_dt* %memtmp3, i32* %D.75857_414, i32 4) nounwind ; CHECK: @_gfortran_transfer_integer_write call void bitcast (void (%struct.__st_parameter_dt*, i8*, i32)* @_gfortran_transfer_real_write to void (%struct.__st_parameter_dt*, float*, i32)*)(%struct.__st_parameter_dt* %memtmp3, float* @xr2.4593, i32 4) nounwind @@ -233,9 +233,9 @@ codeRepl80.exitStub: ; preds = %"<bb 34>" ; CHECK: @_gfortran_transfer_character_write call void @_gfortran_st_write_done(%struct.__st_parameter_dt* %memtmp3) nounwind ; CHECK: @_gfortran_st_write_done - %j.8758_415 = load i32* @j.4580, align 4 + %j.8758_415 = load i32, i32* @j.4580, align 4 %D.4634_416 = icmp eq i32 %j.8758_415, %D.4627_188.reload - %j.8758_417 = load i32* @j.4580, align 4 + %j.8758_417 = load i32, i32* @j.4580, align 4 %j.8770_418 = add nsw i32 %j.8758_417, 1 store i32 %j.8770_418, i32* @j.4580, align 4 %tmp150 = icmp ne i1 %D.4634_416, false diff --git a/test/Transforms/BBVectorize/ld1.ll b/test/Transforms/BBVectorize/ld1.ll index 9c79eef..368c38a 100644 --- a/test/Transforms/BBVectorize/ld1.ll +++ b/test/Transforms/BBVectorize/ld1.ll @@ -3,18 +3,18 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define double @test1(double* %a, double* %b, double* %c) nounwind uwtable readonly { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %i2 = load double* %c, align 8 + %i2 = load double, double* %c, align 8 %add = fadd double %mul, %i2 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 - %arrayidx6 = getelementptr inbounds double* %c, i64 1 - %i5 = load double* %arrayidx6, align 8 + %arrayidx6 = getelementptr inbounds double, double* %c, i64 1 + %i5 = load double, double* %arrayidx6, align 8 %add7 = fadd double %mul5, %i5 %mul9 = fmul double %add, %i1 %add11 = fadd double %mul9, %i2 @@ -26,10 +26,10 @@ entry: ; CHECK: %i0.v.i0 = bitcast double* %a to <2 x double>* ; CHECK: %i1.v.i0 = bitcast double* %b to <2 x double>* ; CHECK: %i2.v.i0 = bitcast double* %c to <2 x double>* -; CHECK: %i0 = load <2 x double>* %i0.v.i0, align 8 -; CHECK: %i1 = load <2 x double>* %i1.v.i0, align 8 +; CHECK: %i0 = load <2 x double>, <2 x double>* %i0.v.i0, align 8 +; CHECK: %i1 = load <2 x double>, <2 x double>* %i1.v.i0, align 8 ; CHECK: %mul = fmul <2 x double> %i0, %i1 -; CHECK: %i2 = load <2 x double>* %i2.v.i0, align 8 +; CHECK: %i2 = load <2 x double>, <2 x double>* %i2.v.i0, align 8 ; CHECK: %add = fadd <2 x double> %mul, %i2 ; CHECK: %mul9 = fmul <2 x double> %add, %i1 ; CHECK: %add11 = fadd <2 x double> %mul9, %i2 diff --git a/test/Transforms/BBVectorize/loop1.ll b/test/Transforms/BBVectorize/loop1.ll index ca36170..70a5def 100644 --- a/test/Transforms/BBVectorize/loop1.ll +++ b/test/Transforms/BBVectorize/loop1.ll @@ -12,10 +12,10 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds double* %in1, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 - %arrayidx2 = getelementptr inbounds double* %in2, i64 %indvars.iv - %1 = load double* %arrayidx2, align 8 + %arrayidx = getelementptr inbounds double, double* %in1, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 + %arrayidx2 = getelementptr inbounds double, double* %in2, i64 %indvars.iv + %1 = load double, double* %arrayidx2, align 8 %mul = fmul double %0, %0 %mul3 = fmul double %0, %1 %add = fadd double %mul, %mul3 @@ -28,17 +28,17 @@ for.body: ; preds = %for.body, %entry %add10 = fadd double %add9, %0 %mul11 = fmul double %mul8, %add10 %add12 = fadd double %add7, %mul11 - %arrayidx14 = getelementptr inbounds double* %out, i64 %indvars.iv + %arrayidx14 = getelementptr inbounds double, double* %out, i64 %indvars.iv store double %add12, double* %arrayidx14, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp eq i32 %lftr.wideiv, 10 br i1 %exitcond, label %for.end, label %for.body ; CHECK: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] -; CHECK: %arrayidx = getelementptr inbounds double* %in1, i64 %indvars.iv -; CHECK: %0 = load double* %arrayidx, align 8 -; CHECK: %arrayidx2 = getelementptr inbounds double* %in2, i64 %indvars.iv -; CHECK: %1 = load double* %arrayidx2, align 8 +; CHECK: %arrayidx = getelementptr inbounds double, double* %in1, i64 %indvars.iv +; CHECK: %0 = load double, double* %arrayidx, align 8 +; CHECK: %arrayidx2 = getelementptr inbounds double, double* %in2, i64 %indvars.iv +; CHECK: %1 = load double, double* %arrayidx2, align 8 ; CHECK: %mul = fmul double %0, %0 ; CHECK: %mul3 = fmul double %0, %1 ; CHECK: %add = fadd double %mul, %mul3 @@ -55,20 +55,20 @@ for.body: ; preds = %for.body, %entry ; CHECK: %mul6.v.r2 = extractelement <2 x double> %mul6, i32 1 ; CHECK: %add7 = fadd double %add, %mul6.v.r1 ; CHECK: %add12 = fadd double %add7, %mul6.v.r2 -; CHECK: %arrayidx14 = getelementptr inbounds double* %out, i64 %indvars.iv +; CHECK: %arrayidx14 = getelementptr inbounds double, double* %out, i64 %indvars.iv ; CHECK: store double %add12, double* %arrayidx14, align 8 ; CHECK: %indvars.iv.next = add i64 %indvars.iv, 1 ; CHECK: %lftr.wideiv = trunc i64 %indvars.iv.next to i32 ; CHECK: %exitcond = icmp eq i32 %lftr.wideiv, 10 ; CHECK: br i1 %exitcond, label %for.end, label %for.body ; CHECK-UNRL: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.1, %for.body ] -; CHECK-UNRL: %arrayidx = getelementptr inbounds double* %in1, i64 %indvars.iv +; CHECK-UNRL: %arrayidx = getelementptr inbounds double, double* %in1, i64 %indvars.iv ; CHECK-UNRL: %0 = bitcast double* %arrayidx to <2 x double>* -; CHECK-UNRL: %arrayidx2 = getelementptr inbounds double* %in2, i64 %indvars.iv +; CHECK-UNRL: %arrayidx2 = getelementptr inbounds double, double* %in2, i64 %indvars.iv ; CHECK-UNRL: %1 = bitcast double* %arrayidx2 to <2 x double>* -; CHECK-UNRL: %arrayidx14 = getelementptr inbounds double* %out, i64 %indvars.iv -; CHECK-UNRL: %2 = load <2 x double>* %0, align 8 -; CHECK-UNRL: %3 = load <2 x double>* %1, align 8 +; CHECK-UNRL: %arrayidx14 = getelementptr inbounds double, double* %out, i64 %indvars.iv +; CHECK-UNRL: %2 = load <2 x double>, <2 x double>* %0, align 8 +; CHECK-UNRL: %3 = load <2 x double>, <2 x double>* %1, align 8 ; CHECK-UNRL: %mul = fmul <2 x double> %2, %2 ; CHECK-UNRL: %mul3 = fmul <2 x double> %2, %3 ; CHECK-UNRL: %add = fadd <2 x double> %mul, %mul3 diff --git a/test/Transforms/BBVectorize/mem-op-depth.ll b/test/Transforms/BBVectorize/mem-op-depth.ll index c31d452..732043b 100644 --- a/test/Transforms/BBVectorize/mem-op-depth.ll +++ b/test/Transforms/BBVectorize/mem-op-depth.ll @@ -7,15 +7,15 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @test1() nounwind { ; CHECK-LABEL: @test1( - %V1 = load float* getelementptr inbounds ([1024 x float]* @A, i64 0, i64 0), align 16 - %V2 = load float* getelementptr inbounds ([1024 x float]* @A, i64 0, i64 1), align 4 - %V3= load float* getelementptr inbounds ([1024 x float]* @A, i64 0, i64 2), align 8 - %V4 = load float* getelementptr inbounds ([1024 x float]* @A, i64 0, i64 3), align 4 -; CHECK: %V1 = load <4 x float>* bitcast ([1024 x float]* @A to <4 x float>*), align 16 - store float %V1, float* getelementptr inbounds ([1024 x float]* @B, i64 0, i64 0), align 16 - store float %V2, float* getelementptr inbounds ([1024 x float]* @B, i64 0, i64 1), align 4 - store float %V3, float* getelementptr inbounds ([1024 x float]* @B, i64 0, i64 2), align 8 - store float %V4, float* getelementptr inbounds ([1024 x float]* @B, i64 0, i64 3), align 4 + %V1 = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i64 0, i64 0), align 16 + %V2 = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i64 0, i64 1), align 4 + %V3= load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i64 0, i64 2), align 8 + %V4 = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i64 0, i64 3), align 4 +; CHECK: %V1 = load <4 x float>, <4 x float>* bitcast ([1024 x float]* @A to <4 x float>*), align 16 + store float %V1, float* getelementptr inbounds ([1024 x float], [1024 x float]* @B, i64 0, i64 0), align 16 + store float %V2, float* getelementptr inbounds ([1024 x float], [1024 x float]* @B, i64 0, i64 1), align 4 + store float %V3, float* getelementptr inbounds ([1024 x float], [1024 x float]* @B, i64 0, i64 2), align 8 + store float %V4, float* getelementptr inbounds ([1024 x float], [1024 x float]* @B, i64 0, i64 3), align 4 ; CHECK-NEXT: store <4 x float> %V1, <4 x float>* bitcast ([1024 x float]* @B to <4 x float>*), align 16 ret i32 0 ; CHECK-NEXT: ret i32 0 diff --git a/test/Transforms/BBVectorize/metadata.ll b/test/Transforms/BBVectorize/metadata.ll index 874fbb8..f5580a8 100644 --- a/test/Transforms/BBVectorize/metadata.ll +++ b/test/Transforms/BBVectorize/metadata.ll @@ -4,16 +4,16 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Simple 3-pair chain with loads and stores (with fpmath) define void @test1(double* %a, double* %b, double* %c) nounwind uwtable readonly { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1, !fpmath !2 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4, !fpmath !3 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void ; CHECK-LABEL: @test1( @@ -24,16 +24,16 @@ entry: ; Simple 3-pair chain with loads and stores (ints with range) define void @test2(i64* %a, i64* %b, i64* %c) nounwind uwtable readonly { entry: - %i0 = load i64* %a, align 8, !range !0 - %i1 = load i64* %b, align 8 + %i0 = load i64, i64* %a, align 8, !range !0 + %i1 = load i64, i64* %b, align 8 %mul = mul i64 %i0, %i1 - %arrayidx3 = getelementptr inbounds i64* %a, i64 1 - %i3 = load i64* %arrayidx3, align 8, !range !1 - %arrayidx4 = getelementptr inbounds i64* %b, i64 1 - %i4 = load i64* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds i64, i64* %a, i64 1 + %i3 = load i64, i64* %arrayidx3, align 8, !range !1 + %arrayidx4 = getelementptr inbounds i64, i64* %b, i64 1 + %i4 = load i64, i64* %arrayidx4, align 8 %mul5 = mul i64 %i3, %i4 store i64 %mul, i64* %c, align 8 - %arrayidx5 = getelementptr inbounds i64* %c, i64 1 + %arrayidx5 = getelementptr inbounds i64, i64* %c, i64 1 store i64 %mul5, i64* %arrayidx5, align 8 ret void ; CHECK-LABEL: @test2( diff --git a/test/Transforms/BBVectorize/no-ldstr-conn.ll b/test/Transforms/BBVectorize/no-ldstr-conn.ll index bcc5ce7..a84cd65 100644 --- a/test/Transforms/BBVectorize/no-ldstr-conn.ll +++ b/test/Transforms/BBVectorize/no-ldstr-conn.ll @@ -7,10 +7,10 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define i64 @test2(i64 %a) nounwind uwtable readonly { entry: %a1 = inttoptr i64 %a to i64* - %a2 = getelementptr i64* %a1, i64 1 - %a3 = getelementptr i64* %a1, i64 2 - %v2 = load i64* %a2, align 8 - %v3 = load i64* %a3, align 8 + %a2 = getelementptr i64, i64* %a1, i64 1 + %a3 = getelementptr i64, i64* %a1, i64 2 + %v2 = load i64, i64* %a2, align 8 + %v3 = load i64, i64* %a3, align 8 %v2a = add i64 %v2, 5 %v3a = add i64 %v3, 7 store i64 %v2a, i64* %a2, align 8 @@ -18,6 +18,6 @@ entry: %r = add i64 %v2, %v3 ret i64 %r ; CHECK-LABEL: @test2( -; CHECK-NOT: getelementptr <2 x i64*> +; CHECK-NOT: getelementptr i64, <2 x i64*> } diff --git a/test/Transforms/BBVectorize/simple-ldstr-ptrs.ll b/test/Transforms/BBVectorize/simple-ldstr-ptrs.ll index 4d2298c..fcc0236 100644 --- a/test/Transforms/BBVectorize/simple-ldstr-ptrs.ll +++ b/test/Transforms/BBVectorize/simple-ldstr-ptrs.ll @@ -8,37 +8,37 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Simple 3-pair chain also with loads and stores (using ptrs and gep) define double @test1(i64* %a, i64* %b, i64* %c) nounwind uwtable readonly { entry: - %i0 = load i64* %a, align 8 - %i1 = load i64* %b, align 8 + %i0 = load i64, i64* %a, align 8 + %i1 = load i64, i64* %b, align 8 %mul = mul i64 %i0, %i1 - %arrayidx3 = getelementptr inbounds i64* %a, i64 1 - %i3 = load i64* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds i64* %b, i64 1 - %i4 = load i64* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds i64, i64* %a, i64 1 + %i3 = load i64, i64* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds i64, i64* %b, i64 1 + %i4 = load i64, i64* %arrayidx4, align 8 %mul5 = mul i64 %i3, %i4 %ptr = inttoptr i64 %mul to double* %ptr5 = inttoptr i64 %mul5 to double* - %aptr = getelementptr inbounds double* %ptr, i64 2 - %aptr5 = getelementptr inbounds double* %ptr5, i64 3 - %av = load double* %aptr, align 16 - %av5 = load double* %aptr5, align 16 + %aptr = getelementptr inbounds double, double* %ptr, i64 2 + %aptr5 = getelementptr inbounds double, double* %ptr5, i64 3 + %av = load double, double* %aptr, align 16 + %av5 = load double, double* %aptr5, align 16 %r = fmul double %av, %av5 store i64 %mul, i64* %c, align 8 - %arrayidx5 = getelementptr inbounds i64* %c, i64 1 + %arrayidx5 = getelementptr inbounds i64, i64* %c, i64 1 store i64 %mul5, i64* %arrayidx5, align 8 ret double %r ; CHECK-LABEL: @test1( ; CHECK: %i0.v.i0 = bitcast i64* %a to <2 x i64>* ; CHECK: %i1.v.i0 = bitcast i64* %b to <2 x i64>* -; CHECK: %i0 = load <2 x i64>* %i0.v.i0, align 8 -; CHECK: %i1 = load <2 x i64>* %i1.v.i0, align 8 +; CHECK: %i0 = load <2 x i64>, <2 x i64>* %i0.v.i0, align 8 +; CHECK: %i1 = load <2 x i64>, <2 x i64>* %i1.v.i0, align 8 ; CHECK: %mul = mul <2 x i64> %i0, %i1 ; CHECK: %ptr = inttoptr <2 x i64> %mul to <2 x double*> -; CHECK: %aptr = getelementptr inbounds <2 x double*> %ptr, <2 x i64> <i64 2, i64 3> +; CHECK: %aptr = getelementptr inbounds double, <2 x double*> %ptr, <2 x i64> <i64 2, i64 3> ; CHECK: %aptr.v.r1 = extractelement <2 x double*> %aptr, i32 0 ; CHECK: %aptr.v.r2 = extractelement <2 x double*> %aptr, i32 1 -; CHECK: %av = load double* %aptr.v.r1, align 16 -; CHECK: %av5 = load double* %aptr.v.r2, align 16 +; CHECK: %av = load double, double* %aptr.v.r1, align 16 +; CHECK: %av5 = load double, double* %aptr.v.r2, align 16 ; CHECK: %r = fmul double %av, %av5 ; CHECK: %0 = bitcast i64* %c to <2 x i64>* ; CHECK: store <2 x i64> %mul, <2 x i64>* %0, align 8 @@ -50,31 +50,31 @@ entry: ; Simple 3-pair chain with loads and stores (using ptrs and gep) define void @test2(i64** %a, i64** %b, i64** %c) nounwind uwtable readonly { entry: - %i0 = load i64** %a, align 8 - %i1 = load i64** %b, align 8 - %arrayidx3 = getelementptr inbounds i64** %a, i64 1 - %i3 = load i64** %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds i64** %b, i64 1 - %i4 = load i64** %arrayidx4, align 8 - %o1 = load i64* %i1, align 8 - %o4 = load i64* %i4, align 8 - %ptr0 = getelementptr inbounds i64* %i0, i64 %o1 - %ptr3 = getelementptr inbounds i64* %i3, i64 %o4 + %i0 = load i64*, i64** %a, align 8 + %i1 = load i64*, i64** %b, align 8 + %arrayidx3 = getelementptr inbounds i64*, i64** %a, i64 1 + %i3 = load i64*, i64** %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds i64*, i64** %b, i64 1 + %i4 = load i64*, i64** %arrayidx4, align 8 + %o1 = load i64, i64* %i1, align 8 + %o4 = load i64, i64* %i4, align 8 + %ptr0 = getelementptr inbounds i64, i64* %i0, i64 %o1 + %ptr3 = getelementptr inbounds i64, i64* %i3, i64 %o4 store i64* %ptr0, i64** %c, align 8 - %arrayidx5 = getelementptr inbounds i64** %c, i64 1 + %arrayidx5 = getelementptr inbounds i64*, i64** %c, i64 1 store i64* %ptr3, i64** %arrayidx5, align 8 ret void ; CHECK-LABEL: @test2( ; CHECK: %i0.v.i0 = bitcast i64** %a to <2 x i64*>* -; CHECK: %i1 = load i64** %b, align 8 -; CHECK: %i0 = load <2 x i64*>* %i0.v.i0, align 8 -; CHECK: %arrayidx4 = getelementptr inbounds i64** %b, i64 1 -; CHECK: %i4 = load i64** %arrayidx4, align 8 -; CHECK: %o1 = load i64* %i1, align 8 -; CHECK: %o4 = load i64* %i4, align 8 +; CHECK: %i1 = load i64*, i64** %b, align 8 +; CHECK: %i0 = load <2 x i64*>, <2 x i64*>* %i0.v.i0, align 8 +; CHECK: %arrayidx4 = getelementptr inbounds i64*, i64** %b, i64 1 +; CHECK: %i4 = load i64*, i64** %arrayidx4, align 8 +; CHECK: %o1 = load i64, i64* %i1, align 8 +; CHECK: %o4 = load i64, i64* %i4, align 8 ; CHECK: %ptr0.v.i1.1 = insertelement <2 x i64> undef, i64 %o1, i32 0 ; CHECK: %ptr0.v.i1.2 = insertelement <2 x i64> %ptr0.v.i1.1, i64 %o4, i32 1 -; CHECK: %ptr0 = getelementptr inbounds <2 x i64*> %i0, <2 x i64> %ptr0.v.i1.2 +; CHECK: %ptr0 = getelementptr inbounds i64, <2 x i64*> %i0, <2 x i64> %ptr0.v.i1.2 ; CHECK: %0 = bitcast i64** %c to <2 x i64*>* ; CHECK: store <2 x i64*> %ptr0, <2 x i64*>* %0, align 8 ; CHECK: ret void @@ -86,42 +86,42 @@ entry: ; using pointer vectors. define void @test3(<2 x i64*>* %a, <2 x i64*>* %b, <2 x i64*>* %c) nounwind uwtable readonly { entry: - %i0 = load <2 x i64*>* %a, align 8 - %i1 = load <2 x i64*>* %b, align 8 - %arrayidx3 = getelementptr inbounds <2 x i64*>* %a, i64 1 - %i3 = load <2 x i64*>* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds <2 x i64*>* %b, i64 1 - %i4 = load <2 x i64*>* %arrayidx4, align 8 + %i0 = load <2 x i64*>, <2 x i64*>* %a, align 8 + %i1 = load <2 x i64*>, <2 x i64*>* %b, align 8 + %arrayidx3 = getelementptr inbounds <2 x i64*>, <2 x i64*>* %a, i64 1 + %i3 = load <2 x i64*>, <2 x i64*>* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds <2 x i64*>, <2 x i64*>* %b, i64 1 + %i4 = load <2 x i64*>, <2 x i64*>* %arrayidx4, align 8 %j1 = extractelement <2 x i64*> %i1, i32 0 %j4 = extractelement <2 x i64*> %i4, i32 0 - %o1 = load i64* %j1, align 8 - %o4 = load i64* %j4, align 8 + %o1 = load i64, i64* %j1, align 8 + %o4 = load i64, i64* %j4, align 8 %j0 = extractelement <2 x i64*> %i0, i32 0 %j3 = extractelement <2 x i64*> %i3, i32 0 - %ptr0 = getelementptr inbounds i64* %j0, i64 %o1 - %ptr3 = getelementptr inbounds i64* %j3, i64 %o4 + %ptr0 = getelementptr inbounds i64, i64* %j0, i64 %o1 + %ptr3 = getelementptr inbounds i64, i64* %j3, i64 %o4 %qtr0 = insertelement <2 x i64*> undef, i64* %ptr0, i32 0 %rtr0 = insertelement <2 x i64*> %qtr0, i64* %ptr0, i32 1 %qtr3 = insertelement <2 x i64*> undef, i64* %ptr3, i32 0 %rtr3 = insertelement <2 x i64*> %qtr3, i64* %ptr3, i32 1 store <2 x i64*> %rtr0, <2 x i64*>* %c, align 8 - %arrayidx5 = getelementptr inbounds <2 x i64*>* %c, i64 1 + %arrayidx5 = getelementptr inbounds <2 x i64*>, <2 x i64*>* %c, i64 1 store <2 x i64*> %rtr3, <2 x i64*>* %arrayidx5, align 8 ret void ; CHECK-LABEL: @test3( ; CHECK: %i0.v.i0 = bitcast <2 x i64*>* %a to <4 x i64*>* -; CHECK: %i1 = load <2 x i64*>* %b, align 8 -; CHECK: %i0 = load <4 x i64*>* %i0.v.i0, align 8 -; CHECK: %arrayidx4 = getelementptr inbounds <2 x i64*>* %b, i64 1 -; CHECK: %i4 = load <2 x i64*>* %arrayidx4, align 8 +; CHECK: %i1 = load <2 x i64*>, <2 x i64*>* %b, align 8 +; CHECK: %i0 = load <4 x i64*>, <4 x i64*>* %i0.v.i0, align 8 +; CHECK: %arrayidx4 = getelementptr inbounds <2 x i64*>, <2 x i64*>* %b, i64 1 +; CHECK: %i4 = load <2 x i64*>, <2 x i64*>* %arrayidx4, align 8 ; CHECK: %j1 = extractelement <2 x i64*> %i1, i32 0 ; CHECK: %j4 = extractelement <2 x i64*> %i4, i32 0 -; CHECK: %o1 = load i64* %j1, align 8 -; CHECK: %o4 = load i64* %j4, align 8 +; CHECK: %o1 = load i64, i64* %j1, align 8 +; CHECK: %o4 = load i64, i64* %j4, align 8 ; CHECK: %ptr0.v.i1.1 = insertelement <2 x i64> undef, i64 %o1, i32 0 ; CHECK: %ptr0.v.i1.2 = insertelement <2 x i64> %ptr0.v.i1.1, i64 %o4, i32 1 ; CHECK: %ptr0.v.i0 = shufflevector <4 x i64*> %i0, <4 x i64*> undef, <2 x i32> <i32 0, i32 2> -; CHECK: %ptr0 = getelementptr inbounds <2 x i64*> %ptr0.v.i0, <2 x i64> %ptr0.v.i1.2 +; CHECK: %ptr0 = getelementptr inbounds i64, <2 x i64*> %ptr0.v.i0, <2 x i64> %ptr0.v.i1.2 ; CHECK: %rtr0 = shufflevector <2 x i64*> %ptr0, <2 x i64*> undef, <2 x i32> zeroinitializer ; CHECK: %rtr3 = shufflevector <2 x i64*> %ptr0, <2 x i64*> undef, <2 x i32> <i32 1, i32 1> ; CHECK: %0 = bitcast <2 x i64*>* %c to <4 x i64*>* diff --git a/test/Transforms/BBVectorize/simple-ldstr.ll b/test/Transforms/BBVectorize/simple-ldstr.ll index 558f8b3..56c1a06 100644 --- a/test/Transforms/BBVectorize/simple-ldstr.ll +++ b/test/Transforms/BBVectorize/simple-ldstr.ll @@ -5,23 +5,23 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; Simple 3-pair chain with loads and stores define void @test1(double* %a, double* %b, double* %c) nounwind uwtable readonly { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void ; CHECK-LABEL: @test1( ; CHECK: %i0.v.i0 = bitcast double* %a to <2 x double>* ; CHECK: %i1.v.i0 = bitcast double* %b to <2 x double>* -; CHECK: %i0 = load <2 x double>* %i0.v.i0, align 8 -; CHECK: %i1 = load <2 x double>* %i1.v.i0, align 8 +; CHECK: %i0 = load <2 x double>, <2 x double>* %i0.v.i0, align 8 +; CHECK: %i1 = load <2 x double>, <2 x double>* %i1.v.i0, align 8 ; CHECK: %mul = fmul <2 x double> %i0, %i1 ; CHECK: %0 = bitcast double* %c to <2 x double>* ; CHECK: store <2 x double> %mul, <2 x double>* %0, align 8 @@ -33,28 +33,28 @@ entry: ; Simple chain with extending loads and stores define void @test2(float* %a, float* %b, double* %c) nounwind uwtable readonly { entry: - %i0f = load float* %a, align 4 + %i0f = load float, float* %a, align 4 %i0 = fpext float %i0f to double - %i1f = load float* %b, align 4 + %i1f = load float, float* %b, align 4 %i1 = fpext float %i1f to double %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds float* %a, i64 1 - %i3f = load float* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds float, float* %a, i64 1 + %i3f = load float, float* %arrayidx3, align 4 %i3 = fpext float %i3f to double - %arrayidx4 = getelementptr inbounds float* %b, i64 1 - %i4f = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds float, float* %b, i64 1 + %i4f = load float, float* %arrayidx4, align 4 %i4 = fpext float %i4f to double %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void ; CHECK-LABEL: @test2( ; CHECK: %i0f.v.i0 = bitcast float* %a to <2 x float>* ; CHECK: %i1f.v.i0 = bitcast float* %b to <2 x float>* -; CHECK: %i0f = load <2 x float>* %i0f.v.i0, align 4 +; CHECK: %i0f = load <2 x float>, <2 x float>* %i0f.v.i0, align 4 ; CHECK: %i0 = fpext <2 x float> %i0f to <2 x double> -; CHECK: %i1f = load <2 x float>* %i1f.v.i0, align 4 +; CHECK: %i1f = load <2 x float>, <2 x float>* %i1f.v.i0, align 4 ; CHECK: %i1 = fpext <2 x float> %i1f to <2 x double> ; CHECK: %mul = fmul <2 x double> %i0, %i1 ; CHECK: %0 = bitcast double* %c to <2 x double>* @@ -67,37 +67,37 @@ entry: ; Simple chain with loads and truncating stores define void @test3(double* %a, double* %b, float* %c) nounwind uwtable readonly { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 %mulf = fptrunc double %mul to float - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 %mul5f = fptrunc double %mul5 to float store float %mulf, float* %c, align 8 - %arrayidx5 = getelementptr inbounds float* %c, i64 1 + %arrayidx5 = getelementptr inbounds float, float* %c, i64 1 store float %mul5f, float* %arrayidx5, align 4 ret void ; CHECK-LABEL: @test3( ; CHECK: %i0.v.i0 = bitcast double* %a to <2 x double>* ; CHECK: %i1.v.i0 = bitcast double* %b to <2 x double>* -; CHECK: %i0 = load <2 x double>* %i0.v.i0, align 8 -; CHECK: %i1 = load <2 x double>* %i1.v.i0, align 8 +; CHECK: %i0 = load <2 x double>, <2 x double>* %i0.v.i0, align 8 +; CHECK: %i1 = load <2 x double>, <2 x double>* %i1.v.i0, align 8 ; CHECK: %mul = fmul <2 x double> %i0, %i1 ; CHECK: %mulf = fptrunc <2 x double> %mul to <2 x float> ; CHECK: %0 = bitcast float* %c to <2 x float>* ; CHECK: store <2 x float> %mulf, <2 x float>* %0, align 8 ; CHECK: ret void ; CHECK-AO-LABEL: @test3( -; CHECK-AO: %i0 = load double* %a, align 8 -; CHECK-AO: %i1 = load double* %b, align 8 -; CHECK-AO: %arrayidx3 = getelementptr inbounds double* %a, i64 1 -; CHECK-AO: %i3 = load double* %arrayidx3, align 8 -; CHECK-AO: %arrayidx4 = getelementptr inbounds double* %b, i64 1 -; CHECK-AO: %i4 = load double* %arrayidx4, align 8 +; CHECK-AO: %i0 = load double, double* %a, align 8 +; CHECK-AO: %i1 = load double, double* %b, align 8 +; CHECK-AO: %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 +; CHECK-AO: %i3 = load double, double* %arrayidx3, align 8 +; CHECK-AO: %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 +; CHECK-AO: %i4 = load double, double* %arrayidx4, align 8 ; CHECK-AO: %mul.v.i1.1 = insertelement <2 x double> undef, double %i1, i32 0 ; CHECK-AO: %mul.v.i1.2 = insertelement <2 x double> %mul.v.i1.1, double %i4, i32 1 ; CHECK-AO: %mul.v.i0.1 = insertelement <2 x double> undef, double %i0, i32 0 @@ -119,16 +119,16 @@ if.then1: br label %if.then if.then: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 br label %if.end @@ -143,23 +143,23 @@ if.end: ; Simple 3-pair chain with loads and stores define void @test5(double* %a, double* %b, double* %c) nounwind uwtable readonly { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 store double %mul, double* %c, align 4 ret void ; CHECK-LABEL: @test5( ; CHECK: %i0.v.i0 = bitcast double* %a to <2 x double>* ; CHECK: %i1.v.i0 = bitcast double* %b to <2 x double>* -; CHECK: %i0 = load <2 x double>* %i0.v.i0, align 8 -; CHECK: %i1 = load <2 x double>* %i1.v.i0, align 8 +; CHECK: %i0 = load <2 x double>, <2 x double>* %i0.v.i0, align 8 +; CHECK: %i1 = load <2 x double>, <2 x double>* %i1.v.i0, align 8 ; CHECK: %mul = fmul <2 x double> %i0, %i1 ; CHECK: %0 = bitcast double* %c to <2 x double>* ; CHECK: store <2 x double> %mul, <2 x double>* %0, align 4 diff --git a/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll b/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll index a6ee63e..2f9c0c73 100644 --- a/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll +++ b/test/Transforms/CodeExtractor/2004-03-14-DominanceProblem.ll @@ -13,7 +13,7 @@ loopentry.1: ; preds = %no_exit.1, %loopentry.1.preheader br i1 false, label %no_exit.1, label %loopexit.0.loopexit1 no_exit.1: ; preds = %loopentry.1 - %tmp.53 = load i32* null ; <i32> [#uses=1] + %tmp.53 = load i32, i32* null ; <i32> [#uses=1] br i1 false, label %shortcirc_next.2, label %loopentry.1 shortcirc_next.2: ; preds = %no_exit.1 diff --git a/test/Transforms/CodeGenPrepare/X86/extend-sink-hoist.ll b/test/Transforms/CodeGenPrepare/X86/extend-sink-hoist.ll index 430b992..519e1ee 100644 --- a/test/Transforms/CodeGenPrepare/X86/extend-sink-hoist.ll +++ b/test/Transforms/CodeGenPrepare/X86/extend-sink-hoist.ll @@ -9,7 +9,7 @@ define i128 @sink(i64* %mem1, i64* %mem2) { ; CHECK-LABEL: block1: ; CHECK-NEXT: load block1: - %l1 = load i64* %mem1 + %l1 = load i64, i64* %mem1 %s1 = sext i64 %l1 to i128 br label %block2 @@ -18,7 +18,7 @@ block1: ; CHECK-NEXT: load ; CHECK-NEXT: sext block2: - %l2 = load i64* %mem2 + %l2 = load i64, i64* %mem2 %s2 = sext i64 %l2 to i128 %res = mul i128 %s1, %s2 ret i128 %res @@ -31,7 +31,7 @@ define i64 @hoist(i32* %mem1, i32* %mem2) { ; CHECK-NEXT: load ; CHECK-NEXT: sext block1: - %l1 = load i32* %mem1 + %l1 = load i32, i32* %mem1 br label %block2 ; CHECK-LABEL: block2: @@ -39,7 +39,7 @@ block1: ; CHECK-NEXT: sext block2: %s1 = sext i32 %l1 to i64 - %l2 = load i32* %mem2 + %l2 = load i32, i32* %mem2 %s2 = sext i32 %l2 to i64 %res = mul i64 %s1, %s2 ret i64 %res diff --git a/test/Transforms/CodeGenPrepare/X86/sink-addrspacecast.ll b/test/Transforms/CodeGenPrepare/X86/sink-addrspacecast.ll index a985c36..c9f49b5 100644 --- a/test/Transforms/CodeGenPrepare/X86/sink-addrspacecast.ll +++ b/test/Transforms/CodeGenPrepare/X86/sink-addrspacecast.ll @@ -8,12 +8,12 @@ target triple = "x86_64-unknown-linux-gnu" ; CHECK: add i64 %sunkaddr, 40 define void @load_cast_gep(i1 %cond, i64* %base) { entry: - %addr = getelementptr inbounds i64* %base, i64 5 + %addr = getelementptr inbounds i64, i64* %base, i64 5 %casted = addrspacecast i64* %addr to i32 addrspace(1)* br i1 %cond, label %if.then, label %fallthrough if.then: - %v = load i32 addrspace(1)* %casted, align 4 + %v = load i32, i32 addrspace(1)* %casted, align 4 br label %fallthrough fallthrough: @@ -25,7 +25,7 @@ fallthrough: define void @store_gep_cast(i1 %cond, i64* %base) { entry: %casted = addrspacecast i64* %base to i32 addrspace(1)* - %addr = getelementptr inbounds i32 addrspace(1)* %casted, i64 5 + %addr = getelementptr inbounds i32, i32 addrspace(1)* %casted, i64 5 br i1 %cond, label %if.then, label %fallthrough if.then: diff --git a/test/Transforms/CodeGenPrepare/statepoint-relocate.ll b/test/Transforms/CodeGenPrepare/statepoint-relocate.ll index cf411bc..7aa526f 100644 --- a/test/Transforms/CodeGenPrepare/statepoint-relocate.ll +++ b/test/Transforms/CodeGenPrepare/statepoint-relocate.ll @@ -6,80 +6,80 @@ target triple = "x86_64-pc-linux-gnu" declare zeroext i1 @return_i1() define i32 @test_sor_basic(i32* %base) { -; CHECK: getelementptr i32* %base, i32 15 -; CHECK: getelementptr i32* %base-new, i32 15 +; CHECK: getelementptr i32, i32* %base, i32 15 +; CHECK: getelementptr i32, i32* %base-new, i32 15 entry: - %ptr = getelementptr i32* %base, i32 15 + %ptr = getelementptr i32, i32* %base, i32 15 %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr) %base-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4) %ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5) - %ret = load i32* %ptr-new + %ret = load i32, i32* %ptr-new ret i32 %ret } define i32 @test_sor_two_derived(i32* %base) { -; CHECK: getelementptr i32* %base, i32 15 -; CHECK: getelementptr i32* %base, i32 12 -; CHECK: getelementptr i32* %base-new, i32 15 -; CHECK: getelementptr i32* %base-new, i32 12 +; CHECK: getelementptr i32, i32* %base, i32 15 +; CHECK: getelementptr i32, i32* %base, i32 12 +; CHECK: getelementptr i32, i32* %base-new, i32 15 +; CHECK: getelementptr i32, i32* %base-new, i32 12 entry: - %ptr = getelementptr i32* %base, i32 15 - %ptr2 = getelementptr i32* %base, i32 12 + %ptr = getelementptr i32, i32* %base, i32 15 + %ptr2 = getelementptr i32, i32* %base, i32 12 %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr, i32* %ptr2) %base-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4) %ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5) %ptr2-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 6) - %ret = load i32* %ptr-new + %ret = load i32, i32* %ptr-new ret i32 %ret } define i32 @test_sor_ooo(i32* %base) { -; CHECK: getelementptr i32* %base, i32 15 -; CHECK: getelementptr i32* %base-new, i32 15 +; CHECK: getelementptr i32, i32* %base, i32 15 +; CHECK: getelementptr i32, i32* %base-new, i32 15 entry: - %ptr = getelementptr i32* %base, i32 15 + %ptr = getelementptr i32, i32* %base, i32 15 %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr) %ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5) %base-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4) - %ret = load i32* %ptr-new + %ret = load i32, i32* %ptr-new ret i32 %ret } define i32 @test_sor_gep_smallint([3 x i32]* %base) { -; CHECK: getelementptr [3 x i32]* %base, i32 0, i32 2 -; CHECK: getelementptr [3 x i32]* %base-new, i32 0, i32 2 +; CHECK: getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 2 +; CHECK: getelementptr [3 x i32], [3 x i32]* %base-new, i32 0, i32 2 entry: - %ptr = getelementptr [3 x i32]* %base, i32 0, i32 2 + %ptr = getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 2 %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %base, i32* %ptr) %base-new = call [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32 %tok, i32 4, i32 4) %ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5) - %ret = load i32* %ptr-new + %ret = load i32, i32* %ptr-new ret i32 %ret } define i32 @test_sor_gep_largeint([3 x i32]* %base) { -; CHECK: getelementptr [3 x i32]* %base, i32 0, i32 21 -; CHECK-NOT: getelementptr [3 x i32]* %base-new, i32 0, i32 21 +; CHECK: getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 21 +; CHECK-NOT: getelementptr [3 x i32], [3 x i32]* %base-new, i32 0, i32 21 entry: - %ptr = getelementptr [3 x i32]* %base, i32 0, i32 21 + %ptr = getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 21 %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %base, i32* %ptr) %base-new = call [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32 %tok, i32 4, i32 4) %ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5) - %ret = load i32* %ptr-new + %ret = load i32, i32* %ptr-new ret i32 %ret } define i32 @test_sor_noop(i32* %base) { -; CHECK: getelementptr i32* %base, i32 15 +; CHECK: getelementptr i32, i32* %base, i32 15 ; CHECK: call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5) ; CHECK: call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 6) entry: - %ptr = getelementptr i32* %base, i32 15 - %ptr2 = getelementptr i32* %base, i32 12 + %ptr = getelementptr i32, i32* %base, i32 15 + %ptr2 = getelementptr i32, i32* %base, i32 12 %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr, i32* %ptr2) %ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5) %ptr2-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 6) - %ret = load i32* %ptr-new + %ret = load i32, i32* %ptr-new ret i32 %ret } diff --git a/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll b/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll index d68cb26..af7e8be 100644 --- a/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll +++ b/test/Transforms/ConstProp/2005-01-28-SetCCGEP.ll @@ -4,7 +4,7 @@ @b = external global [2 x { }] ; <[2 x { }]*> [#uses=2] define i1 @f() { - %tmp.2 = icmp eq { }* getelementptr ([2 x { }]* @b, i32 0, i32 0), getelementptr ([2 x { }]* @b, i32 0, i32 1) ; <i1> [#uses=1] + %tmp.2 = icmp eq { }* getelementptr ([2 x { }], [2 x { }]* @b, i32 0, i32 0), getelementptr ([2 x { }], [2 x { }]* @b, i32 0, i32 1) ; <i1> [#uses=1] ret i1 %tmp.2 } diff --git a/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll b/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll index fc7ff90..e93a2c0 100644 --- a/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll +++ b/test/Transforms/ConstProp/2009-09-01-GEP-Crash.ll @@ -18,7 +18,7 @@ target triple = "x86_64-unknown-linux-gnu" define void @init_hrtimers_cpu(i32 %cpu) nounwind noredzone section ".cpuinit.text" { entry: - %tmp3 = getelementptr %struct.hrtimer_cpu_base* bitcast (%1* @per_cpu__hrtimer_bases to %struct.hrtimer_cpu_base*), i32 0, i32 0 ; <%0*> [#uses=1] + %tmp3 = getelementptr %struct.hrtimer_cpu_base, %struct.hrtimer_cpu_base* bitcast (%1* @per_cpu__hrtimer_bases to %struct.hrtimer_cpu_base*), i32 0, i32 0 ; <%0*> [#uses=1] %tmp5 = bitcast %0* %tmp3 to i8* ; <i8*> [#uses=0] unreachable } diff --git a/test/Transforms/ConstProp/div-zero.ll b/test/Transforms/ConstProp/div-zero.ll index a2c59d3..f4049a9 100644 --- a/test/Transforms/ConstProp/div-zero.ll +++ b/test/Transforms/ConstProp/div-zero.ll @@ -5,7 +5,7 @@ declare void @ext() define i32 @foo(i32 %ptr) { entry: %zero = sub i32 %ptr, %ptr ; <i32> [#uses=1] - %div_zero = sdiv i32 %zero, ptrtoint (i32* getelementptr (i32* null, + %div_zero = sdiv i32 %zero, ptrtoint (i32* getelementptr (i32, i32* null, i32 1) to i32) ; <i32> [#uses=1] ret i32 %div_zero } diff --git a/test/Transforms/ConstProp/loads.ll b/test/Transforms/ConstProp/loads.ll index 5a23dad..5426ad0 100644 --- a/test/Transforms/ConstProp/loads.ll +++ b/test/Transforms/ConstProp/loads.ll @@ -9,7 +9,7 @@ ; Simple load define i32 @test1() { - %r = load i32* getelementptr ({{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) + %r = load i32, i32* getelementptr ({{i32,i8},i32}, {{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) ret i32 %r ; 0xDEADBEEF @@ -24,7 +24,7 @@ define i32 @test1() { ; PR3152 ; Load of first 16 bits of 32-bit value. define i16 @test2() { - %r = load i16* bitcast(i32* getelementptr ({{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16*) + %r = load i16, i16* bitcast(i32* getelementptr ({{i32,i8},i32}, {{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16*) ret i16 %r ; 0xBEEF @@ -37,7 +37,7 @@ define i16 @test2() { } define i16 @test2_addrspacecast() { - %r = load i16 addrspace(1)* addrspacecast(i32* getelementptr ({{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16 addrspace(1)*) + %r = load i16, i16 addrspace(1)* addrspacecast(i32* getelementptr ({{i32,i8},i32}, {{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16 addrspace(1)*) ret i16 %r ; 0xBEEF @@ -51,7 +51,7 @@ define i16 @test2_addrspacecast() { ; Load of second 16 bits of 32-bit value. define i16 @test3() { - %r = load i16* getelementptr(i16* bitcast(i32* getelementptr ({{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16*), i32 1) + %r = load i16, i16* getelementptr(i16, i16* bitcast(i32* getelementptr ({{i32,i8},i32}, {{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16*), i32 1) ret i16 %r ; 0xDEAD @@ -65,7 +65,7 @@ define i16 @test3() { ; Load of 8 bit field + tail padding. define i16 @test4() { - %r = load i16* getelementptr(i16* bitcast(i32* getelementptr ({{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16*), i32 2) + %r = load i16, i16* getelementptr(i16, i16* bitcast(i32* getelementptr ({{i32,i8},i32}, {{i32,i8},i32}* @g1, i32 0, i32 0, i32 0) to i16*), i32 2) ret i16 %r ; 0x00BA @@ -79,7 +79,7 @@ define i16 @test4() { ; Load of double bits. define i64 @test6() { - %r = load i64* bitcast(double* @g2 to i64*) + %r = load i64, i64* bitcast(double* @g2 to i64*) ret i64 %r ; 0x3FF_0000000000000 @@ -93,7 +93,7 @@ define i64 @test6() { ; Load of double bits. define i16 @test7() { - %r = load i16* bitcast(double* @g2 to i16*) + %r = load i16, i16* bitcast(double* @g2 to i16*) ret i16 %r ; 0x0000 @@ -107,7 +107,7 @@ define i16 @test7() { ; Double load. define double @test8() { - %r = load double* bitcast({{i32,i8},i32}* @g1 to double*) + %r = load double, double* bitcast({{i32,i8},i32}* @g1 to double*) ret double %r ; LE-LABEL: @test8( @@ -120,7 +120,7 @@ define double @test8() { ; i128 load. define i128 @test9() { - %r = load i128* bitcast({i64, i64}* @g3 to i128*) + %r = load i128, i128* bitcast({i64, i64}* @g3 to i128*) ret i128 %r ; 0x00000000_06B1BFF8_00000000_0000007B @@ -134,7 +134,7 @@ define i128 @test9() { ; vector load. define <2 x i64> @test10() { - %r = load <2 x i64>* bitcast({i64, i64}* @g3 to <2 x i64>*) + %r = load <2 x i64>, <2 x i64>* bitcast({i64, i64}* @g3 to <2 x i64>*) ret <2 x i64> %r ; LE-LABEL: @test10( @@ -151,7 +151,7 @@ define <2 x i64> @test10() { define i16 @test11() nounwind { entry: - %a = load i16* bitcast ({ i8, i8 }* @g4 to i16*) + %a = load i16, i16* bitcast ({ i8, i8 }* @g4 to i16*) ret i16 %a ; 0x08A1 @@ -168,7 +168,7 @@ entry: @test12g = private constant [6 x i8] c"a\00b\00\00\00" define i16 @test12() { - %a = load i16* getelementptr inbounds ([3 x i16]* bitcast ([6 x i8]* @test12g to [3 x i16]*), i32 0, i64 1) + %a = load i16, i16* getelementptr inbounds ([3 x i16], [3 x i16]* bitcast ([6 x i8]* @test12g to [3 x i16]*), i32 0, i64 1) ret i16 %a ; 0x0062 @@ -184,7 +184,7 @@ define i16 @test12() { ; PR5978 @g5 = constant i8 4 define i1 @test13() { - %A = load i1* bitcast (i8* @g5 to i1*) + %A = load i1, i1* bitcast (i8* @g5 to i1*) ret i1 %A ; LE-LABEL: @test13( @@ -197,7 +197,7 @@ define i1 @test13() { @g6 = constant [2 x i8*] [i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 2 to i8*)] define i64 @test14() nounwind { entry: - %tmp = load i64* bitcast ([2 x i8*]* @g6 to i64*) + %tmp = load i64, i64* bitcast ([2 x i8*]* @g6 to i64*) ret i64 %tmp ; LE-LABEL: @test14( @@ -211,7 +211,7 @@ entry: @g6_as1 = constant [2 x i8 addrspace(1)*] [i8 addrspace(1)* inttoptr (i16 1 to i8 addrspace(1)*), i8 addrspace(1)* inttoptr (i16 2 to i8 addrspace(1)*)] define i16 @test14_as1() nounwind { entry: - %tmp = load i16* bitcast ([2 x i8 addrspace(1)*]* @g6_as1 to i16*) + %tmp = load i16, i16* bitcast ([2 x i8 addrspace(1)*]* @g6_as1 to i16*) ret i16 %tmp ; LE: @test14_as1 @@ -223,7 +223,7 @@ entry: define i64 @test15() nounwind { entry: - %tmp = load i64* bitcast (i8** getelementptr inbounds ([2 x i8*]* @g6, i32 0, i64 1) to i64*) + %tmp = load i64, i64* bitcast (i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @g6, i32 0, i64 1) to i64*) ret i64 %tmp ; LE-LABEL: @test15( @@ -235,7 +235,7 @@ entry: @gv7 = constant [4 x i8*] [i8* null, i8* inttoptr (i64 -14 to i8*), i8* null, i8* null] define i64 @test16.1() { - %v = load i64* bitcast ([4 x i8*]* @gv7 to i64*), align 8 + %v = load i64, i64* bitcast ([4 x i8*]* @gv7 to i64*), align 8 ret i64 %v ; LE-LABEL: @test16.1( @@ -246,7 +246,7 @@ define i64 @test16.1() { } define i64 @test16.2() { - %v = load i64* bitcast (i8** getelementptr inbounds ([4 x i8*]* @gv7, i64 0, i64 1) to i64*), align 8 + %v = load i64, i64* bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @gv7, i64 0, i64 1) to i64*), align 8 ret i64 %v ; LE-LABEL: @test16.2( @@ -257,7 +257,7 @@ define i64 @test16.2() { } define i64 @test16.3() { - %v = load i64* bitcast (i8** getelementptr inbounds ([4 x i8*]* @gv7, i64 0, i64 2) to i64*), align 8 + %v = load i64, i64* bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @gv7, i64 0, i64 2) to i64*), align 8 ret i64 %v ; LE-LABEL: @test16.3( diff --git a/test/Transforms/ConstProp/shift.ll b/test/Transforms/ConstProp/shift.ll new file mode 100644 index 0000000..de23fe9 --- /dev/null +++ b/test/Transforms/ConstProp/shift.ll @@ -0,0 +1,69 @@ +; RUN: opt < %s -constprop -S | FileCheck %s + +; CHECK-LABEL: shift_undef_64 +define void @shift_undef_64(i64* %p) { + %r1 = lshr i64 -1, 4294967296 ; 2^32 + ; CHECK: store i64 undef + store i64 %r1, i64* %p + + %r2 = ashr i64 -1, 4294967297 ; 2^32 + 1 + ; CHECK: store i64 undef + store i64 %r2, i64* %p + + %r3 = shl i64 -1, 4294967298 ; 2^32 + 2 + ; CHECK: store i64 undef + store i64 %r3, i64* %p + + ret void +} + +; CHECK-LABEL: shift_undef_65 +define void @shift_undef_65(i65* %p) { + %r1 = lshr i65 2, 18446744073709551617 + ; CHECK: store i65 undef + store i65 %r1, i65* %p + + %r2 = ashr i65 4, 18446744073709551617 + ; CHECK: store i65 undef + store i65 %r2, i65* %p + + %r3 = shl i65 1, 18446744073709551617 + ; CHECK: store i65 undef + store i65 %r3, i65* %p + + ret void +} + +; CHECK-LABEL: shift_undef_256 +define void @shift_undef_256(i256* %p) { + %r1 = lshr i256 2, 18446744073709551617 + ; CHECK: store i256 undef + store i256 %r1, i256* %p + + %r2 = ashr i256 4, 18446744073709551618 + ; CHECK: store i256 undef + store i256 %r2, i256* %p + + %r3 = shl i256 1, 18446744073709551619 + ; CHECK: store i256 undef + store i256 %r3, i256* %p + + ret void +} + +; CHECK-LABEL: shift_undef_511 +define void @shift_undef_511(i511* %p) { + %r1 = lshr i511 -1, 1208925819614629174706276 ; 2^80 + 100 + ; CHECK: store i511 undef + store i511 %r1, i511* %p + + %r2 = ashr i511 -2, 1208925819614629174706200 + ; CHECK: store i511 undef + store i511 %r2, i511* %p + + %r3 = shl i511 -3, 1208925819614629174706180 + ; CHECK: store i511 undef + store i511 %r3, i511* %p + + ret void +} diff --git a/test/Transforms/ConstantHoisting/AArch64/const-addr.ll b/test/Transforms/ConstantHoisting/AArch64/const-addr.ll index 89d5960..4c36d20 100644 --- a/test/Transforms/ConstantHoisting/AArch64/const-addr.ll +++ b/test/Transforms/ConstantHoisting/AArch64/const-addr.ll @@ -6,17 +6,17 @@ define i32 @test1() nounwind { ; CHECK-LABEL: test1 ; CHECK: %const = bitcast i64 68141056 to i64 ; CHECK: %1 = inttoptr i64 %const to %T* -; CHECK: %o1 = getelementptr %T* %1, i32 0, i32 1 -; CHECK: %o2 = getelementptr %T* %1, i32 0, i32 2 -; CHECK: %o3 = getelementptr %T* %1, i32 0, i32 3 +; CHECK: %o1 = getelementptr %T, %T* %1, i32 0, i32 1 +; CHECK: %o2 = getelementptr %T, %T* %1, i32 0, i32 2 +; CHECK: %o3 = getelementptr %T, %T* %1, i32 0, i32 3 %at = inttoptr i64 68141056 to %T* - %o1 = getelementptr %T* %at, i32 0, i32 1 - %t1 = load i32* %o1 - %o2 = getelementptr %T* %at, i32 0, i32 2 - %t2 = load i32* %o2 + %o1 = getelementptr %T, %T* %at, i32 0, i32 1 + %t1 = load i32, i32* %o1 + %o2 = getelementptr %T, %T* %at, i32 0, i32 2 + %t2 = load i32, i32* %o2 %a1 = add i32 %t1, %t2 - %o3 = getelementptr %T* %at, i32 0, i32 3 - %t3 = load i32* %o3 + %o3 = getelementptr %T, %T* %at, i32 0, i32 3 + %t3 = load i32, i32* %o3 %a2 = add i32 %a1, %t3 ret i32 %a2 } diff --git a/test/Transforms/ConstantHoisting/PowerPC/const-base-addr.ll b/test/Transforms/ConstantHoisting/PowerPC/const-base-addr.ll index b4337ee..69b13cf 100644 --- a/test/Transforms/ConstantHoisting/PowerPC/const-base-addr.ll +++ b/test/Transforms/ConstantHoisting/PowerPC/const-base-addr.ll @@ -9,13 +9,13 @@ define i32 @test1() nounwind { ; CHECK-LABEL: @test1 ; CHECK: %const = bitcast i32 12345678 to i32 ; CHECK: %1 = inttoptr i32 %const to %T* -; CHECK: %addr1 = getelementptr %T* %1, i32 0, i32 1 - %addr1 = getelementptr %T* inttoptr (i32 12345678 to %T*), i32 0, i32 1 - %tmp1 = load i32* %addr1 - %addr2 = getelementptr %T* inttoptr (i32 12345678 to %T*), i32 0, i32 2 - %tmp2 = load i32* %addr2 - %addr3 = getelementptr %T* inttoptr (i32 12345678 to %T*), i32 0, i32 3 - %tmp3 = load i32* %addr3 +; CHECK: %addr1 = getelementptr %T, %T* %1, i32 0, i32 1 + %addr1 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 1 + %tmp1 = load i32, i32* %addr1 + %addr2 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 2 + %tmp2 = load i32, i32* %addr2 + %addr3 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 3 + %tmp3 = load i32, i32* %addr3 %tmp4 = add i32 %tmp1, %tmp2 %tmp5 = add i32 %tmp3, %tmp4 ret i32 %tmp5 diff --git a/test/Transforms/ConstantHoisting/PowerPC/masks.ll b/test/Transforms/ConstantHoisting/PowerPC/masks.ll index d553182..4cc504f 100644 --- a/test/Transforms/ConstantHoisting/PowerPC/masks.ll +++ b/test/Transforms/ConstantHoisting/PowerPC/masks.ll @@ -19,7 +19,7 @@ if.then152: if.end167: ; CHECK: and i32 {{.*}}, 32768 %shl161 = shl nuw nsw i32 %conv121, 15 - %0 = load i8* undef, align 1 + %0 = load i8, i8* undef, align 1 %conv169 = zext i8 %0 to i32 %shl170 = shl nuw nsw i32 %conv169, 7 %shl161.masked = and i32 %shl161, 32768 @@ -49,7 +49,7 @@ if.then152: if.end167: ; CHECK: add i32 {{.*}}, -32758 %shl161 = shl nuw nsw i32 %conv121, 15 - %0 = load i8* undef, align 1 + %0 = load i8, i8* undef, align 1 %conv169 = zext i8 %0 to i32 %shl170 = shl nuw nsw i32 %conv169, 7 %shl161.masked = and i32 %shl161, 32773 diff --git a/test/Transforms/ConstantHoisting/X86/cast-inst.ll b/test/Transforms/ConstantHoisting/X86/cast-inst.ll index f490f4a..bd1e196 100644 --- a/test/Transforms/ConstantHoisting/X86/cast-inst.ll +++ b/test/Transforms/ConstantHoisting/X86/cast-inst.ll @@ -9,19 +9,19 @@ define i32 @cast_inst_test() { ; CHECK-LABEL: @cast_inst_test ; CHECK: %const = bitcast i64 4646526064 to i64 ; CHECK: %1 = inttoptr i64 %const to i32* -; CHECK: %v0 = load i32* %1, align 16 +; CHECK: %v0 = load i32, i32* %1, align 16 ; CHECK: %const_mat = add i64 %const, 16 ; CHECK-NEXT: %2 = inttoptr i64 %const_mat to i32* -; CHECK-NEXT: %v1 = load i32* %2, align 16 +; CHECK-NEXT: %v1 = load i32, i32* %2, align 16 ; CHECK: %const_mat1 = add i64 %const, 32 ; CHECK-NEXT: %3 = inttoptr i64 %const_mat1 to i32* -; CHECK-NEXT: %v2 = load i32* %3, align 16 +; CHECK-NEXT: %v2 = load i32, i32* %3, align 16 %a0 = inttoptr i64 4646526064 to i32* - %v0 = load i32* %a0, align 16 + %v0 = load i32, i32* %a0, align 16 %a1 = inttoptr i64 4646526080 to i32* - %v1 = load i32* %a1, align 16 + %v1 = load i32, i32* %a1, align 16 %a2 = inttoptr i64 4646526096 to i32* - %v2 = load i32* %a2, align 16 + %v2 = load i32, i32* %a2, align 16 %r0 = add i32 %v0, %v1 %r1 = add i32 %r0, %v2 ret i32 %r1 diff --git a/test/Transforms/ConstantHoisting/X86/const-base-addr.ll b/test/Transforms/ConstantHoisting/X86/const-base-addr.ll index 01e6cdf..db5dfdd 100644 --- a/test/Transforms/ConstantHoisting/X86/const-base-addr.ll +++ b/test/Transforms/ConstantHoisting/X86/const-base-addr.ll @@ -10,13 +10,13 @@ define i32 @test1() nounwind { ; CHECK-LABEL: @test1 ; CHECK: %const = bitcast i32 12345678 to i32 ; CHECK: %1 = inttoptr i32 %const to %T* -; CHECK: %addr1 = getelementptr %T* %1, i32 0, i32 1 - %addr1 = getelementptr %T* inttoptr (i32 12345678 to %T*), i32 0, i32 1 - %tmp1 = load i32* %addr1 - %addr2 = getelementptr %T* inttoptr (i32 12345678 to %T*), i32 0, i32 2 - %tmp2 = load i32* %addr2 - %addr3 = getelementptr %T* inttoptr (i32 12345678 to %T*), i32 0, i32 3 - %tmp3 = load i32* %addr3 +; CHECK: %addr1 = getelementptr %T, %T* %1, i32 0, i32 1 + %addr1 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 1 + %tmp1 = load i32, i32* %addr1 + %addr2 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 2 + %tmp2 = load i32, i32* %addr2 + %addr3 = getelementptr %T, %T* inttoptr (i32 12345678 to %T*), i32 0, i32 3 + %tmp3 = load i32, i32* %addr3 %tmp4 = add i32 %tmp1, %tmp2 %tmp5 = add i32 %tmp3, %tmp4 ret i32 %tmp5 diff --git a/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll b/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll index d352386..5df4c1a 100644 --- a/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll +++ b/test/Transforms/ConstantHoisting/X86/delete-dead-cast-inst.ll @@ -10,13 +10,13 @@ define i32 @test1() nounwind { ; CHECK: %const = bitcast i32 12345678 to i32 ; CHECK-NOT: %base = inttoptr i32 12345678 to %T* ; CHECK-NEXT: %1 = inttoptr i32 %const to %T* -; CHECK-NEXT: %addr1 = getelementptr %T* %1, i32 0, i32 1 -; CHECK-NEXT: %addr2 = getelementptr %T* %1, i32 0, i32 2 -; CHECK-NEXT: %addr3 = getelementptr %T* %1, i32 0, i32 3 +; CHECK-NEXT: %addr1 = getelementptr %T, %T* %1, i32 0, i32 1 +; CHECK-NEXT: %addr2 = getelementptr %T, %T* %1, i32 0, i32 2 +; CHECK-NEXT: %addr3 = getelementptr %T, %T* %1, i32 0, i32 3 %base = inttoptr i32 12345678 to %T* - %addr1 = getelementptr %T* %base, i32 0, i32 1 - %addr2 = getelementptr %T* %base, i32 0, i32 2 - %addr3 = getelementptr %T* %base, i32 0, i32 3 + %addr1 = getelementptr %T, %T* %base, i32 0, i32 1 + %addr2 = getelementptr %T, %T* %base, i32 0, i32 2 + %addr3 = getelementptr %T, %T* %base, i32 0, i32 3 ret i32 12345678 } diff --git a/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll b/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll index b7b05cf..2e83503 100644 --- a/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll +++ b/test/Transforms/ConstantMerge/2002-09-23-CPR-Update.ll @@ -6,8 +6,8 @@ declare i32 @test(i32*) define void @foo() { - call i32 @test( i32* getelementptr ({ i32 }* @foo.upgrd.1, i64 0, i32 0) ) ; <i32>:1 [#uses=0] - call i32 @test( i32* getelementptr ({ i32 }* @bar, i64 0, i32 0) ) ; <i32>:2 [#uses=0] + call i32 @test( i32* getelementptr ({ i32 }, { i32 }* @foo.upgrd.1, i64 0, i32 0) ) ; <i32>:1 [#uses=0] + call i32 @test( i32* getelementptr ({ i32 }, { i32 }* @bar, i64 0, i32 0) ) ; <i32>:2 [#uses=0] ret void } diff --git a/test/Transforms/ConstantMerge/merge-both.ll b/test/Transforms/ConstantMerge/merge-both.ll index 3162676..11b0621 100644 --- a/test/Transforms/ConstantMerge/merge-both.ll +++ b/test/Transforms/ConstantMerge/merge-both.ll @@ -1,7 +1,6 @@ ; RUN: opt -constmerge -S < %s | FileCheck %s ; Test that in one run var3 is merged into var2 and var1 into var4. -; Test that we merge @var5 and @var6 into one with the higher alignment, and -; don't merge var7/var8 into var5/var6. +; Test that we merge @var5 and @var6 into one with the higher alignment declare void @zed(%struct.foobar*, %struct.foobar*) @@ -23,8 +22,8 @@ declare void @helper([16 x i8]*) @var7 = internal constant [16 x i8] c"foo1bar2foo3bar\00" @var8 = private unnamed_addr constant [16 x i8] c"foo1bar2foo3bar\00" -; CHECK-NEXT: @var6 = private constant [16 x i8] c"foo1bar2foo3bar\00", align 16 -; CHECK-NEXT: @var8 = private constant [16 x i8] c"foo1bar2foo3bar\00" +; CHECK-NEXT: @var7 = internal constant [16 x i8] c"foo1bar2foo3bar\00" +; CHECK-NEXT: @var8 = private constant [16 x i8] c"foo1bar2foo3bar\00", align 16 @var4a = alias %struct.foobar* @var4 @llvm.used = appending global [1 x %struct.foobar*] [%struct.foobar* @var4a], section "llvm.metadata" diff --git a/test/Transforms/CorrelatedValuePropagation/basic.ll b/test/Transforms/CorrelatedValuePropagation/basic.ll index 9a22647..9d1253a 100644 --- a/test/Transforms/CorrelatedValuePropagation/basic.ll +++ b/test/Transforms/CorrelatedValuePropagation/basic.ll @@ -52,8 +52,8 @@ bb: ; preds = %entry ret i8 0 bb2: ; preds = %entry -; CHECK: %should_be_const = load i8* @gv - %should_be_const = load i8* %a +; CHECK: %should_be_const = load i8, i8* @gv + %should_be_const = load i8, i8* %a ret i8 %should_be_const } diff --git a/test/Transforms/CorrelatedValuePropagation/non-null.ll b/test/Transforms/CorrelatedValuePropagation/non-null.ll index b14abd8..6bb8bb0 100644 --- a/test/Transforms/CorrelatedValuePropagation/non-null.ll +++ b/test/Transforms/CorrelatedValuePropagation/non-null.ll @@ -2,7 +2,7 @@ define void @test1(i8* %ptr) { ; CHECK: test1 - %A = load i8* %ptr + %A = load i8, i8* %ptr br label %bb bb: icmp ne i8* %ptr, null diff --git a/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll b/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll index 93282f7..a7cfe68 100644 --- a/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll +++ b/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll @@ -22,7 +22,7 @@ declare void @llvm.va_end(i8*) nounwind define i32 @main() { entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - %tmp = getelementptr [4 x %struct.point]* @pts, i32 0, i32 0 ; <%struct.point*> [#uses=1] + %tmp = getelementptr [4 x %struct.point], [4 x %struct.point]* @pts, i32 0, i32 0 ; <%struct.point*> [#uses=1] %tmp1 = call i32 (i32, ...)* @va1( i32 1, %struct.point* byval %tmp ) nounwind ; <i32> [#uses=0] call void @exit( i32 0 ) noreturn nounwind unreachable diff --git a/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll b/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll index dd283ae..730a3f3 100644 --- a/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll +++ b/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll @@ -4,10 +4,10 @@ define i8* @vfs_addname(i8* %name, i32 %len, i32 %hash, i32 %flags) nounwind ssp { entry: - call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !0, metadata !{}) - call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !10, metadata !{}) - call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !11, metadata !{}) - call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !12, metadata !{}) + call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !0, metadata !MDExpression()) + call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !10, metadata !MDExpression()) + call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !11, metadata !MDExpression()) + call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !12, metadata !MDExpression()) ; CHECK: call fastcc i8* @add_name_internal(i8* %name, i32 %hash) [[NUW:#[0-9]+]], !dbg !{{[0-9]+}} %0 = call fastcc i8* @add_name_internal(i8* %name, i32 %len, i32 %hash, i8 zeroext 0, i32 %flags) nounwind, !dbg !13 ; <i8*> [#uses=1] ret i8* %0, !dbg !13 @@ -17,11 +17,11 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone define internal fastcc i8* @add_name_internal(i8* %name, i32 %len, i32 %hash, i8 zeroext %extra, i32 %flags) noinline nounwind ssp { entry: - call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !15, metadata !{}) - call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !20, metadata !{}) - call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !21, metadata !{}) - call void @llvm.dbg.value(metadata i8 %extra, i64 0, metadata !22, metadata !{}) - call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !23, metadata !{}) + call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !15, metadata !MDExpression()) + call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !20, metadata !MDExpression()) + call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !21, metadata !MDExpression()) + call void @llvm.dbg.value(metadata i8 %extra, i64 0, metadata !22, metadata !MDExpression()) + call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !23, metadata !MDExpression()) %0 = icmp eq i32 %hash, 0, !dbg !24 ; <i1> [#uses=1] br i1 %0, label %bb, label %bb1, !dbg !24 @@ -32,7 +32,7 @@ bb1: ; preds = %entry br label %bb2, !dbg !27 bb2: ; preds = %bb1, %bb - %.0 = phi i8* [ getelementptr inbounds ([1 x i8]* @.str, i64 0, i64 0), %bb ], [ %name, %bb1 ] ; <i8*> [#uses=1] + %.0 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %bb ], [ %name, %bb1 ] ; <i8*> [#uses=1] ret i8* %.0, !dbg !27 } @@ -45,34 +45,34 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!30} -!0 = !{!"0x101\00name\008\000", !1, !2, !6} ; [ DW_TAG_arg_variable ] -!1 = !{!"0x2e\00vfs_addname\00vfs_addname\00vfs_addname\0012\000\001\000\006\000\000\000", !28, !2, !4, null, null, null, null, null} ; [ DW_TAG_subprogram ] -!2 = !{!"0x29", !28} ; [ DW_TAG_file_type ] -!3 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)\001\00\000\00\000", !28, !29, !29, null, null, null} ; [ DW_TAG_compile_unit ] -!4 = !{!"0x15\00\000\000\000\000\000\000", !28, !2, null, !5, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "name", line: 8, arg: 0, scope: !1, file: !2, type: !6) +!1 = !MDSubprogram(name: "vfs_addname", linkageName: "vfs_addname", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !28, scope: !2, type: !4) +!2 = !MDFile(filename: "tail.c", directory: "/Users/echeng/LLVM/radars/r7927803/") +!3 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: 0, file: !28, enums: !29, retainedTypes: !29) +!4 = !MDSubroutineType(types: !5) !5 = !{!6, !6, !9, !9, !9} -!6 = !{!"0xf\00\000\0064\0064\000\000", !28, !2, !7} ; [ DW_TAG_pointer_type ] -!7 = !{!"0x26\00\000\008\008\000\000", !28, !2, !8} ; [ DW_TAG_const_type ] -!8 = !{!"0x24\00char\000\008\008\000\000\006", !28, !2} ; [ DW_TAG_base_type ] -!9 = !{!"0x24\00unsigned int\000\0032\0032\000\000\007", !28, !2} ; [ DW_TAG_base_type ] -!10 = !{!"0x101\00len\009\000", !1, !2, !9} ; [ DW_TAG_arg_variable ] -!11 = !{!"0x101\00hash\0010\000", !1, !2, !9} ; [ DW_TAG_arg_variable ] -!12 = !{!"0x101\00flags\0011\000", !1, !2, !9} ; [ DW_TAG_arg_variable ] +!6 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !28, scope: !2, baseType: !7) +!7 = !MDDerivedType(tag: DW_TAG_const_type, size: 8, align: 8, file: !28, scope: !2, baseType: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) +!10 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "len", line: 9, arg: 0, scope: !1, file: !2, type: !9) +!11 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "hash", line: 10, arg: 0, scope: !1, file: !2, type: !9) +!12 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "flags", line: 11, arg: 0, scope: !1, file: !2, type: !9) !13 = !MDLocation(line: 13, scope: !14) -!14 = !{!"0xb\0012\000\000", !28, !1} ; [ DW_TAG_lexical_block ] -!15 = !{!"0x101\00name\0017\000", !16, !2, !6} ; [ DW_TAG_arg_variable ] -!16 = !{!"0x2e\00add_name_internal\00add_name_internal\00add_name_internal\0022\001\001\000\006\000\000\000", !28, !2, !17, null, null, null, null, null} ; [ DW_TAG_subprogram ] -!17 = !{!"0x15\00\000\000\000\000\000\000", !28, !2, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!14 = distinct !MDLexicalBlock(line: 12, column: 0, file: !28, scope: !1) +!15 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "name", line: 17, arg: 0, scope: !16, file: !2, type: !6) +!16 = !MDSubprogram(name: "add_name_internal", linkageName: "add_name_internal", line: 22, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !28, scope: !2, type: !17) +!17 = !MDSubroutineType(types: !18) !18 = !{!6, !6, !9, !9, !19, !9} -!19 = !{!"0x24\00unsigned char\000\008\008\000\000\008", !28, !2} ; [ DW_TAG_base_type ] -!20 = !{!"0x101\00len\0018\000", !16, !2, !9} ; [ DW_TAG_arg_variable ] -!21 = !{!"0x101\00hash\0019\000", !16, !2, !9} ; [ DW_TAG_arg_variable ] -!22 = !{!"0x101\00extra\0020\000", !16, !2, !19} ; [ DW_TAG_arg_variable ] -!23 = !{!"0x101\00flags\0021\000", !16, !2, !9} ; [ DW_TAG_arg_variable ] +!19 = !MDBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) +!20 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "len", line: 18, arg: 0, scope: !16, file: !2, type: !9) +!21 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "hash", line: 19, arg: 0, scope: !16, file: !2, type: !9) +!22 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "extra", line: 20, arg: 0, scope: !16, file: !2, type: !19) +!23 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "flags", line: 21, arg: 0, scope: !16, file: !2, type: !9) !24 = !MDLocation(line: 23, scope: !25) -!25 = !{!"0xb\0022\000\000", !28, !16} ; [ DW_TAG_lexical_block ] +!25 = distinct !MDLexicalBlock(line: 22, column: 0, file: !28, scope: !16) !26 = !MDLocation(line: 24, scope: !25) !27 = !MDLocation(line: 26, scope: !25) -!28 = !{!"tail.c", !"/Users/echeng/LLVM/radars/r7927803/"} +!28 = !MDFile(filename: "tail.c", directory: "/Users/echeng/LLVM/radars/r7927803/") !29 = !{i32 0} -!30 = !{i32 1, !"Debug Info Version", i32 2} +!30 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/DeadArgElim/aggregates.ll b/test/Transforms/DeadArgElim/aggregates.ll index f54c6c9..68d2534 100644 --- a/test/Transforms/DeadArgElim/aggregates.ll +++ b/test/Transforms/DeadArgElim/aggregates.ll @@ -157,6 +157,6 @@ define internal i8 @outer() { %res = call {i8*, i32} @mid() %resptr = extractvalue {i8*, i32} %res, 0 - %val = load i8* %resptr + %val = load i8, i8* %resptr ret i8 %val }
\ No newline at end of file diff --git a/test/Transforms/DeadArgElim/dbginfo.ll b/test/Transforms/DeadArgElim/dbginfo.ll index 5bbf821..462ae91 100644 --- a/test/Transforms/DeadArgElim/dbginfo.ll +++ b/test/Transforms/DeadArgElim/dbginfo.ll @@ -14,7 +14,7 @@ ; the function->debug info mapping on update to ensure it's accurate when used ; again for the next removal. -; CHECK: void ()* @_ZL2f1iz, {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [f1] +; CHECK: !MDSubprogram(name: "f1",{{.*}} function: void ()* @_ZL2f1iz ; Check that debug info metadata for subprograms stores pointers to ; updated LLVM functions. @@ -47,24 +47,24 @@ attributes #2 = { nounwind readnone } !llvm.module.flags = !{!12, !13} !llvm.ident = !{!14} -!0 = !{!"0x11\004\00clang version 3.6.0 \000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/dbg.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"dbg.cpp", !"/tmp/dbginfo"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "dbg.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !8} -!4 = !{!"0x2e\00f2\00f2\00_Z2f2v\004\000\001\000\000\00256\000\004", !1, !5, !6, null, void ()* @_Z2f2v, null, null, !2} ; [ DW_TAG_subprogram ] [line 4] [def] [f2] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/tmp/dbginfo/dbg.cpp] -!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 ] +!4 = !MDSubprogram(name: "f2", linkageName: "_Z2f2v", line: 4, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: void ()* @_Z2f2v, variables: !2) +!5 = !MDFile(filename: "dbg.cpp", directory: "/tmp/dbginfo") +!6 = !MDSubroutineType(types: !7) !7 = !{null} -!8 = !{!"0x2e\00f1\00f1\00_ZL2f1iz\001\001\001\000\000\00256\000\001", !1, !5, !9, null, void (i32, ...)* @_ZL2f1iz, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [local] [def] [f1] -!9 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !10, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!8 = !MDSubprogram(name: "f1", linkageName: "_ZL2f1iz", line: 1, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !9, function: void (i32, ...)* @_ZL2f1iz, variables: !2) +!9 = !MDSubroutineType(types: !10) !10 = !{null, !11, null} -!11 = !{!"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] +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{i32 2, !"Dwarf Version", i32 4} -!13 = !{i32 2, !"Debug Info Version", i32 2} +!13 = !{i32 2, !"Debug Info Version", i32 3} !14 = !{!"clang version 3.6.0 "} !15 = !MDLocation(line: 5, column: 3, scope: !4) !16 = !MDLocation(line: 6, column: 1, scope: !4) -!17 = !{!"0x101\00\0016777217\000", !8, !5, !11} ; [ DW_TAG_arg_variable ] [line 1] -!18 = !{!"0x102"} ; [ DW_TAG_expression ] +!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "", line: 1, arg: 1, scope: !8, file: !5, type: !11) +!18 = !MDExpression() !19 = !MDLocation(line: 1, column: 19, scope: !8) !20 = !MDLocation(line: 2, column: 1, scope: !8) diff --git a/test/Transforms/DeadArgElim/deadexternal.ll b/test/Transforms/DeadArgElim/deadexternal.ll index 665d7db..21cbc37 100644 --- a/test/Transforms/DeadArgElim/deadexternal.ll +++ b/test/Transforms/DeadArgElim/deadexternal.ll @@ -31,9 +31,9 @@ define void @h() { entry: %i = alloca i32, align 4 store volatile i32 10, i32* %i, align 4 -; CHECK: %tmp = load volatile i32* %i, align 4 +; CHECK: %tmp = load volatile i32, i32* %i, align 4 ; CHECK-NEXT: call void @f(i32 undef) - %tmp = load volatile i32* %i, align 4 + %tmp = load volatile i32, i32* %i, align 4 call void @f(i32 %tmp) ret void } diff --git a/test/Transforms/DeadArgElim/deadretval2.ll b/test/Transforms/DeadArgElim/deadretval2.ll index dcdc36e..b0d2428 100644 --- a/test/Transforms/DeadArgElim/deadretval2.ll +++ b/test/Transforms/DeadArgElim/deadretval2.ll @@ -20,7 +20,7 @@ define void @test3(i32 %X) { } define internal i32 @foo() { - %DEAD = load i32* @P ; <i32> [#uses=1] + %DEAD = load i32, i32* @P ; <i32> [#uses=1] ret i32 %DEAD } diff --git a/test/Transforms/DeadArgElim/keepalive.ll b/test/Transforms/DeadArgElim/keepalive.ll index 16569db..d8a0993 100644 --- a/test/Transforms/DeadArgElim/keepalive.ll +++ b/test/Transforms/DeadArgElim/keepalive.ll @@ -31,7 +31,7 @@ define void @caller() { ; We can't remove 'this' here, as that would put argmem in ecx instead of ; memory. define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca %argmem) { - %v = load i32* %argmem + %v = load i32, i32* %argmem ret i32 %v } ; CHECK-LABEL: define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca %argmem) diff --git a/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll b/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll index 39d5358..7746cce 100644 --- a/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll +++ b/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll @@ -11,10 +11,10 @@ define ghccc void @Func1(i32* noalias %Arg1, i32* noalias %Arg2, i32* %Arg3, i32 entry: store i32 add (i32 ptrtoint ([0 x i32]* @A to i32), i32 1), i32* %Arg2 ; CHECK: store i32 add (i32 ptrtoint ([0 x i32]* @A to i32), i32 1), i32* %Arg2 - %ln2gz = getelementptr i32* %Arg1, i32 14 + %ln2gz = getelementptr i32, i32* %Arg1, i32 14 %ln2gA = bitcast i32* %ln2gz to double* - %ln2gB = load double* %ln2gA - %ln2gD = getelementptr i32* %Arg2, i32 -3 + %ln2gB = load double, double* %ln2gA + %ln2gD = getelementptr i32, i32* %Arg2, i32 -3 %ln2gE = bitcast i32* %ln2gD to double* store double %ln2gB, double* %ln2gE ; CHECK: store double %ln2gB, double* %ln2gE diff --git a/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll b/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll index 95253f6..7e46d28 100644 --- a/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll +++ b/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll @@ -10,11 +10,11 @@ define void @_Z3foov(%"class.std::auto_ptr"* noalias nocapture sret %agg.result) _ZNSt8auto_ptrIiED1Ev.exit: %temp.lvalue = alloca %"class.std::auto_ptr", align 8 call void @_Z3barv(%"class.std::auto_ptr"* sret %temp.lvalue) - %_M_ptr.i.i = getelementptr inbounds %"class.std::auto_ptr"* %temp.lvalue, i64 0, i32 0 - %tmp.i.i = load i32** %_M_ptr.i.i, align 8 + %_M_ptr.i.i = getelementptr inbounds %"class.std::auto_ptr", %"class.std::auto_ptr"* %temp.lvalue, i64 0, i32 0 + %tmp.i.i = load i32*, i32** %_M_ptr.i.i, align 8 ; CHECK-NOT: store i32* null store i32* null, i32** %_M_ptr.i.i, align 8 - %_M_ptr.i.i4 = getelementptr inbounds %"class.std::auto_ptr"* %agg.result, i64 0, i32 0 + %_M_ptr.i.i4 = getelementptr inbounds %"class.std::auto_ptr", %"class.std::auto_ptr"* %agg.result, i64 0, i32 0 store i32* %tmp.i.i, i32** %_M_ptr.i.i4, align 8 ; CHECK: ret void ret void diff --git a/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll b/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll index 22b8786..d30e9a2 100644 --- a/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll +++ b/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll @@ -68,13 +68,13 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, define void @_ZSt9iter_swapIPSt4pairIPN4llvm10BasicBlockEjES5_EvT_T0_(%struct.pair.162* %__a, %struct.pair.162* %__b) nounwind uwtable inlinehint { entry: %memtmp = alloca %struct.pair.162, align 8 - %0 = getelementptr inbounds %struct.pair.162* %memtmp, i64 0, i32 0 - %1 = getelementptr inbounds %struct.pair.162* %__a, i64 0, i32 0 - %2 = load %struct.BasicBlock** %1, align 8 + %0 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %memtmp, i64 0, i32 0 + %1 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %__a, i64 0, i32 0 + %2 = load %struct.BasicBlock*, %struct.BasicBlock** %1, align 8 store %struct.BasicBlock* %2, %struct.BasicBlock** %0, align 8 - %3 = getelementptr inbounds %struct.pair.162* %memtmp, i64 0, i32 1 - %4 = getelementptr inbounds %struct.pair.162* %__a, i64 0, i32 1 - %5 = load i32* %4, align 4 + %3 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %memtmp, i64 0, i32 1 + %4 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %__a, i64 0, i32 1 + %5 = load i32, i32* %4, align 4 store i32 %5, i32* %3, align 8 %6 = bitcast %struct.pair.162* %__a to i8* %7 = bitcast %struct.pair.162* %__b to i8* diff --git a/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll b/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll index 968d608..de7a4cc 100644 --- a/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll +++ b/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll @@ -10,11 +10,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define void @write24to28(i32* nocapture %p) nounwind uwtable ssp { ; CHECK-LABEL: @write24to28( entry: - %arrayidx0 = getelementptr inbounds i32* %p, i64 1 + %arrayidx0 = getelementptr inbounds i32, i32* %p, i64 1 %p3 = bitcast i32* %arrayidx0 to i8* ; CHECK: call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 24, i32 4, i1 false) call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 28, i32 4, i1 false) - %arrayidx1 = getelementptr inbounds i32* %p, i64 7 + %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -25,7 +25,7 @@ entry: %p3 = bitcast i32* %p to i8* ; CHECK: call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 28, i32 4, i1 false) call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 32, i32 4, i1 false) - %arrayidx1 = getelementptr inbounds i32* %p, i64 7 + %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -36,7 +36,7 @@ entry: %p3 = bitcast i32* %p to i8* ; CHECK: call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 32, i32 16, i1 false) call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 32, i32 16, i1 false) - %arrayidx1 = getelementptr inbounds i32* %p, i64 7 + %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -47,7 +47,7 @@ entry: %0 = bitcast %struct.vec2plusi* %p to i8* ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2plusi* @glob2 to i8*), i64 32, i32 16, i1 false) tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2plusi* @glob2 to i8*), i64 36, i32 16, i1 false) - %c = getelementptr inbounds %struct.vec2plusi* %p, i64 0, i32 2 + %c = getelementptr inbounds %struct.vec2plusi, %struct.vec2plusi* %p, i64 0, i32 2 store i32 1, i32* %c, align 4 ret void } @@ -58,7 +58,7 @@ entry: %0 = bitcast %struct.vec2* %p to i8* ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 16, i32 16, i1 false) tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 16, i1 false) - %c = getelementptr inbounds %struct.vec2* %p, i64 0, i32 1 + %c = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 1 store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %c, align 4 ret void } @@ -69,7 +69,7 @@ entry: %0 = bitcast %struct.vec2* %p to i8* ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 16, i1 false) tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 16, i1 false) - %arrayidx1 = getelementptr inbounds %struct.vec2* %p, i64 0, i32 0, i64 7 + %arrayidx1 = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 0, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -84,12 +84,12 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind define void @cpu_lwp_fork(%struct.trapframe* %md_regs, i64 %pcb_rsp0) nounwind uwtable noinline ssp { entry: %0 = inttoptr i64 %pcb_rsp0 to %struct.trapframe* - %add.ptr = getelementptr inbounds %struct.trapframe* %0, i64 -1 + %add.ptr = getelementptr inbounds %struct.trapframe, %struct.trapframe* %0, i64 -1 %1 = bitcast %struct.trapframe* %add.ptr to i8* %2 = bitcast %struct.trapframe* %md_regs to i8* ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 1, i1 false) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 1, i1 false) - %tf_trapno = getelementptr inbounds %struct.trapframe* %0, i64 -1, i32 1 + %tf_trapno = getelementptr inbounds %struct.trapframe, %struct.trapframe* %0, i64 -1, i32 1 store i64 3, i64* %tf_trapno, align 8 ret void } diff --git a/test/Transforms/DeadStoreElimination/PartialStore.ll b/test/Transforms/DeadStoreElimination/PartialStore.ll index 80c2bfa..d85b4de 100644 --- a/test/Transforms/DeadStoreElimination/PartialStore.ll +++ b/test/Transforms/DeadStoreElimination/PartialStore.ll @@ -30,8 +30,8 @@ define i32 @test3(double %__x) { %__u = alloca { [3 x i32] } %tmp.1 = bitcast { [3 x i32] }* %__u to double* store double %__x, double* %tmp.1 - %tmp.4 = getelementptr { [3 x i32] }* %__u, i32 0, i32 0, i32 1 - %tmp.5 = load i32* %tmp.4 + %tmp.4 = getelementptr { [3 x i32] }, { [3 x i32] }* %__u, i32 0, i32 0, i32 1 + %tmp.5 = load i32, i32* %tmp.4 %tmp.6 = icmp slt i32 %tmp.5, 0 %tmp.7 = zext i1 %tmp.6 to i32 ret i32 %tmp.7 @@ -44,7 +44,7 @@ define void @test4(i8* %P) { ; CHECK-NEXT: store double store i8 19, i8* %P ;; dead - %A = getelementptr i8* %P, i32 3 + %A = getelementptr i8, i8* %P, i32 3 store i8 42, i8* %A ;; dead @@ -58,7 +58,7 @@ declare void @test5a(i32*) define void @test5(i32 %i) nounwind ssp { %A = alloca i32 %B = bitcast i32* %A to i8* - %C = getelementptr i8* %B, i32 %i + %C = getelementptr i8, i8* %B, i32 %i store i8 10, i8* %C ;; Dead store to variable index. store i32 20, i32* %A @@ -74,7 +74,7 @@ declare void @test5a_as1(i32*) define void @test5_addrspacecast(i32 %i) nounwind ssp { %A = alloca i32 %B = addrspacecast i32* %A to i8 addrspace(1)* - %C = getelementptr i8 addrspace(1)* %B, i32 %i + %C = getelementptr i8, i8 addrspace(1)* %B, i32 %i store i8 10, i8 addrspace(1)* %C ;; Dead store to variable index. store i32 20, i32* %A diff --git a/test/Transforms/DeadStoreElimination/atomic.ll b/test/Transforms/DeadStoreElimination/atomic.ll index af303fa..79beee8 100644 --- a/test/Transforms/DeadStoreElimination/atomic.ll +++ b/test/Transforms/DeadStoreElimination/atomic.ll @@ -23,28 +23,6 @@ define void @test1() { ret void } -; DSE across seq_cst load (allowed) -define i32 @test2() { -; CHECK-LABEL: test2 -; CHECK-NOT: store i32 0 -; CHECK: store i32 1 - store i32 0, i32* @x - %x = load atomic i32* @y seq_cst, align 4 - store i32 1, i32* @x - ret i32 %x -} - -; DSE across seq_cst store (allowed) -define void @test3() { -; CHECK-LABEL: test3 -; CHECK-NOT: store i32 0 -; CHECK: store atomic i32 2 - store i32 0, i32* @x - store atomic i32 2, i32* @y seq_cst, align 4 - store i32 1, i32* @x - ret void -} - ; DSE remove unordered store (allowed) define void @test4() { ; CHECK-LABEL: test4 @@ -69,7 +47,7 @@ define void @test6() { ; CHECK-LABEL: test6 ; CHECK-NOT: store ; CHECK: ret void - %x = load atomic i32* @x unordered, align 4 + %x = load atomic i32, i32* @x unordered, align 4 store atomic i32 %x, i32* @x unordered, align 4 ret void } @@ -93,7 +71,7 @@ define i32 @test8() { %a = alloca i32 call void @randomop(i32* %a) store i32 0, i32* %a, align 4 - %x = load atomic i32* @x seq_cst, align 4 + %x = load atomic i32, i32* @x seq_cst, align 4 ret i32 %x } @@ -103,7 +81,7 @@ define i32 @test9() { ; CHECK-NOT: store i32 0 ; CHECK: store i32 1 store i32 0, i32* @x - %x = load atomic i32* @y monotonic, align 4 + %x = load atomic i32, i32* @y monotonic, align 4 store i32 1, i32* @x ret i32 %x } @@ -125,7 +103,7 @@ define i32 @test11() { ; CHECK: store atomic i32 0 ; CHECK: store atomic i32 1 store atomic i32 0, i32* @x monotonic, align 4 - %x = load atomic i32* @y monotonic, align 4 + %x = load atomic i32, i32* @y monotonic, align 4 store atomic i32 1, i32* @x monotonic, align 4 ret i32 %x } @@ -141,30 +119,6 @@ define void @test12() { ret void } -; DSE is allowed across a pair of an atomic read and then write. -define i32 @test13() { -; CHECK-LABEL: test13 -; CHECK-NOT: store i32 0 -; CHECK: store i32 1 - store i32 0, i32* @x - %x = load atomic i32* @y seq_cst, align 4 - store atomic i32 %x, i32* @y seq_cst, align 4 - store i32 1, i32* @x - ret i32 %x -} - -; Same if it is acquire-release instead of seq_cst/seq_cst -define i32 @test14() { -; CHECK-LABEL: test14 -; CHECK-NOT: store i32 0 -; CHECK: store i32 1 - store i32 0, i32* @x - %x = load atomic i32* @y acquire, align 4 - store atomic i32 %x, i32* @y release, align 4 - store i32 1, i32* @x - ret i32 %x -} - ; But DSE is not allowed across a release-acquire pair. define i32 @test15() { ; CHECK-LABEL: test15 @@ -172,7 +126,7 @@ define i32 @test15() { ; CHECK: store i32 1 store i32 0, i32* @x store atomic i32 0, i32* @y release, align 4 - %x = load atomic i32* @y acquire, align 4 + %x = load atomic i32, i32* @y acquire, align 4 store i32 1, i32* @x ret i32 %x } diff --git a/test/Transforms/DeadStoreElimination/const-pointers.ll b/test/Transforms/DeadStoreElimination/const-pointers.ll index 3e772d7..e4403ed 100644 --- a/test/Transforms/DeadStoreElimination/const-pointers.ll +++ b/test/Transforms/DeadStoreElimination/const-pointers.ll @@ -6,10 +6,10 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @g = global i32 42 define void @test1(%t* noalias %pp) { - %p = getelementptr inbounds %t* %pp, i32 0, i32 0 + %p = getelementptr inbounds %t, %t* %pp, i32 0, i32 0 store i32 1, i32* %p; <-- This is dead - %x = load i32* inttoptr (i32 12345 to i32*) + %x = load i32, i32* inttoptr (i32 12345 to i32*) store i32 %x, i32* %p ret void ; CHECK-LABEL: define void @test1( @@ -30,7 +30,7 @@ define void @test3() { define void @test4(i32* %p) { store i32 1, i32* %p - %x = load i32* @g; <-- %p and @g could alias + %x = load i32, i32* @g; <-- %p and @g could alias store i32 %x, i32* %p ret void ; CHECK-LABEL: define void @test4( diff --git a/test/Transforms/DeadStoreElimination/crash.ll b/test/Transforms/DeadStoreElimination/crash.ll index 148695f..78cb842 100644 --- a/test/Transforms/DeadStoreElimination/crash.ll +++ b/test/Transforms/DeadStoreElimination/crash.ll @@ -28,14 +28,14 @@ bb: ; preds = %bb, %entry define fastcc i32 @test2() nounwind ssp { bb14: ; preds = %bb4 %0 = bitcast i8* undef to i8** ; <i8**> [#uses=1] - %1 = getelementptr inbounds i8** %0, i64 undef ; <i8**> [#uses=1] + %1 = getelementptr inbounds i8*, i8** %0, i64 undef ; <i8**> [#uses=1] %2 = bitcast i8** %1 to i16* ; <i16*> [#uses=2] - %3 = getelementptr inbounds i16* %2, i64 undef ; <i16*> [#uses=1] + %3 = getelementptr inbounds i16, i16* %2, i64 undef ; <i16*> [#uses=1] %4 = bitcast i16* %3 to i8* ; <i8*> [#uses=1] - %5 = getelementptr inbounds i8* %4, i64 undef ; <i8*> [#uses=1] - %6 = getelementptr inbounds i16* %2, i64 undef ; <i16*> [#uses=1] + %5 = getelementptr inbounds i8, i8* %4, i64 undef ; <i8*> [#uses=1] + %6 = getelementptr inbounds i16, i16* %2, i64 undef ; <i16*> [#uses=1] store i16 undef, i16* %6, align 2 - %7 = getelementptr inbounds i8* %5, i64 undef ; <i8*> [#uses=1] + %7 = getelementptr inbounds i8, i8* %5, i64 undef ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i64(i8* %7, i8* undef, i64 undef, i32 1, i1 false) unreachable } @@ -49,8 +49,8 @@ entry: ret i32 0 dead: - %P2 = getelementptr i32 *%P2, i32 52 - %Q2 = getelementptr i32 *%Q2, i32 52 + %P2 = getelementptr i32, i32 *%P2, i32 52 + %Q2 = getelementptr i32, i32 *%Q2, i32 52 store i32 4, i32* %P2 store i32 4, i32* %Q2 br label %dead @@ -65,9 +65,9 @@ dead: define void @test4(%struct.f393a00_2__windmill* %a, %struct.f393a00_2__windmill* %b) { entry: %t = alloca %struct.f393a00_2__windmill ; <%struct.f393a00_2__windmill*> [#uses=1] - %0 = getelementptr %struct.f393a00_2__windmill* %t, i32 0, i32 0, i32 0 ; <%struct.ada__tags__dispatch_table**> [#uses=1] - %1 = load %struct.ada__tags__dispatch_table** null, align 4 ; <%struct.ada__tags__dispatch_table*> [#uses=1] - %2 = load %struct.ada__tags__dispatch_table** %0, align 8 ; <%struct.ada__tags__dispatch_table*> [#uses=1] + %0 = getelementptr %struct.f393a00_2__windmill, %struct.f393a00_2__windmill* %t, i32 0, i32 0, i32 0 ; <%struct.ada__tags__dispatch_table**> [#uses=1] + %1 = load %struct.ada__tags__dispatch_table*, %struct.ada__tags__dispatch_table** null, align 4 ; <%struct.ada__tags__dispatch_table*> [#uses=1] + %2 = load %struct.ada__tags__dispatch_table*, %struct.ada__tags__dispatch_table** %0, align 8 ; <%struct.ada__tags__dispatch_table*> [#uses=1] store %struct.ada__tags__dispatch_table* %2, %struct.ada__tags__dispatch_table** null, align 4 store %struct.ada__tags__dispatch_table* %1, %struct.ada__tags__dispatch_table** null, align 4 ret void diff --git a/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll b/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll index 8953f9c..30bb96f 100644 --- a/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll +++ b/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll @@ -22,18 +22,18 @@ define weak_odr zeroext i1 @test() #2 align 2 { bb: %tmp = alloca %class.basic_string, align 8 %tmp1 = alloca %class.basic_string, align 8 - %tmp3 = getelementptr inbounds %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 2 + %tmp3 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 2 %tmp4 = bitcast %union.anon* %tmp3 to i8* - %tmp5 = getelementptr inbounds %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 0, i32 0 - %tmp6 = getelementptr inbounds %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 1 - %tmp7 = getelementptr inbounds i8* %tmp4, i64 1 + %tmp5 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 0, i32 0 + %tmp6 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 1 + %tmp7 = getelementptr inbounds i8, i8* %tmp4, i64 1 %tmp8 = bitcast %class.basic_string* %tmp to i8* %tmp9 = bitcast i64 0 to i64 - %tmp10 = getelementptr inbounds %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 2 + %tmp10 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 2 %tmp11 = bitcast %union.anon* %tmp10 to i8* - %tmp12 = getelementptr inbounds %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 0, i32 0 - %tmp13 = getelementptr inbounds %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 1 - %tmp14 = getelementptr inbounds i8* %tmp11, i64 1 + %tmp12 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 0, i32 0 + %tmp13 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 1 + %tmp14 = getelementptr inbounds i8, i8* %tmp11, i64 1 %tmp15 = bitcast %class.basic_string* %tmp1 to i8* br label %_ZN12basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS2_.exit diff --git a/test/Transforms/DeadStoreElimination/dominate.ll b/test/Transforms/DeadStoreElimination/dominate.ll index 38cf1a0..638992b 100644 --- a/test/Transforms/DeadStoreElimination/dominate.ll +++ b/test/Transforms/DeadStoreElimination/dominate.ll @@ -5,7 +5,7 @@ declare void @bar() define void @foo() { bb1: %memtmp3.i = alloca [21 x i8], align 1 - %0 = getelementptr inbounds [21 x i8]* %memtmp3.i, i64 0, i64 0 + %0 = getelementptr inbounds [21 x i8], [21 x i8]* %memtmp3.i, i64 0, i64 0 br label %bb3 bb2: diff --git a/test/Transforms/DeadStoreElimination/free.ll b/test/Transforms/DeadStoreElimination/free.ll index 1d273d6..6b69ec8 100644 --- a/test/Transforms/DeadStoreElimination/free.ll +++ b/test/Transforms/DeadStoreElimination/free.ll @@ -10,7 +10,7 @@ declare noalias i8* @malloc(i64) ; CHECK-NEXT: @free ; CHECK-NEXT: ret void define void @test(i32* %Q, i32* %P) { - %DEAD = load i32* %Q ; <i32> [#uses=1] + %DEAD = load i32, i32* %Q ; <i32> [#uses=1] store i32 %DEAD, i32* %P %1 = bitcast i32* %P to i8* tail call void @free(i8* %1) @@ -22,7 +22,7 @@ define void @test(i32* %Q, i32* %P) { ; CHECK-NEXT: @free ; CHECK-NEXT: ret void define void @test2({i32, i32}* %P) { - %Q = getelementptr {i32, i32} *%P, i32 0, i32 1 + %Q = getelementptr {i32, i32}, {i32, i32} *%P, i32 0, i32 1 store i32 4, i32* %Q %1 = bitcast {i32, i32}* %P to i8* tail call void @free(i8* %1) @@ -35,7 +35,7 @@ define void @test2({i32, i32}* %P) { define void @test3() { %m = call i8* @malloc(i64 24) store i8 0, i8* %m - %m1 = getelementptr i8* %m, i64 1 + %m1 = getelementptr i8, i8* %m, i64 1 store i8 1, i8* %m1 call void @free(i8* %m) ret void diff --git a/test/Transforms/DeadStoreElimination/inst-limits.ll b/test/Transforms/DeadStoreElimination/inst-limits.ll index 3ef5607..a7b0aeb 100644 --- a/test/Transforms/DeadStoreElimination/inst-limits.ll +++ b/test/Transforms/DeadStoreElimination/inst-limits.ll @@ -118,7 +118,7 @@ entry: ; Insert a meaningless dbg.value intrinsic; it should have no ; effect on the working of DSE in any way. - call void @llvm.dbg.value(metadata i32* undef, i64 0, metadata !10, metadata !{}) + call void @llvm.dbg.value(metadata i32* undef, i64 0, metadata !10, metadata !MDExpression()) ; CHECK: store i32 -1, i32* @x, align 4 store i32 -1, i32* @x, align 4 @@ -245,18 +245,18 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!11, !13} -!0 = !{!"0x11\004\00clang version 3.4\001\00\000\00\000", !1, !2, !2, !3, !9, !2} ; [ DW_TAG_compile_unit ] [/home/tmp/test.c] [DW_LANG_C99] -!1 = !{!"test.c", !"/home/tmp"} -!2 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "test.c", directory: "/home/tmp") +!2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00test_within_limit\00test_within_limit\00\003\000\001\000\006\00256\000\004", !1, !5, !6, null, i32 ()* @test_within_limit, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [scope 4] [test] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/home/tmp/test.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "test_within_limit", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 ()* @test_within_limit, variables: !2) +!5 = !MDFile(filename: "test.c", directory: "/home/tmp") +!6 = !MDSubroutineType(types: !7) !7 = !{!8} -!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] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10} -!10 = !{!"0x34\00x\00x\00\001\000\001", null, !5, !8, i32* @x, null} ; [ DW_TAG_variable ] [x] [line 1] [def] +!10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "x", scope: !4, type: !8) !11 = !{i32 2, !"Dwarf Version", i32 4} !12 = !{i32* undef} -!13 = !{i32 1, !"Debug Info Version", i32 2} +!13 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/DeadStoreElimination/libcalls.ll b/test/Transforms/DeadStoreElimination/libcalls.ll index 6539694..8afa148 100644 --- a/test/Transforms/DeadStoreElimination/libcalls.ll +++ b/test/Transforms/DeadStoreElimination/libcalls.ll @@ -4,7 +4,7 @@ declare i8* @strcpy(i8* %dest, i8* %src) nounwind define void @test1(i8* %src) { ; CHECK-LABEL: @test1( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strcpy %call = call i8* @strcpy(i8* %dest, i8* %src) ; CHECK: ret void @@ -15,7 +15,7 @@ declare i8* @strncpy(i8* %dest, i8* %src, i32 %n) nounwind define void @test2(i8* %src) { ; CHECK-LABEL: @test2( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strncpy %call = call i8* @strncpy(i8* %dest, i8* %src, i32 12) ; CHECK: ret void @@ -26,7 +26,7 @@ declare i8* @strcat(i8* %dest, i8* %src) nounwind define void @test3(i8* %src) { ; CHECK-LABEL: @test3( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strcat %call = call i8* @strcat(i8* %dest, i8* %src) ; CHECK: ret void @@ -37,7 +37,7 @@ declare i8* @strncat(i8* %dest, i8* %src, i32 %n) nounwind define void @test4(i8* %src) { ; CHECK-LABEL: @test4( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strncat %call = call i8* @strncat(i8* %dest, i8* %src, i32 12) ; CHECK: ret void @@ -47,10 +47,10 @@ define void @test4(i8* %src) { define void @test5(i8* nocapture %src) { ; CHECK-LABEL: @test5( %dest = alloca [100 x i8], align 16 - %arraydecay = getelementptr inbounds [100 x i8]* %dest, i64 0, i64 0 + %arraydecay = getelementptr inbounds [100 x i8], [100 x i8]* %dest, i64 0, i64 0 %call = call i8* @strcpy(i8* %arraydecay, i8* %src) ; CHECK: %call = call i8* @strcpy - %arrayidx = getelementptr inbounds i8* %call, i64 10 + %arrayidx = getelementptr inbounds i8, i8* %call, i64 10 store i8 97, i8* %arrayidx, align 1 ret void } @@ -59,7 +59,7 @@ declare void @user(i8* %p) define void @test6(i8* %src) { ; CHECK-LABEL: @test6( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK: @strcpy %call = call i8* @strcpy(i8* %dest, i8* %src) ; CHECK: @user diff --git a/test/Transforms/DeadStoreElimination/lifetime.ll b/test/Transforms/DeadStoreElimination/lifetime.ll index 7fe7fbf..305c916 100644 --- a/test/Transforms/DeadStoreElimination/lifetime.ll +++ b/test/Transforms/DeadStoreElimination/lifetime.ll @@ -23,7 +23,7 @@ define void @test1() { define void @test2(i32* %P) { ; CHECK: test2 - %Q = getelementptr i32* %P, i32 1 + %Q = getelementptr i32, i32* %P, i32 1 %R = bitcast i32* %Q to i8* call void @llvm.lifetime.start(i64 4, i8* %R) ; CHECK: lifetime.start diff --git a/test/Transforms/DeadStoreElimination/no-targetdata.ll b/test/Transforms/DeadStoreElimination/no-targetdata.ll index 2539533..f9262ed 100644 --- a/test/Transforms/DeadStoreElimination/no-targetdata.ll +++ b/test/Transforms/DeadStoreElimination/no-targetdata.ll @@ -12,7 +12,7 @@ entry: ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64 ; CHECK: ret void - %arrayidx = getelementptr i8* %buf, i64 18 + %arrayidx = getelementptr i8, i8* %buf, i64 18 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arrayidx, i8* %buf, i64 18, i32 1, i1 false) store i8 1, i8* %arrayidx, align 1 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %buf, i8* %arrayidx, i64 18, i32 1, i1 false) diff --git a/test/Transforms/DeadStoreElimination/pr11390.ll b/test/Transforms/DeadStoreElimination/pr11390.ll index f63aa1e..faf3b8b 100644 --- a/test/Transforms/DeadStoreElimination/pr11390.ll +++ b/test/Transforms/DeadStoreElimination/pr11390.ll @@ -18,12 +18,12 @@ entry: if.end: ; preds = %entry tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %call4, i8* %name, i64 %call, i32 1, i1 false) - %arrayidx = getelementptr inbounds i8* %call4, i64 %call + %arrayidx = getelementptr inbounds i8, i8* %call4, i64 %call store i8 46, i8* %arrayidx, align 1 ; CHECK: store i8 46 - %add.ptr5 = getelementptr inbounds i8* %call4, i64 %add + %add.ptr5 = getelementptr inbounds i8, i8* %call4, i64 %add tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %add.ptr5, i8* %domain, i64 %call1, i32 1, i1 false) - %arrayidx8 = getelementptr inbounds i8* %call4, i64 %add2 + %arrayidx8 = getelementptr inbounds i8, i8* %call4, i64 %add2 store i8 0, i8* %arrayidx8, align 1 br label %return diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll index 1e81385..dd1443e 100644 --- a/test/Transforms/DeadStoreElimination/simple.ll +++ b/test/Transforms/DeadStoreElimination/simple.ll @@ -6,7 +6,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, declare i8* @llvm.init.trampoline(i8*, i8*, i8*) define void @test1(i32* %Q, i32* %P) { - %DEAD = load i32* %Q + %DEAD = load i32, i32* %Q store i32 %DEAD, i32* %P store i32 0, i32* %P ret void @@ -31,17 +31,17 @@ define void @test2(i32 *%p, i32 *%q) { define i32 @test3(i32* %g_addr) nounwind { ; CHECK-LABEL: @test3( -; CHECK: load i32* %g_addr - %g_value = load i32* %g_addr, align 4 +; CHECK: load i32, i32* %g_addr + %g_value = load i32, i32* %g_addr, align 4 store i32 -1, i32* @g, align 4 store i32 %g_value, i32* %g_addr, align 4 - %tmp3 = load i32* @g, align 4 + %tmp3 = load i32, i32* @g, align 4 ret i32 %tmp3 } define void @test4(i32* %Q) { - %a = load i32* %Q + %a = load i32, i32* %Q store volatile i32 %a, i32* %Q ret void ; CHECK-LABEL: @test4( @@ -51,7 +51,7 @@ define void @test4(i32* %Q) { } define void @test5(i32* %Q) { - %a = load volatile i32* %Q + %a = load volatile i32, i32* %Q store i32 %a, i32* %Q ret void ; CHECK-LABEL: @test5( @@ -87,7 +87,7 @@ define i32 @test8() { store i32 1234567, i32* %V %V2 = bitcast i32* %V to i8* store i8 0, i8* %V2 - %X = load i32* %V + %X = load i32, i32* %V ret i32 %X ; CHECK-LABEL: @test8( @@ -98,7 +98,7 @@ define i32 @test8() { ; Test for byval handling. %struct.x = type { i32, i32, i32, i32 } define void @test9(%struct.x* byval %a) nounwind { - %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 + %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 store i32 1, i32* %tmp2, align 4 ret void ; CHECK-LABEL: @test9( @@ -107,7 +107,7 @@ define void @test9(%struct.x* byval %a) nounwind { ; Test for inalloca handling. define void @test9_2(%struct.x* inalloca %a) nounwind { - %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 + %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 store i32 1, i32* %tmp2, align 4 ret void ; CHECK-LABEL: @test9_2( @@ -131,7 +131,7 @@ define void @test11() { ; CHECK-LABEL: @test11( %storage = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1] ; CHECK-NOT: alloca - %cast = getelementptr [10 x i8]* %storage, i32 0, i32 0 ; <i8*> [#uses=1] + %cast = getelementptr [10 x i8], [10 x i8]* %storage, i32 0, i32 0 ; <i8*> [#uses=1] %tramp = call i8* @llvm.init.trampoline( i8* %cast, i8* bitcast (void ()* @test11f to i8*), i8* null ) ; <i8*> [#uses=1] ; CHECK-NOT: trampoline ret void @@ -141,10 +141,10 @@ define void @test11() { ; PR2599 - load -> store to same address. define void @test12({ i32, i32 }* %x) nounwind { - %tmp4 = getelementptr { i32, i32 }* %x, i32 0, i32 0 - %tmp5 = load i32* %tmp4, align 4 - %tmp7 = getelementptr { i32, i32 }* %x, i32 0, i32 1 - %tmp8 = load i32* %tmp7, align 4 + %tmp4 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 0 + %tmp5 = load i32, i32* %tmp4, align 4 + %tmp7 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 1 + %tmp8 = load i32, i32* %tmp7, align 4 %tmp17 = sub i32 0, %tmp8 store i32 %tmp5, i32* %tmp4, align 4 store i32 %tmp17, i32* %tmp7, align 4 @@ -160,7 +160,7 @@ declare void @test13f() define i32* @test13() { %p = tail call i8* @malloc(i32 4) %P = bitcast i8* %p to i32* - %DEAD = load i32* %P + %DEAD = load i32, i32* %P %DEAD2 = add i32 %DEAD, 1 store i32 %DEAD2, i32* %P call void @test13f( ) @@ -176,7 +176,7 @@ define i32 addrspace(1)* @test13_addrspacecast() { %p = tail call i8* @malloc(i32 4) %p.bc = bitcast i8* %p to i32* %P = addrspacecast i32* %p.bc to i32 addrspace(1)* - %DEAD = load i32 addrspace(1)* %P + %DEAD = load i32, i32 addrspace(1)* %P %DEAD2 = add i32 %DEAD, 1 store i32 %DEAD2, i32 addrspace(1)* %P call void @test13f( ) @@ -195,7 +195,7 @@ declare noalias i8* @calloc(i32, i32) define void @test14(i32* %Q) { %P = alloca i32 - %DEAD = load i32* %Q + %DEAD = load i32, i32* %Q store i32 %DEAD, i32* %P ret void @@ -267,7 +267,7 @@ declare void @test19f({i32}* byval align 4 %P) define void @test19({i32} * nocapture byval align 4 %arg5) nounwind ssp { bb: - %tmp7 = getelementptr inbounds {i32}* %arg5, i32 0, i32 0 + %tmp7 = getelementptr inbounds {i32}, {i32}* %arg5, i32 0, i32 0 store i32 912, i32* %tmp7 call void @test19f({i32}* byval align 4 %arg5) ret void @@ -310,9 +310,9 @@ define void @test22(i1 %i, i32 %k, i32 %m) nounwind { declare noalias i8* @strdup(i8* nocapture) nounwind define noalias i8* @test23() nounwind uwtable ssp { %x = alloca [2 x i8], align 1 - %arrayidx = getelementptr inbounds [2 x i8]* %x, i64 0, i64 0 + %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 0 store i8 97, i8* %arrayidx, align 1 - %arrayidx1 = getelementptr inbounds [2 x i8]* %x, i64 0, i64 1 + %arrayidx1 = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 1 store i8 0, i8* %arrayidx1, align 1 %call = call i8* @strdup(i8* %arrayidx) nounwind ret i8* %call @@ -326,13 +326,13 @@ define noalias i8* @test23() nounwind uwtable ssp { ; CHECK: store i32 %c ; CHECK: ret void define void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind { - %1 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + %1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 0 store i32 0, i32* %1, align 4 - %2 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + %2 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 1 store i32 0, i32* %2, align 4 - %3 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + %3 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 0 store i32 %b, i32* %3, align 4 - %4 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + %4 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 1 store i32 %c, i32* %4, align 4 ret void } @@ -343,8 +343,8 @@ define void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind { ; CHECK: store i8 0 ; CHECK: store i8 %tmp define i8* @test25(i8* %p) nounwind { - %p.4 = getelementptr i8* %p, i64 4 - %tmp = load i8* %p.4, align 1 + %p.4 = getelementptr i8, i8* %p, i64 4 + %tmp = load i8, i8* %p.4, align 1 store i8 0, i8* %p.4, align 1 %q = call i8* @strdup(i8* %p) nounwind optsize store i8 %tmp, i8* %p.4, align 1 diff --git a/test/Transforms/EarlyCSE/basic.ll b/test/Transforms/EarlyCSE/basic.ll index a36a103..43b5e60 100644 --- a/test/Transforms/EarlyCSE/basic.ll +++ b/test/Transforms/EarlyCSE/basic.ll @@ -37,8 +37,8 @@ define void @test1(i8 %V, i32 *%P) { ;; Simple load value numbering. ; CHECK-LABEL: @test2( define i32 @test2(i32 *%P) { - %V1 = load i32* %P - %V2 = load i32* %P + %V1 = load i32, i32* %P + %V2 = load i32, i32* %P %Diff = sub i32 %V1, %V2 ret i32 %Diff ; CHECK: ret i32 0 @@ -46,9 +46,9 @@ define i32 @test2(i32 *%P) { ; CHECK-LABEL: @test2a( define i32 @test2a(i32 *%P, i1 %b) { - %V1 = load i32* %P + %V1 = load i32, i32* %P tail call void @llvm.assume(i1 %b) - %V2 = load i32* %P + %V2 = load i32, i32* %P %Diff = sub i32 %V1, %V2 ret i32 %Diff ; CHECK: ret i32 0 @@ -57,13 +57,13 @@ define i32 @test2a(i32 *%P, i1 %b) { ;; Cross block load value numbering. ; CHECK-LABEL: @test3( define i32 @test3(i32 *%P, i1 %Cond) { - %V1 = load i32* %P + %V1 = load i32, i32* %P br i1 %Cond, label %T, label %F T: store i32 4, i32* %P ret i32 42 F: - %V2 = load i32* %P + %V2 = load i32, i32* %P %Diff = sub i32 %V1, %V2 ret i32 %Diff ; CHECK: F: @@ -72,14 +72,14 @@ F: ; CHECK-LABEL: @test3a( define i32 @test3a(i32 *%P, i1 %Cond, i1 %b) { - %V1 = load i32* %P + %V1 = load i32, i32* %P br i1 %Cond, label %T, label %F T: store i32 4, i32* %P ret i32 42 F: tail call void @llvm.assume(i1 %b) - %V2 = load i32* %P + %V2 = load i32, i32* %P %Diff = sub i32 %V1, %V2 ret i32 %Diff ; CHECK: F: @@ -89,7 +89,7 @@ F: ;; Cross block load value numbering stops when stores happen. ; CHECK-LABEL: @test4( define i32 @test4(i32 *%P, i1 %Cond) { - %V1 = load i32* %P + %V1 = load i32, i32* %P br i1 %Cond, label %T, label %F T: ret i32 42 @@ -97,7 +97,7 @@ F: ; Clobbers V1 store i32 42, i32* %P - %V2 = load i32* %P + %V2 = load i32, i32* %P %Diff = sub i32 %V1, %V2 ret i32 %Diff ; CHECK: F: @@ -120,7 +120,7 @@ define i32 @test5(i32 *%P) { ; CHECK-LABEL: @test6( define i32 @test6(i32 *%P) { store i32 42, i32* %P - %V1 = load i32* %P + %V1 = load i32, i32* %P ret i32 %V1 ; CHECK: ret i32 42 } @@ -129,7 +129,7 @@ define i32 @test6(i32 *%P) { define i32 @test6a(i32 *%P, i1 %b) { store i32 42, i32* %P tail call void @llvm.assume(i1 %b) - %V1 = load i32* %P + %V1 = load i32, i32* %P ret i32 %V1 ; CHECK: ret i32 42 } @@ -195,11 +195,11 @@ define void @test11(i32 *%P) { ; CHECK-LABEL: @test12( define i32 @test12(i1 %B, i32* %P1, i32* %P2) { - %load0 = load i32* %P1 - %1 = load atomic i32* %P2 seq_cst, align 4 - %load1 = load i32* %P1 + %load0 = load i32, i32* %P1 + %1 = load atomic i32, i32* %P2 seq_cst, align 4 + %load1 = load i32, i32* %P1 %sel = select i1 %B, i32 %load0, i32 %load1 ret i32 %sel - ; CHECK: load i32* %P1 - ; CHECK: load i32* %P1 + ; CHECK: load i32, i32* %P1 + ; CHECK: load i32, i32* %P1 } diff --git a/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll b/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll index 36a7658..ca05d63 100644 --- a/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll +++ b/test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll @@ -17,7 +17,7 @@ define i32 @g() readonly { ; CHECK: define i32 @h() #0 define i32 @h() readnone { - %tmp = load i32* @x ; <i32> [#uses=1] + %tmp = load i32, i32* @x ; <i32> [#uses=1] ret i32 %tmp } diff --git a/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll b/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll index b7e4d1f..fef872c 100644 --- a/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll +++ b/test/Transforms/FunctionAttrs/2008-09-13-VolatileRead.ll @@ -4,6 +4,6 @@ @g = global i32 0 ; <i32*> [#uses=1] define i32 @f() { - %t = load volatile i32* @g ; <i32> [#uses=1] + %t = load volatile i32, i32* @g ; <i32> [#uses=1] ret i32 %t } diff --git a/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll b/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll index 9655da4..e3a8f01 100644 --- a/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll +++ b/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll @@ -3,6 +3,6 @@ @s = external constant i8 ; <i8*> [#uses=1] define i8 @f() { - %tmp = load i8* @s ; <i8> [#uses=1] + %tmp = load i8, i8* @s ; <i8> [#uses=1] ret i8 %tmp } diff --git a/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll b/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll index 0cf1cb7..ec1db09 100644 --- a/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll +++ b/test/Transforms/FunctionAttrs/2009-01-02-LocalStores.ll @@ -2,7 +2,7 @@ ; CHECK: define i32* @a(i32** nocapture readonly %p) define i32* @a(i32** %p) { - %tmp = load i32** %p + %tmp = load i32*, i32** %p ret i32* %tmp } diff --git a/test/Transforms/FunctionAttrs/2010-10-30-volatile.ll b/test/Transforms/FunctionAttrs/2010-10-30-volatile.ll index 93991d2..1a64a83 100644 --- a/test/Transforms/FunctionAttrs/2010-10-30-volatile.ll +++ b/test/Transforms/FunctionAttrs/2010-10-30-volatile.ll @@ -5,6 +5,6 @@ define void @foo() { ; CHECK: void @foo() { - %tmp = load volatile i32* @g + %tmp = load volatile i32, i32* @g ret void } diff --git a/test/Transforms/FunctionAttrs/atomic.ll b/test/Transforms/FunctionAttrs/atomic.ll index d5a8db7..bb86701 100644 --- a/test/Transforms/FunctionAttrs/atomic.ll +++ b/test/Transforms/FunctionAttrs/atomic.ll @@ -7,7 +7,7 @@ define i32 @test1(i32 %x) uwtable ssp { entry: %x.addr = alloca i32, align 4 store atomic i32 %x, i32* %x.addr seq_cst, align 4 - %r = load atomic i32* %x.addr seq_cst, align 4 + %r = load atomic i32, i32* %x.addr seq_cst, align 4 ret i32 %r } @@ -15,7 +15,7 @@ entry: define i32 @test2(i32* %x) uwtable ssp { ; CHECK: define i32 @test2(i32* nocapture readonly %x) #1 { entry: - %r = load atomic i32* %x seq_cst, align 4 + %r = load atomic i32, i32* %x seq_cst, align 4 ret i32 %r } diff --git a/test/Transforms/FunctionAttrs/nocapture.ll b/test/Transforms/FunctionAttrs/nocapture.ll index d3842c8..23cbc85 100644 --- a/test/Transforms/FunctionAttrs/nocapture.ll +++ b/test/Transforms/FunctionAttrs/nocapture.ll @@ -39,8 +39,8 @@ define i1 @c5(i32* %q, i32 %bitno) { %tmp2 = lshr i32 %tmp, %bitno %bit = and i32 %tmp2, 1 ; subtle escape mechanism follows - %lookup = getelementptr [2 x i1]* @lookup_table, i32 0, i32 %bit - %val = load i1* %lookup + %lookup = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 %bit + %val = load i1, i1* %lookup ret i1 %val } @@ -64,14 +64,14 @@ define i1* @lookup_bit(i32* %q, i32 %bitno) readnone nounwind { %tmp = ptrtoint i32* %q to i32 %tmp2 = lshr i32 %tmp, %bitno %bit = and i32 %tmp2, 1 - %lookup = getelementptr [2 x i1]* @lookup_table, i32 0, i32 %bit + %lookup = getelementptr [2 x i1], [2 x i1]* @lookup_table, i32 0, i32 %bit ret i1* %lookup } ; CHECK: define i1 @c7(i32* readonly %q, i32 %bitno) define i1 @c7(i32* %q, i32 %bitno) { %ptr = call i1* @lookup_bit(i32* %q, i32 %bitno) - %val = load i1* %ptr + %val = load i1, i1* %ptr ret i1 %val } @@ -85,7 +85,7 @@ l: %y = phi i32* [ %q, %e ] %tmp = bitcast i32* %x to i32* ; <i32*> [#uses=2] %tmp2 = select i1 %b, i32* %tmp, i32* %y - %val = load i32* %tmp2 ; <i32> [#uses=1] + %val = load i32, i32* %tmp2 ; <i32> [#uses=1] store i32 0, i32* %tmp store i32* %y, i32** @g ret i32 %val @@ -100,7 +100,7 @@ l: %y = phi i32* [ %q, %e ] %tmp = addrspacecast i32 addrspace(1)* %x to i32* ; <i32*> [#uses=2] %tmp2 = select i1 %b, i32* %tmp, i32* %y - %val = load i32* %tmp2 ; <i32> [#uses=1] + %val = load i32, i32* %tmp2 ; <i32> [#uses=1] store i32 0, i32* %tmp store i32* %y, i32** @g ret i32 %val diff --git a/test/Transforms/FunctionAttrs/optnone-simple.ll b/test/Transforms/FunctionAttrs/optnone-simple.ll index 9d0f8e3..beaa588 100644 --- a/test/Transforms/FunctionAttrs/optnone-simple.ll +++ b/test/Transforms/FunctionAttrs/optnone-simple.ll @@ -15,8 +15,8 @@ entry: %b.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 store i32 %b, i32* %b.addr, align 4 - %0 = load i32* %a.addr, align 4 - %1 = load i32* %b.addr, align 4 + %0 = load i32, i32* %a.addr, align 4 + %1 = load i32, i32* %b.addr, align 4 %add = add nsw i32 %0, %1 ret i32 %add } @@ -33,8 +33,8 @@ entry: %b.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 store i32 %b, i32* %b.addr, align 4 - %0 = load i32* %a.addr, align 4 - %1 = load i32* %b.addr, align 4 + %0 = load i32, i32* %a.addr, align 4 + %1 = load i32, i32* %b.addr, align 4 %add = add nsw i32 %0, %1 ret i32 %add } @@ -57,8 +57,8 @@ entry: %b.addr = alloca float, align 4 store float %a, float* %a.addr, align 4 store float %b, float* %b.addr, align 4 - %0 = load float* %a.addr, align 4 - %1 = load float* %b.addr, align 4 + %0 = load float, float* %a.addr, align 4 + %1 = load float, float* %b.addr, align 4 %sub = fsub float %0, %1 ret float %sub } @@ -75,8 +75,8 @@ entry: %b.addr = alloca float, align 4 store float %a, float* %a.addr, align 4 store float %b, float* %b.addr, align 4 - %0 = load float* %a.addr, align 4 - %1 = load float* %b.addr, align 4 + %0 = load float, float* %a.addr, align 4 + %1 = load float, float* %b.addr, align 4 %sub = fsub float %0, %1 ret float %sub } @@ -100,8 +100,8 @@ entry: %b.addr = alloca <4 x float>, align 16 store <4 x float> %a, <4 x float>* %a.addr, align 16 store <4 x float> %b, <4 x float>* %b.addr, align 16 - %0 = load <4 x float>* %a.addr, align 16 - %1 = load <4 x float>* %b.addr, align 16 + %0 = load <4 x float>, <4 x float>* %a.addr, align 16 + %1 = load <4 x float>, <4 x float>* %b.addr, align 16 %mul = fmul <4 x float> %0, %1 ret <4 x float> %mul } @@ -118,8 +118,8 @@ entry: %b.addr = alloca <4 x float>, align 16 store <4 x float> %a, <4 x float>* %a.addr, align 16 store <4 x float> %b, <4 x float>* %b.addr, align 16 - %0 = load <4 x float>* %a.addr, align 16 - %1 = load <4 x float>* %b.addr, align 16 + %0 = load <4 x float>, <4 x float>* %a.addr, align 16 + %1 = load <4 x float>, <4 x float>* %b.addr, align 16 %mul = fmul <4 x float> %0, %1 ret <4 x float> %mul } diff --git a/test/Transforms/GCOVProfiling/function-numbering.ll b/test/Transforms/GCOVProfiling/function-numbering.ll index 487f4ca..d39a7e1 100644 --- a/test/Transforms/GCOVProfiling/function-numbering.ll +++ b/test/Transforms/GCOVProfiling/function-numbering.ll @@ -6,7 +6,7 @@ ; RUN: cat %s %t1 > %t2 ; RUN: opt -insert-gcov-profiling -S < %t2 | FileCheck --check-prefix GCDA %s -; RUN: llvm-cov -n -dump %T/function-numbering.gcno 2>&1 | FileCheck --check-prefix GCNO %s +; RUN: llvm-cov gcov -n -dump %T/function-numbering.gcno 2>&1 | FileCheck --check-prefix GCNO %s target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" @@ -15,8 +15,8 @@ target triple = "x86_64-apple-macosx10.10.0" ; GCDA-NOT: @{{[0-9]+}} = private unnamed_addr constant .* c"bar\00" ; GCDA: @[[BAZ:[0-9]+]] = private unnamed_addr constant [4 x i8] c"baz\00" ; GCDA: define internal void @__llvm_gcov_writeout() -; GCDA: call void @llvm_gcda_emit_function(i32 0, i8* getelementptr inbounds ([4 x i8]* @[[FOO]] -; GCDA: call void @llvm_gcda_emit_function(i32 1, i8* getelementptr inbounds ([4 x i8]* @[[BAZ]] +; GCDA: call void @llvm_gcda_emit_function(i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @[[FOO]] +; GCDA: call void @llvm_gcda_emit_function(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @[[BAZ]] ; GCNO: == foo (0) @ ; GCNO-NOT: == bar ({{[0-9]+}}) @ @@ -40,17 +40,17 @@ define void @baz() { !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !{!"0x11\0012\00clang version 3.6.0 \000\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [function-numbering.ll] [DW_LANG_C99] -!1 = !{!".../llvm/test/Transforms/GCOVProfiling/function-numbering.ll", !""} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: ".../llvm/test/Transforms/GCOVProfiling/function-numbering.ll", directory: "") !2 = !{} !3 = !{!4, !7, !8} -!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\000\000\000\001", !1, !5, !6, null, void ()* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/bogner/build/llvm-debug//tmp/foo.c] -!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\00bar\00bar\00\002\000\001\000\000\000\000\002", !1, !5, !6, null, void ()* @bar, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [def] [bar] -!8 = !{!"0x2e\00baz\00baz\00\003\000\001\000\000\000\000\003", !1, !5, !6, null, void ()* @baz, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [baz] +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @foo, variables: !2) +!5 = !MDFile(filename: ".../llvm/test/Transforms/GCOVProfiling/function-numbering.ll", directory: "") +!6 = !MDSubroutineType(types: !2) +!7 = !MDSubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @bar, variables: !2) +!8 = !MDSubprogram(name: "baz", line: 3, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: void ()* @baz, variables: !2) !9 = !{i32 2, !"Dwarf Version", i32 2} -!10 = !{i32 2, !"Debug Info Version", i32 2} +!10 = !{i32 2, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.6.0 "} !12 = !MDLocation(line: 1, column: 13, scope: !4) !13 = !MDLocation(line: 3, column: 13, scope: !8) diff --git a/test/Transforms/GCOVProfiling/global-ctor.ll b/test/Transforms/GCOVProfiling/global-ctor.ll index 9a9b7ce..c064d9a 100644 --- a/test/Transforms/GCOVProfiling/global-ctor.ll +++ b/test/Transforms/GCOVProfiling/global-ctor.ll @@ -38,19 +38,19 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" " !llvm.gcov = !{!16} !llvm.ident = !{!12} -!0 = !{!"0x11\004\00clang version 3.5.0 (trunk 210217)\000\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/home/nlewycky/<stdin>] [DW_LANG_C_plus_plus] -!1 = !{!"<stdin>", !"/home/nlewycky"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 210217)", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "<stdin>", directory: "/home/nlewycky") !2 = !{} !3 = !{!4, !8} -!4 = !{!"0x2e\00__cxx_global_var_init\00__cxx_global_var_init\00\002\001\001\000\006\00256\000\002", !5, !6, !7, null, void ()* @__cxx_global_var_init, null, null, !2} ; [ DW_TAG_subprogram ] [line 2] [local] [def] [__cxx_global_var_init] -!5 = !{!"global-ctor.ll", !"/home/nlewycky"} -!6 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/home/nlewycky/global-ctor.ll] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!8 = !{!"0x2e\00\00\00_GLOBAL__sub_I_global-ctor.ll\000\001\001\000\006\0064\000\000", !1, !9, !7, null, void ()* @_GLOBAL__sub_I_global-ctor.ll, null, null, !2} ; [ DW_TAG_subprogram ] [line 0] [local] [def] -!9 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/home/nlewycky/<stdin>] +!4 = !MDSubprogram(name: "__cxx_global_var_init", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !6, type: !7, function: void ()* @__cxx_global_var_init, variables: !2) +!5 = !MDFile(filename: "global-ctor.ll", directory: "/home/nlewycky") +!6 = !MDFile(filename: "global-ctor.ll", directory: "/home/nlewycky") +!7 = !MDSubroutineType(types: !2) +!8 = !MDSubprogram(name: "", linkageName: "_GLOBAL__sub_I_global-ctor.ll", isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !9, type: !7, function: void ()* @_GLOBAL__sub_I_global-ctor.ll, variables: !2) +!9 = !MDFile(filename: "<stdin>", directory: "/home/nlewycky") !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.5.0 (trunk 210217)"} !13 = !MDLocation(line: 2, scope: !4) !14 = !MDLocation(line: 0, scope: !15) -!15 = !{!"0xb\000", !5, !8} ; [ DW_TAG_lexical_block ] [/home/nlewycky/global-ctor.ll] +!15 = !MDLexicalBlockFile(discriminator: 0, file: !5, scope: !8) diff --git a/test/Transforms/GCOVProfiling/linezero.ll b/test/Transforms/GCOVProfiling/linezero.ll index cf0fcd2..d562282 100644 --- a/test/Transforms/GCOVProfiling/linezero.ll +++ b/test/Transforms/GCOVProfiling/linezero.ll @@ -1,6 +1,5 @@ -; RUN: sed -e 's|PATTERN|%/T|g' < %s > %t1 -; RUN: opt -insert-gcov-profiling -disable-output < %t1 -; RUN: rm %T/linezero.gcno %t1 +; RUN: sed -e 's|PATTERN|%/T|g' %s | opt -insert-gcov-profiling -disable-output +; RUN: rm %T/linezero.gcno ; This is a crash test. @@ -19,38 +18,38 @@ entry: %__begin = alloca i8*, align 8 %__end = alloca i8*, align 8 %spec = alloca i8, align 1 - call void @llvm.dbg.declare(metadata %struct.vector** %__range, metadata !27, metadata !{}), !dbg !30 + call void @llvm.dbg.declare(metadata %struct.vector** %__range, metadata !27, metadata !MDExpression()), !dbg !30 br label %0 ; <label>:0 ; preds = %entry call void @_Z13TagFieldSpecsv(), !dbg !31 store %struct.vector* %ref.tmp, %struct.vector** %__range, align 8, !dbg !31 - call void @llvm.dbg.declare(metadata i8** %__begin, metadata !32, metadata !{}), !dbg !30 - %1 = load %struct.vector** %__range, align 8, !dbg !31 + call void @llvm.dbg.declare(metadata i8** %__begin, metadata !32, metadata !MDExpression()), !dbg !30 + %1 = load %struct.vector*, %struct.vector** %__range, align 8, !dbg !31 %call = call i8* @_ZN6vector5beginEv(%struct.vector* %1), !dbg !31 store i8* %call, i8** %__begin, align 8, !dbg !31 - call void @llvm.dbg.declare(metadata i8** %__end, metadata !33, metadata !{}), !dbg !30 - %2 = load %struct.vector** %__range, align 8, !dbg !31 + call void @llvm.dbg.declare(metadata i8** %__end, metadata !33, metadata !MDExpression()), !dbg !30 + %2 = load %struct.vector*, %struct.vector** %__range, align 8, !dbg !31 %call1 = call i8* @_ZN6vector3endEv(%struct.vector* %2), !dbg !31 store i8* %call1, i8** %__end, align 8, !dbg !31 br label %for.cond, !dbg !31 for.cond: ; preds = %for.inc, %0 - %3 = load i8** %__begin, align 8, !dbg !34 - %4 = load i8** %__end, align 8, !dbg !34 + %3 = load i8*, i8** %__begin, align 8, !dbg !34 + %4 = load i8*, i8** %__end, align 8, !dbg !34 %cmp = icmp ne i8* %3, %4, !dbg !34 br i1 %cmp, label %for.body, label %for.end, !dbg !34 for.body: ; preds = %for.cond - call void @llvm.dbg.declare(metadata i8* %spec, metadata !37, metadata !{}), !dbg !31 - %5 = load i8** %__begin, align 8, !dbg !38 - %6 = load i8* %5, align 1, !dbg !38 + call void @llvm.dbg.declare(metadata i8* %spec, metadata !37, metadata !MDExpression()), !dbg !31 + %5 = load i8*, i8** %__begin, align 8, !dbg !38 + %6 = load i8, i8* %5, align 1, !dbg !38 store i8 %6, i8* %spec, align 1, !dbg !38 br label %for.inc, !dbg !38 for.inc: ; preds = %for.body - %7 = load i8** %__begin, align 8, !dbg !40 - %incdec.ptr = getelementptr inbounds i8* %7, i32 1, !dbg !40 + %7 = load i8*, i8** %__begin, align 8, !dbg !40 + %incdec.ptr = getelementptr inbounds i8, i8* %7, i32 1, !dbg !40 store i8* %incdec.ptr, i8** %__begin, align 8, !dbg !40 br label %for.cond, !dbg !40 @@ -59,7 +58,7 @@ for.end: ; preds = %for.cond unreachable, !dbg !42 return: ; No predecessors! - %8 = load i32* %retval, !dbg !44 + %8 = load i32, i32* %retval, !dbg !44 ret i32 %8, !dbg !44 } @@ -94,49 +93,49 @@ attributes #3 = { noreturn nounwind } !llvm.gcov = !{!25} !llvm.ident = !{!26} -!0 = !{!"0x11\004\00clang version 3.5.0 (trunk 209871)\000\00\000\00\001", !1, !2, !3, !14, !2, !2} ; [ DW_TAG_compile_unit ] [<stdin>] [DW_LANG_C_plus_plus] -!1 = !{!"<stdin>", !"PATTERN"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 209871)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !2, imports: !2) +!1 = !MDFile(filename: "<stdin>", directory: "PATTERN") !2 = !{} !3 = !{!4} -!4 = !{!"0x13\00vector\0021\008\008\000\000\000", !5, null, null, !6, null, null, !"_ZTS6vector"} ; [ DW_TAG_structure_type ] [vector] [line 21, size 8, align 8, offset 0] [def] [from ] -!5 = !{!"linezero.cc", !"PATTERN"} +!4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "vector", line: 21, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS6vector") +!5 = !MDFile(filename: "linezero.cc", directory: "PATTERN") !6 = !{!7, !13} -!7 = !{!"0x2e\00begin\00begin\00_ZN6vector5beginEv\0025\000\000\000\006\00256\000\0025", !5, !"_ZTS6vector", !8, null, null, null, i32 0, null} ; [ DW_TAG_subprogram ] [line 25] [begin] -!8 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !9, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!7 = !MDSubprogram(name: "begin", linkageName: "_ZN6vector5beginEv", line: 25, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !5, scope: !"_ZTS6vector", type: !8) +!8 = !MDSubroutineType(types: !9) !9 = !{!10, !12} -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char] -!11 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char] -!12 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS6vector"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS6vector] -!13 = !{!"0x2e\00end\00end\00_ZN6vector3endEv\0026\000\000\000\006\00256\000\0026", !5, !"_ZTS6vector", !8, null, null, null, i32 0, null} ; [ DW_TAG_subprogram ] [line 26] [end] +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!12 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS6vector") +!13 = !MDSubprogram(name: "end", linkageName: "_ZN6vector3endEv", line: 26, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 26, file: !5, scope: !"_ZTS6vector", type: !8) !14 = !{!15, !20} -!15 = !{!"0x2e\00test\00test\00_Z4testv\0050\000\001\000\006\00256\000\0050", !5, !16, !17, null, i32 ()* @_Z4testv, null, null, !2} ; [ DW_TAG_subprogram ] [line 50] [def] [test] -!16 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [./linezero.cc] -!17 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!15 = !MDSubprogram(name: "test", linkageName: "_Z4testv", line: 50, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 50, file: !5, scope: !16, type: !17, function: i32 ()* @_Z4testv, variables: !2) +!16 = !MDFile(filename: "linezero.cc", directory: "PATTERN") +!17 = !MDSubroutineType(types: !18) !18 = !{!19} -!19 = !{!"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] -!20 = !{!"0x2e\00f1\00f1\00_Z2f1v\0054\000\001\000\006\00256\000\0054", !5, !16, !21, null, void ()* @_Z2f1v, null, null, !2} ; [ DW_TAG_subprogram ] [line 54] [def] [f1] -!21 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !22, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!19 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!20 = !MDSubprogram(name: "f1", linkageName: "_Z2f1v", line: 54, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 54, file: !5, scope: !16, type: !21, function: void ()* @_Z2f1v, variables: !2) +!21 = !MDSubroutineType(types: !22) !22 = !{null} !23 = !{i32 2, !"Dwarf Version", i32 4} -!24 = !{i32 2, !"Debug Info Version", i32 2} +!24 = !{i32 2, !"Debug Info Version", i32 3} !25 = !{!"PATTERN/linezero.o", !0} !26 = !{!"clang version 3.5.0 (trunk 209871)"} -!27 = !{!"0x100\00__range\000\0064", !28, null, !29} ; [ DW_TAG_auto_variable ] [__range] [line 0] -!28 = !{!"0xb\0051\000\000", !5, !15} ; [ DW_TAG_lexical_block ] [./linezero.cc] -!29 = !{!"0x42\00\000\000\000\000\000", null, null, !"_ZTS6vector"} ; [ DW_TAG_rvalue_reference_type ] [line 0, size 0, align 0, offset 0] [from _ZTS6vector] +!27 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "__range", flags: DIFlagArtificial, scope: !28, type: !29) +!28 = distinct !MDLexicalBlock(line: 51, column: 0, file: !5, scope: !15) +!29 = !MDDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !"_ZTS6vector") !30 = !MDLocation(line: 0, scope: !28) !31 = !MDLocation(line: 51, scope: !28) -!32 = !{!"0x100\00__begin\000\0064", !28, null, !10} ; [ DW_TAG_auto_variable ] [__begin] [line 0] -!33 = !{!"0x100\00__end\000\0064", !28, null, !10} ; [ DW_TAG_auto_variable ] [__end] [line 0] +!32 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "__begin", flags: DIFlagArtificial, scope: !28, type: !10) +!33 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "__end", flags: DIFlagArtificial, scope: !28, type: !10) !34 = !MDLocation(line: 51, scope: !35) -!35 = !{!"0xb\0051\000\005", !5, !36} ; [ DW_TAG_lexical_block ] [./linezero.cc] -!36 = !{!"0xb\0051\000\001", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc] -!37 = !{!"0x100\00spec\0051\000", !28, !16, !11} ; [ DW_TAG_auto_variable ] [spec] [line 51] +!35 = distinct !MDLexicalBlock(line: 51, column: 0, file: !5, scope: !36) +!36 = distinct !MDLexicalBlock(line: 51, column: 0, file: !5, scope: !28) +!37 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "spec", line: 51, scope: !28, file: !16, type: !11) !38 = !MDLocation(line: 51, scope: !39) -!39 = !{!"0xb\0051\000\002", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc] +!39 = distinct !MDLexicalBlock(line: 51, column: 0, file: !5, scope: !28) !40 = !MDLocation(line: 51, scope: !41) -!41 = !{!"0xb\0051\000\004", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc] +!41 = distinct !MDLexicalBlock(line: 51, column: 0, file: !5, scope: !28) !42 = !MDLocation(line: 51, scope: !43) -!43 = !{!"0xb\0051\000\003", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc] +!43 = distinct !MDLexicalBlock(line: 51, column: 0, file: !5, scope: !28) !44 = !MDLocation(line: 52, scope: !15) !45 = !MDLocation(line: 54, scope: !20) diff --git a/test/Transforms/GCOVProfiling/linkagename.ll b/test/Transforms/GCOVProfiling/linkagename.ll index c30d4a6..99ef08a 100644 --- a/test/Transforms/GCOVProfiling/linkagename.ll +++ b/test/Transforms/GCOVProfiling/linkagename.ll @@ -13,15 +13,15 @@ entry: !llvm.module.flags = !{!10} !llvm.gcov = !{!9} -!0 = !{!"0x11\004\00clang version 3.3 (trunk 177323)\000\00\000\00\000", !2, !3, !3, !4, !3, !3} ; [ DW_TAG_compile_unit ] [/home/nlewycky/hello.cc] [DW_LANG_C_plus_plus] -!1 = !{!"0x29", !2} ; [ DW_TAG_file_type ] [/home/nlewycky/hello.cc] -!2 = !{!"hello.cc", !"/home/nlewycky"} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 177323)", isOptimized: false, emissionKind: 0, file: !2, enums: !3, retainedTypes: !3, subprograms: !4, globals: !3, imports: !3) +!1 = !MDFile(filename: "hello.cc", directory: "/home/nlewycky") +!2 = !MDFile(filename: "hello.cc", directory: "/home/nlewycky") !3 = !{i32 0} !4 = !{!5} -!5 = !{!"0x2e\00foo\00foo\00_Z3foov\001\000\001\000\006\00256\000\001", !1, !1, !6, null, void ()* @_Z3foov, null, null, !3} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "foo", linkageName: "_Z3foov", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !1, type: !6, function: void ()* @_Z3foov, variables: !3) +!6 = !MDSubroutineType(types: !7) !7 = !{null} !8 = !MDLocation(line: 1, scope: !5) -!10 = !{i32 1, !"Debug Info Version", i32 2} +!10 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/GCOVProfiling/return-block.ll b/test/Transforms/GCOVProfiling/return-block.ll index f0be3d2..0fafc55 100644 --- a/test/Transforms/GCOVProfiling/return-block.ll +++ b/test/Transforms/GCOVProfiling/return-block.ll @@ -1,8 +1,14 @@ ; Inject metadata to set the .gcno file location ; RUN: echo '!19 = !{!"%/T/return-block.ll", !0}' > %t1 ; RUN: cat %s %t1 > %t2 + +; By default, the return block is last. ; RUN: opt -insert-gcov-profiling -disable-output %t2 -; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck %s +; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-LAST %s + +; But we can optionally emit it second, to match newer gcc versions. +; RUN: opt -insert-gcov-profiling -gcov-exit-block-before-body -disable-output %t2 +; RUN: llvm-cov gcov -n -dump %T/return-block.gcno 2>&1 | FileCheck -check-prefix=CHECK -check-prefix=RETURN-SECOND %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @@ -13,7 +19,7 @@ target triple = "x86_64-unknown-linux-gnu" define void @test() #0 { entry: tail call void (...)* @f() #2, !dbg !14 - %0 = load i32* @A, align 4, !dbg !15 + %0 = load i32, i32* @A, align 4, !dbg !15 %tobool = icmp eq i32 %0, 0, !dbg !15 br i1 %tobool, label %if.end, label %if.then, !dbg !15 @@ -38,29 +44,32 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!11, !12} !llvm.ident = !{!13} -!0 = !{!"0x11\0012\00clang version 3.6.0 (trunk 223182)\001\00\000\00\001", !1, !2, !2, !3, !8, !2} ; [ DW_TAG_compile_unit ] [return-block.c] [DW_LANG_C99] -!1 = !{!".../llvm/test/Transforms/GCOVProfiling/return-block.ll", !""} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 223182)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !8, imports: !2) +!1 = !MDFile(filename: ".../llvm/test/Transforms/GCOVProfiling/return-block.ll", directory: "") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00test\00test\00\005\000\001\000\000\000\001\005", !1, !5, !6, null, void ()* @test, null, null, !2} ; [ DW_TAG_subprogram ] [line 5] [def] [test] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [return-block.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 ] +!4 = !MDSubprogram(name: "test", line: 5, isLocal: false, isDefinition: true, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !6, function: void ()* @test, variables: !2) +!5 = !MDFile(filename: ".../llvm/test/Transforms/GCOVProfiling/return-block.ll", directory: "") +!6 = !MDSubroutineType(types: !7) !7 = !{null} !8 = !{!9} -!9 = !{!"0x34\00A\00A\00\003\000\001", null, !5, !10, i32* @A, null} ; [ DW_TAG_variable ] [A] [line 3] [def] -!10 = !{!"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 = !MDGlobalVariable(name: "A", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @A) +!10 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !11 = !{i32 2, !"Dwarf Version", i32 4} -!12 = !{i32 2, !"Debug Info Version", i32 2} +!12 = !{i32 2, !"Debug Info Version", i32 3} !13 = !{!"clang version 3.6.0 (trunk 223182)"} !14 = !MDLocation(line: 6, column: 3, scope: !4) !15 = !MDLocation(line: 7, column: 7, scope: !4) !16 = !MDLocation(line: 8, column: 5, scope: !17) -!17 = !{!"0xb\007\007\000", !1, !4} ; [ DW_TAG_lexical_block ] [return-block.c] +!17 = distinct !MDLexicalBlock(line: 7, column: 7, file: !1, scope: !4) !18 = !MDLocation(line: 9, column: 1, scope: !4) -; There should be no destination edges for block 1. -; CHECK: Block : 0 Counter : 0 -; CHECK-NEXT: Destination Edges : 2 (0), -; CHECK-NEXT: Block : 1 Counter : 0 -; CHECK-NEXT: Source Edges : 4 (0), -; CHECK-NEXT: Block : 2 Counter : 0 +; There should be no destination edges for the exit block. +; CHECK: Block : 1 Counter : 0 +; RETURN-LAST: Destination Edges +; RETURN-SECOND-NOT: Destination Edges +; CHECK: Block : 2 Counter : 0 +; CHECK: Block : 4 Counter : 0 +; RETURN-LAST-NOT: Destination Edges +; RETURN-SECOND: Destination Edges +; CHECK-NOT: Block : diff --git a/test/Transforms/GCOVProfiling/version.ll b/test/Transforms/GCOVProfiling/version.ll index 9436bd6..60bc6a0 100644 --- a/test/Transforms/GCOVProfiling/version.ll +++ b/test/Transforms/GCOVProfiling/version.ll @@ -16,15 +16,15 @@ define void @test() { !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!12} -!0 = !{!"0x11\004\00clang version 3.3 (trunk 176994)\000\00\000\00\000", !11, !3, !3, !4, !3, null} ; [ DW_TAG_compile_unit ] [./version] [DW_LANG_C_plus_plus] -!2 = !{!"0x29", !11} ; [ DW_TAG_file_type ] -!3 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 176994)", isOptimized: false, emissionKind: 0, file: !11, enums: !3, retainedTypes: !3, subprograms: !4, globals: !3) +!2 = !MDFile(filename: "version", directory: "/usr/local/google/home/nlewycky") +!3 = !{} !4 = !{!5} -!5 = !{!"0x2e\00test\00test\00\001\000\001\000\006\00256\000\001", !10, !6, !7, null, void ()* @test, null, null, !3} ; [ DW_TAG_subprogram ] [line 1] [def] [test] -!6 = !{!"0x29", !10} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !3, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "test", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !10, scope: !6, type: !7, function: void ()* @test, variables: !3) +!6 = !MDFile(filename: "<stdin>", directory: ".") +!7 = !MDSubroutineType(types: !{null}) !8 = !MDLocation(line: 1, scope: !5) ;; !9 is added through the echo line at the top. -!10 = !{!"<stdin>", !"."} -!11 = !{!"version", !"/usr/local/google/home/nlewycky"} -!12 = !{i32 1, !"Debug Info Version", i32 2} +!10 = !MDFile(filename: "<stdin>", directory: ".") +!11 = !MDFile(filename: "version", directory: "/usr/local/google/home/nlewycky") +!12 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/GVN/2007-07-25-DominatedLoop.ll b/test/Transforms/GVN/2007-07-25-DominatedLoop.ll index ad580ce..10d1e22 100644 --- a/test/Transforms/GVN/2007-07-25-DominatedLoop.ll +++ b/test/Transforms/GVN/2007-07-25-DominatedLoop.ll @@ -71,11 +71,11 @@ cond_true23.i: ; preds = %Perl_safefree.exit68 ret void cond_next150: ; preds = %Perl_safefree.exit68 - %tmp16092 = load i32* @PL_sv_count, align 4 ; <i32> [#uses=0] + %tmp16092 = load i32, i32* @PL_sv_count, align 4 ; <i32> [#uses=0] br label %cond_next165 bb157: ; preds = %cond_next165 - %tmp158 = load i32* @PL_sv_count, align 4 ; <i32> [#uses=0] + %tmp158 = load i32, i32* @PL_sv_count, align 4 ; <i32> [#uses=0] br label %cond_next165 cond_next165: ; preds = %bb157, %cond_next150 diff --git a/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll b/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll index 7e9c982..0ffb34c 100644 --- a/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll +++ b/test/Transforms/GVN/2007-07-25-InfiniteLoop.ll @@ -9,6 +9,6 @@ entry: br label %bb bb: ; preds = %bb, %entry - %tmp10 = load %struct.INT2** @blkshifts, align 4 ; <%struct.INT2*> [#uses=0] + %tmp10 = load %struct.INT2*, %struct.INT2** @blkshifts, align 4 ; <%struct.INT2*> [#uses=0] br label %bb } diff --git a/test/Transforms/GVN/2007-07-25-Loop.ll b/test/Transforms/GVN/2007-07-25-Loop.ll index 6a9f58e..54c0d98 100644 --- a/test/Transforms/GVN/2007-07-25-Loop.ll +++ b/test/Transforms/GVN/2007-07-25-Loop.ll @@ -10,6 +10,6 @@ bb278: ; preds = %bb278, %entry br i1 false, label %bb278, label %bb344 bb344: ; preds = %bb278, %entry - %tmp38758 = load i16* null, align 2 ; <i16> [#uses=0] + %tmp38758 = load i16, i16* null, align 2 ; <i16> [#uses=0] ret void } diff --git a/test/Transforms/GVN/2007-07-25-NestedLoop.ll b/test/Transforms/GVN/2007-07-25-NestedLoop.ll index c6d7750..8f2c182 100644 --- a/test/Transforms/GVN/2007-07-25-NestedLoop.ll +++ b/test/Transforms/GVN/2007-07-25-NestedLoop.ll @@ -10,27 +10,27 @@ bb534.preheader: ; preds = %entry ret %struct.TypHeader* null bb556.preheader: ; preds = %entry - %tmp56119 = getelementptr %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp56220 = load i32* %tmp56119 ; <i32> [#uses=0] + %tmp56119 = getelementptr %struct.TypHeader, %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp56220 = load i32, i32* %tmp56119 ; <i32> [#uses=0] br i1 false, label %bb.nph23, label %bb675.preheader bb.nph23: ; preds = %bb556.preheader ret %struct.TypHeader* null bb656: ; preds = %bb675.outer, %bb656 - %tmp678 = load i32* %tmp677 ; <i32> [#uses=0] + %tmp678 = load i32, i32* %tmp677 ; <i32> [#uses=0] br i1 false, label %bb684, label %bb656 bb684: ; preds = %bb675.outer, %bb656 br i1 false, label %bb924.preheader, label %bb675.outer bb675.outer: ; preds = %bb675.preheader, %bb684 - %tmp67812 = load i32* %tmp67711 ; <i32> [#uses=0] + %tmp67812 = load i32, i32* %tmp67711 ; <i32> [#uses=0] br i1 false, label %bb684, label %bb656 bb675.preheader: ; preds = %bb556.preheader - %tmp67711 = getelementptr %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp677 = getelementptr %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp67711 = getelementptr %struct.TypHeader, %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp677 = getelementptr %struct.TypHeader, %struct.TypHeader* %hdR, i32 0, i32 0 ; <i32*> [#uses=1] br label %bb675.outer bb924.preheader: ; preds = %bb684 diff --git a/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll b/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll index ecff657..d7e6c20 100644 --- a/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll +++ b/test/Transforms/GVN/2007-07-25-SinglePredecessor.ll @@ -12,7 +12,7 @@ define i32 @_ZNK21mrZEllipticalCylinder10viewingHitERK6ggRay3dddR18mrViewingHitRecordR16ggMaterialRecord(%struct.mrXEllipticalCylinder* %this, %struct.ggBox3* %ray, double %unnamed_arg, double %tmin, double %tmax, %struct.mrViewingHitRecord* %VHR, %struct.ggMaterialRecord* %unnamed_arg2) { entry: - %tmp80.i = getelementptr %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1] + %tmp80.i = getelementptr %struct.mrViewingHitRecord, %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1] store double 0.000000e+00, double* %tmp80.i br i1 false, label %return, label %cond_next.i @@ -20,8 +20,8 @@ cond_next.i: ; preds = %entry br i1 false, label %return, label %cond_true cond_true: ; preds = %cond_next.i - %tmp3.i8 = getelementptr %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1] - %tmp46 = load double* %tmp3.i8 ; <double> [#uses=0] + %tmp3.i8 = getelementptr %struct.mrViewingHitRecord, %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1] + %tmp46 = load double, double* %tmp3.i8 ; <double> [#uses=0] ret i32 1 return: ; preds = %cond_next.i, %entry diff --git a/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll b/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll index 5a15f0e..98e0024 100644 --- a/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll +++ b/test/Transforms/GVN/2007-07-26-InterlockingLoops.ll @@ -5,7 +5,7 @@ define i32 @NextRootMove(i32 %wtm, i32 %x, i32 %y, i32 %z) { entry: %A = alloca i32* - %tmp17618 = load i32** getelementptr ([65 x i32*]* @last, i32 0, i32 1), align 4 + %tmp17618 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4 store i32* %tmp17618, i32** %A ; CHECK: entry: ; CHECK-NEXT: alloca i32 @@ -19,7 +19,7 @@ cond_true116: br i1 %cmp, label %cond_true128, label %cond_true145 cond_true128: - %tmp17625 = load i32** getelementptr ([65 x i32*]* @last, i32 0, i32 1), align 4 + %tmp17625 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4 store i32* %tmp17625, i32** %A %cmp1 = icmp eq i32 %x, %z br i1 %cmp1 , label %bb98.backedge, label %return.loopexit @@ -28,7 +28,7 @@ bb98.backedge: br label %cond_true116 cond_true145: - %tmp17631 = load i32** getelementptr ([65 x i32*]* @last, i32 0, i32 1), align 4 + %tmp17631 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4 store i32* %tmp17631, i32** %A br i1 false, label %bb98.backedge, label %return.loopexit diff --git a/test/Transforms/GVN/2007-07-26-NonRedundant.ll b/test/Transforms/GVN/2007-07-26-NonRedundant.ll index 7579e8a..211830a 100644 --- a/test/Transforms/GVN/2007-07-26-NonRedundant.ll +++ b/test/Transforms/GVN/2007-07-26-NonRedundant.ll @@ -11,6 +11,6 @@ cond_next: ; preds = %entry br label %bb19 bb19: ; preds = %cond_next, %entry - %tmp29 = load i32* @bsLive, align 4 ; <i32> [#uses=0] + %tmp29 = load i32, i32* @bsLive, align 4 ; <i32> [#uses=0] ret i32 0 } diff --git a/test/Transforms/GVN/2007-07-26-PhiErasure.ll b/test/Transforms/GVN/2007-07-26-PhiErasure.ll index d898ab8..82af521 100644 --- a/test/Transforms/GVN/2007-07-26-PhiErasure.ll +++ b/test/Transforms/GVN/2007-07-26-PhiErasure.ll @@ -9,7 +9,7 @@ define i32 @reload(%struct.rtx_def* %first, i32 %global, %struct.FILE* %dumpfile) { cond_next2835.1: ; preds = %cond_next2861 - %tmp2922 = load i32* @n_spills, align 4 ; <i32> [#uses=0] + %tmp2922 = load i32, i32* @n_spills, align 4 ; <i32> [#uses=0] br label %bb2928 bb2928: ; preds = %cond_next2835.1, %cond_next2943 @@ -22,7 +22,7 @@ cond_next2943: ; preds = %cond_true2935, %bb2928 br i1 false, label %bb2982.preheader, label %bb2928 bb2982.preheader: ; preds = %cond_next2943 - %tmp298316 = load i32* @n_spills, align 4 ; <i32> [#uses=0] + %tmp298316 = load i32, i32* @n_spills, align 4 ; <i32> [#uses=0] ret i32 %tmp298316 } diff --git a/test/Transforms/GVN/2007-07-30-PredIDom.ll b/test/Transforms/GVN/2007-07-30-PredIDom.ll index 5cb6bb3..3a7eec7 100644 --- a/test/Transforms/GVN/2007-07-30-PredIDom.ll +++ b/test/Transforms/GVN/2007-07-30-PredIDom.ll @@ -269,6 +269,6 @@ bb970: ; preds = %entry br label %return return: ; preds = %0, %cond_next967, %cond_next922, %cond_next879, %cond_next807, %cond_next630, %cond_next415, %cond_next267, %cond_next191, %bb - %retval980 = load i8** null ; <i8*> [#uses=1] + %retval980 = load i8*, i8** null ; <i8*> [#uses=1] ret i8* %retval980 } diff --git a/test/Transforms/GVN/2007-07-31-NoDomInherit.ll b/test/Transforms/GVN/2007-07-31-NoDomInherit.ll index 5018a07..c30a283 100644 --- a/test/Transforms/GVN/2007-07-31-NoDomInherit.ll +++ b/test/Transforms/GVN/2007-07-31-NoDomInherit.ll @@ -149,27 +149,27 @@ entry: br label %bb91 bb: ; preds = %cond_next97 - %tmp1 = load i32* @numi ; <i32> [#uses=1] - %tmp2 = getelementptr [44 x i8]* @.str43, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp1 = load i32, i32* @numi ; <i32> [#uses=1] + %tmp2 = getelementptr [44 x i8], [44 x i8]* @.str43, i32 0, i32 0 ; <i8*> [#uses=1] %tmp3 = call i32 (i8*, ...)* @printf( i8* %tmp2, i32 %tmp1 ) ; <i32> [#uses=0] store i32 0, i32* %i br label %bb13 bb4: ; preds = %bb13 - %tmp5 = load i32* %i ; <i32> [#uses=1] - %tmp6 = load i32* %i ; <i32> [#uses=1] - %tmp7 = getelementptr [17 x i32]* @trialx, i32 0, i32 %tmp6 ; <i32*> [#uses=1] - %tmp8 = load i32* %tmp7 ; <i32> [#uses=1] + %tmp5 = load i32, i32* %i ; <i32> [#uses=1] + %tmp6 = load i32, i32* %i ; <i32> [#uses=1] + %tmp7 = getelementptr [17 x i32], [17 x i32]* @trialx, i32 0, i32 %tmp6 ; <i32*> [#uses=1] + %tmp8 = load i32, i32* %tmp7 ; <i32> [#uses=1] %tmp9 = call i32 @userfun( i32 %tmp8 ) ; <i32> [#uses=1] - %tmp10 = getelementptr [17 x i32]* @correct_result, i32 0, i32 %tmp5 ; <i32*> [#uses=1] + %tmp10 = getelementptr [17 x i32], [17 x i32]* @correct_result, i32 0, i32 %tmp5 ; <i32*> [#uses=1] store i32 %tmp9, i32* %tmp10 - %tmp11 = load i32* %i ; <i32> [#uses=1] + %tmp11 = load i32, i32* %i ; <i32> [#uses=1] %tmp12 = add i32 %tmp11, 1 ; <i32> [#uses=1] store i32 %tmp12, i32* %i br label %bb13 bb13: ; preds = %bb4, %bb - %tmp14 = load i32* %i ; <i32> [#uses=1] + %tmp14 = load i32, i32* %i ; <i32> [#uses=1] %tmp15 = icmp sle i32 %tmp14, 16 ; <i1> [#uses=1] %tmp1516 = zext i1 %tmp15 to i32 ; <i32> [#uses=1] %toBool = icmp ne i32 %tmp1516, 0 ; <i1> [#uses=1] @@ -180,47 +180,47 @@ bb17: ; preds = %bb13 br label %bb49 bb18: ; preds = %bb49 - %tmp19 = load i32* %i ; <i32> [#uses=1] - %tmp20 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp19 ; <{ i32, [3 x i32] }*> [#uses=1] - %tmp21 = getelementptr { i32, [3 x i32] }* %tmp20, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp19 = load i32, i32* %i ; <i32> [#uses=1] + %tmp20 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp19 ; <{ i32, [3 x i32] }*> [#uses=1] + %tmp21 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp20, i32 0, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %tmp21 - %tmp22 = load i32* %i ; <i32> [#uses=1] - %tmp23 = getelementptr [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1] - %tmp24 = getelementptr %struct.anon* %tmp23, i32 0, i32 3 ; <[3 x i32]*> [#uses=1] - %tmp25 = getelementptr [3 x i32]* %tmp24, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp26 = load i32* %tmp25 ; <i32> [#uses=1] - %tmp27 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp22 ; <{ i32, [3 x i32] }*> [#uses=1] - %tmp28 = getelementptr { i32, [3 x i32] }* %tmp27, i32 0, i32 1 ; <[3 x i32]*> [#uses=1] - %tmp29 = getelementptr [3 x i32]* %tmp28, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp22 = load i32, i32* %i ; <i32> [#uses=1] + %tmp23 = getelementptr [13 x %struct.anon], [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1] + %tmp24 = getelementptr %struct.anon, %struct.anon* %tmp23, i32 0, i32 3 ; <[3 x i32]*> [#uses=1] + %tmp25 = getelementptr [3 x i32], [3 x i32]* %tmp24, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp26 = load i32, i32* %tmp25 ; <i32> [#uses=1] + %tmp27 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp22 ; <{ i32, [3 x i32] }*> [#uses=1] + %tmp28 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp27, i32 0, i32 1 ; <[3 x i32]*> [#uses=1] + %tmp29 = getelementptr [3 x i32], [3 x i32]* %tmp28, i32 0, i32 0 ; <i32*> [#uses=1] store i32 %tmp26, i32* %tmp29 - %tmp30 = load i32* %i ; <i32> [#uses=1] - %tmp31 = getelementptr [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1] - %tmp32 = getelementptr %struct.anon* %tmp31, i32 0, i32 3 ; <[3 x i32]*> [#uses=1] - %tmp33 = getelementptr [3 x i32]* %tmp32, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp34 = load i32* %tmp33 ; <i32> [#uses=1] - %tmp35 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp30 ; <{ i32, [3 x i32] }*> [#uses=1] - %tmp36 = getelementptr { i32, [3 x i32] }* %tmp35, i32 0, i32 1 ; <[3 x i32]*> [#uses=1] - %tmp37 = getelementptr [3 x i32]* %tmp36, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp30 = load i32, i32* %i ; <i32> [#uses=1] + %tmp31 = getelementptr [13 x %struct.anon], [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1] + %tmp32 = getelementptr %struct.anon, %struct.anon* %tmp31, i32 0, i32 3 ; <[3 x i32]*> [#uses=1] + %tmp33 = getelementptr [3 x i32], [3 x i32]* %tmp32, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp34 = load i32, i32* %tmp33 ; <i32> [#uses=1] + %tmp35 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp30 ; <{ i32, [3 x i32] }*> [#uses=1] + %tmp36 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp35, i32 0, i32 1 ; <[3 x i32]*> [#uses=1] + %tmp37 = getelementptr [3 x i32], [3 x i32]* %tmp36, i32 0, i32 1 ; <i32*> [#uses=1] store i32 %tmp34, i32* %tmp37 - %tmp38 = load i32* %i ; <i32> [#uses=1] - %tmp39 = getelementptr [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1] - %tmp40 = getelementptr %struct.anon* %tmp39, i32 0, i32 3 ; <[3 x i32]*> [#uses=1] - %tmp41 = getelementptr [3 x i32]* %tmp40, i32 0, i32 2 ; <i32*> [#uses=1] - %tmp42 = load i32* %tmp41 ; <i32> [#uses=1] - %tmp43 = getelementptr [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp38 ; <{ i32, [3 x i32] }*> [#uses=1] - %tmp44 = getelementptr { i32, [3 x i32] }* %tmp43, i32 0, i32 1 ; <[3 x i32]*> [#uses=1] - %tmp45 = getelementptr [3 x i32]* %tmp44, i32 0, i32 2 ; <i32*> [#uses=1] + %tmp38 = load i32, i32* %i ; <i32> [#uses=1] + %tmp39 = getelementptr [13 x %struct.anon], [13 x %struct.anon]* @isa, i32 0, i32 0 ; <%struct.anon*> [#uses=1] + %tmp40 = getelementptr %struct.anon, %struct.anon* %tmp39, i32 0, i32 3 ; <[3 x i32]*> [#uses=1] + %tmp41 = getelementptr [3 x i32], [3 x i32]* %tmp40, i32 0, i32 2 ; <i32*> [#uses=1] + %tmp42 = load i32, i32* %tmp41 ; <i32> [#uses=1] + %tmp43 = getelementptr [5 x { i32, [3 x i32] }], [5 x { i32, [3 x i32] }]* @pgm, i32 0, i32 %tmp38 ; <{ i32, [3 x i32] }*> [#uses=1] + %tmp44 = getelementptr { i32, [3 x i32] }, { i32, [3 x i32] }* %tmp43, i32 0, i32 1 ; <[3 x i32]*> [#uses=1] + %tmp45 = getelementptr [3 x i32], [3 x i32]* %tmp44, i32 0, i32 2 ; <i32*> [#uses=1] store i32 %tmp42, i32* %tmp45 - %tmp46 = load i32* %i ; <i32> [#uses=1] + %tmp46 = load i32, i32* %i ; <i32> [#uses=1] call void @fix_operands( i32 %tmp46 ) - %tmp47 = load i32* %i ; <i32> [#uses=1] + %tmp47 = load i32, i32* %i ; <i32> [#uses=1] %tmp48 = add i32 %tmp47, 1 ; <i32> [#uses=1] store i32 %tmp48, i32* %i br label %bb49 bb49: ; preds = %bb18, %bb17 - %tmp50 = load i32* @numi ; <i32> [#uses=1] - %tmp51 = load i32* %i ; <i32> [#uses=1] + %tmp50 = load i32, i32* @numi ; <i32> [#uses=1] + %tmp51 = load i32, i32* %i ; <i32> [#uses=1] %tmp52 = icmp slt i32 %tmp51, %tmp50 ; <i1> [#uses=1] %tmp5253 = zext i1 %tmp52 to i32 ; <i32> [#uses=1] %toBool54 = icmp ne i32 %tmp5253, 0 ; <i1> [#uses=1] @@ -229,10 +229,10 @@ bb49: ; preds = %bb18, %bb17 bb55: ; preds = %bb49 %tmp56 = call i32 @search( ) ; <i32> [#uses=1] store i32 %tmp56, i32* %num_sol - %tmp57 = getelementptr [21 x i8]* @.str44, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp58 = load i32* %num_sol ; <i32> [#uses=1] + %tmp57 = getelementptr [21 x i8], [21 x i8]* @.str44, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp58 = load i32, i32* %num_sol ; <i32> [#uses=1] %tmp59 = call i32 (i8*, ...)* @printf( i8* %tmp57, i32 %tmp58 ) ; <i32> [#uses=0] - %tmp60 = load i32* @counters ; <i32> [#uses=1] + %tmp60 = load i32, i32* @counters ; <i32> [#uses=1] %tmp61 = icmp ne i32 %tmp60, 0 ; <i1> [#uses=1] %tmp6162 = zext i1 %tmp61 to i32 ; <i32> [#uses=1] %toBool63 = icmp ne i32 %tmp6162, 0 ; <i1> [#uses=1] @@ -240,50 +240,50 @@ bb55: ; preds = %bb49 cond_true: ; preds = %bb55 store i32 0, i32* %total - %tmp64 = getelementptr [12 x i8]* @.str45, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp64 = getelementptr [12 x i8], [12 x i8]* @.str45, i32 0, i32 0 ; <i8*> [#uses=1] %tmp65 = call i32 (i8*, ...)* @printf( i8* %tmp64 ) ; <i32> [#uses=0] store i32 0, i32* %i br label %bb79 bb66: ; preds = %bb79 - %tmp67 = load i32* %i ; <i32> [#uses=1] - %tmp68 = getelementptr [5 x i32]* @counter, i32 0, i32 %tmp67 ; <i32*> [#uses=1] - %tmp69 = load i32* %tmp68 ; <i32> [#uses=1] - %tmp70 = getelementptr [5 x i8]* @.str46, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp67 = load i32, i32* %i ; <i32> [#uses=1] + %tmp68 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp67 ; <i32*> [#uses=1] + %tmp69 = load i32, i32* %tmp68 ; <i32> [#uses=1] + %tmp70 = getelementptr [5 x i8], [5 x i8]* @.str46, i32 0, i32 0 ; <i8*> [#uses=1] %tmp71 = call i32 (i8*, ...)* @printf( i8* %tmp70, i32 %tmp69 ) ; <i32> [#uses=0] - %tmp72 = load i32* %i ; <i32> [#uses=1] - %tmp73 = getelementptr [5 x i32]* @counter, i32 0, i32 %tmp72 ; <i32*> [#uses=1] - %tmp74 = load i32* %tmp73 ; <i32> [#uses=1] - %tmp75 = load i32* %total ; <i32> [#uses=1] + %tmp72 = load i32, i32* %i ; <i32> [#uses=1] + %tmp73 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp72 ; <i32*> [#uses=1] + %tmp74 = load i32, i32* %tmp73 ; <i32> [#uses=1] + %tmp75 = load i32, i32* %total ; <i32> [#uses=1] %tmp76 = add i32 %tmp74, %tmp75 ; <i32> [#uses=1] store i32 %tmp76, i32* %total - %tmp77 = load i32* %i ; <i32> [#uses=1] + %tmp77 = load i32, i32* %i ; <i32> [#uses=1] %tmp78 = add i32 %tmp77, 1 ; <i32> [#uses=1] store i32 %tmp78, i32* %i br label %bb79 bb79: ; preds = %bb66, %cond_true - %tmp80 = load i32* @numi ; <i32> [#uses=1] - %tmp81 = load i32* %i ; <i32> [#uses=1] + %tmp80 = load i32, i32* @numi ; <i32> [#uses=1] + %tmp81 = load i32, i32* %i ; <i32> [#uses=1] %tmp82 = icmp slt i32 %tmp81, %tmp80 ; <i1> [#uses=1] %tmp8283 = zext i1 %tmp82 to i32 ; <i32> [#uses=1] %toBool84 = icmp ne i32 %tmp8283, 0 ; <i1> [#uses=1] br i1 %toBool84, label %bb66, label %bb85 bb85: ; preds = %bb79 - %tmp86 = getelementptr [12 x i8]* @.str47, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp87 = load i32* %total ; <i32> [#uses=1] + %tmp86 = getelementptr [12 x i8], [12 x i8]* @.str47, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp87 = load i32, i32* %total ; <i32> [#uses=1] %tmp88 = call i32 (i8*, ...)* @printf( i8* %tmp86, i32 %tmp87 ) ; <i32> [#uses=0] br label %cond_next cond_next: ; preds = %bb85, %bb55 - %tmp89 = load i32* @numi ; <i32> [#uses=1] + %tmp89 = load i32, i32* @numi ; <i32> [#uses=1] %tmp90 = add i32 %tmp89, 1 ; <i32> [#uses=1] store i32 %tmp90, i32* @numi br label %bb91 bb91: ; preds = %cond_next, %entry - %tmp92 = load i32* @numi ; <i32> [#uses=1] + %tmp92 = load i32, i32* @numi ; <i32> [#uses=1] %tmp93 = icmp sgt i32 %tmp92, 5 ; <i1> [#uses=1] %tmp9394 = zext i1 %tmp93 to i32 ; <i32> [#uses=1] %toBool95 = icmp ne i32 %tmp9394, 0 ; <i1> [#uses=1] @@ -293,7 +293,7 @@ cond_true96: ; preds = %bb91 br label %bb102 cond_next97: ; preds = %bb91 - %tmp98 = load i32* %num_sol ; <i32> [#uses=1] + %tmp98 = load i32, i32* %num_sol ; <i32> [#uses=1] %tmp99 = icmp eq i32 %tmp98, 0 ; <i1> [#uses=1] %tmp99100 = zext i1 %tmp99 to i32 ; <i32> [#uses=1] %toBool101 = icmp ne i32 %tmp99100, 0 ; <i1> [#uses=1] @@ -301,12 +301,12 @@ cond_next97: ; preds = %bb91 bb102: ; preds = %cond_next97, %cond_true96 store i32 0, i32* %tmp - %tmp103 = load i32* %tmp ; <i32> [#uses=1] + %tmp103 = load i32, i32* %tmp ; <i32> [#uses=1] store i32 %tmp103, i32* %retval br label %return return: ; preds = %bb102 - %retval104 = load i32* %retval ; <i32> [#uses=1] + %retval104 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval104 } diff --git a/test/Transforms/GVN/2007-07-31-RedundantPhi.ll b/test/Transforms/GVN/2007-07-31-RedundantPhi.ll index 13419d1..b285560 100644 --- a/test/Transforms/GVN/2007-07-31-RedundantPhi.ll +++ b/test/Transforms/GVN/2007-07-31-RedundantPhi.ll @@ -17,6 +17,6 @@ cond_false470: ; preds = %cond_next449 br label %cond_next698 cond_next698: ; preds = %cond_true492 - %tmp701 = load i16* @img_width, align 2 ; <i16> [#uses=0] + %tmp701 = load i16, i16* @img_width, align 2 ; <i16> [#uses=0] ret i32 0 } diff --git a/test/Transforms/GVN/2008-02-12-UndefLoad.ll b/test/Transforms/GVN/2008-02-12-UndefLoad.ll index de2aa61..8ebeb14 100644 --- a/test/Transforms/GVN/2008-02-12-UndefLoad.ll +++ b/test/Transforms/GVN/2008-02-12-UndefLoad.ll @@ -6,9 +6,9 @@ define i32 @a() { entry: %c = alloca %struct.anon ; <%struct.anon*> [#uses=2] - %tmp = getelementptr %struct.anon* %c, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp1 = getelementptr i32* %tmp, i32 1 ; <i32*> [#uses=2] - %tmp2 = load i32* %tmp1, align 4 ; <i32> [#uses=1] + %tmp = getelementptr %struct.anon, %struct.anon* %c, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp1 = getelementptr i32, i32* %tmp, i32 1 ; <i32*> [#uses=2] + %tmp2 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1] %tmp3 = or i32 %tmp2, 11 ; <i32> [#uses=1] %tmp4 = and i32 %tmp3, -21 ; <i32> [#uses=1] store i32 %tmp4, i32* %tmp1, align 4 diff --git a/test/Transforms/GVN/2008-02-13-NewPHI.ll b/test/Transforms/GVN/2008-02-13-NewPHI.ll index 80b519d..638939b 100644 --- a/test/Transforms/GVN/2008-02-13-NewPHI.ll +++ b/test/Transforms/GVN/2008-02-13-NewPHI.ll @@ -8,7 +8,7 @@ entry: br label %bb33 bb: ; preds = %bb33 - %tmp27 = load float** %sx_addr, align 4 ; <float*> [#uses=1] + %tmp27 = load float*, float** %sx_addr, align 4 ; <float*> [#uses=1] store float 0.000000e+00, float* %tmp27, align 4 store float* null, float** %sx_addr, align 4 br label %bb33 @@ -17,6 +17,6 @@ bb33: ; preds = %bb, %entry br i1 false, label %bb, label %return return: ; preds = %bb33 - %retval59 = load i32* null, align 4 ; <i32> [#uses=1] + %retval59 = load i32, i32* null, align 4 ; <i32> [#uses=1] ret i32 %retval59 } diff --git a/test/Transforms/GVN/2008-07-02-Unreachable.ll b/test/Transforms/GVN/2008-07-02-Unreachable.ll index ce83fa4..d993264 100644 --- a/test/Transforms/GVN/2008-07-02-Unreachable.ll +++ b/test/Transforms/GVN/2008-07-02-Unreachable.ll @@ -13,7 +13,7 @@ ifthen: ; preds = %entry br label %ifend ifelse: ; preds = %entry - %tmp3 = load i8* @g_3 ; <i8> [#uses=0] + %tmp3 = load i8, i8* @g_3 ; <i8> [#uses=0] store i8 %tmp3, i8* %A br label %afterfor @@ -27,7 +27,7 @@ forinc: ; preds = %forbody br label %forcond afterfor: ; preds = %forcond, %forcond.thread - %tmp10 = load i8* @g_3 ; <i8> [#uses=0] + %tmp10 = load i8, i8* @g_3 ; <i8> [#uses=0] ret i8 %tmp10 ifend: ; preds = %afterfor, %ifthen diff --git a/test/Transforms/GVN/2008-12-09-SelfRemove.ll b/test/Transforms/GVN/2008-12-09-SelfRemove.ll index c6833e3..d8ab1ba 100644 --- a/test/Transforms/GVN/2008-12-09-SelfRemove.ll +++ b/test/Transforms/GVN/2008-12-09-SelfRemove.ll @@ -10,12 +10,12 @@ target triple = "i386-apple-darwin9.5" define void @d_print_mod_list(%struct.d_print_info* %dpi, %struct.d_print_mod* %mods, i32 %suffix) nounwind { entry: - %0 = getelementptr %struct.d_print_info* %dpi, i32 0, i32 1 ; <i8**> [#uses=1] + %0 = getelementptr %struct.d_print_info, %struct.d_print_info* %dpi, i32 0, i32 1 ; <i8**> [#uses=1] br i1 false, label %return, label %bb bb: ; preds = %entry - %1 = load i8** %0, align 4 ; <i8*> [#uses=0] - %2 = getelementptr %struct.d_print_info* %dpi, i32 0, i32 1 ; <i8**> [#uses=0] + %1 = load i8*, i8** %0, align 4 ; <i8*> [#uses=0] + %2 = getelementptr %struct.d_print_info, %struct.d_print_info* %dpi, i32 0, i32 1 ; <i8**> [#uses=0] br label %bb21 bb21: ; preds = %bb21, %bb diff --git a/test/Transforms/GVN/2008-12-12-RLE-Crash.ll b/test/Transforms/GVN/2008-12-12-RLE-Crash.ll index da67ee7..dabf7fa 100644 --- a/test/Transforms/GVN/2008-12-12-RLE-Crash.ll +++ b/test/Transforms/GVN/2008-12-12-RLE-Crash.ll @@ -7,8 +7,8 @@ entry: br label %bb84 bb41: ; preds = %bb82 - %tmp = load i8* %opt.0, align 1 ; <i8> [#uses=0] - %tmp1 = getelementptr i8* %opt.0, i32 1 ; <i8*> [#uses=2] + %tmp = load i8, i8* %opt.0, align 1 ; <i8> [#uses=0] + %tmp1 = getelementptr i8, i8* %opt.0, i32 1 ; <i8*> [#uses=2] switch i32 0, label %bb81 [ i32 102, label %bb82 i32 110, label %bb79 @@ -26,10 +26,10 @@ bb81: ; preds = %bb41 bb82: ; preds = %bb84, %bb79, %bb41 %opt.0 = phi i8* [ %tmp3, %bb84 ], [ %tmp1, %bb79 ], [ %tmp1, %bb41 ] ; <i8*> [#uses=3] - %tmp2 = load i8* %opt.0, align 1 ; <i8> [#uses=0] + %tmp2 = load i8, i8* %opt.0, align 1 ; <i8> [#uses=0] br i1 false, label %bb84, label %bb41 bb84: ; preds = %bb82, %entry - %tmp3 = getelementptr i8* null, i32 1 ; <i8*> [#uses=1] + %tmp3 = getelementptr i8, i8* null, i32 1 ; <i8*> [#uses=1] br label %bb82 } diff --git a/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll b/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll index 41f76c8..207a251 100644 --- a/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll +++ b/test/Transforms/GVN/2008-12-14-rle-reanalyze.ll @@ -11,8 +11,8 @@ bb22: ; preds = %bb23, %bb22, %entry br i1 false, label %bb23, label %bb22 bb23: ; preds = %bb23, %bb22 - %sortv.233 = phi i32* [ getelementptr ([256 x i32]* @sort_value, i32 0, i32 0), %bb22 ], [ %sortv.2, %bb23 ] ; <i32*> [#uses=1] - %0 = load i32* %sortv.233, align 4 ; <i32> [#uses=0] - %sortv.2 = getelementptr [256 x i32]* @sort_value, i32 0, i32 0 ; <i32*> [#uses=1] + %sortv.233 = phi i32* [ getelementptr ([256 x i32], [256 x i32]* @sort_value, i32 0, i32 0), %bb22 ], [ %sortv.2, %bb23 ] ; <i32*> [#uses=1] + %0 = load i32, i32* %sortv.233, align 4 ; <i32> [#uses=0] + %sortv.2 = getelementptr [256 x i32], [256 x i32]* @sort_value, i32 0, i32 0 ; <i32*> [#uses=1] br i1 false, label %bb23, label %bb22 } diff --git a/test/Transforms/GVN/2008-12-15-CacheVisited.ll b/test/Transforms/GVN/2008-12-15-CacheVisited.ll index 0a63f3f..73adacd 100644 --- a/test/Transforms/GVN/2008-12-15-CacheVisited.ll +++ b/test/Transforms/GVN/2008-12-15-CacheVisited.ll @@ -10,12 +10,12 @@ bb202: ; preds = %entry unreachable bb203: ; preds = %entry - %tmp = getelementptr i32* %decl, i32 1 ; <i32*> [#uses=1] - %tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=0] + %tmp = getelementptr i32, i32* %decl, i32 1 ; <i32*> [#uses=1] + %tmp1 = load i32, i32* %tmp, align 4 ; <i32> [#uses=0] br i1 false, label %bb207, label %bb204 bb204: ; preds = %bb203 - %tmp2 = getelementptr i32* %decl, i32 1 ; <i32*> [#uses=1] + %tmp2 = getelementptr i32, i32* %decl, i32 1 ; <i32*> [#uses=1] br label %bb208 bb207: ; preds = %bb203 @@ -23,6 +23,6 @@ bb207: ; preds = %bb203 bb208: ; preds = %bb207, %bb204 %iftmp.1374.0.in = phi i32* [ null, %bb207 ], [ %tmp2, %bb204 ] ; <i32*> [#uses=1] - %iftmp.1374.0 = load i32* %iftmp.1374.0.in ; <i32> [#uses=0] + %iftmp.1374.0 = load i32, i32* %iftmp.1374.0.in ; <i32> [#uses=0] unreachable } diff --git a/test/Transforms/GVN/2009-01-21-SortInvalidation.ll b/test/Transforms/GVN/2009-01-21-SortInvalidation.ll index 3677593..6144697 100644 --- a/test/Transforms/GVN/2009-01-21-SortInvalidation.ll +++ b/test/Transforms/GVN/2009-01-21-SortInvalidation.ll @@ -37,7 +37,7 @@ bb550: ; preds = %bb543 br i1 false, label %bb554, label %bb552 bb552: ; preds = %bb550 - %0 = load i8* %d.0, align 8 ; <i8> [#uses=0] + %0 = load i8, i8* %d.0, align 8 ; <i8> [#uses=0] br label %bb554 bb554: ; preds = %bb552, %bb550, %bb549 diff --git a/test/Transforms/GVN/2009-01-22-SortInvalidation.ll b/test/Transforms/GVN/2009-01-22-SortInvalidation.ll index 95690a5..89b058a 100644 --- a/test/Transforms/GVN/2009-01-22-SortInvalidation.ll +++ b/test/Transforms/GVN/2009-01-22-SortInvalidation.ll @@ -79,20 +79,20 @@ bb54: ; preds = %entry br label %bb69.loopexit bb59: ; preds = %bb63.preheader - %0 = load %struct..4sPragmaType** %3, align 4 ; <%struct..4sPragmaType*> [#uses=0] + %0 = load %struct..4sPragmaType*, %struct..4sPragmaType** %3, align 4 ; <%struct..4sPragmaType*> [#uses=0] br label %bb65 bb65: ; preds = %bb63.preheader, %bb59 - %1 = load %struct..4sPragmaType** %4, align 4 ; <%struct..4sPragmaType*> [#uses=0] + %1 = load %struct..4sPragmaType*, %struct..4sPragmaType** %4, align 4 ; <%struct..4sPragmaType*> [#uses=0] br i1 false, label %bb67, label %bb63.preheader bb67: ; preds = %bb65 - %2 = getelementptr %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=0] + %2 = getelementptr %struct.IdList, %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=0] unreachable bb69.loopexit: ; preds = %bb54, %entry - %3 = getelementptr %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=1] - %4 = getelementptr %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=1] + %3 = getelementptr %struct.IdList, %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=1] + %4 = getelementptr %struct.IdList, %struct.IdList* %pColumn, i32 0, i32 0 ; <%struct..4sPragmaType**> [#uses=1] br label %bb63.preheader bb63.preheader: ; preds = %bb69.loopexit, %bb65 diff --git a/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll b/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll index c2d57a1..378d7e7 100644 --- a/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll +++ b/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll @@ -24,11 +24,11 @@ entry: %addr = alloca %struct.rtx_def* ; <%struct.rtx_def**> [#uses=5] %iftmp.1532 = alloca %struct.rtx_def* ; <%struct.rtx_def**> [#uses=3] store %struct.rtx_def* %orig, %struct.rtx_def** null - %0 = load %struct.rtx_def** null, align 4 ; <%struct.rtx_def*> [#uses=0] + %0 = load %struct.rtx_def*, %struct.rtx_def** null, align 4 ; <%struct.rtx_def*> [#uses=0] br i1 false, label %bb96, label %bb59 bb59: ; preds = %entry - %1 = load %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=1] + %1 = load %struct.rtx_def*, %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=1] %2 = call i32 @local_symbolic_operand(%struct.rtx_def* %1, i32 0) nounwind ; <i32> [#uses=0] br i1 false, label %bb96, label %bb63 @@ -54,7 +54,7 @@ bb76: ; preds = %bb75, %bb74 br i1 false, label %bb77, label %bb84 bb77: ; preds = %bb76 - %3 = getelementptr [1 x %struct.cgraph_rtl_info]* null, i32 0, i32 0 ; <%struct.cgraph_rtl_info*> [#uses=0] + %3 = getelementptr [1 x %struct.cgraph_rtl_info], [1 x %struct.cgraph_rtl_info]* null, i32 0, i32 0 ; <%struct.cgraph_rtl_info*> [#uses=0] unreachable bb84: ; preds = %bb76 @@ -89,22 +89,22 @@ bb94: ; preds = %bb93, %bb92 unreachable bb96: ; preds = %bb59, %entry - %5 = load %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=1] - %6 = getelementptr %struct.rtx_def* %5, i32 0, i32 0 ; <i16*> [#uses=1] - %7 = load i16* %6, align 2 ; <i16> [#uses=0] + %5 = load %struct.rtx_def*, %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=1] + %6 = getelementptr %struct.rtx_def, %struct.rtx_def* %5, i32 0, i32 0 ; <i16*> [#uses=1] + %7 = load i16, i16* %6, align 2 ; <i16> [#uses=0] br i1 false, label %bb147, label %bb97 bb97: ; preds = %bb96 - %8 = load %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=0] + %8 = load %struct.rtx_def*, %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=0] br i1 false, label %bb147, label %bb99 bb99: ; preds = %bb97 unreachable bb147: ; preds = %bb97, %bb96 - %9 = load %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=1] - %10 = getelementptr %struct.rtx_def* %9, i32 0, i32 0 ; <i16*> [#uses=1] - %11 = load i16* %10, align 2 ; <i16> [#uses=0] + %9 = load %struct.rtx_def*, %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=1] + %10 = getelementptr %struct.rtx_def, %struct.rtx_def* %9, i32 0, i32 0 ; <i16*> [#uses=1] + %11 = load i16, i16* %10, align 2 ; <i16> [#uses=0] br i1 false, label %bb164, label %bb148 bb148: ; preds = %bb147 @@ -120,7 +120,7 @@ bb152: ; preds = %bb149 br label %bb164 bb164: ; preds = %bb152, %bb148, %bb147 - %12 = getelementptr [1 x %struct.cgraph_rtl_info]* null, i32 0, i32 1 ; <%struct.cgraph_rtl_info*> [#uses=0] + %12 = getelementptr [1 x %struct.cgraph_rtl_info], [1 x %struct.cgraph_rtl_info]* null, i32 0, i32 1 ; <%struct.cgraph_rtl_info*> [#uses=0] br i1 false, label %bb165, label %bb166 bb165: ; preds = %bb164 @@ -167,8 +167,8 @@ bb181: ; preds = %bb180, %bb170 unreachable bb211: ; preds = %bb168, %bb167 - %14 = load %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=0] - %15 = getelementptr [1 x %struct.cgraph_rtl_info]* null, i32 0, i32 0 ; <%struct.cgraph_rtl_info*> [#uses=0] + %14 = load %struct.rtx_def*, %struct.rtx_def** %addr, align 4 ; <%struct.rtx_def*> [#uses=0] + %15 = getelementptr [1 x %struct.cgraph_rtl_info], [1 x %struct.cgraph_rtl_info]* null, i32 0, i32 0 ; <%struct.cgraph_rtl_info*> [#uses=0] store %struct.rtx_def* null, %struct.rtx_def** null, align 4 br i1 false, label %bb212, label %bb213 @@ -182,12 +182,12 @@ bb213: ; preds = %bb211 bb214: ; preds = %bb213, %bb212 %16 = bitcast %struct.block_symbol* null to [1 x %struct.cgraph_rtl_info]* ; <[1 x %struct.cgraph_rtl_info]*> [#uses=1] - %17 = getelementptr [1 x %struct.cgraph_rtl_info]* %16, i32 0, i32 1 ; <%struct.cgraph_rtl_info*> [#uses=0] - %18 = load %struct.rtx_def** %iftmp.1532, align 4 ; <%struct.rtx_def*> [#uses=0] - %19 = getelementptr %struct.rtx_def* null, i32 0, i32 3 ; <%struct.u*> [#uses=1] - %20 = getelementptr %struct.u* %19, i32 0, i32 0 ; <%struct.block_symbol*> [#uses=1] + %17 = getelementptr [1 x %struct.cgraph_rtl_info], [1 x %struct.cgraph_rtl_info]* %16, i32 0, i32 1 ; <%struct.cgraph_rtl_info*> [#uses=0] + %18 = load %struct.rtx_def*, %struct.rtx_def** %iftmp.1532, align 4 ; <%struct.rtx_def*> [#uses=0] + %19 = getelementptr %struct.rtx_def, %struct.rtx_def* null, i32 0, i32 3 ; <%struct.u*> [#uses=1] + %20 = getelementptr %struct.u, %struct.u* %19, i32 0, i32 0 ; <%struct.block_symbol*> [#uses=1] %21 = bitcast %struct.block_symbol* %20 to [1 x i64]* ; <[1 x i64]*> [#uses=1] - %22 = getelementptr [1 x i64]* %21, i32 0, i32 0 ; <i64*> [#uses=0] + %22 = getelementptr [1 x i64], [1 x i64]* %21, i32 0, i32 0 ; <i64*> [#uses=0] %23 = call %struct.rtx_def* @plus_constant(%struct.rtx_def* null, i64 0) nounwind ; <%struct.rtx_def*> [#uses=0] unreachable } diff --git a/test/Transforms/GVN/2009-06-17-InvalidPRE.ll b/test/Transforms/GVN/2009-06-17-InvalidPRE.ll index 6ac6072..bf0a234 100644 --- a/test/Transforms/GVN/2009-06-17-InvalidPRE.ll +++ b/test/Transforms/GVN/2009-06-17-InvalidPRE.ll @@ -18,20 +18,20 @@ bb4.preheader: ; preds = %entry bb2: ; preds = %bb1 %2 = sub i32 %len.0, %13 ; <i32> [#uses=1] - %3 = getelementptr %struct.mbuf* %m.0.ph, i32 0, i32 2 ; <i32*> [#uses=1] + %3 = getelementptr %struct.mbuf, %struct.mbuf* %m.0.ph, i32 0, i32 2 ; <i32*> [#uses=1] store i32 0, i32* %3, align 4 - %4 = getelementptr %struct.mbuf* %m.0.ph, i32 0, i32 0 ; <%struct.mbuf**> [#uses=1] - %5 = load %struct.mbuf** %4, align 4 ; <%struct.mbuf*> [#uses=1] + %4 = getelementptr %struct.mbuf, %struct.mbuf* %m.0.ph, i32 0, i32 0 ; <%struct.mbuf**> [#uses=1] + %5 = load %struct.mbuf*, %struct.mbuf** %4, align 4 ; <%struct.mbuf*> [#uses=1] br label %bb4.outer bb4.outer: ; preds = %bb4.preheader, %bb2 %m.0.ph = phi %struct.mbuf* [ %5, %bb2 ], [ %mp, %bb4.preheader ] ; <%struct.mbuf*> [#uses=7] %len.0.ph = phi i32 [ %2, %bb2 ], [ %req_len, %bb4.preheader ] ; <i32> [#uses=1] %6 = icmp ne %struct.mbuf* %m.0.ph, null ; <i1> [#uses=1] - %7 = getelementptr %struct.mbuf* %m.0.ph, i32 0, i32 2 ; <i32*> [#uses=1] - %8 = getelementptr %struct.mbuf* %m.0.ph, i32 0, i32 2 ; <i32*> [#uses=1] - %9 = getelementptr %struct.mbuf* %m.0.ph, i32 0, i32 3 ; <i8**> [#uses=1] - %10 = getelementptr %struct.mbuf* %m.0.ph, i32 0, i32 3 ; <i8**> [#uses=1] + %7 = getelementptr %struct.mbuf, %struct.mbuf* %m.0.ph, i32 0, i32 2 ; <i32*> [#uses=1] + %8 = getelementptr %struct.mbuf, %struct.mbuf* %m.0.ph, i32 0, i32 2 ; <i32*> [#uses=1] + %9 = getelementptr %struct.mbuf, %struct.mbuf* %m.0.ph, i32 0, i32 3 ; <i8**> [#uses=1] + %10 = getelementptr %struct.mbuf, %struct.mbuf* %m.0.ph, i32 0, i32 3 ; <i8**> [#uses=1] br label %bb4 bb4: ; preds = %bb4.outer, %bb3 @@ -41,21 +41,21 @@ bb4: ; preds = %bb4.outer, %bb3 br i1 %12, label %bb1, label %bb7 bb1: ; preds = %bb4 - %13 = load i32* %7, align 4 ; <i32> [#uses=3] + %13 = load i32, i32* %7, align 4 ; <i32> [#uses=3] %14 = icmp sgt i32 %13, %len.0 ; <i1> [#uses=1] br i1 %14, label %bb3, label %bb2 bb3: ; preds = %bb1 %15 = sub i32 %13, %len.0 ; <i32> [#uses=1] store i32 %15, i32* %8, align 4 - %16 = load i8** %9, align 4 ; <i8*> [#uses=1] - %17 = getelementptr i8* %16, i32 %len.0 ; <i8*> [#uses=1] + %16 = load i8*, i8** %9, align 4 ; <i8*> [#uses=1] + %17 = getelementptr i8, i8* %16, i32 %len.0 ; <i8*> [#uses=1] store i8* %17, i8** %10, align 4 br label %bb4 bb7: ; preds = %bb4 - %18 = getelementptr %struct.mbuf* %mp, i32 0, i32 5 ; <i16*> [#uses=1] - %19 = load i16* %18, align 2 ; <i16> [#uses=1] + %18 = getelementptr %struct.mbuf, %struct.mbuf* %mp, i32 0, i32 5 ; <i16*> [#uses=1] + %19 = load i16, i16* %18, align 2 ; <i16> [#uses=1] %20 = zext i16 %19 to i32 ; <i32> [#uses=1] %21 = and i32 %20, 2 ; <i32> [#uses=1] %22 = icmp eq i32 %21, 0 ; <i1> [#uses=1] @@ -63,7 +63,7 @@ bb7: ; preds = %bb4 bb8: ; preds = %bb7 %23 = sub i32 %req_len, %len.0 ; <i32> [#uses=1] - %24 = getelementptr %struct.mbuf* %mp, i32 0, i32 6 ; <i32*> [#uses=1] + %24 = getelementptr %struct.mbuf, %struct.mbuf* %mp, i32 0, i32 6 ; <i32*> [#uses=1] store i32 %23, i32* %24, align 4 ret void diff --git a/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll b/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll index f079108..0ed5237 100644 --- a/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll +++ b/test/Transforms/GVN/2009-07-13-MemDepSortFail.ll @@ -22,11 +22,11 @@ bb2: ; preds = %bb br label %bb62 bb9: ; preds = %bb - %0 = load i8* %sp.1, align 1 ; <i8> [#uses=0] + %0 = load i8, i8* %sp.1, align 1 ; <i8> [#uses=0] br label %bb62 bb51: ; preds = %bb - %1 = load i8* %sp.1, align 1 ; <i8> [#uses=0] + %1 = load i8, i8* %sp.1, align 1 ; <i8> [#uses=0] ret i8* null bb62: ; preds = %bb9, %bb2, %bb diff --git a/test/Transforms/GVN/2009-11-12-MemDepMallocBitCast.ll b/test/Transforms/GVN/2009-11-12-MemDepMallocBitCast.ll index b433297..a12fbdd 100644 --- a/test/Transforms/GVN/2009-11-12-MemDepMallocBitCast.ll +++ b/test/Transforms/GVN/2009-11-12-MemDepMallocBitCast.ll @@ -3,12 +3,12 @@ ; RUN: opt < %s -gvn -S | FileCheck %s define i64 @test() { - %1 = tail call i8* @malloc(i64 mul (i64 4, i64 ptrtoint (i64* getelementptr (i64* null, i64 1) to i64))) ; <i8*> [#uses=2] + %1 = tail call i8* @malloc(i64 mul (i64 4, i64 ptrtoint (i64* getelementptr (i64, i64* null, i64 1) to i64))) ; <i8*> [#uses=2] store i8 42, i8* %1 %X = bitcast i8* %1 to i64* ; <i64*> [#uses=1] - %Y = load i64* %X ; <i64> [#uses=1] + %Y = load i64, i64* %X ; <i64> [#uses=1] ret i64 %Y -; CHECK: %Y = load i64* %X +; CHECK: %Y = load i64, i64* %X ; CHECK: ret i64 %Y } diff --git a/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll b/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll index d6e1c6b..9d9ad54 100644 --- a/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll +++ b/test/Transforms/GVN/2010-03-31-RedundantPHIs.ll @@ -24,8 +24,8 @@ bb8: ; preds = %bb12 br i1 undef, label %bb9, label %bb10 bb9: ; preds = %bb8 - %0 = load i8** undef, align 4 ; <i8*> [#uses=0] - %1 = load i8** undef, align 4 ; <i8*> [#uses=0] + %0 = load i8*, i8** undef, align 4 ; <i8*> [#uses=0] + %1 = load i8*, i8** undef, align 4 ; <i8*> [#uses=0] br label %bb11 bb10: ; preds = %bb8 diff --git a/test/Transforms/GVN/2010-05-08-OneBit.ll b/test/Transforms/GVN/2010-05-08-OneBit.ll index 480ce8b..0e3fa4b 100644 --- a/test/Transforms/GVN/2010-05-08-OneBit.ll +++ b/test/Transforms/GVN/2010-05-08-OneBit.ll @@ -6,7 +6,7 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @main(i32 %argc, i8** nocapture %argv) { entry: - %0 = getelementptr inbounds i8* undef, i64 5 ; <i8*> [#uses=1] + %0 = getelementptr inbounds i8, i8* undef, i64 5 ; <i8*> [#uses=1] %1 = bitcast i8* %0 to i32* ; <i32*> [#uses=1] store i32 undef, i32* %1, align 1 br i1 undef, label %k121.i.i, label %l117.i.i @@ -29,9 +29,9 @@ l129.i.i: ; preds = %k121.i.i unreachable k133.i.i: ; preds = %k121.i.i - %2 = getelementptr i8* undef, i64 5 ; <i8*> [#uses=1] + %2 = getelementptr i8, i8* undef, i64 5 ; <i8*> [#uses=1] %3 = bitcast i8* %2 to i1* ; <i1*> [#uses=1] - %4 = load i1* %3 ; <i1> [#uses=1] + %4 = load i1, i1* %3 ; <i1> [#uses=1] br i1 %4, label %k151.i.i, label %l147.i.i l147.i.i: ; preds = %k133.i.i diff --git a/test/Transforms/GVN/2011-04-27-phioperands.ll b/test/Transforms/GVN/2011-04-27-phioperands.ll index 42c4650..e964120 100644 --- a/test/Transforms/GVN/2011-04-27-phioperands.ll +++ b/test/Transforms/GVN/2011-04-27-phioperands.ll @@ -27,7 +27,7 @@ doemit.exit76.i: br label %"<bb 53>.i" "<L98>.i": - store i8* getelementptr inbounds ([10 x i8]* @nuls, i64 0, i64 0), i8** undef, align 8 + store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @nuls, i64 0, i64 0), i8** undef, align 8 br label %"<bb 53>.i" "<L99>.i": @@ -50,7 +50,7 @@ doemit.exit76.i: "<bb 53>.i": %wascaret_2.i = phi i32 [ 0, %"<L39>.i" ], [ 0, %"<L29>.i" ], [ 0, %"<L28>.i" ], [ 0, %"<bb 35>.i" ], [ 0, %"<L99>.i" ], [ 0, %"<L98>.i" ], [ 0, %doemit.exit76.i ], [ 1, %doemit.exit51.i ], [ 0, %"<L24>.i" ] - %D.5496_84.i = load i8** undef, align 8 + %D.5496_84.i = load i8*, i8** undef, align 8 br i1 undef, label %"<bb 54>.i", label %"<bb 5>" "<bb 54>.i": diff --git a/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll b/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll index 298f274..0769575 100644 --- a/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll +++ b/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll @@ -19,10 +19,10 @@ bb1: br i1 undef, label %bb3, label %bb15 ; CHECK: bb1: -; CHECK: [[TMP:%.*]] = phi i8* [ getelementptr (i8* null, i64 undef), %bb10 ], [ null, %bb ] +; CHECK: [[TMP:%.*]] = phi i8* [ getelementptr (i8, i8* null, i64 undef), %bb10 ], [ null, %bb ] ; CHECK: bb1.bb15_crit_edge: -; CHECK: %tmp17.pre = load i8* [[TMP]], align 1 +; CHECK: %tmp17.pre = load i8, i8* [[TMP]], align 1 bb3: call void @isalnum() @@ -32,22 +32,22 @@ bb5: br i1 undef, label %bb10, label %bb6 bb6: - %tmp7 = load i8** %tmp, align 8 - %tmp8 = load i8* %tmp7, align 1 + %tmp7 = load i8*, i8** %tmp, align 8 + %tmp8 = load i8, i8* %tmp7, align 1 %tmp9 = zext i8 %tmp8 to i64 br i1 undef, label %bb15, label %bb10 bb10: - %tmp11 = load i8** %tmp, align 8 - %tmp12 = load i8* %tmp11, align 1 + %tmp11 = load i8*, i8** %tmp, align 8 + %tmp12 = load i8, i8* %tmp11, align 1 %tmp13 = zext i8 %tmp12 to i64 - %tmp14 = getelementptr inbounds i8* null, i64 undef + %tmp14 = getelementptr inbounds i8, i8* null, i64 undef store i8* %tmp14, i8** %tmp, align 8 br label %bb1 bb15: - %tmp16 = load i8** %tmp, align 8 - %tmp17 = load i8* %tmp16, align 1 + %tmp16 = load i8*, i8** %tmp, align 8 + %tmp17 = load i8, i8* %tmp16, align 1 %tmp18 = icmp eq i8 %tmp17, 0 br label %bb19 diff --git a/test/Transforms/GVN/MemdepMiscompile.ll b/test/Transforms/GVN/MemdepMiscompile.ll index d420169..0652304 100644 --- a/test/Transforms/GVN/MemdepMiscompile.ll +++ b/test/Transforms/GVN/MemdepMiscompile.ll @@ -13,14 +13,14 @@ entry: ; CHECK: call void @RunInMode ; CHECK: br i1 %tobool, label %while.cond.backedge, label %if.then ; CHECK: while.cond.backedge: -; CHECK: load i32* %shouldExit +; CHECK: load i32, i32* %shouldExit ; CHECK: br i1 %cmp, label %while.body %shouldExit = alloca i32, align 4 %tasksIdle = alloca i32, align 4 store i32 0, i32* %shouldExit, align 4 store i32 0, i32* %tasksIdle, align 4 call void @CTestInitialize(i32* %tasksIdle) nounwind - %0 = load i32* %shouldExit, align 4 + %0 = load i32, i32* %shouldExit, align 4 %cmp1 = icmp eq i32 %0, 0 br i1 %cmp1, label %while.body.lr.ph, label %while.end @@ -29,7 +29,7 @@ while.body.lr.ph: while.body: call void @RunInMode(i32 100) nounwind - %1 = load i32* %tasksIdle, align 4 + %1 = load i32, i32* %tasksIdle, align 4 %tobool = icmp eq i32 %1, 0 br i1 %tobool, label %while.cond.backedge, label %if.then @@ -39,7 +39,7 @@ if.then: br label %while.cond.backedge while.cond.backedge: - %2 = load i32* %shouldExit, align 4 + %2 = load i32, i32* %shouldExit, align 4 %cmp = icmp eq i32 %2, 0 br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge diff --git a/test/Transforms/GVN/atomic.ll b/test/Transforms/GVN/atomic.ll index 8c13d20..11b54f3 100644 --- a/test/Transforms/GVN/atomic.ll +++ b/test/Transforms/GVN/atomic.ll @@ -11,21 +11,9 @@ define i32 @test1() nounwind uwtable ssp { ; CHECK-LABEL: test1 ; CHECK: add i32 %x, %x entry: - %x = load i32* @y + %x = load i32, i32* @y store atomic i32 %x, i32* @x unordered, align 4 - %y = load i32* @y - %z = add i32 %x, %y - ret i32 %z -} - -; GVN across seq_cst store (allowed) -define i32 @test2() nounwind uwtable ssp { -; CHECK-LABEL: test2 -; CHECK: add i32 %x, %x -entry: - %x = load i32* @y - store atomic i32 %x, i32* @x seq_cst, align 4 - %y = load i32* @y + %y = load i32, i32* @y %z = add i32 %x, %y ret i32 %z } @@ -35,35 +23,21 @@ define i32 @test3() nounwind uwtable ssp { ; CHECK-LABEL: test3 ; CHECK: add i32 %x, %x entry: - %x = load i32* @y - %y = load atomic i32* @x unordered, align 4 - %z = load i32* @y + %x = load i32, i32* @y + %y = load atomic i32, i32* @x unordered, align 4 + %z = load i32, i32* @y %a = add i32 %x, %z %b = add i32 %y, %a ret i32 %b } -; GVN across acquire load (allowed as the original load was not atomic) -define i32 @test4() nounwind uwtable ssp { -; CHECK-LABEL: test4 -; CHECK: load atomic i32* @x -; CHECK-NOT: load i32* @y -entry: - %x = load i32* @y - %y = load atomic i32* @x seq_cst, align 4 - %x2 = load i32* @y - %x3 = add i32 %x, %x2 - %y2 = add i32 %y, %x3 - ret i32 %y2 -} - ; GVN load to unordered load (allowed) define i32 @test5() nounwind uwtable ssp { ; CHECK-LABEL: test5 ; CHECK: add i32 %x, %x entry: - %x = load atomic i32* @x unordered, align 4 - %y = load i32* @x + %x = load atomic i32, i32* @x unordered, align 4 + %y = load i32, i32* @x %z = add i32 %x, %y ret i32 %z } @@ -71,10 +45,10 @@ entry: ; GVN unordered load to load (unordered load must not be removed) define i32 @test6() nounwind uwtable ssp { ; CHECK-LABEL: test6 -; CHECK: load atomic i32* @x unordered +; CHECK: load atomic i32, i32* @x unordered entry: - %x = load i32* @x - %x2 = load atomic i32* @x unordered, align 4 + %x = load i32, i32* @x + %x2 = load atomic i32, i32* @x unordered, align 4 %x3 = add i32 %x, %x2 ret i32 %x3 } @@ -84,23 +58,10 @@ define i32 @test7() nounwind uwtable ssp { ; CHECK-LABEL: test7 ; CHECK: add i32 %x, %y entry: - %x = load i32* @y + %x = load i32, i32* @y store atomic i32 %x, i32* @x release, align 4 - %w = load atomic i32* @x acquire, align 4 - %y = load i32* @y - %z = add i32 %x, %y - ret i32 %z -} - -; GVN across acquire-release pair (allowed) -define i32 @test8() nounwind uwtable ssp { -; CHECK-LABEL: test8 -; CHECK: add i32 %x, %x -entry: - %x = load i32* @y - %w = load atomic i32* @x acquire, align 4 - store atomic i32 %x, i32* @x release, align 4 - %y = load i32* @y + %w = load atomic i32, i32* @x acquire, align 4 + %y = load i32, i32* @y %z = add i32 %x, %y ret i32 %z } @@ -110,9 +71,9 @@ define i32 @test9() nounwind uwtable ssp { ; CHECK-LABEL: test9 ; CHECK: add i32 %x, %x entry: - %x = load i32* @y + %x = load i32, i32* @y store atomic i32 %x, i32* @x monotonic, align 4 - %y = load i32* @y + %y = load i32, i32* @y %z = add i32 %x, %y ret i32 %z } @@ -122,10 +83,27 @@ define i32 @test10() nounwind uwtable ssp { ; CHECK-LABEL: test10 ; CHECK: add i32 %x, %y entry: - %x = load atomic i32* @y unordered, align 4 - %clobber = load atomic i32* @x monotonic, align 4 - %y = load atomic i32* @y monotonic, align 4 + %x = load atomic i32, i32* @y unordered, align 4 + %clobber = load atomic i32, i32* @x monotonic, align 4 + %y = load atomic i32, i32* @y monotonic, align 4 %z = add i32 %x, %y ret i32 %z } +define i32 @PR22708(i1 %flag) { +; CHECK-LABEL: PR22708 +entry: + br i1 %flag, label %if.then, label %if.end + +if.then: + store i32 43, i32* @y, align 4 +; CHECK: store i32 43, i32* @y, align 4 + br label %if.end + +if.end: + load atomic i32, i32* @x acquire, align 4 + %load = load i32, i32* @y, align 4 +; CHECK: load atomic i32, i32* @x acquire, align 4 +; CHECK: load i32, i32* @y, align 4 + ret i32 %load +} diff --git a/test/Transforms/GVN/calloc-load-removal.ll b/test/Transforms/GVN/calloc-load-removal.ll index 2dde5b7..a51f71f 100644 --- a/test/Transforms/GVN/calloc-load-removal.ll +++ b/test/Transforms/GVN/calloc-load-removal.ll @@ -9,11 +9,11 @@ define i32 @test1() { %1 = tail call noalias i8* @calloc(i64 1, i64 4) %2 = bitcast i8* %1 to i32* ; This load is trivially constant zero - %3 = load i32* %2, align 4 + %3 = load i32, i32* %2, align 4 ret i32 %3 ; CHECK-LABEL: @test1( -; CHECK-NOT: %3 = load i32* %2, align 4 +; CHECK-NOT: %3 = load i32, i32* %2, align 4 ; CHECK: ret i32 0 ; CHECK_NO_LIBCALLS-LABEL: @test1( diff --git a/test/Transforms/GVN/calls-readonly.ll b/test/Transforms/GVN/calls-readonly.ll index a477740..ba8ad66 100644 --- a/test/Transforms/GVN/calls-readonly.ll +++ b/test/Transforms/GVN/calls-readonly.ll @@ -20,7 +20,7 @@ bb1: ; preds = %bb, %entry %4 = tail call i32 @strlen(i8* %P) ; <i32> [#uses=1] %5 = add i32 %x_addr.0, %0 ; <i32> [#uses=1] %.sum = sub i32 %5, %4 ; <i32> [#uses=1] - %6 = getelementptr i8* %3, i32 %.sum ; <i8*> [#uses=1] + %6 = getelementptr i8, i8* %3, i32 %.sum ; <i8*> [#uses=1] ret i8* %6 } diff --git a/test/Transforms/GVN/cond_br.ll b/test/Transforms/GVN/cond_br.ll index 918e7d4..aeb1a6e 100644 --- a/test/Transforms/GVN/cond_br.ll +++ b/test/Transforms/GVN/cond_br.ll @@ -5,11 +5,11 @@ ; Function Attrs: nounwind ssp uwtable define void @foo(i32 %x) { ; CHECK: @foo(i32 %x) -; CHECK: %.pre = load i32* @y +; CHECK: %.pre = load i32, i32* @y ; CHECK: call void @bar(i32 %.pre) %t = sub i32 %x, %x - %.pre = load i32* @y, align 4 + %.pre = load i32, i32* @y, align 4 %cmp = icmp sgt i32 %t, 2 br i1 %cmp, label %if.then, label %entry.if.end_crit_edge @@ -29,11 +29,11 @@ if.end: ; preds = %entry.if.end_crit_e define void @foo2(i32 %x) { ; CHECK: @foo2(i32 %x) -; CHECK: %.pre = load i32* @y +; CHECK: %.pre = load i32, i32* @y ; CHECK: tail call void @bar(i32 %.pre) entry: %t = sub i32 %x, %x - %.pre = load i32* @y, align 4 + %.pre = load i32, i32* @y, align 4 %cmp = icmp sgt i32 %t, 2 br i1 %cmp, label %if.then, label %if.else diff --git a/test/Transforms/GVN/cond_br2.ll b/test/Transforms/GVN/cond_br2.ll index a7ca219..02154a7 100644 --- a/test/Transforms/GVN/cond_br2.ll +++ b/test/Transforms/GVN/cond_br2.ll @@ -19,19 +19,19 @@ entry: %sv = alloca %"class.llvm::SmallVector", align 16 %0 = bitcast %"class.llvm::SmallVector"* %sv to i8* call void @llvm.lifetime.start(i64 64, i8* %0) #1 - %BeginX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0 - %FirstEl.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 3 + %BeginX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 0 + %FirstEl.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 3 %1 = bitcast %"union.llvm::SmallVectorBase::U"* %FirstEl.i.i.i.i.i.i to i8* store i8* %1, i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4 - %EndX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1 + %EndX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1 store i8* %1, i8** %EndX.i.i.i.i.i.i, align 8, !tbaa !4 - %CapacityX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2 - %add.ptr.i.i.i.i2.i.i = getelementptr inbounds %"union.llvm::SmallVectorBase::U"* %FirstEl.i.i.i.i.i.i, i64 2 + %CapacityX.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2 + %add.ptr.i.i.i.i2.i.i = getelementptr inbounds %"union.llvm::SmallVectorBase::U", %"union.llvm::SmallVectorBase::U"* %FirstEl.i.i.i.i.i.i, i64 2 %add.ptr.i.i.i.i.i.i = bitcast %"union.llvm::SmallVectorBase::U"* %add.ptr.i.i.i.i2.i.i to i8* store i8* %add.ptr.i.i.i.i.i.i, i8** %CapacityX.i.i.i.i.i.i, align 16, !tbaa !4 - %EndX.i = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1 - %2 = load i8** %EndX.i, align 8, !tbaa !4 - %CapacityX.i = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2 + %EndX.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 1 + %2 = load i8*, i8** %EndX.i, align 8, !tbaa !4 + %CapacityX.i = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0, i32 2 %cmp.i = icmp ult i8* %2, %add.ptr.i.i.i.i.i.i br i1 %cmp.i, label %Retry.i, label %if.end.i @@ -46,23 +46,23 @@ new.notnull.i: ; preds = %Retry.i br label %invoke.cont if.end.i: ; preds = %entry - %5 = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0 + %5 = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0 invoke void @_ZN4llvm15SmallVectorBase8grow_podEmm(%"class.llvm::SmallVectorBase"* %5, i64 0, i64 4) to label %.noexc unwind label %lpad .noexc: ; preds = %if.end.i - %.pre.i = load i8** %EndX.i, align 8, !tbaa !4 + %.pre.i = load i8*, i8** %EndX.i, align 8, !tbaa !4 br label %Retry.i invoke.cont: ; preds = %new.notnull.i, %Retry.i - %add.ptr.i = getelementptr inbounds i8* %3, i64 4 + %add.ptr.i = getelementptr inbounds i8, i8* %3, i64 4 store i8* %add.ptr.i, i8** %EndX.i, align 8, !tbaa !4 - %6 = load i8** %CapacityX.i, align 16, !tbaa !4 + %6 = load i8*, i8** %CapacityX.i, align 16, !tbaa !4 %cmp.i8 = icmp ult i8* %add.ptr.i, %6 br i1 %cmp.i8, label %new.notnull.i11, label %if.end.i14 Retry.i10: ; preds = %if.end.i14 - %.pre.i13 = load i8** %EndX.i, align 8, !tbaa !4 + %.pre.i13 = load i8*, i8** %EndX.i, align 8, !tbaa !4 %new.isnull.i9 = icmp eq i8* %.pre.i13, null br i1 %new.isnull.i9, label %invoke.cont2, label %new.notnull.i11 @@ -73,19 +73,19 @@ new.notnull.i11: ; preds = %invoke.cont, %Retry br label %invoke.cont2 if.end.i14: ; preds = %invoke.cont - %9 = getelementptr inbounds %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0 + %9 = getelementptr inbounds %"class.llvm::SmallVector", %"class.llvm::SmallVector"* %sv, i64 0, i32 0, i32 0, i32 0, i32 0 invoke void @_ZN4llvm15SmallVectorBase8grow_podEmm(%"class.llvm::SmallVectorBase"* %9, i64 0, i64 4) to label %Retry.i10 unwind label %lpad invoke.cont2: ; preds = %new.notnull.i11, %Retry.i10 %10 = phi i8* [ null, %Retry.i10 ], [ %7, %new.notnull.i11 ] - %add.ptr.i12 = getelementptr inbounds i8* %10, i64 4 + %add.ptr.i12 = getelementptr inbounds i8, i8* %10, i64 4 store i8* %add.ptr.i12, i8** %EndX.i, align 8, !tbaa !4 invoke void @_Z1gRN4llvm11SmallVectorIiLj8EEE(%"class.llvm::SmallVector"* %sv) to label %invoke.cont3 unwind label %lpad invoke.cont3: ; preds = %invoke.cont2 - %11 = load i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4 + %11 = load i8*, i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4 %cmp.i.i.i.i19 = icmp eq i8* %11, %1 br i1 %cmp.i.i.i.i19, label %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit21, label %if.then.i.i.i20 @@ -100,7 +100,7 @@ _ZN4llvm11SmallVectorIiLj8EED1Ev.exit21: ; preds = %invoke.cont3, %if.t lpad: ; preds = %if.end.i14, %if.end.i, %invoke.cont2 %12 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup - %13 = load i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4 + %13 = load i8*, i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4 %cmp.i.i.i.i = icmp eq i8* %13, %1 br i1 %cmp.i.i.i.i, label %eh.resume, label %if.then.i.i.i diff --git a/test/Transforms/GVN/condprop.ll b/test/Transforms/GVN/condprop.ll index 845f88e..6aa3cb8 100644 --- a/test/Transforms/GVN/condprop.ll +++ b/test/Transforms/GVN/condprop.ll @@ -5,7 +5,7 @@ ; CHECK-LABEL: @test1( define i32 @test1() nounwind { entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %1 = icmp eq i32 %0, 4 br i1 %1, label %bb, label %bb1 @@ -13,7 +13,7 @@ bb: ; preds = %entry br label %bb8 bb1: ; preds = %entry - %2 = load i32* @a, align 4 + %2 = load i32, i32* @a, align 4 %3 = icmp eq i32 %2, 5 br i1 %3, label %bb2, label %bb3 @@ -21,29 +21,29 @@ bb2: ; preds = %bb1 br label %bb8 bb3: ; preds = %bb1 - %4 = load i32* @a, align 4 + %4 = load i32, i32* @a, align 4 %5 = icmp eq i32 %4, 4 ; CHECK: br i1 false, label %bb4, label %bb5 br i1 %5, label %bb4, label %bb5 bb4: ; preds = %bb3 - %6 = load i32* @a, align 4 + %6 = load i32, i32* @a, align 4 %7 = add i32 %6, 5 br label %bb8 bb5: ; preds = %bb3 - %8 = load i32* @a, align 4 + %8 = load i32, i32* @a, align 4 %9 = icmp eq i32 %8, 5 ; CHECK: br i1 false, label %bb6, label %bb7 br i1 %9, label %bb6, label %bb7 bb6: ; preds = %bb5 - %10 = load i32* @a, align 4 + %10 = load i32, i32* @a, align 4 %11 = add i32 %10, 4 br label %bb8 bb7: ; preds = %bb5 - %12 = load i32* @a, align 4 + %12 = load i32, i32* @a, align 4 br label %bb8 bb8: ; preds = %bb7, %bb6, %bb4, %bb2, %bb diff --git a/test/Transforms/GVN/crash-no-aa.ll b/test/Transforms/GVN/crash-no-aa.ll index 9ad63a7..f076a8d 100644 --- a/test/Transforms/GVN/crash-no-aa.ll +++ b/test/Transforms/GVN/crash-no-aa.ll @@ -5,11 +5,11 @@ target triple = "x86_64-unknown-freebsd8.0" ; PR5744 define i32 @test1({i16, i32} *%P) { - %P2 = getelementptr {i16, i32} *%P, i32 0, i32 0 + %P2 = getelementptr {i16, i32}, {i16, i32} *%P, i32 0, i32 0 store i16 42, i16* %P2 - %P3 = getelementptr {i16, i32} *%P, i32 0, i32 1 - %V = load i32* %P3 + %P3 = getelementptr {i16, i32}, {i16, i32} *%P, i32 0, i32 1 + %V = load i32, i32* %P3 ret i32 %V } diff --git a/test/Transforms/GVN/crash.ll b/test/Transforms/GVN/crash.ll index 9fb612f..2abb419 100644 --- a/test/Transforms/GVN/crash.ll +++ b/test/Transforms/GVN/crash.ll @@ -22,7 +22,7 @@ while.body: ; preds = %while.body.backedge lor.lhs.false: ; preds = %while.body %tmp20 = bitcast i32* %o.addr.0 to i32* ; <i32*> [#uses=1] - %tmp22 = load i32* %tmp20 ; <i32> [#uses=0] + %tmp22 = load i32, i32* %tmp20 ; <i32> [#uses=0] br i1 undef, label %land.lhs.true24, label %if.end31 land.lhs.true24: ; preds = %lor.lhs.false @@ -34,11 +34,11 @@ if.end31: ; preds = %land.lhs.true24, %l if.end41: ; preds = %if.end31 %tmp43 = bitcast i32* %o.addr.0 to i32* ; <i32*> [#uses=1] - %tmp45 = load i32* %tmp43 ; <i32> [#uses=0] + %tmp45 = load i32, i32* %tmp43 ; <i32> [#uses=0] br i1 undef, label %if.then50, label %if.else if.then50: ; preds = %if.end41 - %tmp53 = load i32** undef ; <i32*> [#uses=1] + %tmp53 = load i32*, i32** undef ; <i32*> [#uses=1] br label %while.body.backedge if.else: ; preds = %if.end41 @@ -74,16 +74,16 @@ entry: br label %bb69.i bb69.i: ; preds = %bb57.i.preheader - %tmp4 = getelementptr inbounds [4 x %struct.attribute_spec*]* @attribute_tables, i32 0, i32 undef ; <%struct.attribute_spec**> [#uses=1] - %tmp3 = load %struct.attribute_spec** %tmp4, align 4 ; <%struct.attribute_spec*> [#uses=1] + %tmp4 = getelementptr inbounds [4 x %struct.attribute_spec*], [4 x %struct.attribute_spec*]* @attribute_tables, i32 0, i32 undef ; <%struct.attribute_spec**> [#uses=1] + %tmp3 = load %struct.attribute_spec*, %struct.attribute_spec** %tmp4, align 4 ; <%struct.attribute_spec*> [#uses=1] br label %bb65.i bb65.i: ; preds = %bb65.i.preheader, %bb64.i %storemerge6.i = phi i32 [ 1, %bb64.i ], [ 0, %bb69.i ] ; <i32> [#uses=3] - %scevgep14 = getelementptr inbounds %struct.attribute_spec* %tmp3, i32 %storemerge6.i, i32 0 ; <i8**> [#uses=1] - %tmp2 = load i8** %scevgep14, align 4 ; <i8*> [#uses=0] - %tmp = load %struct.attribute_spec** %tmp4, align 4 ; <%struct.attribute_spec*> [#uses=1] - %scevgep1516 = getelementptr inbounds %struct.attribute_spec* %tmp, i32 %storemerge6.i, i32 0 ; <i8**> [#uses=0] + %scevgep14 = getelementptr inbounds %struct.attribute_spec, %struct.attribute_spec* %tmp3, i32 %storemerge6.i, i32 0 ; <i8**> [#uses=1] + %tmp2 = load i8*, i8** %scevgep14, align 4 ; <i8*> [#uses=0] + %tmp = load %struct.attribute_spec*, %struct.attribute_spec** %tmp4, align 4 ; <%struct.attribute_spec*> [#uses=1] + %scevgep1516 = getelementptr inbounds %struct.attribute_spec, %struct.attribute_spec* %tmp, i32 %storemerge6.i, i32 0 ; <i8**> [#uses=0] unreachable bb64.i: ; Unreachable @@ -101,7 +101,7 @@ bb66.i: ; Unreachable define i32* @test3() { do.end17.i: - %tmp18.i = load i7** undef + %tmp18.i = load i7*, i7** undef %tmp1 = bitcast i7* %tmp18.i to i8* br i1 undef, label %do.body36.i, label %if.then21.i @@ -110,12 +110,12 @@ if.then21.i: ret i32* undef do.body36.i: - %ivar38.i = load i64* @g + %ivar38.i = load i64, i64* @g %tmp3 = bitcast i7* %tmp18.i to i8* %add.ptr39.sum.i = add i64 %ivar38.i, 8 - %tmp40.i = getelementptr inbounds i8* %tmp3, i64 %add.ptr39.sum.i + %tmp40.i = getelementptr inbounds i8, i8* %tmp3, i64 %add.ptr39.sum.i %tmp4 = bitcast i8* %tmp40.i to i64* - %tmp41.i = load i64* %tmp4 + %tmp41.i = load i64, i64* %tmp4 br i1 undef, label %if.then48.i, label %do.body57.i if.then48.i: @@ -123,13 +123,13 @@ if.then48.i: br label %do.body57.i do.body57.i: - %tmp58.i = load i7** undef - %ivar59.i = load i64* @g + %tmp58.i = load i7*, i7** undef + %ivar59.i = load i64, i64* @g %tmp5 = bitcast i7* %tmp58.i to i8* %add.ptr65.sum.i = add i64 %ivar59.i, 8 - %tmp66.i = getelementptr inbounds i8* %tmp5, i64 %add.ptr65.sum.i + %tmp66.i = getelementptr inbounds i8, i8* %tmp5, i64 %add.ptr65.sum.i %tmp6 = bitcast i8* %tmp66.i to i64* - %tmp67.i = load i64* %tmp6 + %tmp67.i = load i64, i64* %tmp6 ret i32* undef } @@ -142,10 +142,10 @@ entry: ret i32 0 dead: - %P2 = getelementptr i32 *%P2, i32 52 - %Q2 = getelementptr i32 *%Q2, i32 52 + %P2 = getelementptr i32, i32 *%P2, i32 52 + %Q2 = getelementptr i32, i32 *%Q2, i32 52 store i32 4, i32* %P2 - %A = load i32* %Q2 + %A = load i32, i32* %Q2 br i1 true, label %dead, label %dead2 dead2: @@ -156,10 +156,10 @@ dead2: ; PR9841 define fastcc i8 @test5(i8* %P) nounwind { entry: - %0 = load i8* %P, align 2 + %0 = load i8, i8* %P, align 2 - %Q = getelementptr i8* %P, i32 1 - %1 = load i8* %Q, align 1 + %Q = getelementptr i8, i8* %P, i32 1 + %1 = load i8, i8* %Q, align 1 ret i8 %1 } @@ -178,16 +178,16 @@ entry: ;; Unreachable code. unreachable.bb: - %gep.val = getelementptr inbounds %struct.type* %gep.val, i64 1 + %gep.val = getelementptr inbounds %struct.type, %struct.type* %gep.val, i64 1 br i1 undef, label %u2.bb, label %u1.bb u1.bb: - %tmp1 = getelementptr inbounds %struct.type* %gep.val, i64 0, i32 0 + %tmp1 = getelementptr inbounds %struct.type, %struct.type* %gep.val, i64 0, i32 0 store i64 -1, i64* %tmp1, align 8 br label %unreachable.bb u2.bb: - %0 = load i32* undef, align 4 + %0 = load i32, i32* undef, align 4 %conv.i.i.i.i.i = zext i32 %0 to i64 br label %u2.bb diff --git a/test/Transforms/GVN/invariant-load.ll b/test/Transforms/GVN/invariant-load.ll index 2a83c45..f126458 100644 --- a/test/Transforms/GVN/invariant-load.ll +++ b/test/Transforms/GVN/invariant-load.ll @@ -3,13 +3,13 @@ define i32 @test1(i32* nocapture %p, i8* nocapture %q) { ; CHECK-LABEL: test1 -; CHECK: %x = load i32* %p, align 4, !invariant.load !0 +; CHECK: %x = load i32, i32* %p, align 4, !invariant.load !0 ; CHECK-NOT: %y = load entry: - %x = load i32* %p, align 4, !invariant.load !0 + %x = load i32, i32* %p, align 4, !invariant.load !0 %conv = trunc i32 %x to i8 store i8 %conv, i8* %q, align 1 - %y = load i32* %p, align 4, !invariant.load !0 + %y = load i32, i32* %p, align 4, !invariant.load !0 %add = add i32 %y, 1 ret i32 %add } @@ -19,10 +19,10 @@ define i32 @test2(i32* nocapture %p, i8* nocapture %q) { ; CHECK-NOT: !invariant.load ; CHECK-NOT: %y = load entry: - %x = load i32* %p, align 4 + %x = load i32, i32* %p, align 4 %conv = trunc i32 %x to i8 store i8 %conv, i8* %q, align 1 - %y = load i32* %p, align 4, !invariant.load !0 + %y = load i32, i32* %p, align 4, !invariant.load !0 %add = add i32 %y, 1 ret i32 %add } @@ -33,7 +33,7 @@ define i32 @test3(i1 %cnd, i32* %p, i32* %q) { ; CHECK-LABEL: test3 ; CHECK-NOT: load entry: - %v1 = load i32* %p + %v1 = load i32, i32* %p br i1 %cnd, label %bb1, label %bb2 bb1: @@ -41,7 +41,7 @@ bb1: br label %bb2 bb2: - %v2 = load i32* %p, !invariant.load !0 + %v2 = load i32, i32* %p, !invariant.load !0 %res = sub i32 %v1, %v2 ret i32 %res } @@ -52,7 +52,7 @@ define i32 @test4(i1 %cnd, i32* %p, i32* %q) { ; CHECK-LABEL: test4 ; %v2 is redundant, but GVN currently doesn't catch that entry: - %v1 = load i32* %p, !invariant.load !0 + %v1 = load i32, i32* %p, !invariant.load !0 br i1 %cnd, label %bb1, label %bb2 bb1: @@ -60,10 +60,60 @@ bb1: br label %bb2 bb2: - %v2 = load i32* %p + %v2 = load i32, i32* %p %res = sub i32 %v1, %v2 ret i32 %res } +; Checks that we return the mustalias store as a def +; so that it contributes to value forwarding. Note +; that we could and should remove the store too. +define i32 @test5(i1 %cnd, i32* %p) { +; CHECK-LABEL: test5 +; CHECK-LABEL: entry: +; CHECK-NEXT: store i32 5, i32* %p +; CHECK-NEXT: ret i32 5 +entry: + %v1 = load i32, i32* %p, !invariant.load !0 + store i32 5, i32* %p ;; must alias store, want to exploit + %v2 = load i32, i32* %p, !invariant.load !0 + ret i32 %v2 +} + + +declare void @foo() + +; Clobbering (mayalias) stores, even in function calls, can be ignored +define i32 @test6(i1 %cnd, i32* %p) { +; CHECK-LABEL: test6 +; CHECK-LABEL: entry: +; CHECK-NEXT: @foo +; CHECK-NEXT: ret i32 0 +entry: + %v1 = load i32, i32* %p, !invariant.load !0 + call void @foo() + %v2 = load i32, i32* %p, !invariant.load !0 + %res = sub i32 %v1, %v2 + ret i32 %res +} + +declare noalias i32* @bar(...) + +; Same as previous, but a function with a noalias result (since they're handled +; differently in MDA) +define i32 @test7(i1 %cnd, i32* %p) { +; CHECK-LABEL: test7 +; CHECK-LABEL: entry: +; CHECK-NEXT: @bar +; CHECK-NEXT: ret i32 0 +entry: + %v1 = load i32, i32* %p, !invariant.load !0 + call i32* (...)* @bar(i32* %p) + %v2 = load i32, i32* %p, !invariant.load !0 + %res = sub i32 %v1, %v2 + ret i32 %res +} + + !0 = !{ } diff --git a/test/Transforms/GVN/lifetime-simple.ll b/test/Transforms/GVN/lifetime-simple.ll index 02f7bcc..d03b62c 100644 --- a/test/Transforms/GVN/lifetime-simple.ll +++ b/test/Transforms/GVN/lifetime-simple.ll @@ -9,10 +9,10 @@ define i8 @test(i8* %P) nounwind { ; CHECK: lifetime.end entry: call void @llvm.lifetime.start(i64 32, i8* %P) - %0 = load i8* %P + %0 = load i8, i8* %P store i8 1, i8* %P call void @llvm.lifetime.end(i64 32, i8* %P) - %1 = load i8* %P + %1 = load i8, i8* %P ret i8 %1 } diff --git a/test/Transforms/GVN/load-constant-mem.ll b/test/Transforms/GVN/load-constant-mem.ll index a7dacea..f870485 100644 --- a/test/Transforms/GVN/load-constant-mem.ll +++ b/test/Transforms/GVN/load-constant-mem.ll @@ -4,10 +4,10 @@ define i32 @test(i8* %p, i32 %i) nounwind { entry: - %P = getelementptr [4 x i32]* @G, i32 0, i32 %i - %A = load i32* %P + %P = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %i + %A = load i32, i32* %P store i8 4, i8* %p - %B = load i32* %P + %B = load i32, i32* %P %C = sub i32 %A, %B ret i32 %C } diff --git a/test/Transforms/GVN/load-from-unreachable-predecessor.ll b/test/Transforms/GVN/load-from-unreachable-predecessor.ll index b676d95..29ea14d 100644 --- a/test/Transforms/GVN/load-from-unreachable-predecessor.ll +++ b/test/Transforms/GVN/load-from-unreachable-predecessor.ll @@ -8,13 +8,13 @@ define i32 @f(i32** %f) { ; Load should be removed, since it's ignored. ; CHECK-NEXT: br label bb0: - %bar = load i32** %f + %bar = load i32*, i32** %f br label %bb2 bb1: - %zed = load i32** %f + %zed = load i32*, i32** %f br i1 false, label %bb1, label %bb2 bb2: %foo = phi i32* [ null, %bb0 ], [ %zed, %bb1 ] - %storemerge = load i32* %foo + %storemerge = load i32, i32* %foo ret i32 %storemerge } diff --git a/test/Transforms/GVN/load-pre-align.ll b/test/Transforms/GVN/load-pre-align.ll index 4816af2..1198caf 100644 --- a/test/Transforms/GVN/load-pre-align.ll +++ b/test/Transforms/GVN/load-pre-align.ll @@ -25,7 +25,7 @@ for.cond.for.end_crit_edge: br label %for.end for.body: - %tmp3 = load i32* @p, align 8 + %tmp3 = load i32, i32* @p, align 8 %dec = add i32 %tmp3, -1 store i32 %dec, i32* @p %cmp6 = icmp slt i32 %dec, 0 @@ -39,6 +39,6 @@ for.inc: br label %for.cond for.end: - %tmp9 = load i32* @p, align 8 + %tmp9 = load i32, i32* @p, align 8 ret i32 %tmp9 } diff --git a/test/Transforms/GVN/load-pre-licm.ll b/test/Transforms/GVN/load-pre-licm.ll index 63541ad..d14b01c 100644 --- a/test/Transforms/GVN/load-pre-licm.ll +++ b/test/Transforms/GVN/load-pre-licm.ll @@ -16,11 +16,11 @@ entry: while.body5: %indvar = phi i32 [ 0, %entry ], [ %tmp6, %if.end ] %tmp5 = add i32 %indvar, 2 - %arrayidx9 = getelementptr [5001 x i32]* @sortlist, i32 0, i32 %tmp5 + %arrayidx9 = getelementptr [5001 x i32], [5001 x i32]* @sortlist, i32 0, i32 %tmp5 %tmp6 = add i32 %indvar, 1 - %arrayidx = getelementptr [5001 x i32]* @sortlist, i32 0, i32 %tmp6 - %tmp7 = load i32* %arrayidx, align 4 - %tmp10 = load i32* %arrayidx9, align 4 + %arrayidx = getelementptr [5001 x i32], [5001 x i32]* @sortlist, i32 0, i32 %tmp6 + %tmp7 = load i32, i32* %arrayidx, align 4 + %tmp10 = load i32, i32* %arrayidx9, align 4 %cmp11 = icmp sgt i32 %tmp7, %tmp10 br i1 %cmp11, label %if.then, label %if.end diff --git a/test/Transforms/GVN/load-pre-nonlocal.ll b/test/Transforms/GVN/load-pre-nonlocal.ll index ae508b9..c75e54d 100644 --- a/test/Transforms/GVN/load-pre-nonlocal.ll +++ b/test/Transforms/GVN/load-pre-nonlocal.ll @@ -12,8 +12,8 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" ; CHECK-LABEL: define i32 @volatile_load ; CHECK: for.body: -; CHECK: %2 = load i32* -; CHECK: %3 = load volatile i32* +; CHECK: %2 = load i32, i32* +; CHECK: %3 = load volatile i32, i32* ; CHECK: for.cond.for.end_crit_edge: define i32 @volatile_load(i32 %n) { @@ -22,21 +22,21 @@ entry: br i1 %cmp6, label %for.body.lr.ph, label %for.end for.body.lr.ph: - %0 = load i32** @a2, align 8, !tbaa !1 - %1 = load i32** @a, align 8, !tbaa !1 + %0 = load i32*, i32** @a2, align 8, !tbaa !1 + %1 = load i32*, i32** @a, align 8, !tbaa !1 br label %for.body for.body: %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %s.09 = phi i32 [ 0, %for.body.lr.ph ], [ %add, %for.body ] %p.08 = phi i32* [ %0, %for.body.lr.ph ], [ %incdec.ptr, %for.body ] - %2 = load i32* %p.08, align 4, !tbaa !5 - %arrayidx = getelementptr inbounds i32* %1, i64 %indvars.iv + %2 = load i32, i32* %p.08, align 4, !tbaa !5 + %arrayidx = getelementptr inbounds i32, i32* %1, i64 %indvars.iv store i32 %2, i32* %arrayidx, align 4, !tbaa !5 - %3 = load volatile i32* %p.08, align 4, !tbaa !5 + %3 = load volatile i32, i32* %p.08, align 4, !tbaa !5 %add = add nsw i32 %3, %s.09 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %incdec.ptr = getelementptr inbounds i32* %p.08, i64 1 + %incdec.ptr = getelementptr inbounds i32, i32* %p.08, i64 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp ne i32 %lftr.wideiv, %n br i1 %exitcond, label %for.body, label %for.cond.for.end_crit_edge @@ -54,7 +54,7 @@ for.end: ; CHECK-LABEL: define i32 @overaligned_load ; CHECK: if.end: -; CHECK-NOT: %1 = load i32* +; CHECK-NOT: %1 = load i32, i32* define i32 @overaligned_load(i32 %a, i32* nocapture %b) { entry: @@ -62,19 +62,19 @@ entry: br i1 %cmp, label %if.then, label %if.else if.then: - %0 = load i32* getelementptr inbounds (%struct.S1* @s1, i64 0, i32 0), align 8, !tbaa !5 + %0 = load i32, i32* getelementptr inbounds (%struct.S1, %struct.S1* @s1, i64 0, i32 0), align 8, !tbaa !5 br label %if.end if.else: - %arrayidx = getelementptr inbounds i32* %b, i64 2 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 2 store i32 10, i32* %arrayidx, align 4, !tbaa !5 br label %if.end if.end: %i.0 = phi i32 [ %0, %if.then ], [ 0, %if.else ] - %p.0 = phi i32* [ getelementptr inbounds (%struct.S1* @s1, i64 0, i32 0), %if.then ], [ %b, %if.else ] - %add.ptr = getelementptr inbounds i32* %p.0, i64 1 - %1 = load i32* %add.ptr, align 4, !tbaa !5 + %p.0 = phi i32* [ getelementptr inbounds (%struct.S1, %struct.S1* @s1, i64 0, i32 0), %if.then ], [ %b, %if.else ] + %add.ptr = getelementptr inbounds i32, i32* %p.0, i64 1 + %1 = load i32, i32* %add.ptr, align 4, !tbaa !5 %add1 = add nsw i32 %1, %i.0 ret i32 %add1 } diff --git a/test/Transforms/GVN/lpre-call-wrap-2.ll b/test/Transforms/GVN/lpre-call-wrap-2.ll index 35e3534..5dc779e 100644 --- a/test/Transforms/GVN/lpre-call-wrap-2.ll +++ b/test/Transforms/GVN/lpre-call-wrap-2.ll @@ -16,10 +16,10 @@ target triple = "i386-apple-darwin7" define void @bi_windup(i8* %outbuf, i8 zeroext %bi_buf) nounwind { entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - %0 = load i32* @outcnt, align 4 ; <i32> [#uses=1] - %1 = getelementptr i8* %outbuf, i32 %0 ; <i8*> [#uses=1] + %0 = load i32, i32* @outcnt, align 4 ; <i32> [#uses=1] + %1 = getelementptr i8, i8* %outbuf, i32 %0 ; <i8*> [#uses=1] store i8 %bi_buf, i8* %1, align 1 - %2 = load i32* @outcnt, align 4 ; <i32> [#uses=1] + %2 = load i32, i32* @outcnt, align 4 ; <i32> [#uses=1] %3 = icmp eq i32 %2, 16384 ; <i1> [#uses=1] br i1 %3, label %bb, label %bb1 @@ -31,8 +31,8 @@ bb1: ; preds = %bb, %entry ; CHECK: bb1: ; CHECK-NEXT: phi ; CHECK-NEXT: getelementptr - %4 = load i32* @outcnt, align 4 ; <i32> [#uses=1] - %5 = getelementptr i8* %outbuf, i32 %4 ; <i8*> [#uses=1] + %4 = load i32, i32* @outcnt, align 4 ; <i32> [#uses=1] + %5 = getelementptr i8, i8* %outbuf, i32 %4 ; <i8*> [#uses=1] store i8 %bi_buf, i8* %5, align 1 ret void } diff --git a/test/Transforms/GVN/lpre-call-wrap.ll b/test/Transforms/GVN/lpre-call-wrap.ll index 0646f3f..2748305 100644 --- a/test/Transforms/GVN/lpre-call-wrap.ll +++ b/test/Transforms/GVN/lpre-call-wrap.ll @@ -19,20 +19,20 @@ target triple = "i386-apple-darwin7" define void @_Z12testfunctionR1A(%struct.A* %iter) { entry: - %0 = getelementptr %struct.A* %iter, i32 0, i32 0 ; <i32*> [#uses=3] - %1 = load i32* %0, align 4 ; <i32> [#uses=2] + %0 = getelementptr %struct.A, %struct.A* %iter, i32 0, i32 0 ; <i32*> [#uses=3] + %1 = load i32, i32* %0, align 4 ; <i32> [#uses=2] %2 = icmp eq i32 %1, 0 ; <i1> [#uses=1] br i1 %2, label %return, label %bb.nph bb.nph: ; preds = %entry - %3 = getelementptr %struct.A* %iter, i32 0, i32 1 ; <i32*> [#uses=1] + %3 = getelementptr %struct.A, %struct.A* %iter, i32 0, i32 1 ; <i32*> [#uses=1] br label %bb bb: ; preds = %bb3.backedge, %bb.nph %.rle = phi i32 [ %1, %bb.nph ], [ %7, %bb3.backedge ] ; <i32> [#uses=1] %4 = add i32 %.rle, 1 ; <i32> [#uses=2] store i32 %4, i32* %0, align 4 - %5 = load i32* %3, align 4 ; <i32> [#uses=1] + %5 = load i32, i32* %3, align 4 ; <i32> [#uses=1] %6 = icmp eq i32 %4, %5 ; <i1> [#uses=1] br i1 %6, label %bb1, label %bb3.backedge @@ -44,7 +44,7 @@ bb3.backedge: ; preds = %bb, %bb1 ; CHECK: bb3.backedge: ; CHECK-NEXT: phi ; CHECK-NEXT: icmp - %7 = load i32* %0, align 4 ; <i32> [#uses=2] + %7 = load i32, i32* %0, align 4 ; <i32> [#uses=2] %8 = icmp eq i32 %7, 0 ; <i1> [#uses=1] br i1 %8, label %return, label %bb diff --git a/test/Transforms/GVN/malloc-load-removal.ll b/test/Transforms/GVN/malloc-load-removal.ll index d2d2fd7..1d7a2dd 100644 --- a/test/Transforms/GVN/malloc-load-removal.ll +++ b/test/Transforms/GVN/malloc-load-removal.ll @@ -10,7 +10,7 @@ declare i8* @malloc(i64) nounwind define noalias i8* @test1() nounwind uwtable ssp { entry: %call = tail call i8* @malloc(i64 100) nounwind - %0 = load i8* %call, align 1 + %0 = load i8, i8* %call, align 1 %tobool = icmp eq i8 %0, 0 br i1 %tobool, label %if.end, label %if.then @@ -35,7 +35,7 @@ declare i8* @_Znwm(i64) nounwind define noalias i8* @test2() nounwind uwtable ssp { entry: %call = tail call i8* @_Znwm(i64 100) nounwind - %0 = load i8* %call, align 1 + %0 = load i8, i8* %call, align 1 %tobool = icmp eq i8 %0, 0 br i1 %tobool, label %if.end, label %if.then diff --git a/test/Transforms/GVN/noalias.ll b/test/Transforms/GVN/noalias.ll index 6c310fa..cfff096 100644 --- a/test/Transforms/GVN/noalias.ll +++ b/test/Transforms/GVN/noalias.ll @@ -2,21 +2,21 @@ define i32 @test1(i32* %p, i32* %q) { ; CHECK-LABEL: @test1(i32* %p, i32* %q) -; CHECK: load i32* %p +; CHECK: load i32, i32* %p ; CHECK-NOT: noalias ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !noalias !0 - %b = load i32* %p + %a = load i32, i32* %p, !noalias !0 + %b = load i32, i32* %p %c = add i32 %a, %b ret i32 %c } define i32 @test2(i32* %p, i32* %q) { ; CHECK-LABEL: @test2(i32* %p, i32* %q) -; CHECK: load i32* %p, !alias.scope !0 +; CHECK: load i32, i32* %p, !alias.scope !0 ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !alias.scope !0 - %b = load i32* %p, !alias.scope !0 + %a = load i32, i32* %p, !alias.scope !0 + %b = load i32, i32* %p, !alias.scope !0 %c = add i32 %a, %b ret i32 %c } @@ -27,10 +27,10 @@ define i32 @test2(i32* %p, i32* %q) { ; throw in between. define i32 @test3(i32* %p, i32* %q) { ; CHECK-LABEL: @test3(i32* %p, i32* %q) -; CHECK: load i32* %p, !alias.scope !1 +; CHECK: load i32, i32* %p, !alias.scope !1 ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !alias.scope !1 - %b = load i32* %p, !alias.scope !2 + %a = load i32, i32* %p, !alias.scope !1 + %b = load i32, i32* %p, !alias.scope !2 %c = add i32 %a, %b ret i32 %c } diff --git a/test/Transforms/GVN/non-local-offset.ll b/test/Transforms/GVN/non-local-offset.ll index 0b9edcb..2373ef5 100644 --- a/test/Transforms/GVN/non-local-offset.ll +++ b/test/Transforms/GVN/non-local-offset.ll @@ -13,12 +13,12 @@ target datalayout = "e-p:64:64:64" define void @yes(i1 %c, i32* %p, i32* %q) nounwind { entry: store i32 0, i32* %p - %p1 = getelementptr inbounds i32* %p, i64 1 + %p1 = getelementptr inbounds i32, i32* %p, i64 1 store i32 1, i32* %p1 br i1 %c, label %if.else, label %if.then if.then: - %t = load i32* %p + %t = load i32, i32* %p store i32 %t, i32* %q ret void @@ -35,25 +35,25 @@ if.else: ; CHECK-NEXT: store i32 0, i32* %q ; CHECK-NEXT: ret void ; CHECK: if.else: -; CHECK: load i64* %pc +; CHECK: load i64, i64* %pc ; CHECK: store i64 define void @watch_out_for_size_change(i1 %c, i32* %p, i32* %q) nounwind { entry: store i32 0, i32* %p - %p1 = getelementptr inbounds i32* %p, i64 1 + %p1 = getelementptr inbounds i32, i32* %p, i64 1 store i32 1, i32* %p1 br i1 %c, label %if.else, label %if.then if.then: - %t = load i32* %p + %t = load i32, i32* %p store i32 %t, i32* %q ret void if.else: %pc = bitcast i32* %p to i64* %qc = bitcast i32* %q to i64* - %t64 = load i64* %pc + %t64 = load i64, i64* %pc store i64 %t64, i64* %qc ret void } diff --git a/test/Transforms/GVN/nonescaping-malloc.ll b/test/Transforms/GVN/nonescaping-malloc.ll index c2eeed5..f83b317 100644 --- a/test/Transforms/GVN/nonescaping-malloc.ll +++ b/test/Transforms/GVN/nonescaping-malloc.ll @@ -22,10 +22,10 @@ target triple = "x86_64-apple-darwin10.0" define %"struct.llvm::StringMapEntry<void*>"* @_Z3fooRN4llvm9StringMapIPvNS_15MallocAllocatorEEEPKc(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %X, i8* %P) ssp { entry: %tmp = alloca %"struct.llvm::StringRef", align 8 - %tmp.i = getelementptr inbounds %"struct.llvm::StringRef"* %tmp, i64 0, i32 0 + %tmp.i = getelementptr inbounds %"struct.llvm::StringRef", %"struct.llvm::StringRef"* %tmp, i64 0, i32 0 store i8* %P, i8** %tmp.i, align 8 %tmp1.i = call i64 @strlen(i8* %P) nounwind readonly - %tmp2.i = getelementptr inbounds %"struct.llvm::StringRef"* %tmp, i64 0, i32 1 + %tmp2.i = getelementptr inbounds %"struct.llvm::StringRef", %"struct.llvm::StringRef"* %tmp, i64 0, i32 1 store i64 %tmp1.i, i64* %tmp2.i, align 8 %tmp1 = call %"struct.llvm::StringMapEntry<void*>"* @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %X, %"struct.llvm::StringRef"* %tmp) ssp ret %"struct.llvm::StringMapEntry<void*>"* %tmp1 @@ -40,16 +40,16 @@ declare i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.ll define linkonce_odr %"struct.llvm::StringMapEntry<void*>"* @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, %"struct.llvm::StringRef"* nocapture %Key) ssp align 2 { entry: %elt = bitcast %"struct.llvm::StringRef"* %Key to i64* - %val = load i64* %elt - %tmp = getelementptr inbounds %"struct.llvm::StringRef"* %Key, i64 0, i32 1 - %val2 = load i64* %tmp - %tmp2.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0 + %val = load i64, i64* %elt + %tmp = getelementptr inbounds %"struct.llvm::StringRef", %"struct.llvm::StringRef"* %Key, i64 0, i32 1 + %val2 = load i64, i64* %tmp + %tmp2.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>", %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0 %tmp3.i = tail call i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.llvm::StringMapImpl"* %tmp2.i, i64 %val, i64 %val2) - %tmp4.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 0 - %tmp5.i = load %"struct.llvm::StringMapImpl::ItemBucket"** %tmp4.i, align 8 + %tmp4.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>", %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 0 + %tmp5.i = load %"struct.llvm::StringMapImpl::ItemBucket"*, %"struct.llvm::StringMapImpl::ItemBucket"** %tmp4.i, align 8 %tmp6.i = zext i32 %tmp3.i to i64 - %tmp7.i = getelementptr inbounds %"struct.llvm::StringMapImpl::ItemBucket"* %tmp5.i, i64 %tmp6.i, i32 1 - %tmp8.i = load %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 + %tmp7.i = getelementptr inbounds %"struct.llvm::StringMapImpl::ItemBucket", %"struct.llvm::StringMapImpl::ItemBucket"* %tmp5.i, i64 %tmp6.i, i32 1 + %tmp8.i = load %"struct.llvm::StringMapEntryBase"*, %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 %tmp9.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, null %tmp13.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*) %or.cond.i = or i1 %tmp9.i, %tmp13.i @@ -57,7 +57,7 @@ entry: bb4.i: ; preds = %entry %tmp41.i = inttoptr i64 %val to i8* - %tmp4.i35.i = getelementptr inbounds i8* %tmp41.i, i64 %val2 + %tmp4.i35.i = getelementptr inbounds i8, i8* %tmp41.i, i64 %val2 %tmp.i.i = ptrtoint i8* %tmp4.i35.i to i64 %tmp1.i.i = trunc i64 %tmp.i.i to i32 %tmp3.i.i = trunc i64 %val to i32 @@ -72,22 +72,22 @@ bb4.i: ; preds = %entry bb.i.i: ; preds = %bb4.i %tmp.i.i.i.i = bitcast i8* %tmp.i20.i.i to i32* store i32 %tmp4.i.i, i32* %tmp.i.i.i.i, align 4 - %tmp1.i19.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 8 + %tmp1.i19.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 8 %0 = bitcast i8* %tmp1.i19.i.i to i8** store i8* null, i8** %0, align 8 br label %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i _ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i: ; preds = %bb.i.i, %bb4.i - %tmp.i18.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 16 + %tmp.i18.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 16 %tmp15.i.i = zext i32 %tmp4.i.i to i64 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp.i18.i.i, i8* %tmp41.i, i64 %tmp15.i.i, i32 1, i1 false) %tmp.i18.sum.i.i = add i64 %tmp15.i.i, 16 - %tmp17.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 %tmp.i18.sum.i.i + %tmp17.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 %tmp.i18.sum.i.i store i8 0, i8* %tmp17.i.i, align 1 - %tmp.i.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 8 + %tmp.i.i.i = getelementptr inbounds i8, i8* %tmp.i20.i.i, i64 8 %1 = bitcast i8* %tmp.i.i.i to i8** store i8* null, i8** %1, align 8 - %tmp22.i = load %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 + %tmp22.i = load %"struct.llvm::StringMapEntryBase"*, %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 %tmp24.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp22.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*) br i1 %tmp24.i, label %bb9.i, label %_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueIS1_EERNS_14StringMapEntryIS1_EENS_9StringRefET_.exit @@ -96,8 +96,8 @@ bb6.i: ; preds = %entry ret %"struct.llvm::StringMapEntry<void*>"* %tmp16.i bb9.i: ; preds = %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i - %tmp25.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 3 - %tmp26.i = load i32* %tmp25.i, align 8 + %tmp25.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>", %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 3 + %tmp26.i = load i32, i32* %tmp25.i, align 8 %tmp27.i = add i32 %tmp26.i, -1 store i32 %tmp27.i, i32* %tmp25.i, align 8 ret %"struct.llvm::StringMapEntry<void*>"* %tmp10.i.i diff --git a/test/Transforms/GVN/null-aliases-nothing.ll b/test/Transforms/GVN/null-aliases-nothing.ll index 37bf09d..0b7c5eb 100644 --- a/test/Transforms/GVN/null-aliases-nothing.ll +++ b/test/Transforms/GVN/null-aliases-nothing.ll @@ -4,12 +4,12 @@ declare void @test1f(i8*) define void @test1(%t* noalias %stuff ) { - %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 - %before = load i32* %p + %p = getelementptr inbounds %t, %t* %stuff, i32 0, i32 0 + %before = load i32, i32* %p call void @test1f(i8* null) - %after = load i32* %p ; <--- This should be a dead load + %after = load i32, i32* %p ; <--- This should be a dead load %sum = add i32 %before, %after store i32 %sum, i32* %p diff --git a/test/Transforms/GVN/phi-translate-partial-alias.ll b/test/Transforms/GVN/phi-translate-partial-alias.ll index 47bec41..f1cf53e 100644 --- a/test/Transforms/GVN/phi-translate-partial-alias.ll +++ b/test/Transforms/GVN/phi-translate-partial-alias.ll @@ -8,19 +8,19 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; CHECK: define void @test0(i8* %begin) ; CHECK: loop: -; CHECK: %l0 = load i8* %phi +; CHECK: %l0 = load i8, i8* %phi ; CHECK: call void @bar(i8 %l0) -; CHECK: %l1 = load i8* %phi +; CHECK: %l1 = load i8, i8* %phi define void @test0(i8* %begin) { entry: br label %loop loop: %phi = phi i8* [ %begin, %entry ], [ %next, %loop ] - %l0 = load i8* %phi + %l0 = load i8, i8* %phi call void @bar(i8 %l0) - %l1 = load i8* %phi - %next = getelementptr inbounds i8* %phi, i8 %l1 + %l1 = load i8, i8* %phi + %next = getelementptr inbounds i8, i8* %phi, i8 %l1 br label %loop } diff --git a/test/Transforms/GVN/phi-translate.ll b/test/Transforms/GVN/phi-translate.ll index 50d6178..6068b05 100644 --- a/test/Transforms/GVN/phi-translate.ll +++ b/test/Transforms/GVN/phi-translate.ll @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64" ; CHECK-LABEL: @foo( ; CHECK: entry.end_crit_edge: -; CHECK: %n.pre = load i32* %q.phi.trans.insert +; CHECK: %n.pre = load i32, i32* %q.phi.trans.insert ; CHECK: then: ; CHECK: store i32 %z ; CHECK: end: @@ -19,13 +19,13 @@ entry: then: %i = sext i32 %x to i64 - %p = getelementptr [100 x i32]* @G, i64 0, i64 %i + %p = getelementptr [100 x i32], [100 x i32]* @G, i64 0, i64 %i store i32 %z, i32* %p br label %end end: %j = sext i32 %x to i64 - %q = getelementptr [100 x i32]* @G, i64 0, i64 %j - %n = load i32* %q + %q = getelementptr [100 x i32], [100 x i32]* @G, i64 0, i64 %j + %n = load i32, i32* %q ret i32 %n } diff --git a/test/Transforms/GVN/pr10820.ll b/test/Transforms/GVN/pr10820.ll index 12c1e70..c6a9a93 100644 --- a/test/Transforms/GVN/pr10820.ll +++ b/test/Transforms/GVN/pr10820.ll @@ -11,7 +11,7 @@ entry: ; CHECK: store i32 store i32 402662078, i32* bitcast (i31* @g to i32*), align 8 ; CHECK-NOT: load i31 - %0 = load i31* @g, align 8 + %0 = load i31, i31* @g, align 8 ; CHECK: store i31 store i31 %0, i31* undef, align 1 unreachable diff --git a/test/Transforms/GVN/pr14166.ll b/test/Transforms/GVN/pr14166.ll index 4d68205..eafe418 100644 --- a/test/Transforms/GVN/pr14166.ll +++ b/test/Transforms/GVN/pr14166.ll @@ -4,16 +4,16 @@ target triple = "i386-pc-linux-gnu" define <2 x i32> @test1() { %v1 = alloca <2 x i32> call void @anything(<2 x i32>* %v1) - %v2 = load <2 x i32>* %v1 + %v2 = load <2 x i32>, <2 x i32>* %v1 %v3 = inttoptr <2 x i32> %v2 to <2 x i8*> %v4 = bitcast <2 x i32>* %v1 to <2 x i8*>* store <2 x i8*> %v3, <2 x i8*>* %v4 - %v5 = load <2 x i32>* %v1 + %v5 = load <2 x i32>, <2 x i32>* %v1 ret <2 x i32> %v5 ; CHECK-LABEL: @test1( ; CHECK: %v1 = alloca <2 x i32> ; CHECK: call void @anything(<2 x i32>* %v1) -; CHECK: %v2 = load <2 x i32>* %v1 +; CHECK: %v2 = load <2 x i32>, <2 x i32>* %v1 ; CHECK: %v3 = inttoptr <2 x i32> %v2 to <2 x i8*> ; CHECK: %v4 = bitcast <2 x i32>* %v1 to <2 x i8*>* ; CHECK: store <2 x i8*> %v3, <2 x i8*>* %v4 diff --git a/test/Transforms/GVN/pr17732.ll b/test/Transforms/GVN/pr17732.ll index 606a195..6c40ccf 100644 --- a/test/Transforms/GVN/pr17732.ll +++ b/test/Transforms/GVN/pr17732.ll @@ -14,11 +14,11 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @main() { entry: - tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds (%struct.with_array* @array_with_zeroinit, i64 0, i32 0, i64 0), i8* getelementptr inbounds ({ [2 x i8], i32, i8, [3 x i8] }* @main.obj_with_array, i64 0, i32 0, i64 0), i64 12, i32 4, i1 false) - %0 = load i8* getelementptr inbounds (%struct.with_array* @array_with_zeroinit, i64 0, i32 2), align 4 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds (%struct.with_array, %struct.with_array* @array_with_zeroinit, i64 0, i32 0, i64 0), i8* getelementptr inbounds ({ [2 x i8], i32, i8, [3 x i8] }, { [2 x i8], i32, i8, [3 x i8] }* @main.obj_with_array, i64 0, i32 0, i64 0), i64 12, i32 4, i1 false) + %0 = load i8, i8* getelementptr inbounds (%struct.with_array, %struct.with_array* @array_with_zeroinit, i64 0, i32 2), align 4 - tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds (%struct.with_vector* @vector_with_zeroinit, i64 0, i32 0, i64 0), i8* getelementptr inbounds ({ <2 x i8>, i32, i8, [3 x i8] }* @main.obj_with_vector, i64 0, i32 0, i64 0), i64 12, i32 4, i1 false) - %1 = load i8* getelementptr inbounds (%struct.with_vector* @vector_with_zeroinit, i64 0, i32 2), align 4 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr inbounds (%struct.with_vector, %struct.with_vector* @vector_with_zeroinit, i64 0, i32 0, i64 0), i8* getelementptr inbounds ({ <2 x i8>, i32, i8, [3 x i8] }, { <2 x i8>, i32, i8, [3 x i8] }* @main.obj_with_vector, i64 0, i32 0, i64 0), i64 12, i32 4, i1 false) + %1 = load i8, i8* getelementptr inbounds (%struct.with_vector, %struct.with_vector* @vector_with_zeroinit, i64 0, i32 2), align 4 %conv0 = sext i8 %0 to i32 %conv1 = sext i8 %1 to i32 %and = and i32 %conv0, %conv1 diff --git a/test/Transforms/GVN/pr17852.ll b/test/Transforms/GVN/pr17852.ll index e95ff7f..9a8a709 100644 --- a/test/Transforms/GVN/pr17852.ll +++ b/test/Transforms/GVN/pr17852.ll @@ -5,60 +5,60 @@ define void @fn1(%struct.S0* byval align 8 %p1) { br label %for.cond for.cond: ; preds = %1, %0 br label %for.end - %f2 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 2 - %f9 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 7 + %f2 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2 + %f9 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 7 br label %for.cond for.end: ; preds = %for.cond br i1 true, label %if.else, label %if.then if.then: ; preds = %for.end - %f22 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 2 - %f7 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 5 - %tmp7 = load i32* %f7, align 8 + %f22 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2 + %f7 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 5 + %tmp7 = load i32, i32* %f7, align 8 br label %if.end40 if.else: ; preds = %for.end br i1 false, label %for.cond18, label %if.then6 if.then6: ; preds = %if.else - %f3 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 2 + %f3 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2 %tmp10 = bitcast %struct.S0* %p1 to i16* - %f5 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 3 + %f5 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3 %tmp11 = bitcast [2 x i8]* %f5 to i16* - %bf.load13 = load i16* %tmp11, align 8 + %bf.load13 = load i16, i16* %tmp11, align 8 br label %if.end36 for.cond18: ; preds = %if.else call void @fn4() br i1 true, label %if.end, label %if.end36 if.end: ; preds = %for.cond18 - %f321 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 2 - %f925 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 7 - %f526 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 3 + %f321 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 2 + %f925 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 7 + %f526 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3 %tmp15 = bitcast [2 x i8]* %f526 to i16* - %bf.load27 = load i16* %tmp15, align 8 + %bf.load27 = load i16, i16* %tmp15, align 8 %tmp16 = bitcast %struct.S0* %p1 to i16* br label %if.end36 if.end36: ; preds = %if.end, %for.cond18, %if.then6 - %f537 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 3 + %f537 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3 %tmp17 = bitcast [2 x i8]* %f537 to i16* - %bf.load38 = load i16* %tmp17, align 8 + %bf.load38 = load i16, i16* %tmp17, align 8 %bf.clear39 = and i16 %bf.load38, -16384 br label %if.end40 if.end40: ; preds = %if.end36, %if.then - %f6 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 4 - %tmp18 = load i32* %f6, align 4 + %f6 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 4 + %tmp18 = load i32, i32* %f6, align 4 call void @fn2(i32 %tmp18) - %f8 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 6 - %tmp19 = load i32* %f8, align 4 + %f8 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 6 + %tmp19 = load i32, i32* %f8, align 4 %tobool41 = icmp eq i32 %tmp19, 0 br i1 true, label %if.end50, label %if.then42 if.then42: ; preds = %if.end40 %tmp20 = bitcast %struct.S0* %p1 to i16* - %f547 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 3 + %f547 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3 %tmp21 = bitcast [2 x i8]* %f547 to i16* - %bf.load48 = load i16* %tmp21, align 8 + %bf.load48 = load i16, i16* %tmp21, align 8 br label %if.end50 if.end50: ; preds = %if.then42, %if.end40 - %f551 = getelementptr inbounds %struct.S0* %p1, i64 0, i32 3 + %f551 = getelementptr inbounds %struct.S0, %struct.S0* %p1, i64 0, i32 3 %tmp22 = bitcast [2 x i8]* %f551 to i16* - %bf.load52 = load i16* %tmp22, align 8 + %bf.load52 = load i16, i16* %tmp22, align 8 %bf.clear53 = and i16 %bf.load52, -16384 ret void } diff --git a/test/Transforms/GVN/pre-basic-add.ll b/test/Transforms/GVN/pre-basic-add.ll index 4bde05c..460d1f9 100644 --- a/test/Transforms/GVN/pre-basic-add.ll +++ b/test/Transforms/GVN/pre-basic-add.ll @@ -5,7 +5,7 @@ define i32 @test() nounwind { entry: - %0 = load i32* @H, align 4 ; <i32> [#uses=2] + %0 = load i32, i32* @H, align 4 ; <i32> [#uses=2] %1 = call i32 (...)* @foo() nounwind ; <i32> [#uses=1] %2 = icmp ne i32 %1, 0 ; <i1> [#uses=1] br i1 %2, label %bb, label %bb1 diff --git a/test/Transforms/GVN/pre-compare.ll b/test/Transforms/GVN/pre-compare.ll index 18d0c2e..52c6b0b 100644 --- a/test/Transforms/GVN/pre-compare.ll +++ b/test/Transforms/GVN/pre-compare.ll @@ -43,7 +43,7 @@ entry: if.then: ; preds = %entry %cmp1 = icmp eq i32 %x, 2 - %cond = select i1 %cmp1, i8* getelementptr inbounds ([2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8]* @.str1, i64 0, i64 0) + %cond = select i1 %cmp1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str1, i64 0, i64 0) %call = tail call i32 @puts(i8* %cond) nounwind br label %for.cond.preheader @@ -52,11 +52,11 @@ for.cond.preheader: ; preds = %entry, %if.then br label %for.cond for.cond: ; preds = %for.cond.backedge, %for.cond.preheader - %call2 = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8]* @.str2, i64 0, i64 0)) nounwind + %call2 = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str2, i64 0, i64 0)) nounwind br i1 %cmp3, label %for.cond.backedge, label %if.end5 if.end5: ; preds = %for.cond - %call6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str3, i64 0, i64 0), i32 %x) nounwind + %call6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str3, i64 0, i64 0), i32 %x) nounwind br label %for.cond.backedge for.cond.backedge: ; preds = %if.end5, %for.cond diff --git a/test/Transforms/GVN/pre-gep-load.ll b/test/Transforms/GVN/pre-gep-load.ll index 3ee3a37..291af35 100644 --- a/test/Transforms/GVN/pre-gep-load.ll +++ b/test/Transforms/GVN/pre-gep-load.ll @@ -13,10 +13,10 @@ entry: sw.bb: ; preds = %entry, %entry %idxprom = sext i32 %i to i64 - %arrayidx = getelementptr inbounds double** %p, i64 0 - %0 = load double** %arrayidx, align 8 - %arrayidx1 = getelementptr inbounds double* %0, i64 %idxprom - %1 = load double* %arrayidx1, align 8 + %arrayidx = getelementptr inbounds double*, double** %p, i64 0 + %0 = load double*, double** %arrayidx, align 8 + %arrayidx1 = getelementptr inbounds double, double* %0, i64 %idxprom + %1 = load double, double* %arrayidx1, align 8 %sub = fsub double %1, 1.000000e+00 %cmp = fcmp olt double %sub, 0.000000e+00 br i1 %cmp, label %if.then, label %if.end @@ -29,10 +29,10 @@ if.end: ; preds = %sw.bb sw.bb2: ; preds = %if.end, %entry %idxprom3 = sext i32 %i to i64 - %arrayidx4 = getelementptr inbounds double** %p, i64 0 - %2 = load double** %arrayidx4, align 8 - %arrayidx5 = getelementptr inbounds double* %2, i64 %idxprom3 - %3 = load double* %arrayidx5, align 8 + %arrayidx4 = getelementptr inbounds double*, double** %p, i64 0 + %2 = load double*, double** %arrayidx4, align 8 + %arrayidx5 = getelementptr inbounds double, double* %2, i64 %idxprom3 + %3 = load double, double* %arrayidx5, align 8 ; CHECK: sw.bb2: ; CHECK-NEXT-NOT: sext ; CHECK-NEXT: phi double [ diff --git a/test/Transforms/GVN/pre-load.ll b/test/Transforms/GVN/pre-load.ll index 9842886..24221d5 100644 --- a/test/Transforms/GVN/pre-load.ll +++ b/test/Transforms/GVN/pre-load.ll @@ -9,14 +9,14 @@ block1: block2: br label %block4 ; CHECK: block2: -; CHECK-NEXT: load i32* %p +; CHECK-NEXT: load i32, i32* %p block3: store i32 0, i32* %p br label %block4 block4: - %PRE = load i32* %p + %PRE = load i32, i32* %p ret i32 %PRE ; CHECK: block4: ; CHECK-NEXT: phi i32 @@ -32,7 +32,7 @@ block1: block2: br label %block4 ; CHECK: block2: -; CHECK-NEXT: load i32* %q +; CHECK-NEXT: load i32, i32* %q block3: store i32 0, i32* %p @@ -40,7 +40,7 @@ block3: block4: %P2 = phi i32* [%p, %block3], [%q, %block2] - %PRE = load i32* %P2 + %PRE = load i32, i32* %P2 ret i32 %PRE ; CHECK: block4: ; CHECK-NEXT: phi i32 [ @@ -52,24 +52,24 @@ block4: define i32 @test3(i32* %p, i32* %q, i32** %Hack, i1 %C) { ; CHECK-LABEL: @test3( block1: - %B = getelementptr i32* %q, i32 1 + %B = getelementptr i32, i32* %q, i32 1 store i32* %B, i32** %Hack br i1 %C, label %block2, label %block3 block2: br label %block4 ; CHECK: block2: -; CHECK-NEXT: load i32* %B +; CHECK-NEXT: load i32, i32* %B block3: - %A = getelementptr i32* %p, i32 1 + %A = getelementptr i32, i32* %p, i32 1 store i32 0, i32* %A br label %block4 block4: %P2 = phi i32* [%p, %block3], [%q, %block2] - %P3 = getelementptr i32* %P2, i32 1 - %PRE = load i32* %P3 + %P3 = getelementptr i32, i32* %P2, i32 1 + %PRE = load i32, i32* %P3 ret i32 %PRE ; CHECK: block4: ; CHECK-NEXT: phi i32 [ @@ -87,21 +87,21 @@ block1: block2: br label %block4 ; CHECK: block2: -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK: br label %block4 block3: - %B = getelementptr i32* %q, i32 1 + %B = getelementptr i32, i32* %q, i32 1 store i32* %B, i32** %Hack - %A = getelementptr i32* %p, i32 1 + %A = getelementptr i32, i32* %p, i32 1 store i32 0, i32* %A br label %block4 block4: %P2 = phi i32* [%p, %block3], [%q, %block2] - %P3 = getelementptr i32* %P2, i32 1 - %PRE = load i32* %P3 + %P3 = getelementptr i32, i32* %P2, i32 1 + %PRE = load i32, i32* %P3 ret i32 %PRE ; CHECK: block4: ; CHECK-NEXT: phi i32 [ @@ -127,16 +127,16 @@ bb.nph: br label %bb ; CHECK: bb.nph: -; CHECK: load double* +; CHECK: load double, double* ; CHECK: br label %bb bb: %indvar = phi i64 [ 0, %bb.nph ], [ %tmp6, %bb ] %tmp6 = add i64 %indvar, 1 - %scevgep = getelementptr double* %G, i64 %tmp6 - %scevgep7 = getelementptr double* %G, i64 %indvar - %2 = load double* %scevgep7, align 8 - %3 = load double* %scevgep, align 8 + %scevgep = getelementptr double, double* %G, i64 %tmp6 + %scevgep7 = getelementptr double, double* %G, i64 %indvar + %2 = load double, double* %scevgep7, align 8 + %3 = load double, double* %scevgep, align 8 %4 = fadd double %2, %3 store double %4, double* %scevgep7, align 8 %exitcond = icmp eq i64 %tmp6, %tmp @@ -144,8 +144,8 @@ bb: ; Should only be one load in the loop. ; CHECK: bb: -; CHECK: load double* -; CHECK-NOT: load double* +; CHECK: load double, double* +; CHECK-NOT: load double, double* ; CHECK: br i1 %exitcond return: @@ -170,16 +170,16 @@ bb.nph: br label %bb ; CHECK: bb.nph: -; CHECK: load double* +; CHECK: load double, double* ; CHECK: br label %bb bb: %indvar = phi i64 [ 0, %bb.nph ], [ %tmp6, %bb ] %tmp6 = add i64 %indvar, 1 - %scevgep = getelementptr double* %G, i64 %tmp6 - %scevgep7 = getelementptr double* %G, i64 %indvar - %2 = load double* %scevgep7, align 8 - %3 = load double* %scevgep, align 8 + %scevgep = getelementptr double, double* %G, i64 %tmp6 + %scevgep7 = getelementptr double, double* %G, i64 %indvar + %2 = load double, double* %scevgep7, align 8 + %3 = load double, double* %scevgep, align 8 %4 = fadd double %2, %3 store double %4, double* %scevgep, align 8 %exitcond = icmp eq i64 %tmp6, %tmp @@ -187,8 +187,8 @@ bb: ; Should only be one load in the loop. ; CHECK: bb: -; CHECK: load double* -; CHECK-NOT: load double* +; CHECK: load double, double* +; CHECK-NOT: load double, double* ; CHECK: br i1 %exitcond return: @@ -205,7 +205,7 @@ return: ; This requires phi translation of the adds. define void @test7(i32 %N, double* nocapture %G) nounwind ssp { entry: - %0 = getelementptr inbounds double* %G, i64 1 + %0 = getelementptr inbounds double, double* %G, i64 1 store double 1.000000e+00, double* %0, align 8 %1 = add i32 %N, -1 %2 = icmp sgt i32 %1, 1 @@ -219,11 +219,11 @@ bb.nph: bb: %indvar = phi i64 [ 0, %bb.nph ], [ %tmp9, %bb ] %tmp8 = add i64 %indvar, 2 - %scevgep = getelementptr double* %G, i64 %tmp8 + %scevgep = getelementptr double, double* %G, i64 %tmp8 %tmp9 = add i64 %indvar, 1 - %scevgep10 = getelementptr double* %G, i64 %tmp9 - %3 = load double* %scevgep10, align 8 - %4 = load double* %scevgep, align 8 + %scevgep10 = getelementptr double, double* %G, i64 %tmp9 + %3 = load double, double* %scevgep10, align 8 + %4 = load double, double* %scevgep, align 8 %5 = fadd double %3, %4 store double %5, double* %scevgep, align 8 %exitcond = icmp eq i64 %tmp9, %tmp7 @@ -231,8 +231,8 @@ bb: ; Should only be one load in the loop. ; CHECK: bb: -; CHECK: load double* -; CHECK-NOT: load double* +; CHECK: load double, double* +; CHECK-NOT: load double, double* ; CHECK: br i1 %exitcond return: @@ -249,18 +249,18 @@ block1: block2: br label %block4 ; CHECK: block2: -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK: br label %block4 block3: - %A = getelementptr i32* %p, i32 1 + %A = getelementptr i32, i32* %p, i32 1 store i32 0, i32* %A br label %block4 block4: %P2 = phi i32* [%p, %block3], [%q, %block2] - %P3 = getelementptr i32* %P2, i32 1 - %PRE = load i32* %P3 + %P3 = getelementptr i32, i32* %P2, i32 1 + %PRE = load i32, i32* %P3 ret i32 %PRE ; CHECK: block4: ; CHECK-NEXT: phi i32 [ @@ -288,17 +288,17 @@ bb.nph: br label %bb ; CHECK: bb.nph: -; CHECK: load double* +; CHECK: load double, double* ; CHECK: br label %bb bb: %indvar = phi i64 [ 0, %bb.nph ], [ %tmp9, %bb ] %tmp8 = add i64 %indvar, 2 - %scevgep = getelementptr double* %G, i64 %tmp8 + %scevgep = getelementptr double, double* %G, i64 %tmp8 %tmp9 = add i64 %indvar, 1 - %scevgep10 = getelementptr double* %G, i64 %tmp9 - %3 = load double* %scevgep10, align 8 - %4 = load double* %scevgep, align 8 + %scevgep10 = getelementptr double, double* %G, i64 %tmp9 + %3 = load double, double* %scevgep10, align 8 + %4 = load double, double* %scevgep, align 8 %5 = fadd double %3, %4 store double %5, double* %scevgep, align 8 %exitcond = icmp eq i64 %tmp9, %tmp7 @@ -306,8 +306,8 @@ bb: ; Should only be one load in the loop. ; CHECK: bb: -; CHECK: load double* -; CHECK-NOT: load double* +; CHECK: load double, double* +; CHECK-NOT: load double, double* ; CHECK: br i1 %exitcond return: @@ -332,22 +332,22 @@ bb.nph: %tmp8 = add i64 %tmp, -1 br label %bb ; CHECK: bb.nph: -; CHECK: load double* -; CHECK: load double* +; CHECK: load double, double* +; CHECK: load double, double* ; CHECK: br label %bb bb: %indvar = phi i64 [ 0, %bb.nph ], [ %tmp11, %bb ] - %scevgep = getelementptr double* %G, i64 %indvar + %scevgep = getelementptr double, double* %G, i64 %indvar %tmp9 = add i64 %indvar, 2 - %scevgep10 = getelementptr double* %G, i64 %tmp9 + %scevgep10 = getelementptr double, double* %G, i64 %tmp9 %tmp11 = add i64 %indvar, 1 - %scevgep12 = getelementptr double* %G, i64 %tmp11 - %2 = load double* %scevgep12, align 8 - %3 = load double* %scevgep10, align 8 + %scevgep12 = getelementptr double, double* %G, i64 %tmp11 + %2 = load double, double* %scevgep12, align 8 + %3 = load double, double* %scevgep10, align 8 %4 = fadd double %2, %3 - %5 = load double* %scevgep, align 8 + %5 = load double, double* %scevgep, align 8 %6 = fadd double %4, %5 store double %6, double* %scevgep12, align 8 %exitcond = icmp eq i64 %tmp11, %tmp8 @@ -355,8 +355,8 @@ bb: ; Should only be one load in the loop. ; CHECK: bb: -; CHECK: load double* -; CHECK-NOT: load double* +; CHECK: load double, double* +; CHECK-NOT: load double, double* ; CHECK: br i1 %exitcond return: @@ -372,7 +372,7 @@ block1: block2: %cond = icmp sgt i32 %N, 1 br i1 %cond, label %block4, label %block5 -; CHECK: load i32* %p +; CHECK: load i32, i32* %p ; CHECK-NEXT: br label %block4 block3: @@ -380,7 +380,7 @@ block3: br label %block4 block4: - %PRE = load i32* %p + %PRE = load i32, i32* %p br label %block5 block5: diff --git a/test/Transforms/GVN/pre-single-pred.ll b/test/Transforms/GVN/pre-single-pred.ll index f1f5c71..0df45cf 100644 --- a/test/Transforms/GVN/pre-single-pred.ll +++ b/test/Transforms/GVN/pre-single-pred.ll @@ -23,9 +23,9 @@ for.cond.for.end_crit_edge: ; preds = %for.cond br label %for.end ; CHECK: for.body: -; CHECK-NEXT: %tmp3 = load i32* @p +; CHECK-NEXT: %tmp3 = load i32, i32* @p for.body: ; preds = %for.cond - %tmp3 = load i32* @p ; <i32> [#uses=1] + %tmp3 = load i32, i32* @p ; <i32> [#uses=1] %dec = add i32 %tmp3, -1 ; <i32> [#uses=2] store i32 %dec, i32* @p %cmp6 = icmp slt i32 %dec, 0 ; <i1> [#uses=1] @@ -40,6 +40,6 @@ for.inc: ; preds = %for.body br label %for.cond for.end: ; preds = %for.body.for.end_crit_edge, %for.cond.for.end_crit_edge - %tmp9 = load i32* @p ; <i32> [#uses=1] + %tmp9 = load i32, i32* @p ; <i32> [#uses=1] ret i32 %tmp9 } diff --git a/test/Transforms/GVN/preserve-tbaa.ll b/test/Transforms/GVN/preserve-tbaa.ll index 587d463..19467ee 100644 --- a/test/Transforms/GVN/preserve-tbaa.ll +++ b/test/Transforms/GVN/preserve-tbaa.ll @@ -5,7 +5,7 @@ target datalayout = "e-p:64:64:64" ; GVN should preserve the TBAA tag on loads when doing PRE. ; CHECK-LABEL: @test( -; CHECK: %tmp33.pre = load i16* %P, align 2, !tbaa !0 +; CHECK: %tmp33.pre = load i16, i16* %P, align 2, !tbaa !0 ; CHECK: br label %for.body define void @test(i16 *%P, i16* %Q) nounwind { entry: @@ -15,7 +15,7 @@ bb.nph: ; preds = %entry br label %for.body for.body: ; preds = %for.body, %bb.nph - %tmp33 = load i16* %P, align 2, !tbaa !0 + %tmp33 = load i16, i16* %P, align 2, !tbaa !0 store i16 %tmp33, i16* %Q store i16 0, i16* %P, align 2, !tbaa !0 diff --git a/test/Transforms/GVN/range.ll b/test/Transforms/GVN/range.ll index 3720232..297c6aa 100644 --- a/test/Transforms/GVN/range.ll +++ b/test/Transforms/GVN/range.ll @@ -2,82 +2,82 @@ define i32 @test1(i32* %p) { ; CHECK: @test1(i32* %p) -; CHECK: %a = load i32* %p, !range !0 +; CHECK: %a = load i32, i32* %p, !range !0 ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !0 - %b = load i32* %p, !range !0 + %a = load i32, i32* %p, !range !0 + %b = load i32, i32* %p, !range !0 %c = add i32 %a, %b ret i32 %c } define i32 @test2(i32* %p) { ; CHECK: @test2(i32* %p) -; CHECK: %a = load i32* %p +; CHECK: %a = load i32, i32* %p ; CHECK-NOT: range ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !0 - %b = load i32* %p + %a = load i32, i32* %p, !range !0 + %b = load i32, i32* %p %c = add i32 %a, %b ret i32 %c } define i32 @test3(i32* %p) { ; CHECK: @test3(i32* %p) -; CHECK: %a = load i32* %p, !range ![[DISJOINT_RANGE:[0-9]+]] +; CHECK: %a = load i32, i32* %p, !range ![[DISJOINT_RANGE:[0-9]+]] ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !0 - %b = load i32* %p, !range !1 + %a = load i32, i32* %p, !range !0 + %b = load i32, i32* %p, !range !1 %c = add i32 %a, %b ret i32 %c } define i32 @test4(i32* %p) { ; CHECK: @test4(i32* %p) -; CHECK: %a = load i32* %p, !range ![[MERGED_RANGE:[0-9]+]] +; CHECK: %a = load i32, i32* %p, !range ![[MERGED_RANGE:[0-9]+]] ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !0 - %b = load i32* %p, !range !2 + %a = load i32, i32* %p, !range !0 + %b = load i32, i32* %p, !range !2 %c = add i32 %a, %b ret i32 %c } define i32 @test5(i32* %p) { ; CHECK: @test5(i32* %p) -; CHECK: %a = load i32* %p, !range ![[MERGED_SIGNED_RANGE:[0-9]+]] +; CHECK: %a = load i32, i32* %p, !range ![[MERGED_SIGNED_RANGE:[0-9]+]] ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !3 - %b = load i32* %p, !range !4 + %a = load i32, i32* %p, !range !3 + %b = load i32, i32* %p, !range !4 %c = add i32 %a, %b ret i32 %c } define i32 @test6(i32* %p) { ; CHECK: @test6(i32* %p) -; CHECK: %a = load i32* %p, !range ![[MERGED_TEST6:[0-9]+]] +; CHECK: %a = load i32, i32* %p, !range ![[MERGED_TEST6:[0-9]+]] ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !5 - %b = load i32* %p, !range !6 + %a = load i32, i32* %p, !range !5 + %b = load i32, i32* %p, !range !6 %c = add i32 %a, %b ret i32 %c } define i32 @test7(i32* %p) { ; CHECK: @test7(i32* %p) -; CHECK: %a = load i32* %p, !range ![[MERGED_TEST7:[0-9]+]] +; CHECK: %a = load i32, i32* %p, !range ![[MERGED_TEST7:[0-9]+]] ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !7 - %b = load i32* %p, !range !8 + %a = load i32, i32* %p, !range !7 + %b = load i32, i32* %p, !range !8 %c = add i32 %a, %b ret i32 %c } define i32 @test8(i32* %p) { ; CHECK: @test8(i32* %p) -; CHECK: %a = load i32* %p +; CHECK: %a = load i32, i32* %p ; CHECK-NOT: range ; CHECK: %c = add i32 %a, %a - %a = load i32* %p, !range !9 - %b = load i32* %p, !range !10 + %a = load i32, i32* %p, !range !9 + %b = load i32, i32* %p, !range !10 %c = add i32 %a, %b ret i32 %c } diff --git a/test/Transforms/GVN/readattrs.ll b/test/Transforms/GVN/readattrs.ll index ba624a7..fb36d07 100644 --- a/test/Transforms/GVN/readattrs.ll +++ b/test/Transforms/GVN/readattrs.ll @@ -9,7 +9,7 @@ define i8 @test() { %a = alloca i8 store i8 1, i8* %a call void @use(i8* %a) - %b = load i8* %a + %b = load i8, i8* %a ret i8 %b ; CHECK-LABEL: define i8 @test( ; CHECK: call void @use(i8* %a) diff --git a/test/Transforms/GVN/rle-must-alias.ll b/test/Transforms/GVN/rle-must-alias.ll index e7dc9c4..0d181dd 100644 --- a/test/Transforms/GVN/rle-must-alias.ll +++ b/test/Transforms/GVN/rle-must-alias.ll @@ -17,22 +17,22 @@ entry: bb: ; preds = %entry %2 = tail call i32 (...)* @bar() nounwind ; <i32> [#uses=0] - %3 = getelementptr [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1] - %4 = load i32* %3, align 4 ; <i32> [#uses=1] + %3 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1] + %4 = load i32, i32* %3, align 4 ; <i32> [#uses=1] store i32 %4, i32* @G, align 4 br label %bb3 bb1: ; preds = %entry %5 = tail call i32 (...)* @baz() nounwind ; <i32> [#uses=0] - %6 = getelementptr [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1] - %7 = load i32* %6, align 4 ; <i32> [#uses=2] + %6 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1] + %7 = load i32, i32* %6, align 4 ; <i32> [#uses=2] store i32 %7, i32* @G, align 4 %8 = icmp eq i32 %7, 0 ; <i1> [#uses=1] br i1 %8, label %bb3, label %bb4 bb3: ; preds = %bb1, %bb - %9 = getelementptr [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1] - %DEAD = load i32* %9, align 4 ; <i32> [#uses=1] + %9 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1] + %DEAD = load i32, i32* %9, align 4 ; <i32> [#uses=1] ret i32 %DEAD bb4: ; preds = %bb1 diff --git a/test/Transforms/GVN/rle-no-phi-translate.ll b/test/Transforms/GVN/rle-no-phi-translate.ll index 96dbf48..c1fd201 100644 --- a/test/Transforms/GVN/rle-no-phi-translate.ll +++ b/test/Transforms/GVN/rle-no-phi-translate.ll @@ -19,7 +19,7 @@ bb: ; preds = %entry bb2: ; preds = %bb1, %bb %c_addr.0 = phi i32* [ %b, %entry ], [ %c, %bb ] ; <i32*> [#uses=1] - %cv = load i32* %c_addr.0, align 4 ; <i32> [#uses=1] + %cv = load i32, i32* %c_addr.0, align 4 ; <i32> [#uses=1] ret i32 %cv ; CHECK: bb2: ; CHECK-NOT: load i32 diff --git a/test/Transforms/GVN/rle-nonlocal.ll b/test/Transforms/GVN/rle-nonlocal.ll index 8229aaa..7975462 100644 --- a/test/Transforms/GVN/rle-nonlocal.ll +++ b/test/Transforms/GVN/rle-nonlocal.ll @@ -6,20 +6,20 @@ block1: br i1 %cmp , label %block2, label %block3 block2: - %a = load i32** %p + %a = load i32*, i32** %p br label %block4 block3: - %b = load i32** %p + %b = load i32*, i32** %p br label %block4 block4: ; CHECK-NOT: %existingPHI = phi ; CHECK: %DEAD = phi %existingPHI = phi i32* [ %a, %block2 ], [ %b, %block3 ] - %DEAD = load i32** %p - %c = load i32* %DEAD - %d = load i32* %existingPHI + %DEAD = load i32*, i32** %p + %c = load i32, i32* %DEAD + %d = load i32, i32* %existingPHI %e = add i32 %c, %d ret i32 %e } diff --git a/test/Transforms/GVN/rle-phi-translate.ll b/test/Transforms/GVN/rle-phi-translate.ll index 1ce7e0b..7402e1a 100644 --- a/test/Transforms/GVN/rle-phi-translate.ll +++ b/test/Transforms/GVN/rle-phi-translate.ll @@ -11,13 +11,13 @@ entry: br i1 %t1, label %bb, label %bb1 bb: - %t2 = load i32* %c, align 4 + %t2 = load i32, i32* %c, align 4 %t3 = add i32 %t2, 1 store i32 %t3, i32* %g, align 4 br label %bb2 bb1: ; preds = %entry - %t5 = load i32* %b, align 4 + %t5 = load i32, i32* %b, align 4 %t6 = add i32 %t5, 1 store i32 %t6, i32* %g, align 4 br label %bb2 @@ -25,8 +25,8 @@ bb1: ; preds = %entry bb2: ; preds = %bb1, %bb %c_addr.0 = phi i32* [ %g, %bb1 ], [ %c, %bb ] %b_addr.0 = phi i32* [ %b, %bb1 ], [ %g, %bb ] - %cv = load i32* %c_addr.0, align 4 - %bv = load i32* %b_addr.0, align 4 + %cv = load i32, i32* %c_addr.0, align 4 + %bv = load i32, i32* %b_addr.0, align 4 ; CHECK: %bv = phi i32 ; CHECK: %cv = phi i32 ; CHECK-NOT: load @@ -53,7 +53,7 @@ bb1: bb2: %d = phi i32* [ %c, %bb1 ], [ %b, %bb ] %d1 = bitcast i32* %d to i8* - %dv = load i8* %d1 + %dv = load i8, i8* %d1 ; CHECK: %dv = phi i8 [ 92, %bb1 ], [ 4, %bb ] ; CHECK-NOT: load ; CHECK: ret i8 %dv @@ -66,20 +66,20 @@ entry: br i1 %cond, label %bb, label %bb1 bb: - %b1 = getelementptr i32* %b, i32 17 + %b1 = getelementptr i32, i32* %b, i32 17 store i32 4, i32* %b1 br label %bb2 bb1: - %c1 = getelementptr i32* %c, i32 7 + %c1 = getelementptr i32, i32* %c, i32 7 store i32 82, i32* %c1 br label %bb2 bb2: %d = phi i32* [ %c, %bb1 ], [ %b, %bb ] %i = phi i32 [ 7, %bb1 ], [ 17, %bb ] - %d1 = getelementptr i32* %d, i32 %i - %dv = load i32* %d1 + %d1 = getelementptr i32, i32* %d, i32 %i + %dv = load i32, i32* %d1 ; CHECK: %dv = phi i32 [ 82, %bb1 ], [ 4, %bb ] ; CHECK-NOT: load ; CHECK: ret i32 %dv @@ -97,15 +97,15 @@ bb: br label %bb2 bb1: - %c1 = getelementptr i32* %c, i32 7 + %c1 = getelementptr i32, i32* %c, i32 7 store i32 82, i32* %c1 br label %bb2 bb2: %d = phi i32* [ %c, %bb1 ], [ %b, %bb ] %i = phi i32 [ 7, %bb1 ], [ 0, %bb ] - %d1 = getelementptr i32* %d, i32 %i - %dv = load i32* %d1 + %d1 = getelementptr i32, i32* %d, i32 %i + %dv = load i32, i32* %d1 ; CHECK: %dv = phi i32 [ 82, %bb1 ], [ 4, %bb ] ; CHECK-NOT: load ; CHECK: ret i32 %dv @@ -127,11 +127,11 @@ bb.nph: for.body: %indvar = phi i64 [ 0, %bb.nph ], [ %tmp, %for.body ] - %arrayidx6 = getelementptr double* %G, i64 %indvar + %arrayidx6 = getelementptr double, double* %G, i64 %indvar %tmp = add i64 %indvar, 1 - %arrayidx = getelementptr double* %G, i64 %tmp - %tmp3 = load double* %arrayidx - %tmp7 = load double* %arrayidx6 + %arrayidx = getelementptr double, double* %G, i64 %tmp + %tmp3 = load double, double* %arrayidx + %tmp7 = load double, double* %arrayidx6 %add = fadd double %tmp3, %tmp7 store double %add, double* %arrayidx %exitcond = icmp eq i64 %tmp, 999 diff --git a/test/Transforms/GVN/rle-semidominated.ll b/test/Transforms/GVN/rle-semidominated.ll index 923cd03..f80d040 100644 --- a/test/Transforms/GVN/rle-semidominated.ll +++ b/test/Transforms/GVN/rle-semidominated.ll @@ -2,7 +2,7 @@ define i32 @main(i32* %p, i32 %x, i32 %y) { block1: - %z = load i32* %p + %z = load i32, i32* %p %cmp = icmp eq i32 %x, %y br i1 %cmp, label %block2, label %block3 @@ -15,6 +15,6 @@ block3: br label %block4 block4: - %DEAD = load i32* %p + %DEAD = load i32, i32* %p ret i32 %DEAD } diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll index 6aac93e..3f42135 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -5,7 +5,7 @@ define i32 @test0(i32 %V, i32* %P) { store i32 %V, i32* %P - %A = load i32* %P + %A = load i32, i32* %P ret i32 %A ; CHECK-LABEL: @test0( ; CHECK: ret i32 %V @@ -20,7 +20,7 @@ define i32 @test0(i32 %V, i32* %P) { define i8 @crash0({i32, i32} %A, {i32, i32}* %P) { store {i32, i32} %A, {i32, i32}* %P %X = bitcast {i32, i32}* %P to i8* - %Y = load i8* %X + %Y = load i8, i8* %X ret i8 %Y } @@ -28,7 +28,7 @@ define i8 @crash0({i32, i32} %A, {i32, i32}* %P) { declare void @helper() define void @crash1() { tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* undef, i64 undef, i32 1, i1 false) nounwind - %tmp = load i8* bitcast (void ()* @helper to i8*) + %tmp = load i8, i8* bitcast (void ()* @helper to i8*) %x = icmp eq i8 %tmp, 15 ret void } @@ -45,7 +45,7 @@ define float @coerce_mustalias1(i32 %V, i32* %P) { %P2 = bitcast i32* %P to float* - %A = load float* %P2 + %A = load float, float* %P2 ret float %A ; CHECK-LABEL: @coerce_mustalias1( ; CHECK-NOT: load @@ -58,7 +58,7 @@ define float @coerce_mustalias2(i32* %V, i32** %P) { %P2 = bitcast i32** %P to float* - %A = load float* %P2 + %A = load float, float* %P2 ret float %A ; CHECK-LABEL: @coerce_mustalias2( ; CHECK-NOT: load @@ -71,7 +71,7 @@ define i32* @coerce_mustalias3(float %V, float* %P) { %P2 = bitcast float* %P to i32** - %A = load i32** %P2 + %A = load i32*, i32** %P2 ret i32* %A ; CHECK-LABEL: @coerce_mustalias3( ; CHECK-NOT: load @@ -80,10 +80,10 @@ define i32* @coerce_mustalias3(float %V, float* %P) { ;; i32 -> f32 load forwarding. define float @coerce_mustalias4(i32* %P, i1 %cond) { - %A = load i32* %P + %A = load i32, i32* %P %P2 = bitcast i32* %P to float* - %B = load float* %P2 + %B = load float, float* %P2 br i1 %cond, label %T, label %F T: ret float %B @@ -93,7 +93,7 @@ F: ret float %X ; CHECK-LABEL: @coerce_mustalias4( -; CHECK: %A = load i32* %P +; CHECK: %A = load i32, i32* %P ; CHECK-NOT: load ; CHECK: ret float ; CHECK: F: @@ -105,7 +105,7 @@ define i8 @coerce_mustalias5(i32 %V, i32* %P) { %P2 = bitcast i32* %P to i8* - %A = load i8* %P2 + %A = load i8, i8* %P2 ret i8 %A ; CHECK-LABEL: @coerce_mustalias5( ; CHECK-NOT: load @@ -118,7 +118,7 @@ define float @coerce_mustalias6(i64 %V, i64* %P) { %P2 = bitcast i64* %P to float* - %A = load float* %P2 + %A = load float, float* %P2 ret float %A ; CHECK-LABEL: @coerce_mustalias6( ; CHECK-NOT: load @@ -131,7 +131,7 @@ define i8* @coerce_mustalias7(i64 %V, i64* %P) { %P2 = bitcast i64* %P to i8** - %A = load i8** %P2 + %A = load i8*, i8** %P2 ret i8* %A ; CHECK-LABEL: @coerce_mustalias7( ; CHECK-NOT: load @@ -143,8 +143,8 @@ define signext i16 @memset_to_i16_local(i16* %A) nounwind ssp { entry: %conv = bitcast i16* %A to i8* tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 1, i64 200, i32 1, i1 false) - %arrayidx = getelementptr inbounds i16* %A, i64 42 - %tmp2 = load i16* %arrayidx + %arrayidx = getelementptr inbounds i16, i16* %A, i64 42 + %tmp2 = load i16, i16* %arrayidx ret i16 %tmp2 ; CHECK-LABEL: @memset_to_i16_local( ; CHECK-NOT: load @@ -156,8 +156,8 @@ define float @memset_to_float_local(float* %A, i8 %Val) nounwind ssp { entry: %conv = bitcast float* %A to i8* ; <i8*> [#uses=1] tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 %Val, i64 400, i32 1, i1 false) - %arrayidx = getelementptr inbounds float* %A, i64 42 ; <float*> [#uses=1] - %tmp2 = load float* %arrayidx ; <float> [#uses=1] + %arrayidx = getelementptr inbounds float, float* %A, i64 42 ; <float*> [#uses=1] + %tmp2 = load float, float* %arrayidx ; <float> [#uses=1] ret float %tmp2 ; CHECK-LABEL: @memset_to_float_local( ; CHECK-NOT: load @@ -183,8 +183,8 @@ F: br label %Cont Cont: - %P2 = getelementptr i16* %P, i32 4 - %A = load i16* %P2 + %P2 = getelementptr i16, i16* %P, i32 4 + %A = load i16, i16* %P2 ret i16 %A ; CHECK-LABEL: @memset_to_i16_nonlocal0( @@ -202,8 +202,8 @@ define float @memcpy_to_float_local(float* %A) nounwind ssp { entry: %conv = bitcast float* %A to i8* ; <i8*> [#uses=1] tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %conv, i8* bitcast ({i32, float, i32 }* @GCst to i8*), i64 12, i32 1, i1 false) - %arrayidx = getelementptr inbounds float* %A, i64 1 ; <float*> [#uses=1] - %tmp2 = load float* %arrayidx ; <float> [#uses=1] + %arrayidx = getelementptr inbounds float, float* %A, i64 1 ; <float*> [#uses=1] + %tmp2 = load float, float* %arrayidx ; <float> [#uses=1] ret float %tmp2 ; CHECK-LABEL: @memcpy_to_float_local( ; CHECK-NOT: load @@ -215,8 +215,8 @@ define float @memcpy_to_float_local_as1(float* %A) nounwind ssp { entry: %conv = bitcast float* %A to i8* ; <i8*> [#uses=1] tail call void @llvm.memcpy.p0i8.p1i8.i64(i8* %conv, i8 addrspace(1)* bitcast ({i32, float, i32 } addrspace(1)* @GCst_as1 to i8 addrspace(1)*), i64 12, i32 1, i1 false) - %arrayidx = getelementptr inbounds float* %A, i64 1 ; <float*> [#uses=1] - %tmp2 = load float* %arrayidx ; <float> [#uses=1] + %arrayidx = getelementptr inbounds float, float* %A, i64 1 ; <float*> [#uses=1] + %tmp2 = load float, float* %arrayidx ; <float> [#uses=1] ret float %tmp2 ; CHECK-LABEL: @memcpy_to_float_local_as1( ; CHECK-NOT: load @@ -237,7 +237,7 @@ F: br label %Cont Cont: - %A = load i8* %P3 + %A = load i8, i8* %P3 ret i8 %A ; CHECK-LABEL: @coerce_mustalias_nonlocal0( @@ -263,7 +263,7 @@ F: Cont: %P3 = bitcast i32* %P to i8* - %A = load i8* %P3 + %A = load i8, i8* %P3 ret i8 %A ; CHECK-LABEL: @coerce_mustalias_nonlocal1( @@ -286,12 +286,12 @@ F: br label %Cont Cont: - %A = load i8* %P3 + %A = load i8, i8* %P3 ret i8 %A ; CHECK-LABEL: @coerce_mustalias_pre0( ; CHECK: F: -; CHECK: load i8* %P3 +; CHECK: load i8, i8* %P3 ; CHECK: Cont: ; CHECK: %A = phi i8 [ ; CHECK-NOT: load @@ -309,9 +309,9 @@ define i8 @coerce_offset0(i32 %V, i32* %P) { store i32 %V, i32* %P %P2 = bitcast i32* %P to i8* - %P3 = getelementptr i8* %P2, i32 2 + %P3 = getelementptr i8, i8* %P2, i32 2 - %A = load i8* %P3 + %A = load i8, i8* %P3 ret i8 %A ; CHECK-LABEL: @coerce_offset0( ; CHECK-NOT: load @@ -322,9 +322,9 @@ define i8 @coerce_offset0_addrspacecast(i32 %V, i32* %P) { store i32 %V, i32* %P %P2 = addrspacecast i32* %P to i8 addrspace(1)* - %P3 = getelementptr i8 addrspace(1)* %P2, i32 2 + %P3 = getelementptr i8, i8 addrspace(1)* %P2, i32 2 - %A = load i8 addrspace(1)* %P3 + %A = load i8, i8 addrspace(1)* %P3 ret i8 %A ; CHECK-LABEL: @coerce_offset0_addrspacecast( ; CHECK-NOT: load @@ -335,7 +335,7 @@ define i8 @coerce_offset0_addrspacecast(i32 %V, i32* %P) { define i8 @coerce_offset_nonlocal0(i32* %P, i1 %cond) { %P2 = bitcast i32* %P to float* %P3 = bitcast i32* %P to i8* - %P4 = getelementptr i8* %P3, i32 2 + %P4 = getelementptr i8, i8* %P3, i32 2 br i1 %cond, label %T, label %F T: store i32 57005, i32* %P @@ -346,7 +346,7 @@ F: br label %Cont Cont: - %A = load i8* %P4 + %A = load i8, i8* %P4 ret i8 %A ; CHECK-LABEL: @coerce_offset_nonlocal0( @@ -360,7 +360,7 @@ Cont: ;; non-local i32 -> i8 partial redundancy load forwarding. define i8 @coerce_offset_pre0(i32* %P, i1 %cond) { %P3 = bitcast i32* %P to i8* - %P4 = getelementptr i8* %P3, i32 2 + %P4 = getelementptr i8, i8* %P3, i32 2 br i1 %cond, label %T, label %F T: store i32 42, i32* %P @@ -370,12 +370,12 @@ F: br label %Cont Cont: - %A = load i8* %P4 + %A = load i8, i8* %P4 ret i8 %A ; CHECK-LABEL: @coerce_offset_pre0( ; CHECK: F: -; CHECK: load i8* %P4 +; CHECK: load i8, i8* %P4 ; CHECK: Cont: ; CHECK: %A = phi i8 [ ; CHECK-NOT: load @@ -386,28 +386,28 @@ define i32 @chained_load(i32** %p, i32 %x, i32 %y) { block1: %A = alloca i32* - %z = load i32** %p + %z = load i32*, i32** %p store i32* %z, i32** %A %cmp = icmp eq i32 %x, %y br i1 %cmp, label %block2, label %block3 block2: - %a = load i32** %p + %a = load i32*, i32** %p br label %block4 block3: - %b = load i32** %p + %b = load i32*, i32** %p br label %block4 block4: - %c = load i32** %p - %d = load i32* %c + %c = load i32*, i32** %p + %d = load i32, i32* %c ret i32 %d ; CHECK-LABEL: @chained_load( -; CHECK: %z = load i32** %p +; CHECK: %z = load i32*, i32** %p ; CHECK-NOT: load -; CHECK: %d = load i32* %z +; CHECK: %d = load i32, i32* %z ; CHECK-NEXT: ret i32 %d } @@ -427,13 +427,13 @@ F1: br i1 %cond2, label %T1, label %TY T1: - %P2 = getelementptr i32* %P, i32 %A - %x = load i32* %P2 + %P2 = getelementptr i32, i32* %P, i32 %A + %x = load i32, i32* %P2 %cond = call i1 @cond2() br i1 %cond, label %TX, label %F F: - %P3 = getelementptr i32* %P, i32 2 + %P3 = getelementptr i32, i32* %P, i32 2 store i32 17, i32* %P3 store i32 42, i32* %P2 ; Provides "P[A]". @@ -464,7 +464,7 @@ block2: br label %block4 block3: - %p2 = getelementptr i32* %p, i32 43 + %p2 = getelementptr i32, i32* %p, i32 43 store i32 97, i32* %p2 br label %block4 @@ -481,11 +481,11 @@ block5: br i1 %cmpxy, label %block6, label %exit block6: - %C = getelementptr i32* %p, i32 %B + %C = getelementptr i32, i32* %p, i32 %B br i1 %cmpxy, label %block7, label %exit block7: - %D = load i32* %C + %D = load i32, i32* %C ret i32 %D ; CHECK: block7: @@ -498,17 +498,17 @@ exit: define i8 @phi_trans4(i8* %p) { ; CHECK-LABEL: @phi_trans4( entry: - %X3 = getelementptr i8* %p, i32 192 + %X3 = getelementptr i8, i8* %p, i32 192 store i8 192, i8* %X3 - %X = getelementptr i8* %p, i32 4 - %Y = load i8* %X + %X = getelementptr i8, i8* %p, i32 4 + %Y = load i8, i8* %X br label %loop loop: %i = phi i32 [4, %entry], [192, %loop] - %X2 = getelementptr i8* %p, i32 %i - %Y2 = load i8* %X2 + %X2 = getelementptr i8, i8* %p, i32 %i + %Y2 = load i8, i8* %X2 ; CHECK: loop: ; CHECK-NEXT: %Y2 = phi i8 [ %Y, %entry ], [ 0, %loop ] @@ -529,29 +529,29 @@ define i8 @phi_trans5(i8* %p) { ; CHECK-LABEL: @phi_trans5( entry: - %X4 = getelementptr i8* %p, i32 2 + %X4 = getelementptr i8, i8* %p, i32 2 store i8 19, i8* %X4 - %X = getelementptr i8* %p, i32 4 - %Y = load i8* %X + %X = getelementptr i8, i8* %p, i32 4 + %Y = load i8, i8* %X br label %loop loop: %i = phi i32 [4, %entry], [3, %cont] - %X2 = getelementptr i8* %p, i32 %i - %Y2 = load i8* %X2 ; Ensure this load is not being incorrectly replaced. + %X2 = getelementptr i8, i8* %p, i32 %i + %Y2 = load i8, i8* %X2 ; Ensure this load is not being incorrectly replaced. %cond = call i1 @cond2() br i1 %cond, label %cont, label %out cont: - %Z = getelementptr i8* %X2, i32 -1 + %Z = getelementptr i8, i8* %X2, i32 -1 %Z2 = bitcast i8 *%Z to i32* store i32 50462976, i32* %Z2 ;; (1 << 8) | (2 << 16) | (3 << 24) ; CHECK: store i32 -; CHECK-NEXT: getelementptr i8* %p, i32 3 -; CHECK-NEXT: load i8* +; CHECK-NEXT: getelementptr i8, i8* %p, i32 3 +; CHECK-NEXT: load i8, i8* br label %loop out: @@ -566,8 +566,8 @@ entry: %x = alloca [256 x i32], align 4 ; <[256 x i32]*> [#uses=2] %tmp = bitcast [256 x i32]* %x to i8* ; <i8*> [#uses=1] call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 1024, i32 4, i1 false) - %arraydecay = getelementptr inbounds [256 x i32]* %x, i32 0, i32 0 ; <i32*> - %tmp1 = load i32* %arraydecay ; <i32> [#uses=1] + %arraydecay = getelementptr inbounds [256 x i32], [256 x i32]* %x, i32 0, i32 0 ; <i32*> + %tmp1 = load i32, i32* %arraydecay ; <i32> [#uses=1] ret i32 %tmp1 ; CHECK-LABEL: @memset_to_load( ; CHECK: ret i32 0 @@ -581,15 +581,15 @@ entry: define i32 @load_load_partial_alias(i8* %P) nounwind ssp { entry: %0 = bitcast i8* %P to i32* - %tmp2 = load i32* %0 - %add.ptr = getelementptr inbounds i8* %P, i64 1 - %tmp5 = load i8* %add.ptr + %tmp2 = load i32, i32* %0 + %add.ptr = getelementptr inbounds i8, i8* %P, i64 1 + %tmp5 = load i8, i8* %add.ptr %conv = zext i8 %tmp5 to i32 %add = add nsw i32 %tmp2, %conv ret i32 %add ; TEMPORARILYDISABLED-LABEL: @load_load_partial_alias( -; TEMPORARILYDISABLED: load i32* +; TEMPORARILYDISABLED: load i32, i32* ; TEMPORARILYDISABLED-NOT: load ; TEMPORARILYDISABLED: lshr i32 {{.*}}, 8 ; TEMPORARILYDISABLED-NOT: load @@ -603,13 +603,13 @@ entry: define i32 @load_load_partial_alias_cross_block(i8* %P) nounwind ssp { entry: %xx = bitcast i8* %P to i32* - %x1 = load i32* %xx, align 4 + %x1 = load i32, i32* %xx, align 4 %cmp = icmp eq i32 %x1, 127 br i1 %cmp, label %land.lhs.true, label %if.end land.lhs.true: ; preds = %entry - %arrayidx4 = getelementptr inbounds i8* %P, i64 1 - %tmp5 = load i8* %arrayidx4, align 1 + %arrayidx4 = getelementptr inbounds i8, i8* %P, i64 1 + %tmp5 = load i8, i8* %arrayidx4, align 1 %conv6 = zext i8 %tmp5 to i32 ret i32 %conv6 @@ -632,39 +632,39 @@ if.end: define i32 @test_widening1(i8* %P) nounwind ssp noredzone { entry: - %tmp = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 1), align 4 + %tmp = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 1), align 4 %conv = zext i8 %tmp to i32 - %tmp1 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 2), align 1 + %tmp1 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 2), align 1 %conv2 = zext i8 %tmp1 to i32 %add = add nsw i32 %conv, %conv2 ret i32 %add ; CHECK-LABEL: @test_widening1( ; CHECK-NOT: load -; CHECK: load i16* +; CHECK: load i16, i16* ; CHECK-NOT: load ; CHECK: ret i32 } define i32 @test_widening2() nounwind ssp noredzone { entry: - %tmp = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 1), align 4 + %tmp = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 1), align 4 %conv = zext i8 %tmp to i32 - %tmp1 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 2), align 1 + %tmp1 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 2), align 1 %conv2 = zext i8 %tmp1 to i32 %add = add nsw i32 %conv, %conv2 - %tmp2 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 3), align 2 + %tmp2 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 3), align 2 %conv3 = zext i8 %tmp2 to i32 %add2 = add nsw i32 %add, %conv3 - %tmp3 = load i8* getelementptr inbounds (%widening1* @f, i64 0, i32 4), align 1 + %tmp3 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 4), align 1 %conv4 = zext i8 %tmp3 to i32 %add3 = add nsw i32 %add2, %conv3 ret i32 %add3 ; CHECK-LABEL: @test_widening2( ; CHECK-NOT: load -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK-NOT: load ; CHECK: ret i32 } @@ -691,9 +691,9 @@ declare void @use3(i8***, i8**) ; PR8908 define void @test_escape1() nounwind { %x = alloca i8**, align 8 - store i8** getelementptr inbounds ([5 x i8*]* @_ZTV1X, i64 0, i64 2), i8*** %x, align 8 + store i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @_ZTV1X, i64 0, i64 2), i8*** %x, align 8 call void @use() nounwind - %DEAD = load i8*** %x, align 8 + %DEAD = load i8**, i8*** %x, align 8 call void @use3(i8*** %x, i8** %DEAD) nounwind ret void ; CHECK: test_escape1 diff --git a/test/Transforms/GVN/tbaa.ll b/test/Transforms/GVN/tbaa.ll index 71fbed41..b5a717b 100644 --- a/test/Transforms/GVN/tbaa.ll +++ b/test/Transforms/GVN/tbaa.ll @@ -81,9 +81,9 @@ define i32 @test8(i32* %p, i32* %q) { ; Since we know the location is invariant, we can forward the ; load across the potentially aliasing store. - %a = load i32* %q, !tbaa !10 + %a = load i32, i32* %q, !tbaa !10 store i32 15, i32* %p - %b = load i32* %q, !tbaa !10 + %b = load i32, i32* %q, !tbaa !10 %c = sub i32 %a, %b ret i32 %c } @@ -94,9 +94,9 @@ define i32 @test9(i32* %p, i32* %q) { ; Since we know the location is invariant, we can forward the ; load across the potentially aliasing store (within the call). - %a = load i32* %q, !tbaa !10 + %a = load i32, i32* %q, !tbaa !10 call void @clobber() - %b = load i32* %q, !tbaa !10 + %b = load i32, i32* %q, !tbaa !10 %c = sub i32 %a, %b ret i32 %c } diff --git a/test/Transforms/GVN/volatile.ll b/test/Transforms/GVN/volatile.ll index 5ba03d9..b31058d 100644 --- a/test/Transforms/GVN/volatile.ll +++ b/test/Transforms/GVN/volatile.ll @@ -6,12 +6,12 @@ ; for dependencies of a non-volatile load define i32 @test1(i32* nocapture %p, i32* nocapture %q) { ; CHECK-LABEL: test1 -; CHECK: %0 = load volatile i32* %q +; CHECK: %0 = load volatile i32, i32* %q ; CHECK-NEXT: ret i32 0 entry: - %x = load i32* %p - load volatile i32* %q - %y = load i32* %p + %x = load i32, i32* %p + load volatile i32, i32* %q + %y = load i32, i32* %p %add = sub i32 %y, %x ret i32 %add } @@ -20,12 +20,12 @@ entry: ; volatile, this would be (in effect) removing the volatile load define i32 @test2(i32* nocapture %p, i32* nocapture %q) { ; CHECK-LABEL: test2 -; CHECK: %x = load i32* %p -; CHECK-NEXT: %y = load volatile i32* %p +; CHECK: %x = load i32, i32* %p +; CHECK-NEXT: %y = load volatile i32, i32* %p ; CHECK-NEXT: %add = sub i32 %y, %x entry: - %x = load i32* %p - %y = load volatile i32* %p + %x = load i32, i32* %p + %y = load volatile i32, i32* %p %add = sub i32 %y, %x ret i32 %add } @@ -34,13 +34,13 @@ entry: ; reorder it even if p and q are noalias define i32 @test3(i32* noalias nocapture %p, i32* noalias nocapture %q) { ; CHECK-LABEL: test3 -; CHECK: %x = load i32* %p -; CHECK-NEXT: %0 = load volatile i32* %q -; CHECK-NEXT: %y = load volatile i32* %p +; CHECK: %x = load i32, i32* %p +; CHECK-NEXT: %0 = load volatile i32, i32* %q +; CHECK-NEXT: %y = load volatile i32, i32* %p entry: - %x = load i32* %p - load volatile i32* %q - %y = load volatile i32* %p + %x = load i32, i32* %p + load volatile i32, i32* %q + %y = load volatile i32, i32* %p %add = sub i32 %y, %x ret i32 %add } @@ -50,13 +50,13 @@ entry: ; case, the ordering prevents forwarding. define i32 @test4(i32* noalias nocapture %p, i32* noalias nocapture %q) { ; CHECK-LABEL: test4 -; CHECK: %x = load i32* %p -; CHECK-NEXT: %0 = load atomic volatile i32* %q seq_cst -; CHECK-NEXT: %y = load atomic i32* %p seq_cst +; CHECK: %x = load i32, i32* %p +; CHECK-NEXT: %0 = load atomic volatile i32, i32* %q seq_cst +; CHECK-NEXT: %y = load atomic i32, i32* %p seq_cst entry: - %x = load i32* %p - load atomic volatile i32* %q seq_cst, align 4 - %y = load atomic i32* %p seq_cst, align 4 + %x = load i32, i32* %p + load atomic volatile i32, i32* %q seq_cst, align 4 + %y = load atomic i32, i32* %p seq_cst, align 4 %add = sub i32 %y, %x ret i32 %add } @@ -64,11 +64,11 @@ entry: ; Value forwarding from a volatile load is perfectly legal define i32 @test5(i32* nocapture %p, i32* nocapture %q) { ; CHECK-LABEL: test5 -; CHECK: %x = load volatile i32* %p +; CHECK: %x = load volatile i32, i32* %p ; CHECK-NEXT: ret i32 0 entry: - %x = load volatile i32* %p - %y = load i32* %p + %x = load volatile i32, i32* %p + %y = load i32, i32* %p %add = sub i32 %y, %x ret i32 %add } @@ -76,17 +76,17 @@ entry: ; Does cross block redundancy elimination work with volatiles? define i32 @test6(i32* noalias nocapture %p, i32* noalias nocapture %q) { ; CHECK-LABEL: test6 -; CHECK: %y1 = load i32* %p +; CHECK: %y1 = load i32, i32* %p ; CHECK-LABEL: header -; CHECK: %x = load volatile i32* %q +; CHECK: %x = load volatile i32, i32* %q ; CHECK-NEXT: %add = sub i32 %y1, %x entry: - %y1 = load i32* %p + %y1 = load i32, i32* %p call void @use(i32 %y1) br label %header header: - %x = load volatile i32* %q - %y = load i32* %p + %x = load volatile i32, i32* %q + %y = load i32, i32* %p %add = sub i32 %y, %x %cnd = icmp eq i32 %add, 0 br i1 %cnd, label %exit, label %header @@ -98,22 +98,22 @@ exit: define i32 @test7(i1 %c, i32* noalias nocapture %p, i32* noalias nocapture %q) { ; CHECK-LABEL: test7 ; CHECK-LABEL: entry.header_crit_edge: -; CHECK: %y.pre = load i32* %p +; CHECK: %y.pre = load i32, i32* %p ; CHECK-LABEL: skip: -; CHECK: %y1 = load i32* %p +; CHECK: %y1 = load i32, i32* %p ; CHECK-LABEL: header: ; CHECK: %y = phi i32 -; CHECK-NEXT: %x = load volatile i32* %q +; CHECK-NEXT: %x = load volatile i32, i32* %q ; CHECK-NEXT: %add = sub i32 %y, %x entry: br i1 %c, label %header, label %skip skip: - %y1 = load i32* %p + %y1 = load i32, i32* %p call void @use(i32 %y1) br label %header header: - %x = load volatile i32* %q - %y = load i32* %p + %x = load volatile i32, i32* %q + %y = load i32, i32* %p %add = sub i32 %y, %x %cnd = icmp eq i32 %add, 0 br i1 %cnd, label %exit, label %header @@ -126,20 +126,20 @@ exit: define i32 @test8(i1 %b, i1 %c, i32* noalias %p, i32* noalias %q) { ; CHECK-LABEL: test8 ; CHECK-LABEL: entry -; CHECK: %y1 = load i32* %p +; CHECK: %y1 = load i32, i32* %p ; CHECK-LABEL: header: ; CHECK: %y = phi i32 -; CHECK-NEXT: %x = load volatile i32* %q +; CHECK-NEXT: %x = load volatile i32, i32* %q ; CHECK-NOT: load ; CHECK-LABEL: skip.header_crit_edge: -; CHECK: %y.pre = load i32* %p +; CHECK: %y.pre = load i32, i32* %p entry: - %y1 = load i32* %p + %y1 = load i32, i32* %p call void @use(i32 %y1) br label %header header: - %x = load volatile i32* %q - %y = load i32* %p + %x = load volatile i32, i32* %q + %y = load i32, i32* %p call void @use(i32 %y) br i1 %b, label %skip, label %header skip: diff --git a/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll index 766c227..49a87d9 100644 --- a/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll +++ b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll @@ -11,7 +11,7 @@ ;; dies when %b dies. define internal i32 @foo() { - %ret = load i32* @foo.upgrd.1 ; <i32> [#uses=1] + %ret = load i32, i32* @foo.upgrd.1 ; <i32> [#uses=1] ret i32 %ret } diff --git a/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll b/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll index 42fcb1e..58d3f4c 100644 --- a/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll +++ b/test/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll @@ -5,8 +5,8 @@ @t0 = internal global [4 x i8] c"foo\00" ; <[4 x i8]*> [#uses=1] @t1 = internal global [4 x i8] c"bar\00" ; <[4 x i8]*> [#uses=1] -@s1 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8]* @t0, i32 0, i32 0) ] ; <[1 x i8*]*> [#uses=0] -@s2 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8]* @t1, i64 0, i64 0) ] ; <[1 x i8*]*> [#uses=0] +@s1 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8], [4 x i8]* @t0, i32 0, i32 0) ] ; <[1 x i8*]*> [#uses=0] +@s2 = internal global [1 x i8*] [ i8* getelementptr ([4 x i8], [4 x i8]* @t1, i64 0, i64 0) ] ; <[1 x i8*]*> [#uses=0] @b = internal global i32* @a ; <i32**> [#uses=0] @a = internal global i32 7 ; <i32*> [#uses=1] diff --git a/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll b/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll index 6221fa3..afa2629 100644 --- a/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll +++ b/test/Transforms/GlobalDCE/2002-09-12-Redeletion.ll @@ -5,7 +5,7 @@ @bar = internal global [2 x { i32*, i32 }] [ { i32*, i32 } { i32* @foo.upgrd.1, i32 7 }, { i32*, i32 } { i32* @foo.upgrd.1, i32 1 } ] ; <[2 x { i32*, i32 }]*> [#uses=0] define internal i32 @foo() { - %ret = load i32* @foo.upgrd.1 ; <i32> [#uses=1] + %ret = load i32, i32* @foo.upgrd.1 ; <i32> [#uses=1] ret i32 %ret } diff --git a/test/Transforms/GlobalDCE/complex-constantexpr.ll b/test/Transforms/GlobalDCE/complex-constantexpr.ll index 4bf1aee..b4eed02 100644 --- a/test/Transforms/GlobalDCE/complex-constantexpr.ll +++ b/test/Transforms/GlobalDCE/complex-constantexpr.ll @@ -19,7 +19,7 @@ bb: br label %bb2 bb1: ; preds = %bb11 - %tmp = load i32* @global5, align 4 + %tmp = load i32, i32* @global5, align 4 br label %bb2 bb2: ; preds = %bb1, %bb @@ -34,12 +34,12 @@ bb6: ; preds = %bb2 br label %bb8 bb8: ; preds = %bb6, %bb2 - %tmp9 = load i32* @global7, align 4 + %tmp9 = load i32, i32* @global7, align 4 %tmp10 = icmp eq i32 %tmp9, 0 br i1 %tmp10, label %bb11, label %bb15 bb11: ; preds = %bb8 - %tmp12 = load i32* @global6, align 4 + %tmp12 = load i32, i32* @global6, align 4 %tmp13 = add nsw i32 %tmp12, 1 store i32 %tmp13, i32* @global6, align 4 %tmp14 = icmp slt i32 %tmp13, 42 @@ -69,9 +69,9 @@ bb: define void @blam() { bb: - store i32 ptrtoint (i32* @global to i32), i32* getelementptr inbounds (%struct.ham* @global8, i64 0, i32 0), align 4 + store i32 ptrtoint (i32* @global to i32), i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4 store i32 0, i32* @global9, align 4 - %tmp = load i32* getelementptr inbounds (%struct.ham* @global8, i64 0, i32 0), align 4 + %tmp = load i32, i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4 br label %bb1 bb1: ; preds = %bb1, %bb @@ -89,7 +89,7 @@ bb1: ; preds = %bb1, %bb br i1 %tmp12, label %bb13, label %bb1 bb13: ; preds = %bb1 - store i32 %tmp10, i32* getelementptr inbounds (%struct.ham* @global8, i64 0, i32 0), align 4 + store i32 %tmp10, i32* getelementptr inbounds (%struct.ham, %struct.ham* @global8, i64 0, i32 0), align 4 store i32 0, i32* @global10, align 4 store i32 %tmp6, i32* @global11, align 4 store i32 20, i32* @global9, align 4 diff --git a/test/Transforms/GlobalDCE/global_ctors_integration.ll b/test/Transforms/GlobalDCE/global_ctors_integration.ll index 5e6cc79..f7f702a 100644 --- a/test/Transforms/GlobalDCE/global_ctors_integration.ll +++ b/test/Transforms/GlobalDCE/global_ctors_integration.ll @@ -12,7 +12,7 @@ @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { - %1 = load i32* @_ZN3Bar18LINKER_INITIALIZEDE, align 4 + %1 = load i32, i32* @_ZN3Bar18LINKER_INITIALIZEDE, align 4 call void @_ZN3FooC1E17LinkerInitialized(%class.Foo* @foo, i32 %1) ret void } @@ -23,8 +23,8 @@ define linkonce_odr void @_ZN3FooC1E17LinkerInitialized(%class.Foo* %this, i32) %3 = alloca i32, align 4 store %class.Foo* %this, %class.Foo** %2, align 8 store i32 %0, i32* %3, align 4 - %4 = load %class.Foo** %2 - %5 = load i32* %3, align 4 + %4 = load %class.Foo*, %class.Foo** %2 + %5 = load i32, i32* %3, align 4 call void @_ZN3FooC2E17LinkerInitialized(%class.Foo* %4, i32 %5) ret void } @@ -35,7 +35,7 @@ define linkonce_odr void @_ZN3FooC2E17LinkerInitialized(%class.Foo* %this, i32) %3 = alloca i32, align 4 store %class.Foo* %this, %class.Foo** %2, align 8 store i32 %0, i32* %3, align 4 - %4 = load %class.Foo** %2 + %4 = load %class.Foo*, %class.Foo** %2 ret void } diff --git a/test/Transforms/GlobalDCE/indirectbr.ll b/test/Transforms/GlobalDCE/indirectbr.ll index 90f1ae4..5671aea 100644 --- a/test/Transforms/GlobalDCE/indirectbr.ll +++ b/test/Transforms/GlobalDCE/indirectbr.ll @@ -9,8 +9,8 @@ entry: br label %L1 L1: - %arrayidx = getelementptr inbounds [3 x i8*]* @L, i32 0, i32 %idx - %l = load i8** %arrayidx + %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @L, i32 0, i32 %idx + %l = load i8*, i8** %arrayidx indirectbr i8* %l, [label %L1, label %L2] L2: diff --git a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll index bdcf1fa..061b9b0 100644 --- a/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll +++ b/test/Transforms/GlobalOpt/2004-10-10-CastStoreOnce.ll @@ -4,8 +4,8 @@ @G = internal global i32* null ; <i32**> [#uses=2] define i32 @user() { - %P = load i32** @G ; <i32*> [#uses=1] - %Q = load i32* %P ; <i32> [#uses=1] + %P = load i32*, i32** @G ; <i32*> [#uses=1] + %Q = load i32, i32* %P ; <i32> [#uses=1] ret i32 %Q } diff --git a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll index 7bcb1d4..3efbde4 100644 --- a/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll +++ b/test/Transforms/GlobalOpt/2005-06-15-LocalizeConstExprCrash.ll @@ -4,7 +4,7 @@ @g_40507551 = internal global i16 31038 ; <i16*> [#uses=1] define void @main() { - %tmp.4.i.1 = load i8* getelementptr (i8* bitcast (i16* @g_40507551 to i8*), i32 1) ; <i8> [#uses=0] + %tmp.4.i.1 = load i8, i8* getelementptr (i8, i8* bitcast (i16* @g_40507551 to i8*), i32 1) ; <i8> [#uses=0] ret void } diff --git a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll index 43597bf..061c881 100644 --- a/test/Transforms/GlobalOpt/2005-09-27-Crash.ll +++ b/test/Transforms/GlobalOpt/2005-09-27-Crash.ll @@ -8,7 +8,7 @@ define fastcc void @pypy_array_constant() { block0: - %tmp.9 = getelementptr %structtype.test* bitcast ({ i32, { i32, [2 x i32] } }* @structinstance.test to %structtype.test*), i32 0, i32 0 ; <i32*> [#uses=0] + %tmp.9 = getelementptr %structtype.test, %structtype.test* bitcast ({ i32, { i32, [2 x i32] } }* @structinstance.test to %structtype.test*), i32 0, i32 0 ; <i32*> [#uses=0] ret void } diff --git a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll index c971219..419ae10 100644 --- a/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll +++ b/test/Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll @@ -106,12 +106,12 @@ entry: %__priority_addr = alloca i32 ; <i32*> [#uses=2] store i32 %__initialize_p, i32* %__initialize_p_addr store i32 %__priority, i32* %__priority_addr - %tmp = load i32* %__priority_addr ; <i32> [#uses=1] + %tmp = load i32, i32* %__priority_addr ; <i32> [#uses=1] %tmp.upgrd.1 = icmp eq i32 %tmp, 65535 ; <i1> [#uses=1] br i1 %tmp.upgrd.1, label %cond_true, label %cond_next14 cond_true: ; preds = %entry - %tmp8 = load i32* %__initialize_p_addr ; <i32> [#uses=1] + %tmp8 = load i32, i32* %__initialize_p_addr ; <i32> [#uses=1] %tmp9 = icmp eq i32 %tmp8, 1 ; <i1> [#uses=1] br i1 %tmp9, label %cond_true10, label %cond_next14 diff --git a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll index 352639a..7b62cf0 100644 --- a/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll +++ b/test/Transforms/GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll @@ -10,7 +10,7 @@ entry: cond_true16.i: ; preds = %cond_true16.i, %entry %low.0.in.i.0 = phi i32* [ @nrow, %entry ], [ null, %cond_true16.i ] ; <i32*> [#uses=1] - %low.0.i = load i32* %low.0.in.i.0 ; <i32> [#uses=0] + %low.0.i = load i32, i32* %low.0.in.i.0 ; <i32> [#uses=0] br label %cond_true16.i } diff --git a/test/Transforms/GlobalOpt/2007-04-05-Crash.ll b/test/Transforms/GlobalOpt/2007-04-05-Crash.ll index c7aca62..f312fbb 100644 --- a/test/Transforms/GlobalOpt/2007-04-05-Crash.ll +++ b/test/Transforms/GlobalOpt/2007-04-05-Crash.ll @@ -9,7 +9,7 @@ target triple = "thumb-apple-darwin8" define zeroext i16 @__NSCharToUnicharCFWrapper(i8 zeroext %ch) { entry: %iftmp.0.0.in.in = select i1 false, i16* @replacementUnichar, i16* null ; <i16*> [#uses=1] - %iftmp.0.0.in = load i16* %iftmp.0.0.in.in ; <i16> [#uses=1] + %iftmp.0.0.in = load i16, i16* %iftmp.0.0.in.in ; <i16> [#uses=1] ret i16 %iftmp.0.0.in } diff --git a/test/Transforms/GlobalOpt/2007-05-13-Crash.ll b/test/Transforms/GlobalOpt/2007-05-13-Crash.ll index 5703909..90ba15c 100644 --- a/test/Transforms/GlobalOpt/2007-05-13-Crash.ll +++ b/test/Transforms/GlobalOpt/2007-05-13-Crash.ll @@ -9,9 +9,9 @@ target triple = "i686-apple-darwin8" @_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey = internal global %struct.__CFString* null ; <%struct.__CFString**> [#uses=2] @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey = internal global %struct.__CFString* null ; <%struct.__CFString**> [#uses=7] internal constant %struct.__builtin_CFString { - i32* getelementptr ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), + i32* getelementptr ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, - i8* getelementptr ([14 x i8]* @.str, i32 0, i32 0), + i8* getelementptr ([14 x i8], [14 x i8]* @.str, i32 0, i32 0), i32 13 }, section "__DATA,__cfstring" ; <%struct.__builtin_CFString*>:0 [#uses=1] @__CFConstantStringClassReference = external global [0 x i32] ; <[0 x i32]*> [#uses=1] @.str = internal constant [14 x i8] c"AlwaysVisible\00" ; <[14 x i8]*> [#uses=1] @@ -19,13 +19,13 @@ internal constant %struct.__builtin_CFString { define %struct.__CFString* @_Z19SFLGetVisibilityKeyv() { entry: - %tmp1 = load %struct.__CFString** @_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey ; <%struct.__CFString*> [#uses=1] + %tmp1 = load %struct.__CFString*, %struct.__CFString** @_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey ; <%struct.__CFString*> [#uses=1] ret %struct.__CFString* %tmp1 } define %struct.__CFString* @_Z22SFLGetAlwaysVisibleKeyv() { entry: - %tmp1 = load %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1] + %tmp1 = load %struct.__CFString*, %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1] %tmp2 = icmp eq %struct.__CFString* %tmp1, null ; <i1> [#uses=1] br i1 %tmp2, label %cond_true, label %cond_next @@ -34,25 +34,25 @@ cond_true: ; preds = %entry br label %cond_next cond_next: ; preds = %entry, %cond_true - %tmp4 = load %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1] + %tmp4 = load %struct.__CFString*, %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1] ret %struct.__CFString* %tmp4 } define %struct.__CFString* @_Z21SFLGetNeverVisibleKeyv() { entry: - %tmp1 = load %struct.__CFString** @_ZZ21SFLGetNeverVisibleKeyvE21_kSFLLNeverVisibleKey ; <%struct.__CFString*> [#uses=1] + %tmp1 = load %struct.__CFString*, %struct.__CFString** @_ZZ21SFLGetNeverVisibleKeyvE21_kSFLLNeverVisibleKey ; <%struct.__CFString*> [#uses=1] ret %struct.__CFString* %tmp1 } define %struct.__CFDictionary* @_ZN18SFLMutableListItem18GetPrefsDictionaryEv(%struct.SFLMutableListItem* %this) { entry: - %tmp4 = getelementptr %struct.SFLMutableListItem* %this, i32 0, i32 0 ; <i16*> [#uses=1] - %tmp5 = load i16* %tmp4 ; <i16> [#uses=1] + %tmp4 = getelementptr %struct.SFLMutableListItem, %struct.SFLMutableListItem* %this, i32 0, i32 0 ; <i16*> [#uses=1] + %tmp5 = load i16, i16* %tmp4 ; <i16> [#uses=1] %tmp6 = icmp eq i16 %tmp5, 0 ; <i1> [#uses=1] br i1 %tmp6, label %cond_next22, label %cond_true cond_true: ; preds = %entry - %tmp9 = load %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1] + %tmp9 = load %struct.__CFString*, %struct.__CFString** @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey ; <%struct.__CFString*> [#uses=1] %tmp10 = icmp eq %struct.__CFString* %tmp9, null ; <i1> [#uses=1] br i1 %tmp10, label %cond_true13, label %cond_next22 @@ -62,8 +62,8 @@ cond_true13: ; preds = %cond_true cond_next22: ; preds = %entry, %cond_true13, %cond_true %iftmp.1.0.in = phi %struct.__CFString** [ @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey, %cond_true ], [ @_ZZ22SFLGetAlwaysVisibleKeyvE22_kSFLLAlwaysVisibleKey, %cond_true13 ], [ @_ZZ21SFLGetNeverVisibleKeyvE21_kSFLLNeverVisibleKey, %entry ] ; <%struct.__CFString**> [#uses=1] - %iftmp.1.0 = load %struct.__CFString** %iftmp.1.0.in ; <%struct.__CFString*> [#uses=1] - %tmp24 = load %struct.__CFString** @_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey ; <%struct.__CFString*> [#uses=1] + %iftmp.1.0 = load %struct.__CFString*, %struct.__CFString** %iftmp.1.0.in ; <%struct.__CFString*> [#uses=1] + %tmp24 = load %struct.__CFString*, %struct.__CFString** @_ZZ19SFLGetVisibilityKeyvE19_kSFLLVisibilityKey ; <%struct.__CFString*> [#uses=1] %tmp2728 = bitcast %struct.__CFString* %tmp24 to i8* ; <i8*> [#uses=1] %tmp2930 = bitcast %struct.__CFString* %iftmp.1.0 to i8* ; <i8*> [#uses=1] call void @_Z20CFDictionaryAddValuePKvS0_( i8* %tmp2728, i8* %tmp2930 ) diff --git a/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll b/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll index 7036c15..f6e0bb7 100644 --- a/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll +++ b/test/Transforms/GlobalOpt/2007-06-04-PackedStruct.ll @@ -28,7 +28,7 @@ entry: br i1 %tmp7, label %cond_true, label %cond_next cond_true: ; preds = %entry - store i8 0, i8* getelementptr (%"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >"* @someMap, i32 0, i32 0, i32 0, i32 0, i32 0) + store i8 0, i8* getelementptr (%"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >", %"struct.std::map<int,int,std::less<int>,std::allocator<std::pair<const int, int> > >"* @someMap, i32 0, i32 0, i32 0, i32 0, i32 0) ret void cond_next: ; preds = %entry diff --git a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll index 442cb92..cbc9c75 100644 --- a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll +++ b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll @@ -9,8 +9,8 @@ target triple = "powerpc-apple-darwin8" define i8 @func() { entry: - %tmp10 = getelementptr [2 x i32]* getelementptr ([6 x [2 x i32]]* @aaui1, i32 0, i32 0), i32 5, i32 1 ; <i32*> [#uses=1] - %tmp11 = load i32* %tmp10, align 4 ; <i32> [#uses=1] + %tmp10 = getelementptr [2 x i32], [2 x i32]* getelementptr ([6 x [2 x i32]], [6 x [2 x i32]]* @aaui1, i32 0, i32 0), i32 5, i32 1 ; <i32*> [#uses=1] + %tmp11 = load i32, i32* %tmp10, align 4 ; <i32> [#uses=1] %tmp12 = call i32 (...)* @func3( i32* null, i32 0, i32 %tmp11 ) ; <i32> [#uses=0] ret i8 undef } diff --git a/test/Transforms/GlobalOpt/2008-01-03-Crash.ll b/test/Transforms/GlobalOpt/2008-01-03-Crash.ll index 4105ab1..dc41fdb 100644 --- a/test/Transforms/GlobalOpt/2008-01-03-Crash.ll +++ b/test/Transforms/GlobalOpt/2008-01-03-Crash.ll @@ -20,7 +20,7 @@ stack_restore: ; preds = %cond_next20.i ret i32 0 cond_next21.i.i23.i: ; preds = %cond_next20.i - %tmp6.i4.i = load i32* bitcast (void (i32)** @indirect1 to i32*), align 4 ; <i32> [#uses=0] + %tmp6.i4.i = load i32, i32* bitcast (void (i32)** @indirect1 to i32*), align 4 ; <i32> [#uses=0] ret i32 0 } diff --git a/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll b/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll index 7c07d5d..8df7050 100644 --- a/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll +++ b/test/Transforms/GlobalOpt/2008-01-13-OutOfRangeSROA.ll @@ -4,13 +4,13 @@ @mm = internal global [16 x [31 x double]] zeroinitializer, align 32 define void @test(i32 %X) { - %P = getelementptr [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X + %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X store double 1.0, double* %P ret void } define double @get(i32 %X) { - %P = getelementptr [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X - %V = load double* %P + %P = getelementptr [16 x [31 x double]], [16 x [31 x double]]* @mm, i32 0, i32 0, i32 %X + %V = load double, double* %P ret double %V } diff --git a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll index 08b2cb1..ac66360 100644 --- a/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll +++ b/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll @@ -3,7 +3,7 @@ define double @foo() nounwind { entry: - %tmp1 = load volatile double* @t0.1441, align 8 ; <double> [#uses=2] + %tmp1 = load volatile double, double* @t0.1441, align 8 ; <double> [#uses=2] %tmp4 = fmul double %tmp1, %tmp1 ; <double> [#uses=1] ret double %tmp4 } diff --git a/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll b/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll index d58becd..934d928 100644 --- a/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll +++ b/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll @@ -16,16 +16,16 @@ target triple = "x86_64-apple-darwin8" define void @test() { - store double 1.0, double* getelementptr (%T* @G, i32 0, i32 0), align 16 - store double 2.0, double* getelementptr (%T* @G, i32 0, i32 1), align 8 - store double 3.0, double* getelementptr (%T* @G, i32 0, i32 2), align 16 + store double 1.0, double* getelementptr (%T, %T* @G, i32 0, i32 0), align 16 + store double 2.0, double* getelementptr (%T, %T* @G, i32 0, i32 1), align 8 + store double 3.0, double* getelementptr (%T, %T* @G, i32 0, i32 2), align 16 ret void } define double @test2() { - %V1 = load double* getelementptr (%T* @G, i32 0, i32 0), align 16 - %V2 = load double* getelementptr (%T* @G, i32 0, i32 1), align 8 - %V3 = load double* getelementptr (%T* @G, i32 0, i32 2), align 16 + %V1 = load double, double* getelementptr (%T, %T* @G, i32 0, i32 0), align 16 + %V2 = load double, double* getelementptr (%T, %T* @G, i32 0, i32 1), align 8 + %V3 = load double, double* getelementptr (%T, %T* @G, i32 0, i32 2), align 16 %R = fadd double %V1, %V2 %R2 = fadd double %R, %V3 ret double %R2 diff --git a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll index 0867ca9..d602df1 100644 --- a/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll +++ b/test/Transforms/GlobalOpt/2008-07-17-addrspace.ll @@ -10,8 +10,8 @@ @array = internal addrspace(1) global [ 2 x i32 ] zeroinitializer define i32 @foo() { - %A = load i32 addrspace(1) * getelementptr ({ i32, i32 } addrspace(1) * @struct, i32 0, i32 0) - %B = load i32 addrspace(1) * getelementptr ([ 2 x i32 ] addrspace(1) * @array, i32 0, i32 0) + %A = load i32, i32 addrspace(1) * getelementptr ({ i32, i32 }, { i32, i32 } addrspace(1) * @struct, i32 0, i32 0) + %B = load i32, i32 addrspace(1) * getelementptr ([ 2 x i32 ], [ 2 x i32 ] addrspace(1) * @array, i32 0, i32 0) ; Use the loaded values, so they won't get removed completely %R = add i32 %A, %B ret i32 %R @@ -20,8 +20,8 @@ define i32 @foo() { ; We put stores in a different function, so that the global variables won't get ; optimized away completely. define void @bar(i32 %R) { - store i32 %R, i32 addrspace(1) * getelementptr ([ 2 x i32 ] addrspace(1) * @array, i32 0, i32 0) - store i32 %R, i32 addrspace(1) * getelementptr ({ i32, i32 } addrspace(1) * @struct, i32 0, i32 0) + store i32 %R, i32 addrspace(1) * getelementptr ([ 2 x i32 ], [ 2 x i32 ] addrspace(1) * @array, i32 0, i32 0) + store i32 %R, i32 addrspace(1) * getelementptr ({ i32, i32 }, { i32, i32 } addrspace(1) * @struct, i32 0, i32 0) ret void } diff --git a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll index b74e4fc..bd32163 100644 --- a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll +++ b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash-2.ll @@ -6,9 +6,9 @@ target triple = "i386-apple-darwin7" define void @bar(i32 %Size) nounwind noinline { entry: - %malloccall = tail call i8* @malloc(i32 trunc (i64 mul (i64 ptrtoint (i32* getelementptr (i32* null, i32 1) to i64), i64 2000000) to i32)) + %malloccall = tail call i8* @malloc(i32 trunc (i64 mul (i64 ptrtoint (i32* getelementptr (i32, i32* null, i32 1) to i64), i64 2000000) to i32)) %tmp = bitcast i8* %malloccall to [1000000 x %struct.foo]* - %.sub = getelementptr [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1] + %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } @@ -18,11 +18,11 @@ declare noalias i8* @malloc(i32) define i32 @baz() nounwind readonly noinline { bb1.thread: - %tmpLD1 = load %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=2] + %tmpLD1 = load %struct.foo*, %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=2] br label %bb1 bb1: ; preds = %bb1, %bb1.thread %tmp = phi %struct.foo* [ %tmpLD1, %bb1.thread ], [ %tmpLD1, %bb1 ] ; <%struct.foo*> [#uses=1] - %0 = getelementptr %struct.foo* %tmp, i32 1 ; <%struct.foo*> [#uses=0] + %0 = getelementptr %struct.foo, %struct.foo* %tmp, i32 1 ; <%struct.foo*> [#uses=0] br label %bb1 } diff --git a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll index 613cb7b..e9c1678 100644 --- a/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll +++ b/test/Transforms/GlobalOpt/2008-12-16-HeapSRACrash.ll @@ -6,9 +6,9 @@ target triple = "i386-apple-darwin7" define void @bar(i32 %Size) nounwind noinline { entry: - %malloccall = tail call i8* @malloc(i32 trunc (i64 mul (i64 ptrtoint (i32* getelementptr (i32* null, i32 1) to i64), i64 2000000) to i32)) + %malloccall = tail call i8* @malloc(i32 trunc (i64 mul (i64 ptrtoint (i32* getelementptr (i32, i32* null, i32 1) to i64), i64 2000000) to i32)) %tmp = bitcast i8* %malloccall to [1000000 x %struct.foo]* - %.sub = getelementptr [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1] + %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } @@ -17,7 +17,7 @@ declare noalias i8* @malloc(i32) define i32 @baz() nounwind readonly noinline { bb1.thread: - %tmpLD1 = load %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=3] + %tmpLD1 = load %struct.foo*, %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=3] store %struct.foo* %tmpLD1, %struct.foo** null br label %bb1 diff --git a/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll b/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll index e76c44d..21ec526 100644 --- a/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll +++ b/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll @@ -12,15 +12,15 @@ entry: br label %bb1 bb: ; preds = %bb1 - %0 = getelementptr %struct.node* %t.0, i64 0, i32 1 ; <i32*> [#uses=1] - %1 = load i32* %0, align 4 ; <i32> [#uses=1] - %2 = getelementptr %struct.node* %t.0, i64 0, i32 0 ; <%struct.node**> [#uses=1] + %0 = getelementptr %struct.node, %struct.node* %t.0, i64 0, i32 1 ; <i32*> [#uses=1] + %1 = load i32, i32* %0, align 4 ; <i32> [#uses=1] + %2 = getelementptr %struct.node, %struct.node* %t.0, i64 0, i32 0 ; <%struct.node**> [#uses=1] br label %bb1 bb1: ; preds = %bb, %entry %value.0 = phi i32 [ undef, %entry ], [ %1, %bb ] ; <i32> [#uses=1] %t.0.in = phi %struct.node** [ @head, %entry ], [ %2, %bb ] ; <%struct.node**> [#uses=1] - %t.0 = load %struct.node** %t.0.in ; <%struct.node*> [#uses=3] + %t.0 = load %struct.node*, %struct.node** %t.0.in ; <%struct.node*> [#uses=3] %3 = icmp eq %struct.node* %t.0, null ; <i1> [#uses=1] br i1 %3, label %bb2, label %bb diff --git a/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll index d6a565a..a3e9004 100644 --- a/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll +++ b/test/Transforms/GlobalOpt/2009-02-15-BitcastAlias.ll @@ -5,6 +5,6 @@ @a = alias bitcast (i32* @g to i8*) define void @f() { - %tmp = load i8* @a + %tmp = load i8, i8* @a ret void } diff --git a/test/Transforms/GlobalOpt/2009-03-05-dbg.ll b/test/Transforms/GlobalOpt/2009-03-05-dbg.ll index 049eef1..f52a313 100644 --- a/test/Transforms/GlobalOpt/2009-03-05-dbg.ll +++ b/test/Transforms/GlobalOpt/2009-03-05-dbg.ll @@ -33,7 +33,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone define i32 @bar() nounwind ssp { entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - %0 = load i32* @Stop, align 4, !dbg !13 ; <i32> [#uses=1] + %0 = load i32, i32* @Stop, align 4, !dbg !13 ; <i32> [#uses=1] %1 = icmp eq i32 %0, 1, !dbg !13 ; <i1> [#uses=1] br i1 %1, label %bb, label %bb1, !dbg !13 @@ -55,25 +55,25 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.gv = !{!0} -!0 = !{!"0x34\00Stop\00Stop\00\002\001\001", !1, !1, !2, i32* @Stop} ; [ DW_TAG_variable ] -!1 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\001\00\000\00\000", !20, !21, !21, null, null, null} ; [ DW_TAG_compile_unit ] -!2 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !1} ; [ DW_TAG_base_type ] -!3 = !{!"0x101\00i\004\000", !4, !1, !2} ; [ DW_TAG_arg_variable ] -!4 = !{!"0x2e\00foo\00foo\00foo\004\000\001\000\006\000\000\000", i32 0, !1, !5, null, null, null, null, null} ; [ DW_TAG_subprogram ] -!5 = !{!"0x15\00\000\000\000\000\000\000", !1, null, null, !6, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDGlobalVariable(name: "Stop", line: 2, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !2, variable: i32* @Stop) +!1 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !20, enums: !21, retainedTypes: !21) +!2 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!3 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 4, arg: 0, scope: !4, file: !1, type: !2) +!4 = !MDSubprogram(name: "foo", linkageName: "foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !1, type: !5) +!5 = !MDSubroutineType(types: !6) !6 = !{!2, !2} !7 = !MDLocation(line: 5, scope: !8) -!8 = !{!"0xb\000\000\000", !20, !4} ; [ DW_TAG_lexical_block ] +!8 = distinct !MDLexicalBlock(line: 0, column: 0, file: !20, scope: !4) !9 = !MDLocation(line: 6, scope: !8) !10 = !MDLocation(line: 7, scope: !8) !11 = !MDLocation(line: 9, scope: !8) !12 = !MDLocation(line: 11, scope: !8) !13 = !MDLocation(line: 14, scope: !14) -!14 = !{!"0xb\000\000\000", !20, !15} ; [ DW_TAG_lexical_block ] -!15 = !{!"0x2e\00bar\00bar\00bar\0013\000\001\000\006\000\000\000", i32 0, !1, !16, null, null, null, null, null} ; [ DW_TAG_subprogram ] -!16 = !{!"0x15\00\000\000\000\000\000\000", !1, null, null, !17, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!14 = distinct !MDLexicalBlock(line: 0, column: 0, file: !20, scope: !15) +!15 = !MDSubprogram(name: "bar", linkageName: "bar", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !1, type: !16) +!16 = !MDSubroutineType(types: !17) !17 = !{!2} !18 = !MDLocation(line: 15, scope: !14) !19 = !MDLocation(line: 16, scope: !14) -!20 = !{!"g.c", !"/tmp"} +!20 = !MDFile(filename: "g.c", directory: "/tmp") !21 = !{i32 0} diff --git a/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll b/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll index 059af1c..469fa76 100644 --- a/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll +++ b/test/Transforms/GlobalOpt/2009-03-07-PromotePtrToBool.ll @@ -12,6 +12,6 @@ entry: define i32* @get() nounwind { entry: - %0 = load i32** @X, align 4 ; <i32*> [#uses=1] + %0 = load i32*, i32** @X, align 4 ; <i32*> [#uses=1] ret i32* %0 } diff --git a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll index d3c3ff5..30e4d42 100644 --- a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll +++ b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll @@ -33,7 +33,7 @@ bb.i4.i: ; preds = %my_calloc.exit.i unreachable my_calloc.exit5.i: ; preds = %my_calloc.exit.i - %.pre.i58 = load %struct.s_net** @net, align 4 ; <%struct.s_net*> [#uses=1] + %.pre.i58 = load %struct.s_net*, %struct.s_net** @net, align 4 ; <%struct.s_net*> [#uses=1] br label %bb17.i78 bb1.i61: ; preds = %bb4.preheader.i, %bb1.i61 @@ -58,11 +58,11 @@ bb.i1.i68: ; preds = %bb8.i67 unreachable my_malloc.exit.i70: ; preds = %bb8.i67 - %0 = load %struct.s_net** @net, align 4 ; <%struct.s_net*> [#uses=1] + %0 = load %struct.s_net*, %struct.s_net** @net, align 4 ; <%struct.s_net*> [#uses=1] br i1 undef, label %bb9.i71, label %bb16.i77 bb9.i71: ; preds = %bb9.i71, %my_malloc.exit.i70 - %1 = load %struct.s_net** @net, align 4 ; <%struct.s_net*> [#uses=1] + %1 = load %struct.s_net*, %struct.s_net** @net, align 4 ; <%struct.s_net*> [#uses=1] br i1 undef, label %bb9.i71, label %bb16.i77 bb16.i77: ; preds = %bb9.i71, %my_malloc.exit.i70, %bb15.preheader.i diff --git a/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll b/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll index 40862bd..461c253 100644 --- a/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll +++ b/test/Transforms/GlobalOpt/2009-11-16-BrokenPerformHeapAllocSRoA.ll @@ -13,9 +13,9 @@ target triple = "x86_64-apple-darwin10.0" ; based on linit in office-ispell define void @test() nounwind ssp { - %1 = load i32* getelementptr inbounds (%struct.hashheader* @hashheader, i64 0, i32 13), align 8 ; <i32> [#uses=1] + %1 = load i32, i32* getelementptr inbounds (%struct.hashheader, %struct.hashheader* @hashheader, i64 0, i32 13), align 8 ; <i32> [#uses=1] %2 = sext i32 %1 to i64 ; <i64> [#uses=1] - %3 = mul i64 %2, ptrtoint (%struct.strchartype* getelementptr (%struct.strchartype* null, i64 1) to i64) ; <i64> [#uses=1] + %3 = mul i64 %2, ptrtoint (%struct.strchartype* getelementptr (%struct.strchartype, %struct.strchartype* null, i64 1) to i64) ; <i64> [#uses=1] %4 = tail call i8* @malloc(i64 %3) ; <i8*> [#uses=1] ; CHECK-NOT: call i8* @malloc(i64 %5 = bitcast i8* %4 to %struct.strchartype* ; <%struct.strchartype*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll b/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll index b73f62b..25bb976 100644 --- a/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll +++ b/test/Transforms/GlobalOpt/2009-11-16-MallocSingleStoreToGlobalVar.ll @@ -14,15 +14,15 @@ target triple = "x86_64-apple-darwin10.0" ; Derived from @DescribeChannel() in yacr2 define void @test() nounwind ssp { store i64 2335, i64* @channelColumns, align 8 - %1 = load i64* @channelColumns, align 8 ; <i64> [#uses=1] + %1 = load i64, i64* @channelColumns, align 8 ; <i64> [#uses=1] %2 = shl i64 %1, 3 ; <i64> [#uses=1] %3 = add i64 %2, 8 ; <i64> [#uses=1] %4 = call noalias i8* @malloc(i64 %3) nounwind ; <i8*> [#uses=1] ; CHECK: call noalias i8* @malloc %5 = bitcast i8* %4 to i64* ; <i64*> [#uses=1] store i64* %5, i64** @TOP, align 8 - %6 = load i64** @TOP, align 8 ; <i64*> [#uses=1] - %7 = getelementptr inbounds i64* %6, i64 13 ; <i64*> [#uses=1] + %6 = load i64*, i64** @TOP, align 8 ; <i64*> [#uses=1] + %7 = getelementptr inbounds i64, i64* %6, i64 13 ; <i64*> [#uses=1] store i64 0, i64* %7, align 8 ret void } diff --git a/test/Transforms/GlobalOpt/2010-02-25-MallocPromote.ll b/test/Transforms/GlobalOpt/2010-02-25-MallocPromote.ll index 629d57c..9f53ce4 100644 --- a/test/Transforms/GlobalOpt/2010-02-25-MallocPromote.ll +++ b/test/Transforms/GlobalOpt/2010-02-25-MallocPromote.ll @@ -12,7 +12,7 @@ bb918: %malloccall.i10 = call i8* @malloc(i32 16) nounwind ; <i8*> [#uses=1] %0 = bitcast i8* %malloccall.i10 to i32* ; <i32*> [#uses=1] store i32* %0, i32** @fixLRBT, align 8 - %1 = load i32** @fixLRBT, align 8 ; <i32*> [#uses=0] - %A = load i32* %1 + %1 = load i32*, i32** @fixLRBT, align 8 ; <i32*> [#uses=0] + %A = load i32, i32* %1 ret i32 %A } diff --git a/test/Transforms/GlobalOpt/2010-02-26-MallocSROA.ll b/test/Transforms/GlobalOpt/2010-02-26-MallocSROA.ll index ab7721f..12fa341 100644 --- a/test/Transforms/GlobalOpt/2010-02-26-MallocSROA.ll +++ b/test/Transforms/GlobalOpt/2010-02-26-MallocSROA.ll @@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu" define fastcc void @init_net() nounwind { entry: - %0 = load i32* @numf2s, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* @numf2s, align 4 ; <i32> [#uses=1] %mallocsize2 = shl i32 %0, 4 ; <i32> [#uses=1] %malloccall3 = tail call i8* @malloc(i32 %mallocsize2) nounwind ; <i8*> [#uses=1] %1 = bitcast i8* %malloccall3 to %struct.xyz* ; <%struct.xyz*> [#uses=1] @@ -20,7 +20,7 @@ entry: define fastcc void @load_train(i8* %trainfile, i32 %mode, i32 %objects) nounwind { entry: - %0 = load %struct.xyz** @Y, align 8 ; <%struct.xyz*> [#uses=0] + %0 = load %struct.xyz*, %struct.xyz** @Y, align 8 ; <%struct.xyz*> [#uses=0] ret void } diff --git a/test/Transforms/GlobalOpt/alias-resolve.ll b/test/Transforms/GlobalOpt/alias-resolve.ll index ebc20c6..090d784 100644 --- a/test/Transforms/GlobalOpt/alias-resolve.ll +++ b/test/Transforms/GlobalOpt/alias-resolve.ll @@ -13,8 +13,8 @@ ; CHECK: @weak1 = weak alias void ()* @bar2 @bar4 = private unnamed_addr constant [2 x i8*] zeroinitializer -@foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*]* @bar4, i32 0, i32 1) -; CHECK: @foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*]* @bar4, i32 0, i32 1) +@foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1) +; CHECK: @foo4 = linkonce_odr unnamed_addr alias getelementptr inbounds ([2 x i8*], [2 x i8*]* @bar4, i32 0, i32 1) define void @bar2() { ret void diff --git a/test/Transforms/GlobalOpt/array-elem-refs.ll b/test/Transforms/GlobalOpt/array-elem-refs.ll index ec472b0..c31965b 100644 --- a/test/Transforms/GlobalOpt/array-elem-refs.ll +++ b/test/Transforms/GlobalOpt/array-elem-refs.ll @@ -4,16 +4,16 @@ target triple = "x86_64-unknown-linux-gnu" %struct.S = type { i8, i8 } -@c = internal global i8** bitcast (i8* getelementptr (i8* bitcast ([8 x i8*]* @b to i8*), i64 48) to i8**), align 8 -@b = internal global [8 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds (%struct.S* @a, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S* @a, i32 0, i32 0), i64 1)], align 16 +@c = internal global i8** bitcast (i8* getelementptr (i8, i8* bitcast ([8 x i8*]* @b to i8*), i64 48) to i8**), align 8 +@b = internal global [8 x i8*] [i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds (%struct.S, %struct.S* @a, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S, %struct.S* @a, i32 0, i32 0), i64 1)], align 16 @a = internal global %struct.S zeroinitializer, align 1 ; Function Attrs: nounwind uwtable define signext i8 @foo() #0 { entry: - %0 = load i8*** @c, align 8 - %1 = load i8** %0, align 8 - %2 = load i8* %1, align 1 + %0 = load i8**, i8*** @c, align 8 + %1 = load i8*, i8** %0, align 8 + %2 = load i8, i8* %1, align 1 ret i8 %2 ; CHECK-LABEL: @foo diff --git a/test/Transforms/GlobalOpt/atomic.ll b/test/Transforms/GlobalOpt/atomic.ll index ac05bfd..563c1fe 100644 --- a/test/Transforms/GlobalOpt/atomic.ll +++ b/test/Transforms/GlobalOpt/atomic.ll @@ -8,7 +8,7 @@ define void @test1() { entry: - %0 = load atomic i8* bitcast (i64* @GV1 to i8*) acquire, align 8 + %0 = load atomic i8, i8* bitcast (i64* @GV1 to i8*) acquire, align 8 ret void } @@ -20,6 +20,6 @@ entry: } define i32 @test2b() { entry: - %atomic-load = load atomic i32* @GV2 seq_cst, align 4 + %atomic-load = load atomic i32, i32* @GV2 seq_cst, align 4 ret i32 %atomic-load } diff --git a/test/Transforms/GlobalOpt/basictest.ll b/test/Transforms/GlobalOpt/basictest.ll index 4332d3d..4c25e4f 100644 --- a/test/Transforms/GlobalOpt/basictest.ll +++ b/test/Transforms/GlobalOpt/basictest.ll @@ -3,7 +3,7 @@ @X = internal global i32 4 ; <i32*> [#uses=1] define i32 @foo() { - %V = load i32* @X ; <i32> [#uses=1] + %V = load i32, i32* @X ; <i32> [#uses=1] ret i32 %V } diff --git a/test/Transforms/GlobalOpt/constantfold-initializers.ll b/test/Transforms/GlobalOpt/constantfold-initializers.ll index 36de19c..d0c1881 100644 --- a/test/Transforms/GlobalOpt/constantfold-initializers.ll +++ b/test/Transforms/GlobalOpt/constantfold-initializers.ll @@ -5,7 +5,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 @.str91250 = global [3 x i8] zeroinitializer ; CHECK: @A = global i1 false -@A = global i1 icmp ne (i64 sub nsw (i64 ptrtoint (i8* getelementptr inbounds ([3 x i8]* @.str91250, i64 0, i64 1) to i64), i64 ptrtoint ([3 x i8]* @.str91250 to i64)), i64 1) +@A = global i1 icmp ne (i64 sub nsw (i64 ptrtoint (i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str91250, i64 0, i64 1) to i64), i64 ptrtoint ([3 x i8]* @.str91250 to i64)), i64 1) ; PR11352 @@ -15,13 +15,13 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; PR12642 %PR12642.struct = type { i8 } @PR12642.s = global <{}> zeroinitializer, align 1 -@PR12642.p = constant %PR12642.struct* bitcast (i8* getelementptr (i8* bitcast (<{}>* @PR12642.s to i8*), i64 1) to %PR12642.struct*), align 8 +@PR12642.p = constant %PR12642.struct* bitcast (i8* getelementptr (i8, i8* bitcast (<{}>* @PR12642.s to i8*), i64 1) to %PR12642.struct*), align 8 define internal void @test1() { entry: - store i32 1, i32* getelementptr inbounds ([2 x i32]* @xs, i64 0, i64 0) - %0 = load i32* getelementptr inbounds ([2 x i32]* @xs, i32 0, i64 0), align 4 - store i32 %0, i32* getelementptr inbounds ([2 x i32]* @xs, i64 0, i64 1) + store i32 1, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @xs, i64 0, i64 0) + %0 = load i32, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @xs, i32 0, i64 0), align 4 + store i32 %0, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @xs, i64 0, i64 1) ret void } @@ -36,15 +36,15 @@ entry: define internal i32 @test2_helper(%closure* %this, i32 %b) { entry: - %0 = getelementptr inbounds %closure* %this, i32 0, i32 0 - %1 = load i32* %0, align 4 + %0 = getelementptr inbounds %closure, %closure* %this, i32 0, i32 0 + %1 = load i32, i32* %0, align 4 %add = add nsw i32 %1, %b ret i32 %add } define internal void @test2() { entry: - store i32 4, i32* getelementptr inbounds (%closure* @f, i32 0, i32 0) + store i32 4, i32* getelementptr inbounds (%closure, %closure* @f, i32 0, i32 0) %call = call i32 @test2_helper(%closure* @f, i32 9) store i32 %call, i32* @m, align 4 ret void @@ -85,7 +85,7 @@ entry: @test6_v2 = global i32 0, align 4 ; CHECK: @test6_v2 = global i32 42, align 4 define internal void @test6() { - %load = load { i32, i32 }* @test6_v1, align 8 + %load = load { i32, i32 }, { i32, i32 }* @test6_v1, align 8 %xv0 = extractvalue { i32, i32 } %load, 0 %iv = insertvalue { i32, i32 } %load, i32 %xv0, 1 %xv1 = extractvalue { i32, i32 } %iv, 1 diff --git a/test/Transforms/GlobalOpt/crash-2.ll b/test/Transforms/GlobalOpt/crash-2.ll index 684f6ce..748fb02 100644 --- a/test/Transforms/GlobalOpt/crash-2.ll +++ b/test/Transforms/GlobalOpt/crash-2.ll @@ -11,9 +11,9 @@ @g_71 = internal global %struct.S0.1.7.13 { i8 1, i8 -93, i8 58, i8 -1, i16 -5, [2 x i8] undef }, align 4 @g_114 = external global i8, align 1 @g_30 = external global { i32, i8, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, align 4 -@g_271 = internal global [7 x [6 x [5 x i8*]]] [[6 x [5 x i8*]] [[5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null, i8* null], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* @g_25, i8* null, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* @g_114, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25], [5 x i8*] [i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* @g_25, i8* @g_25], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* null, i8* @g_25, i8* @g_25, i8* @g_25, i8* null], [5 x i8*] [i8* @g_25, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* null, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* null, i8* @g_25], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null], [5 x i8*] [i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null, i8* @g_25], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25], [5 x i8*] [i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_114, i8* @g_25, i8* @g_25, i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* @g_25, i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_114], [5 x i8*] [i8* @g_25, i8* null, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* null], [5 x i8*] [i8* @g_114, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* @g_25]], [6 x [5 x i8*]] [[5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* @g_114, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25]], [6 x [5 x i8*]] [[5 x i8*] [i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* @g_25, i8* @g_25, i8* @g_114], [5 x i8*] [i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25], [5 x i8*] [i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* @g_25, i8* getelementptr (i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25]]], align 4 +@g_271 = internal global [7 x [6 x [5 x i8*]]] [[6 x [5 x i8*]] [[5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null, i8* null], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* @g_25, i8* null, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* @g_114, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25], [5 x i8*] [i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* @g_25, i8* @g_25], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* null, i8* @g_25, i8* @g_25, i8* @g_25, i8* null], [5 x i8*] [i8* @g_25, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* null, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* null, i8* @g_25], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null], [5 x i8*] [i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null, i8* @g_25], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25], [5 x i8*] [i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_114, i8* @g_25, i8* @g_25, i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)]], [6 x [5 x i8*]] [[5 x i8*] [i8* @g_25, i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_114], [5 x i8*] [i8* @g_25, i8* null, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* null], [5 x i8*] [i8* @g_114, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* @g_25]], [6 x [5 x i8*]] [[5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* @g_114, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0)], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25]], [6 x [5 x i8*]] [[5 x i8*] [i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* null], [5 x i8*] [i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* @g_25, i8* @g_25, i8* @g_114], [5 x i8*] [i8* null, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_25, i8* null, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_114, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* @g_114, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1)], [5 x i8*] [i8* @g_25, i8* @g_25, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25], [5 x i8*] [i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25, i8* @g_25, i8* getelementptr (i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), i64 1), i8* @g_25]]], align 4 define i32 @func() { - %tmp = load i8* getelementptr inbounds (%struct.S0.1.7.13* @g_71, i32 0, i32 0), align 1 + %tmp = load i8, i8* getelementptr inbounds (%struct.S0.1.7.13, %struct.S0.1.7.13* @g_71, i32 0, i32 0), align 1 ret i32 0 } diff --git a/test/Transforms/GlobalOpt/crash.ll b/test/Transforms/GlobalOpt/crash.ll index 80c777c..8e39931 100644 --- a/test/Transforms/GlobalOpt/crash.ll +++ b/test/Transforms/GlobalOpt/crash.ll @@ -11,7 +11,7 @@ target triple = "i386-apple-darwin9.8" define internal void @_GLOBAL__I__ZN21btConeTwistConstraintC2Ev() nounwind section "__TEXT,__StaticInit,regular,pure_instructions" { entry: - store float 1.0, float* getelementptr inbounds (%struct.btSimdScalar* @_ZL6vTwist, i32 0, i32 0, i32 0, i32 3), align 4 + store float 1.0, float* getelementptr inbounds (%struct.btSimdScalar, %struct.btSimdScalar* @_ZL6vTwist, i32 0, i32 0, i32 0, i32 3), align 4 ret void } @@ -31,11 +31,11 @@ entry: unreachable bb.nph.i: - %scevgep.i539 = getelementptr i8* %C, i64 4 + %scevgep.i539 = getelementptr i8, i8* %C, i64 4 unreachable xx: - %E = load %T** @switch_inf, align 8 + %E = load %T*, %T** @switch_inf, align 8 unreachable } @@ -46,7 +46,7 @@ declare noalias i8* @malloc(i64) nounwind @permute_bitrev.bitrev = internal global i32* null, align 8 define void @permute_bitrev() nounwind { entry: - %tmp = load i32** @permute_bitrev.bitrev, align 8 + %tmp = load i32*, i32** @permute_bitrev.bitrev, align 8 %conv = sext i32 0 to i64 %mul = mul i64 %conv, 4 %call = call i8* @malloc(i64 %mul) @@ -60,7 +60,7 @@ entry: @data8 = internal global [8000 x i8] zeroinitializer, align 16 define void @memset_with_strange_user() ssp { - call void @llvm.memset.p0i8.i64(i8* getelementptr inbounds ([8000 x i8]* @data8, i64 0, i64 0), i8 undef, i64 ptrtoint (i8* getelementptr ([8000 x i8]* @data8, i64 1, i64 sub (i64 0, i64 ptrtoint ([8000 x i8]* @data8 to i64))) to i64), i32 16, i1 false) + call void @llvm.memset.p0i8.i64(i8* getelementptr inbounds ([8000 x i8], [8000 x i8]* @data8, i64 0, i64 0), i8 undef, i64 ptrtoint (i8* getelementptr ([8000 x i8], [8000 x i8]* @data8, i64 1, i64 sub (i64 0, i64 ptrtoint ([8000 x i8]* @data8 to i64))) to i64), i32 16, i1 false) ret void } declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind @@ -72,7 +72,7 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind define void @icmp_user_of_stored_once() nounwind ssp { entry: - %tmp4 = load i32*** @g_52, align 8 + %tmp4 = load i32**, i32*** @g_52, align 8 store i32** @g_90, i32*** @g_52 %cmp17 = icmp ne i32*** undef, @g_52 ret void diff --git a/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll b/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll index dd86f01..0c3ff68 100644 --- a/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll +++ b/test/Transforms/GlobalOpt/ctor-list-opt-constexpr.ll @@ -16,7 +16,7 @@ target triple = "x86_64-apple-darwin10.0.0" ; arbitrary constant expression, the code generator can't handle it. define internal void @init1() { entry: - %tmp = getelementptr inbounds %struct.foo* @X, i32 0, i32 0 + %tmp = getelementptr inbounds %struct.foo, %struct.foo* @X, i32 0, i32 0 store i32* inttoptr (i64 sdiv (i64 ptrtoint (i32* @G to i64), i64 ptrtoint (i32* @H to i64)) to i32*), i32** %tmp, align 8 ret void } @@ -26,7 +26,7 @@ entry: ; PR11705 - ptrtoint isn't safe in general in global initializers. define internal void @init2() { entry: - %tmp = getelementptr inbounds %struct.bar* @X2, i32 0, i32 0 + %tmp = getelementptr inbounds %struct.bar, %struct.bar* @X2, i32 0, i32 0 store i128 ptrtoint (i32* @G to i128), i128* %tmp, align 16 ret void } diff --git a/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll b/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll index 9b11985..63dc783 100644 --- a/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll +++ b/test/Transforms/GlobalOpt/ctor-list-opt-inbounds.ll @@ -13,11 +13,11 @@ @I = global i32 90 define internal void @CTOR() { - store i32 1, i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) - store i32 2, i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) - %t = load i32* getelementptr ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 1, i32* getelementptr ([6 x [5 x i32]], [6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + store i32 2, i32* getelementptr inbounds ([6 x [5 x i32]], [6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + %t = load i32, i32* getelementptr ([6 x [5 x i32]], [6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) store i32 %t, i32* @H - %s = load i32* getelementptr inbounds ([6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) + %s = load i32, i32* getelementptr inbounds ([6 x [5 x i32]], [6 x [5 x i32]]* @G, i64 0, i64 0, i64 0) store i32 %s, i32* @I ret void } diff --git a/test/Transforms/GlobalOpt/ctor-list-opt.ll b/test/Transforms/GlobalOpt/ctor-list-opt.ll index 450bdb8..95e7d4d 100644 --- a/test/Transforms/GlobalOpt/ctor-list-opt.ll +++ b/test/Transforms/GlobalOpt/ctor-list-opt.ll @@ -51,16 +51,16 @@ T: ; preds = %Cont } define internal void @CTOR4() { - %X = load i32* @G3 ; <i32> [#uses=1] + %X = load i32, i32* @G3 ; <i32> [#uses=1] %Y = add i32 %X, 123 ; <i32> [#uses=1] store i32 %Y, i32* @G3 ret void } define internal void @CTOR5() { - %X.2p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2] - %X.2 = load i32* %X.2p ; <i32> [#uses=1] - %X.1p = getelementptr inbounds { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1] + %X.2p = getelementptr inbounds { i32, [2 x i32] }, { i32, [2 x i32] }* @X, i32 0, i32 1, i32 0 ; <i32*> [#uses=2] + %X.2 = load i32, i32* %X.2p ; <i32> [#uses=1] + %X.1p = getelementptr inbounds { i32, [2 x i32] }, { i32, [2 x i32] }* @X, i32 0, i32 0 ; <i32*> [#uses=1] store i32 %X.2, i32* %X.1p store i32 42, i32* %X.2p ret void @@ -68,9 +68,9 @@ define internal void @CTOR5() { define internal void @CTOR6() { %A = alloca i32 ; <i32*> [#uses=2] - %y = load i32* @Y ; <i32> [#uses=1] + %y = load i32, i32* @Y ; <i32> [#uses=1] store i32 %y, i32* %A - %Av = load i32* %A ; <i32> [#uses=1] + %Av = load i32, i32* %A ; <i32> [#uses=1] %Av1 = add i32 %Av, 1 ; <i32> [#uses=1] store i32 %Av1, i32* @Y ret void @@ -95,7 +95,7 @@ define internal void @CTOR8() { } define i1 @accessor() { - %V = load i1* @CTORGV ; <i1> [#uses=1] + %V = load i1, i1* @CTORGV ; <i1> [#uses=1] ret i1 %V } @@ -107,9 +107,9 @@ define i1 @accessor() { define internal void @CTOR9() { entry: %0 = bitcast %struct.B* @GV1 to i8* - %1 = getelementptr inbounds i8* %0, i64 16 + %1 = getelementptr inbounds i8, i8* %0, i64 16 %2 = bitcast i8* %1 to %struct.A* %3 = bitcast %struct.B* @GV1 to i8*** - store i8** getelementptr inbounds ([3 x i8*]* @GV2, i64 1, i64 0), i8*** %3 + store i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @GV2, i64 1, i64 0), i8*** %3 ret void } diff --git a/test/Transforms/GlobalOpt/cxx-dtor.ll b/test/Transforms/GlobalOpt/cxx-dtor.ll index 7c6ae78..c94c26b 100644 --- a/test/Transforms/GlobalOpt/cxx-dtor.ll +++ b/test/Transforms/GlobalOpt/cxx-dtor.ll @@ -11,7 +11,7 @@ ; CHECK-NOT: call i32 @__cxa_atexit define internal void @__cxx_global_var_init() nounwind section "__TEXT,__StaticInit,regular,pure_instructions" { - %1 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1AD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A* @a, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*)) + %1 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.A*)* @_ZN1AD1Ev to void (i8*)*), i8* getelementptr inbounds (%struct.A, %struct.A* @a, i32 0, i32 0), i8* bitcast (i8** @__dso_handle to i8*)) ret void } diff --git a/test/Transforms/GlobalOpt/deadfunction.ll b/test/Transforms/GlobalOpt/deadfunction.ll index 5e003c6..5771c4c 100644 --- a/test/Transforms/GlobalOpt/deadfunction.ll +++ b/test/Transforms/GlobalOpt/deadfunction.ll @@ -10,8 +10,8 @@ declare void @bb() define internal void @test(i32 %n) nounwind noinline { entry: %idxprom = sext i32 %n to i64 - %arrayidx = getelementptr inbounds [3 x i8*]* @test.x, i64 0, i64 %idxprom - %0 = load i8** %arrayidx, align 8 + %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @test.x, i64 0, i64 %idxprom + %0 = load i8*, i8** %arrayidx, align 8 indirectbr i8* %0, [label %a, label %b, label %c] a: diff --git a/test/Transforms/GlobalOpt/deadglobal-2.ll b/test/Transforms/GlobalOpt/deadglobal-2.ll index 4f81819..6b8717e 100644 --- a/test/Transforms/GlobalOpt/deadglobal-2.ll +++ b/test/Transforms/GlobalOpt/deadglobal-2.ll @@ -5,7 +5,7 @@ @G = internal global [4 x i32] zeroinitializer define void @foo(i32 %X) { - %Ptr = getelementptr [4 x i32]* @G, i32 0, i32 %X + %Ptr = getelementptr [4 x i32], [4 x i32]* @G, i32 0, i32 %X store i32 1, i32* %Ptr ret void } diff --git a/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll b/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll index 675211b..2e22ff0 100644 --- a/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll +++ b/test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll @@ -7,14 +7,14 @@ @_ZL14buttonInitData = internal global [1 x %struct.ButtonInitData] zeroinitializer, align 4 @"\01L_OBJC_METH_VAR_NAME_40" = internal global [7 x i8] c"print:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 -@"\01L_OBJC_SELECTOR_REFERENCES_41" = internal externally_initialized global i8* getelementptr inbounds ([7 x i8]* @"\01L_OBJC_METH_VAR_NAME_40", i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" +@"\01L_OBJC_SELECTOR_REFERENCES_41" = internal externally_initialized global i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_METH_VAR_NAME_40", i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] -@llvm.used = appending global [2 x i8*] [i8* getelementptr inbounds ([7 x i8]* @"\01L_OBJC_METH_VAR_NAME_40", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_41" to i8*)] +@llvm.used = appending global [2 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_METH_VAR_NAME_40", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_41" to i8*)] define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { - %1 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_41", !invariant.load !2009 - store i8* %1, i8** getelementptr inbounds ([1 x %struct.ButtonInitData]* @_ZL14buttonInitData, i32 0, i32 0, i32 0), align 4 + %1 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_41", !invariant.load !2009 + store i8* %1, i8** getelementptr inbounds ([1 x %struct.ButtonInitData], [1 x %struct.ButtonInitData]* @_ZL14buttonInitData, i32 0, i32 0, i32 0), align 4 ret void } @@ -26,8 +26,8 @@ define internal void @_GLOBAL__I_a() section "__TEXT,__StaticInit,regular,pure_i declare void @test(i8*) define void @print() { -; CHECK: %1 = load i8** getelementptr inbounds ([1 x %struct.ButtonInitData]* @_ZL14buttonInitData, i32 0, i32 0, i32 0), align 4 - %1 = load i8** getelementptr inbounds ([1 x %struct.ButtonInitData]* @_ZL14buttonInitData, i32 0, i32 0, i32 0), align 4 +; CHECK: %1 = load i8*, i8** @_ZL14buttonInitData.0.0, align 4 + %1 = load i8*, i8** getelementptr inbounds ([1 x %struct.ButtonInitData], [1 x %struct.ButtonInitData]* @_ZL14buttonInitData, i32 0, i32 0, i32 0), align 4 call void @test(i8* %1) ret void } diff --git a/test/Transforms/GlobalOpt/fastcc.ll b/test/Transforms/GlobalOpt/fastcc.ll index 76122b2..26398d2 100644 --- a/test/Transforms/GlobalOpt/fastcc.ll +++ b/test/Transforms/GlobalOpt/fastcc.ll @@ -2,13 +2,13 @@ define internal i32 @f(i32* %m) { ; CHECK-LABEL: define internal fastcc i32 @f - %v = load i32* %m + %v = load i32, i32* %m ret i32 %v } define internal x86_thiscallcc i32 @g(i32* %m) { ; CHECK-LABEL: define internal fastcc i32 @g - %v = load i32* %m + %v = load i32, i32* %m ret i32 %v } @@ -16,13 +16,13 @@ define internal x86_thiscallcc i32 @g(i32* %m) { ; convention. define internal coldcc i32 @h(i32* %m) { ; CHECK-LABEL: define internal coldcc i32 @h - %v = load i32* %m + %v = load i32, i32* %m ret i32 %v } define internal i32 @j(i32* %m) { ; CHECK-LABEL: define internal i32 @j - %v = load i32* %m + %v = load i32, i32* %m ret i32 %v } diff --git a/test/Transforms/GlobalOpt/globalsra-partial.ll b/test/Transforms/GlobalOpt/globalsra-partial.ll index 06485b5..9abcce6 100644 --- a/test/Transforms/GlobalOpt/globalsra-partial.ll +++ b/test/Transforms/GlobalOpt/globalsra-partial.ll @@ -6,19 +6,19 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 @G = internal global { i32, [4 x float] } zeroinitializer ; <{ i32, [4 x float] }*> [#uses=3] define void @onlystore() { - store i32 12345, i32* getelementptr ({ i32, [4 x float] }* @G, i32 0, i32 0) + store i32 12345, i32* getelementptr ({ i32, [4 x float] }, { i32, [4 x float] }* @G, i32 0, i32 0) ret void } define void @storeinit(i32 %i) { - %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1] + %Ptr = getelementptr { i32, [4 x float] }, { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1] store float 1.000000e+00, float* %Ptr ret void } define float @readval(i32 %i) { - %Ptr = getelementptr { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1] - %V = load float* %Ptr ; <float> [#uses=1] + %Ptr = getelementptr { i32, [4 x float] }, { i32, [4 x float] }* @G, i32 0, i32 1, i32 %i ; <float*> [#uses=1] + %V = load float, float* %Ptr ; <float> [#uses=1] ret float %V } diff --git a/test/Transforms/GlobalOpt/globalsra-unknown-index.ll b/test/Transforms/GlobalOpt/globalsra-unknown-index.ll index cc655e9..5194b2c 100644 --- a/test/Transforms/GlobalOpt/globalsra-unknown-index.ll +++ b/test/Transforms/GlobalOpt/globalsra-unknown-index.ll @@ -12,30 +12,30 @@ @addr = external global i8 define void @frob() { - store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 ptrtoint (i8* @addr to i64)), align 4 + store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 ptrtoint (i8* @addr to i64)), align 4 ret void } define i32 @borf(i64 %i, i64 %j) { - %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0 - %a = load i32* %p - %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0 - %b = load i32* %q + %p = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0 + %a = load i32, i32* %p + %q = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0 + %b = load i32, i32* %q %c = add i32 %a, %b ret i32 %c } define i32 @borg(i64 %i, i64 %j) { - %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1 - %a = load i32* %p - %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1 - %b = load i32* %q + %p = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1 + %a = load i32, i32* %p + %q = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1 + %b = load i32, i32* %q %c = add i32 %a, %b ret i32 %c } define i32 @borh(i64 %i, i64 %j) { - %p = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2 - %a = load i32* %p - %q = getelementptr inbounds [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2 - %b = load i32* %q + %p = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2 + %a = load i32, i32* %p + %q = getelementptr inbounds [3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2 + %b = load i32, i32* %q %c = add i32 %a, %b ret i32 %c } diff --git a/test/Transforms/GlobalOpt/globalsra.ll b/test/Transforms/GlobalOpt/globalsra.ll index 6d8f220..d593fcd 100644 --- a/test/Transforms/GlobalOpt/globalsra.ll +++ b/test/Transforms/GlobalOpt/globalsra.ll @@ -7,18 +7,18 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1 { double } { double 1.727000e+01 } } ; <{ i32, float, { double } }*> [#uses=3] define void @onlystore() { - store i32 123, i32* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 0) + store i32 123, i32* getelementptr ({ i32, float, { double } }, { i32, float, { double } }* @G, i32 0, i32 0) ret void } define float @storeinit() { - store float 1.000000e+00, float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1) - %X = load float* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 1) ; <float> [#uses=1] + store float 1.000000e+00, float* getelementptr ({ i32, float, { double } }, { i32, float, { double } }* @G, i32 0, i32 1) + %X = load float, float* getelementptr ({ i32, float, { double } }, { i32, float, { double } }* @G, i32 0, i32 1) ; <float> [#uses=1] ret float %X } define double @constantize() { - %X = load double* getelementptr ({ i32, float, { double } }* @G, i32 0, i32 2, i32 0) ; <double> [#uses=1] + %X = load double, double* getelementptr ({ i32, float, { double } }, { i32, float, { double } }* @G, i32 0, i32 2, i32 0) ; <double> [#uses=1] ret double %X } diff --git a/test/Transforms/GlobalOpt/heap-sra-1.ll b/test/Transforms/GlobalOpt/heap-sra-1.ll index 9d5148f..6035eaa 100644 --- a/test/Transforms/GlobalOpt/heap-sra-1.ll +++ b/test/Transforms/GlobalOpt/heap-sra-1.ll @@ -19,14 +19,14 @@ declare noalias i8* @malloc(i64) define i32 @baz() nounwind readonly noinline { bb1.thread: - %0 = load %struct.foo** @X, align 4 + %0 = load %struct.foo*, %struct.foo** @X, align 4 br label %bb1 bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] %sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ] - %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 - %2 = load i32* %1, align 4 + %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 + %2 = load i32, i32* %1, align 4 %3 = add i32 %2, %sum.0.reg2mem.0 %indvar.next = add i32 %i.0.reg2mem.0, 1 %exitcond = icmp eq i32 %indvar.next, 1200 diff --git a/test/Transforms/GlobalOpt/heap-sra-2.ll b/test/Transforms/GlobalOpt/heap-sra-2.ll index fa8c362..d66c627 100644 --- a/test/Transforms/GlobalOpt/heap-sra-2.ll +++ b/test/Transforms/GlobalOpt/heap-sra-2.ll @@ -10,7 +10,7 @@ define void @bar(i32 %Size) nounwind noinline { entry: %malloccall = tail call i8* @malloc(i64 8000000) ; <i8*> [#uses=1] %0 = bitcast i8* %malloccall to [1000000 x %struct.foo]* ; <[1000000 x %struct.foo]*> [#uses=1] - %.sub = getelementptr [1000000 x %struct.foo]* %0, i32 0, i32 0 ; <%struct.foo*> [#uses=1] + %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %0, i32 0, i32 0 ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } @@ -19,14 +19,14 @@ declare noalias i8* @malloc(i64) define i32 @baz() nounwind readonly noinline { bb1.thread: - %0 = load %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] + %0 = load %struct.foo*, %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] br label %bb1 bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] ; <i32> [#uses=2] %sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ] ; <i32> [#uses=1] - %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1] - %2 = load i32* %1, align 4 ; <i32> [#uses=1] + %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1] + %2 = load i32, i32* %1, align 4 ; <i32> [#uses=1] %3 = add i32 %2, %sum.0.reg2mem.0 ; <i32> [#uses=2] %indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] %exitcond = icmp eq i32 %indvar.next, 1200 ; <i1> [#uses=1] diff --git a/test/Transforms/GlobalOpt/heap-sra-3.ll b/test/Transforms/GlobalOpt/heap-sra-3.ll index e7a877c..6a34364 100644 --- a/test/Transforms/GlobalOpt/heap-sra-3.ll +++ b/test/Transforms/GlobalOpt/heap-sra-3.ll @@ -20,14 +20,14 @@ declare noalias i8* @malloc(i64) define i32 @baz() nounwind readonly noinline { bb1.thread: - %0 = load %struct.foo** @X, align 4 + %0 = load %struct.foo*, %struct.foo** @X, align 4 br label %bb1 bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] %sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ] - %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 - %2 = load i32* %1, align 4 + %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 + %2 = load i32, i32* %1, align 4 %3 = add i32 %2, %sum.0.reg2mem.0 %indvar.next = add i32 %i.0.reg2mem.0, 1 %exitcond = icmp eq i32 %indvar.next, 1200 diff --git a/test/Transforms/GlobalOpt/heap-sra-4.ll b/test/Transforms/GlobalOpt/heap-sra-4.ll index d5a5828..2176b9f 100644 --- a/test/Transforms/GlobalOpt/heap-sra-4.ll +++ b/test/Transforms/GlobalOpt/heap-sra-4.ll @@ -20,14 +20,14 @@ declare noalias i8* @malloc(i64) define i32 @baz() nounwind readonly noinline { bb1.thread: - %0 = load %struct.foo** @X, align 4 + %0 = load %struct.foo*, %struct.foo** @X, align 4 br label %bb1 bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] %sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %3, %bb1 ] - %1 = getelementptr %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 - %2 = load i32* %1, align 4 + %1 = getelementptr %struct.foo, %struct.foo* %0, i32 %i.0.reg2mem.0, i32 0 + %2 = load i32, i32* %1, align 4 %3 = add i32 %2, %sum.0.reg2mem.0 %indvar.next = add i32 %i.0.reg2mem.0, 1 %exitcond = icmp eq i32 %indvar.next, 1200 diff --git a/test/Transforms/GlobalOpt/heap-sra-phi.ll b/test/Transforms/GlobalOpt/heap-sra-phi.ll index 123ad85..bf9ca7b 100644 --- a/test/Transforms/GlobalOpt/heap-sra-phi.ll +++ b/test/Transforms/GlobalOpt/heap-sra-phi.ll @@ -9,7 +9,7 @@ define void @bar(i32 %Size) nounwind noinline { entry: %malloccall = tail call i8* @malloc(i64 8000000) ; <i8*> [#uses=1] %tmp = bitcast i8* %malloccall to [1000000 x %struct.foo]* ; <[1000000 x %struct.foo]*> [#uses=1] - %.sub = getelementptr [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1] + %.sub = getelementptr [1000000 x %struct.foo], [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } @@ -18,22 +18,22 @@ declare noalias i8* @malloc(i64) define i32 @baz() nounwind readonly noinline { bb1.thread: - %tmpLD1 = load %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] + %tmpLD1 = load %struct.foo*, %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] br label %bb1 bb1: ; preds = %bb1, %bb1.thread %tmp = phi %struct.foo* [%tmpLD1, %bb1.thread ], [ %tmpLD2, %bb1 ] ; <i32> [#uses=2] %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %indvar.next, %bb1 ] ; <i32> [#uses=2] %sum.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %tmp3, %bb1 ] ; <i32> [#uses=1] - %tmp1 = getelementptr %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1] - %tmp2 = load i32* %tmp1, align 4 ; <i32> [#uses=1] + %tmp1 = getelementptr %struct.foo, %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 0 ; <i32*> [#uses=1] + %tmp2 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1] %tmp6 = add i32 %tmp2, %sum.0.reg2mem.0 ; <i32> [#uses=2] - %tmp4 = getelementptr %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 1 ; <i32*> [#uses=1] - %tmp5 = load i32 * %tmp4 + %tmp4 = getelementptr %struct.foo, %struct.foo* %tmp, i32 %i.0.reg2mem.0, i32 1 ; <i32*> [#uses=1] + %tmp5 = load i32 , i32 * %tmp4 %tmp3 = add i32 %tmp5, %tmp6 %indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] - %tmpLD2 = load %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] + %tmpLD2 = load %struct.foo*, %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] %exitcond = icmp eq i32 %indvar.next, 1200 ; <i1> [#uses=1] br i1 %exitcond, label %bb2, label %bb1 diff --git a/test/Transforms/GlobalOpt/integer-bool.ll b/test/Transforms/GlobalOpt/integer-bool.ll index abf5fdd..617febd 100644 --- a/test/Transforms/GlobalOpt/integer-bool.ll +++ b/test/Transforms/GlobalOpt/integer-bool.ll @@ -20,7 +20,7 @@ define void @set2() { define i1 @get() { ; CHECK-LABEL: @get( - %A = load i32 addrspace(1) * @G + %A = load i32, i32 addrspace(1) * @G %C = icmp slt i32 %A, 2 ret i1 %C ; CHECK: ret i1 true diff --git a/test/Transforms/GlobalOpt/iterate.ll b/test/Transforms/GlobalOpt/iterate.ll index 7466874..f7f34fc 100644 --- a/test/Transforms/GlobalOpt/iterate.ll +++ b/test/Transforms/GlobalOpt/iterate.ll @@ -4,8 +4,8 @@ @H = internal global { i32* } { i32* @G } ; <{ i32* }*> [#uses=1] define i32 @loadg() { - %G = load i32** getelementptr ({ i32* }* @H, i32 0, i32 0) ; <i32*> [#uses=1] - %GV = load i32* %G ; <i32> [#uses=1] + %G = load i32*, i32** getelementptr ({ i32* }, { i32* }* @H, i32 0, i32 0) ; <i32*> [#uses=1] + %GV = load i32, i32* %G ; <i32> [#uses=1] ret i32 %GV } diff --git a/test/Transforms/GlobalOpt/load-store-global.ll b/test/Transforms/GlobalOpt/load-store-global.ll index ad7326d..e01358e 100644 --- a/test/Transforms/GlobalOpt/load-store-global.ll +++ b/test/Transforms/GlobalOpt/load-store-global.ll @@ -4,7 +4,7 @@ ; CHECK-NOT: @G define void @foo() { - %V = load i32* @G ; <i32> [#uses=1] + %V = load i32, i32* @G ; <i32> [#uses=1] store i32 %V, i32* @G ret void ; CHECK-LABEL: @foo( @@ -12,7 +12,7 @@ define void @foo() { } define i32 @bar() { - %X = load i32* @G ; <i32> [#uses=1] + %X = load i32, i32* @G ; <i32> [#uses=1] ret i32 %X ; CHECK-LABEL: @bar( ; CHECK-NEXT: ret i32 17 @@ -24,12 +24,12 @@ define i32 @bar() { ; PR13968 define void @qux() nounwind { %b = bitcast i64** @a to i8* - %g = getelementptr i64** @a, i32 1 + %g = getelementptr i64*, i64** @a, i32 1 %cmp = icmp ne i8* null, %b %cmp2 = icmp eq i8* null, %b %cmp3 = icmp eq i64** null, %g store i64* inttoptr (i64 1 to i64*), i64** @a, align 8 - %l = load i64** @a, align 8 + %l = load i64*, i64** @a, align 8 ret void ; CHECK-LABEL: @qux( ; CHECK-NOT: store diff --git a/test/Transforms/GlobalOpt/malloc-promote-1.ll b/test/Transforms/GlobalOpt/malloc-promote-1.ll index 51ccbbd..d5087de 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-1.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-1.ll @@ -8,7 +8,7 @@ define void @init() { %malloccall = tail call i8* @malloc(i64 4) ; <i8*> [#uses=1] %P = bitcast i8* %malloccall to i32* ; <i32*> [#uses=1] store i32* %P, i32** @G - %GV = load i32** @G ; <i32*> [#uses=1] + %GV = load i32*, i32** @G ; <i32*> [#uses=1] store i32 0, i32* %GV ret void } @@ -16,8 +16,8 @@ define void @init() { declare noalias i8* @malloc(i64) define i32 @get() { - %GV = load i32** @G ; <i32*> [#uses=1] - %V = load i32* %GV ; <i32> [#uses=1] + %GV = load i32*, i32** @G ; <i32*> [#uses=1] + %V = load i32, i32* %GV ; <i32> [#uses=1] ret i32 %V ; CHECK: ret i32 0 } diff --git a/test/Transforms/GlobalOpt/malloc-promote-2.ll b/test/Transforms/GlobalOpt/malloc-promote-2.ll index 6cb4481..335ed82 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-2.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-2.ll @@ -10,8 +10,8 @@ define void @t() { %malloccall = tail call i8* @malloc(i64 mul (i64 100, i64 4)) %P = bitcast i8* %malloccall to i32* store i32* %P, i32** @G - %GV = load i32** @G - %GVe = getelementptr i32* %GV, i32 40 + %GV = load i32*, i32** @G + %GVe = getelementptr i32, i32* %GV, i32 40 store i32 20, i32* %GVe ret void } diff --git a/test/Transforms/GlobalOpt/malloc-promote-3.ll b/test/Transforms/GlobalOpt/malloc-promote-3.ll index d44ee64..1e42c3b 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-3.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-3.ll @@ -9,8 +9,8 @@ define void @t() { %malloccall = tail call i8* @malloc(i64 mul (i64 100, i64 4)) nobuiltin %P = bitcast i8* %malloccall to i32* store i32* %P, i32** @G - %GV = load i32** @G - %GVe = getelementptr i32* %GV, i32 40 + %GV = load i32*, i32** @G + %GVe = getelementptr i32, i32* %GV, i32 40 store i32 20, i32* %GVe ret void } diff --git a/test/Transforms/GlobalOpt/memcpy.ll b/test/Transforms/GlobalOpt/memcpy.ll index dcfe009..437142e 100644 --- a/test/Transforms/GlobalOpt/memcpy.ll +++ b/test/Transforms/GlobalOpt/memcpy.ll @@ -5,8 +5,8 @@ define void @foo() { %Blah = alloca [58 x i8] - %tmp.0 = getelementptr [58 x i8]* %Blah, i32 0, i32 0 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp.0, i8* getelementptr inbounds ([58 x i8]* @G1, i32 0, i32 0), i32 58, i32 1, i1 false) + %tmp.0 = getelementptr [58 x i8], [58 x i8]* %Blah, i32 0, i32 0 + call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp.0, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @G1, i32 0, i32 0), i32 58, i32 1, i1 false) ret void } diff --git a/test/Transforms/GlobalOpt/memset-null.ll b/test/Transforms/GlobalOpt/memset-null.ll index 53ec755..838ac09 100644 --- a/test/Transforms/GlobalOpt/memset-null.ll +++ b/test/Transforms/GlobalOpt/memset-null.ll @@ -23,7 +23,7 @@ entry: define internal void @_GLOBAL__I_b() nounwind { entry: - %tmp.i.i.i = load i8** @y, align 8 + %tmp.i.i.i = load i8*, i8** @y, align 8 tail call void @llvm.memset.p0i8.i64(i8* %tmp.i.i.i, i8 0, i64 10, i32 1, i1 false) nounwind ret void } diff --git a/test/Transforms/GlobalOpt/memset.ll b/test/Transforms/GlobalOpt/memset.ll index 85320b7..1dfdd64 100644 --- a/test/Transforms/GlobalOpt/memset.ll +++ b/test/Transforms/GlobalOpt/memset.ll @@ -11,7 +11,7 @@ define void @foo() { %Blah = alloca [58 x i8] %tmp3 = bitcast [58 x i8]* %Blah to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([4 x i32]* @G1 to i8*), i8* %tmp3, i32 16, i32 1, i1 false) - call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([58 x i8]* @G0, i32 0, i32 0), i8 17, i32 58, i32 1, i1 false) + call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @G0, i32 0, i32 0), i8 17, i32 58, i32 1, i1 false) ret void } @@ -22,7 +22,7 @@ define void @foo_as1() { %Blah = alloca [58 x i8] %tmp3 = bitcast [58 x i8]* %Blah to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* addrspacecast ([4 x i32] addrspace(1)* @G1_as1 to i8*), i8* %tmp3, i32 16, i32 1, i1 false) - call void @llvm.memset.p1i8.i32(i8 addrspace(1)* getelementptr inbounds ([58 x i8] addrspace(1)* @G0_as1, i32 0, i32 0), i8 17, i32 58, i32 1, i1 false) + call void @llvm.memset.p1i8.i32(i8 addrspace(1)* getelementptr inbounds ([58 x i8], [58 x i8] addrspace(1)* @G0_as1, i32 0, i32 0), i8 17, i32 58, i32 1, i1 false) ret void } diff --git a/test/Transforms/GlobalOpt/phi-select.ll b/test/Transforms/GlobalOpt/phi-select.ll index cd8a7dc..e5cb981 100644 --- a/test/Transforms/GlobalOpt/phi-select.ll +++ b/test/Transforms/GlobalOpt/phi-select.ll @@ -8,7 +8,7 @@ define i32 @test1(i1 %C) { %P = select i1 %C, i32* @X, i32* @Y ; <i32*> [#uses=1] - %V = load i32* %P ; <i32> [#uses=1] + %V = load i32, i32* %P ; <i32> [#uses=1] ret i32 %V } @@ -21,7 +21,7 @@ T: ; preds = %0 Cont: ; preds = %T, %0 %P = phi i32* [ @X, %0 ], [ @Y, %T ] ; <i32*> [#uses=1] - %V = load i32* %P ; <i32> [#uses=1] + %V = load i32, i32* %P ; <i32> [#uses=1] ret i32 %V } diff --git a/test/Transforms/GlobalOpt/storepointer-compare.ll b/test/Transforms/GlobalOpt/storepointer-compare.ll index 09e20a8..bcf7caf 100644 --- a/test/Transforms/GlobalOpt/storepointer-compare.ll +++ b/test/Transforms/GlobalOpt/storepointer-compare.ll @@ -16,7 +16,7 @@ define void @init() { } define void @doit() { - %FP = load void ()** @G ; <void ()*> [#uses=2] + %FP = load void ()*, void ()** @G ; <void ()*> [#uses=2] %CC = icmp eq void ()* %FP, null ; <i1> [#uses=1] br i1 %CC, label %isNull, label %DoCall diff --git a/test/Transforms/GlobalOpt/storepointer.ll b/test/Transforms/GlobalOpt/storepointer.ll index 8019076..9003004 100644 --- a/test/Transforms/GlobalOpt/storepointer.ll +++ b/test/Transforms/GlobalOpt/storepointer.ll @@ -12,7 +12,7 @@ define void @init() { } define void @doit() { - %FP = load void ()** @G ; <void ()*> [#uses=1] + %FP = load void ()*, void ()** @G ; <void ()*> [#uses=1] call void %FP( ) ret void } diff --git a/test/Transforms/GlobalOpt/tls.ll b/test/Transforms/GlobalOpt/tls.ll index 59ae23a..f3cb4a6 100644 --- a/test/Transforms/GlobalOpt/tls.ll +++ b/test/Transforms/GlobalOpt/tls.ll @@ -14,34 +14,34 @@ declare void @start_thread(void ()*) define i32 @f() { entry: ; Set @ip to point to x[1] for thread 1. - store i32* getelementptr inbounds ([100 x i32]* @x, i64 0, i64 1), i32** @ip, align 8 + store i32* getelementptr inbounds ([100 x i32], [100 x i32]* @x, i64 0, i64 1), i32** @ip, align 8 ; Run g on a new thread. tail call void @start_thread(void ()* @g) nounwind tail call void @wait() nounwind ; Reset x[1] for thread 1. - store i32 0, i32* getelementptr inbounds ([100 x i32]* @x, i64 0, i64 1), align 4 + store i32 0, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @x, i64 0, i64 1), align 4 ; Read the value of @ip, which now points at x[1] for thread 2. - %0 = load i32** @ip, align 8 + %0 = load i32*, i32** @ip, align 8 - %1 = load i32* %0, align 4 + %1 = load i32, i32* %0, align 4 ret i32 %1 ; CHECK-LABEL: @f( ; Make sure that the load from @ip hasn't been removed. -; CHECK: load i32** @ip +; CHECK: load i32*, i32** @ip ; CHECK: ret } define internal void @g() nounwind uwtable { entry: ; Set @ip to point to x[1] for thread 2. - store i32* getelementptr inbounds ([100 x i32]* @x, i64 0, i64 1), i32** @ip, align 8 + store i32* getelementptr inbounds ([100 x i32], [100 x i32]* @x, i64 0, i64 1), i32** @ip, align 8 ; Store 50 in x[1] for thread 2. - store i32 50, i32* getelementptr inbounds ([100 x i32]* @x, i64 0, i64 1), align 4 + store i32 50, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @x, i64 0, i64 1), align 4 tail call void @signal() nounwind ret void diff --git a/test/Transforms/GlobalOpt/trivialstore.ll b/test/Transforms/GlobalOpt/trivialstore.ll index 21437f3..f907d83 100644 --- a/test/Transforms/GlobalOpt/trivialstore.ll +++ b/test/Transforms/GlobalOpt/trivialstore.ll @@ -8,7 +8,7 @@ define void @foo() { } define i32 @bar() { - %X = load i32* @G ; <i32> [#uses=1] + %X = load i32, i32* @G ; <i32> [#uses=1] ret i32 %X } diff --git a/test/Transforms/GlobalOpt/undef-init.ll b/test/Transforms/GlobalOpt/undef-init.ll index c149497..d304821 100644 --- a/test/Transforms/GlobalOpt/undef-init.ll +++ b/test/Transforms/GlobalOpt/undef-init.ll @@ -5,7 +5,7 @@ define i32 @_Z3foov() { entry: - %tmp.1 = load i32* @X.0 ; <i32> [#uses=1] + %tmp.1 = load i32, i32* @X.0 ; <i32> [#uses=1] ret i32 %tmp.1 } diff --git a/test/Transforms/GlobalOpt/unnamed-addr.ll b/test/Transforms/GlobalOpt/unnamed-addr.ll index 2ca91e5..85ed829 100644 --- a/test/Transforms/GlobalOpt/unnamed-addr.ll +++ b/test/Transforms/GlobalOpt/unnamed-addr.ll @@ -13,7 +13,7 @@ ; CHECK: @e = linkonce_odr global i32 0 define i32 @get_e() { - %t = load i32* @e + %t = load i32, i32* @e ret i32 %t } @@ -24,10 +24,10 @@ define void @set_e(i32 %x) { define i1 @bah(i64 %i) nounwind readonly optsize ssp { entry: - %arrayidx4 = getelementptr inbounds [4 x i8]* @d, i64 0, i64 %i - %tmp5 = load i8* %arrayidx4, align 1 + %arrayidx4 = getelementptr inbounds [4 x i8], [4 x i8]* @d, i64 0, i64 %i + %tmp5 = load i8, i8* %arrayidx4, align 1 %array0 = bitcast [4 x i8]* @d to i8* - %tmp6 = load i8* %array0, align 1 + %tmp6 = load i8, i8* %array0, align 1 %cmp = icmp eq i8 %tmp5, %tmp6 ret i1 %cmp } @@ -63,6 +63,6 @@ return: define i32 @zed() { entry: - %tmp1 = load i32* @c, align 4 + %tmp1 = load i32, i32* @c, align 4 ret i32 %tmp1 } diff --git a/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll b/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll index d978723..51feb48 100644 --- a/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll +++ b/test/Transforms/GlobalOpt/zeroinitializer-gep-load.ll @@ -3,8 +3,8 @@ @zero = internal global [10 x i32] zeroinitializer define i32 @test1(i64 %idx) nounwind { - %arrayidx = getelementptr inbounds [10 x i32]* @zero, i64 0, i64 %idx - %l = load i32* %arrayidx + %arrayidx = getelementptr inbounds [10 x i32], [10 x i32]* @zero, i64 0, i64 %idx + %l = load i32, i32* %arrayidx ret i32 %l ; CHECK-LABEL: @test1( ; CHECK: ret i32 0 diff --git a/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll b/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll index 4ea0b88..61f4bf6 100644 --- a/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll +++ b/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll @@ -5,10 +5,10 @@ @mystr = internal global %struct.MYstr zeroinitializer ; <%struct.MYstr*> [#uses=3] define internal void @vfu1(%struct.MYstr* byval align 4 %u) nounwind { entry: - %0 = getelementptr %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1] + %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1] store i32 99, i32* %0, align 4 ; CHECK: %struct.MYstr* %u - %1 = getelementptr %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1] + %1 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1] store i8 97, i8* %1, align 4 ; CHECK: %struct.MYstr* %u br label %return @@ -19,12 +19,12 @@ return: ; preds = %entry define internal i32 @vfu2(%struct.MYstr* byval align 4 %u) nounwind readonly { entry: - %0 = getelementptr %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1] - %1 = load i32* %0 -; CHECK: load i32* getelementptr inbounds (%struct.MYstr* @mystr, i32 0, i32 1) - %2 = getelementptr %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1] - %3 = load i8* %2 -; CHECK: load i8* getelementptr inbounds (%struct.MYstr* @mystr, i32 0, i32 0) + %0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1] + %1 = load i32, i32* %0 +; CHECK: load i32, i32* getelementptr inbounds (%struct.MYstr, %struct.MYstr* @mystr, i32 0, i32 1) + %2 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1] + %3 = load i8, i8* %2 +; CHECK: load i8, i8* getelementptr inbounds (%struct.MYstr, %struct.MYstr* @mystr, i32 0, i32 0) %4 = zext i8 %3 to i32 %5 = add i32 %4, %1 ret i32 %5 diff --git a/test/Transforms/IPConstantProp/dangling-block-address.ll b/test/Transforms/IPConstantProp/dangling-block-address.ll index bb10133..abd0b0f 100644 --- a/test/Transforms/IPConstantProp/dangling-block-address.ll +++ b/test/Transforms/IPConstantProp/dangling-block-address.ll @@ -29,10 +29,10 @@ end: ; preds = %indirectgoto indirectgoto: ; preds = %lab0, %entry %indvar = phi i32 [ %indvar.next, %lab0 ], [ 0, %entry ] ; <i32> [#uses=2] - %pc.addr.0 = getelementptr i32* %pc, i32 %indvar ; <i32*> [#uses=1] - %tmp1.pn = load i32* %pc.addr.0 ; <i32> [#uses=1] - %indirect.goto.dest.in = getelementptr inbounds [2 x i8*]* @bar.l, i32 0, i32 %tmp1.pn ; <i8**> [#uses=1] - %indirect.goto.dest = load i8** %indirect.goto.dest.in ; <i8*> [#uses=1] + %pc.addr.0 = getelementptr i32, i32* %pc, i32 %indvar ; <i32*> [#uses=1] + %tmp1.pn = load i32, i32* %pc.addr.0 ; <i32> [#uses=1] + %indirect.goto.dest.in = getelementptr inbounds [2 x i8*], [2 x i8*]* @bar.l, i32 0, i32 %tmp1.pn ; <i8**> [#uses=1] + %indirect.goto.dest = load i8*, i8** %indirect.goto.dest.in ; <i8*> [#uses=1] indirectbr i8* %indirect.goto.dest, [label %lab0, label %end] } diff --git a/test/Transforms/IPConstantProp/global.ll b/test/Transforms/IPConstantProp/global.ll index 6715293..d3ba146 100644 --- a/test/Transforms/IPConstantProp/global.ll +++ b/test/Transforms/IPConstantProp/global.ll @@ -4,7 +4,7 @@ define void @_Z7test1f1v() nounwind { entry: - %tmp = load i32* @_ZL6test1g, align 4 + %tmp = load i32, i32* @_ZL6test1g, align 4 %cmp = icmp eq i32 %tmp, 0 br i1 %cmp, label %if.then, label %if.end @@ -21,6 +21,6 @@ if.end: ; preds = %if.then, %entry ; CHECK-NEXT: ret i32 42 define i32 @_Z7test1f2v() nounwind { entry: - %tmp = load i32* @_ZL6test1g, align 4 + %tmp = load i32, i32* @_ZL6test1g, align 4 ret i32 %tmp } diff --git a/test/Transforms/IPConstantProp/return-argument.ll b/test/Transforms/IPConstantProp/return-argument.ll index 2a14f05..927531b 100644 --- a/test/Transforms/IPConstantProp/return-argument.ll +++ b/test/Transforms/IPConstantProp/return-argument.ll @@ -4,7 +4,7 @@ ;; This function returns its second argument on all return statements define internal i32* @incdec(i1 %C, i32* %V) { - %X = load i32* %V + %X = load i32, i32* %V br i1 %C, label %T, label %F T: ; preds = %0 diff --git a/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll b/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll new file mode 100644 index 0000000..4635bb4 --- /dev/null +++ b/test/Transforms/IRCE/bug-loop-varying-upper-limit.ll @@ -0,0 +1,31 @@ +; RUN: opt -irce-print-changed-loops -S -irce -verify < %s 2>&1 | FileCheck %s + +; CHECK-NOT: constrained loop + +define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) { + entry: + %first.itr.check = icmp sgt i32 %n, 0 + br i1 %first.itr.check, label %loop, label %exit + + loop: + %idx = phi i32 [ 0, %entry ] , [ %idx.next, %in.bounds ] + %idx.next = add i32 %idx, 1 + %len = load i32, i32* %a_len_ptr, !range !0 + %abc = icmp slt i32 %idx, %len + br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 + + in.bounds: + %addr = getelementptr i32, i32* %arr, i32 %idx + store i32 0, i32* %addr + %next = icmp slt i32 %idx.next, %n + br i1 %next, label %loop, label %exit + + out.of.bounds: + ret void + + exit: + ret void +} + +!0 = !{i32 0, i32 2147483647} +!1 = !{!"branch_weights", i32 64, i32 4} diff --git a/test/Transforms/IRCE/decrementing-loop.ll b/test/Transforms/IRCE/decrementing-loop.ll index 877a2c2..6ff3e76 100644 --- a/test/Transforms/IRCE/decrementing-loop.ll +++ b/test/Transforms/IRCE/decrementing-loop.ll @@ -2,7 +2,7 @@ define void @decrementing_loop(i32 *%arr, i32 *%a_len_ptr, i32 %n) { entry: - %len = load i32* %a_len_ptr, !range !0 + %len = load i32, i32* %a_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 %start = sub i32 %n, 1 br i1 %first.itr.check, label %loop, label %exit @@ -16,7 +16,7 @@ define void @decrementing_loop(i32 *%arr, i32 *%a_len_ptr, i32 %n) { br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 in.bounds: - %addr = getelementptr i32* %arr, i32 %idx + %addr = getelementptr i32, i32* %arr, i32 %idx store i32 0, i32* %addr %next = icmp sgt i32 %idx.dec, -1 br i1 %next, label %loop, label %exit diff --git a/test/Transforms/IRCE/low-becount.ll b/test/Transforms/IRCE/low-becount.ll index 2ddaf19..89b91d6 100644 --- a/test/Transforms/IRCE/low-becount.ll +++ b/test/Transforms/IRCE/low-becount.ll @@ -4,7 +4,7 @@ define void @low_profiled_be_count(i32 *%arr, i32 *%a_len_ptr, i32 %n) { entry: - %len = load i32* %a_len_ptr, !range !0 + %len = load i32, i32* %a_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -15,7 +15,7 @@ define void @low_profiled_be_count(i32 *%arr, i32 *%a_len_ptr, i32 %n) { br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 in.bounds: - %addr = getelementptr i32* %arr, i32 %idx + %addr = getelementptr i32, i32* %arr, i32 %idx store i32 0, i32* %addr %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit, !prof !2 diff --git a/test/Transforms/IRCE/multiple-access-no-preloop.ll b/test/Transforms/IRCE/multiple-access-no-preloop.ll index 304bb4d..9963a57 100644 --- a/test/Transforms/IRCE/multiple-access-no-preloop.ll +++ b/test/Transforms/IRCE/multiple-access-no-preloop.ll @@ -4,8 +4,8 @@ define void @multiple_access_no_preloop( i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) { entry: - %len.a = load i32* %a_len_ptr, !range !0 - %len.b = load i32* %b_len_ptr, !range !0 + %len.a = load i32, i32* %a_len_ptr, !range !0 + %len.b = load i32, i32* %b_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -16,13 +16,13 @@ define void @multiple_access_no_preloop( br i1 %abc.a, label %in.bounds.a, label %out.of.bounds, !prof !1 in.bounds.a: - %addr.a = getelementptr i32* %arr_a, i32 %idx + %addr.a = getelementptr i32, i32* %arr_a, i32 %idx store i32 0, i32* %addr.a %abc.b = icmp slt i32 %idx, %len.b br i1 %abc.b, label %in.bounds.b, label %out.of.bounds, !prof !1 in.bounds.b: - %addr.b = getelementptr i32* %arr_b, i32 %idx + %addr.b = getelementptr i32, i32* %arr_b, i32 %idx store i32 -1, i32* %addr.b %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit diff --git a/test/Transforms/IRCE/not-likely-taken.ll b/test/Transforms/IRCE/not-likely-taken.ll index c044530..50a64a2 100644 --- a/test/Transforms/IRCE/not-likely-taken.ll +++ b/test/Transforms/IRCE/not-likely-taken.ll @@ -6,8 +6,8 @@ define void @multiple_access_no_preloop( i32* %arr_a, i32* %a_len_ptr, i32* %arr_b, i32* %b_len_ptr, i32 %n) { entry: - %len.a = load i32* %a_len_ptr, !range !0 - %len.b = load i32* %b_len_ptr, !range !0 + %len.a = load i32, i32* %a_len_ptr, !range !0 + %len.b = load i32, i32* %b_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -18,13 +18,13 @@ define void @multiple_access_no_preloop( br i1 %abc.a, label %in.bounds.a, label %out.of.bounds, !prof !1 in.bounds.a: - %addr.a = getelementptr i32* %arr_a, i32 %idx + %addr.a = getelementptr i32, i32* %arr_a, i32 %idx store i32 0, i32* %addr.a %abc.b = icmp slt i32 %idx, %len.b br i1 %abc.b, label %in.bounds.b, label %out.of.bounds, !prof !1 in.bounds.b: - %addr.b = getelementptr i32* %arr_b, i32 %idx + %addr.b = getelementptr i32, i32* %arr_b, i32 %idx store i32 -1, i32* %addr.b %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit diff --git a/test/Transforms/IRCE/only-lower-check.ll b/test/Transforms/IRCE/only-lower-check.ll new file mode 100644 index 0000000..69abc89 --- /dev/null +++ b/test/Transforms/IRCE/only-lower-check.ll @@ -0,0 +1,37 @@ +; RUN: opt -irce-print-range-checks -irce-print-changed-loops -irce < %s 2>&1 | FileCheck %s + +; CHECK: irce: loop has 1 inductive range checks: +; CHECK-NEXT: InductiveRangeCheck: +; CHECK-NEXT: Kind: RANGE_CHECK_LOWER +; CHECK-NEXT: Offset: (-1 + %n) Scale: -1 Length: (null) +; CHECK-NEXT: Branch: br i1 %abc, label %in.bounds, label %out.of.bounds +; CHECK-NEXT: irce: in function only_lower_check: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting> + +define void @only_lower_check(i32 *%arr, i32 *%a_len_ptr, i32 %n) { + entry: + %len = load i32, i32* %a_len_ptr, !range !0 + %first.itr.check = icmp sgt i32 %n, 0 + %start = sub i32 %n, 1 + br i1 %first.itr.check, label %loop, label %exit + + loop: + %idx = phi i32 [ %start, %entry ] , [ %idx.dec, %in.bounds ] + %idx.dec = sub i32 %idx, 1 + %abc = icmp sge i32 %idx, 0 + br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 + + in.bounds: + %addr = getelementptr i32, i32* %arr, i32 %idx + store i32 0, i32* %addr + %next = icmp sgt i32 %idx.dec, -1 + br i1 %next, label %loop, label %exit + + out.of.bounds: + ret void + + exit: + ret void +} + +!0 = !{i32 0, i32 2147483647} +!1 = !{!"branch_weights", i32 64, i32 4} diff --git a/test/Transforms/IRCE/only-upper-check.ll b/test/Transforms/IRCE/only-upper-check.ll new file mode 100644 index 0000000..dda3f3f --- /dev/null +++ b/test/Transforms/IRCE/only-upper-check.ll @@ -0,0 +1,37 @@ +; RUN: opt -irce -irce-print-range-checks -irce-print-changed-loops %s -S 2>&1 | FileCheck %s + +; CHECK: irce: loop has 1 inductive range checks: +; CHECK-NEXT:InductiveRangeCheck: +; CHECK-NEXT: Kind: RANGE_CHECK_UPPER +; CHECK-NEXT: Offset: %offset Scale: 1 Length: %len = load i32, i32* %a_len_ptr, !range !0 +; CHECK-NEXT: Branch: br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 +; CHECK-NEXT: irce: in function incrementing: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting> + +define void @incrementing(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) { + entry: + %len = load i32, i32* %a_len_ptr, !range !0 + %first.itr.check = icmp sgt i32 %n, 0 + br i1 %first.itr.check, label %loop, label %exit + + loop: + %idx = phi i32 [ 0, %entry ] , [ %idx.next, %in.bounds ] + %idx.next = add i32 %idx, 1 + %array.idx = add i32 %idx, %offset + %abc = icmp slt i32 %array.idx, %len + br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 + + in.bounds: + %addr = getelementptr i32, i32* %arr, i32 %array.idx + store i32 0, i32* %addr + %next = icmp slt i32 %idx.next, %n + br i1 %next, label %loop, label %exit + + out.of.bounds: + ret void + + exit: + ret void +} + +!0 = !{i32 0, i32 2147483647} +!1 = !{!"branch_weights", i32 64, i32 4} diff --git a/test/Transforms/IRCE/single-access-no-preloop.ll b/test/Transforms/IRCE/single-access-no-preloop.ll index 4d47ba8..4824d95 100644 --- a/test/Transforms/IRCE/single-access-no-preloop.ll +++ b/test/Transforms/IRCE/single-access-no-preloop.ll @@ -2,7 +2,7 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) { entry: - %len = load i32* %a_len_ptr, !range !0 + %len = load i32, i32* %a_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -13,7 +13,7 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 in.bounds: - %addr = getelementptr i32* %arr, i32 %idx + %addr = getelementptr i32, i32* %arr, i32 %idx store i32 0, i32* %addr %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit @@ -49,7 +49,7 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 ; CHECK-NEXT: br i1 %abc.postloop, label %in.bounds.postloop, label %out.of.bounds ; CHECK-LABEL: in.bounds.postloop: -; CHECK-NEXT: %addr.postloop = getelementptr i32* %arr, i32 %idx.postloop +; CHECK-NEXT: %addr.postloop = getelementptr i32, i32* %arr, i32 %idx.postloop ; CHECK-NEXT: store i32 0, i32* %addr.postloop ; CHECK-NEXT: %next.postloop = icmp slt i32 %idx.next.postloop, %n ; CHECK-NEXT: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit @@ -57,7 +57,7 @@ define void @single_access_no_preloop_no_offset(i32 *%arr, i32 *%a_len_ptr, i32 define void @single_access_no_preloop_with_offset(i32 *%arr, i32 *%a_len_ptr, i32 %n) { entry: - %len = load i32* %a_len_ptr, !range !0 + %len = load i32, i32* %a_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -69,7 +69,7 @@ define void @single_access_no_preloop_with_offset(i32 *%arr, i32 *%a_len_ptr, i3 br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 in.bounds: - %addr = getelementptr i32* %arr, i32 %idx.for.abc + %addr = getelementptr i32, i32* %arr, i32 %idx.for.abc store i32 0, i32* %addr %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit diff --git a/test/Transforms/IRCE/single-access-with-preloop.ll b/test/Transforms/IRCE/single-access-with-preloop.ll index 16426b8..e581014 100644 --- a/test/Transforms/IRCE/single-access-with-preloop.ll +++ b/test/Transforms/IRCE/single-access-with-preloop.ll @@ -2,7 +2,7 @@ define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %offset) { entry: - %len = load i32* %a_len_ptr, !range !0 + %len = load i32, i32* %a_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -16,7 +16,7 @@ define void @single_access_with_preloop(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 in.bounds: - %addr = getelementptr i32* %arr, i32 %array.idx + %addr = getelementptr i32, i32* %arr, i32 %array.idx store i32 0, i32* %addr %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit diff --git a/test/Transforms/IRCE/unhandled.ll b/test/Transforms/IRCE/unhandled.ll index 3531c48..0d5ff95 100644 --- a/test/Transforms/IRCE/unhandled.ll +++ b/test/Transforms/IRCE/unhandled.ll @@ -7,7 +7,7 @@ define void @general_affine_expressions(i32 *%arr, i32 *%a_len_ptr, i32 %n, i32 %scale, i32 %offset) { ; CHECK-NOT: constrained Loop at depth entry: - %len = load i32* %a_len_ptr, !range !0 + %len = load i32, i32* %a_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -22,7 +22,7 @@ define void @general_affine_expressions(i32 *%arr, i32 *%a_len_ptr, i32 %n, br i1 %abc, label %in.bounds, label %out.of.bounds in.bounds: - %addr = getelementptr i32* %arr, i32 %array.idx + %addr = getelementptr i32, i32* %arr, i32 %array.idx store i32 0, i32* %addr %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit diff --git a/test/Transforms/IRCE/with-parent-loops.ll b/test/Transforms/IRCE/with-parent-loops.ll index f8d6c83..00af20b 100644 --- a/test/Transforms/IRCE/with-parent-loops.ll +++ b/test/Transforms/IRCE/with-parent-loops.ll @@ -8,7 +8,7 @@ define void @inner_loop(i32* %arr, i32* %a_len_ptr, i32 %n) #0 { ; CHECK: irce: in function inner_loop: constrained Loop at depth 1 containing: %loop<header><exiting>,%in.bounds<latch><exiting> entry: - %len = load i32* %a_len_ptr, !range !0 + %len = load i32, i32* %a_len_ptr, !range !0 %first.itr.check = icmp sgt i32 %n, 0 br i1 %first.itr.check, label %loop, label %exit @@ -19,7 +19,7 @@ loop: ; preds = %in.bounds, %entry br i1 %abc, label %in.bounds, label %out.of.bounds, !prof !1 in.bounds: ; preds = %loop - %addr = getelementptr i32* %arr, i32 %idx + %addr = getelementptr i32, i32* %arr, i32 %idx store i32 0, i32* %addr %next = icmp slt i32 %idx.next, %n br i1 %next, label %loop, label %exit @@ -42,7 +42,7 @@ loop: ; preds = %inner_loop.exit, %e %idx = phi i32 [ 0, %entry ], [ %idx.next, %inner_loop.exit ] %idx.next = add i32 %idx, 1 %next = icmp ult i32 %idx.next, %parent.count - %len.i = load i32* %a_len_ptr, !range !0 + %len.i = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i = icmp sgt i32 %n, 0 br i1 %first.itr.check.i, label %loop.i, label %exit.i @@ -53,7 +53,7 @@ loop.i: ; preds = %in.bounds.i, %loop br i1 %abc.i, label %in.bounds.i, label %out.of.bounds.i, !prof !1 in.bounds.i: ; preds = %loop.i - %addr.i = getelementptr i32* %arr, i32 %idx.i + %addr.i = getelementptr i32, i32* %arr, i32 %idx.i store i32 0, i32* %addr.i %next.i = icmp slt i32 %idx.next.i, %n br i1 %next.i, label %loop.i, label %exit.i @@ -88,7 +88,7 @@ loop.i: ; preds = %inner_loop.exit.i, %idx.i = phi i32 [ 0, %loop ], [ %idx.next.i, %inner_loop.exit.i ] %idx.next.i = add i32 %idx.i, 1 %next.i = icmp ult i32 %idx.next.i, %parent.count - %len.i.i = load i32* %a_len_ptr, !range !0 + %len.i.i = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i.i = icmp sgt i32 %n, 0 br i1 %first.itr.check.i.i, label %loop.i.i, label %exit.i.i @@ -99,7 +99,7 @@ loop.i.i: ; preds = %in.bounds.i.i, %loo br i1 %abc.i.i, label %in.bounds.i.i, label %out.of.bounds.i.i, !prof !1 in.bounds.i.i: ; preds = %loop.i.i - %addr.i.i = getelementptr i32* %arr, i32 %idx.i.i + %addr.i.i = getelementptr i32, i32* %arr, i32 %idx.i.i store i32 0, i32* %addr.i.i %next.i.i = icmp slt i32 %idx.next.i.i, %n br i1 %next.i.i, label %loop.i.i, label %exit.i.i @@ -132,7 +132,7 @@ loop: ; preds = %inner_loop.exit12, %idx = phi i32 [ 0, %entry ], [ %idx.next, %inner_loop.exit12 ] %idx.next = add i32 %idx, 1 %next = icmp ult i32 %idx.next, %parent.count - %len.i = load i32* %a_len_ptr, !range !0 + %len.i = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i = icmp sgt i32 %n, 0 br i1 %first.itr.check.i, label %loop.i, label %exit.i @@ -143,7 +143,7 @@ loop.i: ; preds = %in.bounds.i, %loop br i1 %abc.i, label %in.bounds.i, label %out.of.bounds.i, !prof !1 in.bounds.i: ; preds = %loop.i - %addr.i = getelementptr i32* %arr, i32 %idx.i + %addr.i = getelementptr i32, i32* %arr, i32 %idx.i store i32 0, i32* %addr.i %next.i = icmp slt i32 %idx.next.i, %n br i1 %next.i, label %loop.i, label %exit.i @@ -155,7 +155,7 @@ exit.i: ; preds = %in.bounds.i, %loop br label %inner_loop.exit inner_loop.exit: ; preds = %exit.i, %out.of.bounds.i - %len.i1 = load i32* %a_len_ptr, !range !0 + %len.i1 = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i2 = icmp sgt i32 %n, 0 br i1 %first.itr.check.i2, label %loop.i6, label %exit.i11 @@ -166,7 +166,7 @@ loop.i6: ; preds = %in.bounds.i9, %inne br i1 %abc.i5, label %in.bounds.i9, label %out.of.bounds.i10, !prof !1 in.bounds.i9: ; preds = %loop.i6 - %addr.i7 = getelementptr i32* %arr, i32 %idx.i3 + %addr.i7 = getelementptr i32, i32* %arr, i32 %idx.i3 store i32 0, i32* %addr.i7 %next.i8 = icmp slt i32 %idx.next.i4, %n br i1 %next.i8, label %loop.i6, label %exit.i11 @@ -202,7 +202,7 @@ loop.i: ; preds = %inner_loop.exit.i, %idx.i = phi i32 [ 0, %loop ], [ %idx.next.i, %inner_loop.exit.i ] %idx.next.i = add i32 %idx.i, 1 %next.i = icmp ult i32 %idx.next.i, %parent.count - %len.i.i = load i32* %a_len_ptr, !range !0 + %len.i.i = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i.i = icmp sgt i32 %n, 0 br i1 %first.itr.check.i.i, label %loop.i.i, label %exit.i.i @@ -213,7 +213,7 @@ loop.i.i: ; preds = %in.bounds.i.i, %loo br i1 %abc.i.i, label %in.bounds.i.i, label %out.of.bounds.i.i, !prof !1 in.bounds.i.i: ; preds = %loop.i.i - %addr.i.i = getelementptr i32* %arr, i32 %idx.i.i + %addr.i.i = getelementptr i32, i32* %arr, i32 %idx.i.i store i32 0, i32* %addr.i.i %next.i.i = icmp slt i32 %idx.next.i.i, %n br i1 %next.i.i, label %loop.i.i, label %exit.i.i @@ -234,7 +234,7 @@ loop.i6: ; preds = %inner_loop.exit.i16 %idx.i1 = phi i32 [ 0, %with_parent.exit ], [ %idx.next.i2, %inner_loop.exit.i16 ] %idx.next.i2 = add i32 %idx.i1, 1 %next.i3 = icmp ult i32 %idx.next.i2, %parent.count - %len.i.i4 = load i32* %a_len_ptr, !range !0 + %len.i.i4 = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i.i5 = icmp sgt i32 %n, 0 br i1 %first.itr.check.i.i5, label %loop.i.i10, label %exit.i.i15 @@ -245,7 +245,7 @@ loop.i.i10: ; preds = %in.bounds.i.i13, %l br i1 %abc.i.i9, label %in.bounds.i.i13, label %out.of.bounds.i.i14, !prof !1 in.bounds.i.i13: ; preds = %loop.i.i10 - %addr.i.i11 = getelementptr i32* %arr, i32 %idx.i.i7 + %addr.i.i11 = getelementptr i32, i32* %arr, i32 %idx.i.i7 store i32 0, i32* %addr.i.i11 %next.i.i12 = icmp slt i32 %idx.next.i.i8, %n br i1 %next.i.i12, label %loop.i.i10, label %exit.i.i15 @@ -278,7 +278,7 @@ loop: ; preds = %with_parent.exit, % %idx = phi i32 [ 0, %entry ], [ %idx.next, %with_parent.exit ] %idx.next = add i32 %idx, 1 %next = icmp ult i32 %idx.next, %grandparent.count - %len.i = load i32* %a_len_ptr, !range !0 + %len.i = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i = icmp sgt i32 %n, 0 br i1 %first.itr.check.i, label %loop.i, label %exit.i @@ -289,7 +289,7 @@ loop.i: ; preds = %in.bounds.i, %loop br i1 %abc.i, label %in.bounds.i, label %out.of.bounds.i, !prof !1 in.bounds.i: ; preds = %loop.i - %addr.i = getelementptr i32* %arr, i32 %idx.i + %addr.i = getelementptr i32, i32* %arr, i32 %idx.i store i32 0, i32* %addr.i %next.i = icmp slt i32 %idx.next.i, %n br i1 %next.i, label %loop.i, label %exit.i @@ -307,7 +307,7 @@ loop.i4: ; preds = %inner_loop.exit.i, %idx.i1 = phi i32 [ 0, %inner_loop.exit ], [ %idx.next.i2, %inner_loop.exit.i ] %idx.next.i2 = add i32 %idx.i1, 1 %next.i3 = icmp ult i32 %idx.next.i2, %parent.count - %len.i.i = load i32* %a_len_ptr, !range !0 + %len.i.i = load i32, i32* %a_len_ptr, !range !0 %first.itr.check.i.i = icmp sgt i32 %n, 0 br i1 %first.itr.check.i.i, label %loop.i.i, label %exit.i.i @@ -318,7 +318,7 @@ loop.i.i: ; preds = %in.bounds.i.i, %loo br i1 %abc.i.i, label %in.bounds.i.i, label %out.of.bounds.i.i, !prof !1 in.bounds.i.i: ; preds = %loop.i.i - %addr.i.i = getelementptr i32* %arr, i32 %idx.i.i + %addr.i.i = getelementptr i32, i32* %arr, i32 %idx.i.i store i32 0, i32* %addr.i.i %next.i.i = icmp slt i32 %idx.next.i.i, %n br i1 %next.i.i, label %loop.i.i, label %exit.i.i diff --git a/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll b/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll index ce043be..16ad635 100644 --- a/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll +++ b/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll @@ -45,7 +45,7 @@ then.4: ; preds = %_ZNK7QString2atEi.exit ret void endif.4: ; preds = %_ZNK7QString2atEi.exit - %tmp.115 = load i8* null ; <i8> [#uses=1] + %tmp.115 = load i8, i8* null ; <i8> [#uses=1] br i1 false, label %loopexit.1, label %no_exit.0 no_exit.0: ; preds = %no_exit.0, %endif.4 diff --git a/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll b/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll index 7202c7a..7ef351d 100644 --- a/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll +++ b/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll @@ -7,8 +7,8 @@ entry: br label %no_exit.0 no_exit.0: ; preds = %no_exit.0, %entry - %p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ] ; <i32*> [#uses=1] - %inc.0 = getelementptr i32* %p.0.0, i32 1 ; <i32*> [#uses=1] + %p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]], [29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ] ; <i32*> [#uses=1] + %inc.0 = getelementptr i32, i32* %p.0.0, i32 1 ; <i32*> [#uses=1] br i1 undef, label %no_exit.0, label %no_exit.1 no_exit.1: ; preds = %no_exit.0 diff --git a/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll b/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll index 36ec2b8..2d40f88 100644 --- a/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll +++ b/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll @@ -6,9 +6,9 @@ endif.0: no_exit.30: ; preds = %no_exit.30, %endif.0 %x.12.0 = phi i32 [ %inc.28, %no_exit.30 ], [ -2, %endif.0 ] ; <i32> [#uses=1] - %tmp.583 = load i16* null ; <i16> [#uses=1] + %tmp.583 = load i16, i16* null ; <i16> [#uses=1] %tmp.584 = zext i16 %tmp.583 to i32 ; <i32> [#uses=1] - %tmp.588 = load i32* null ; <i32> [#uses=1] + %tmp.588 = load i32, i32* null ; <i32> [#uses=1] %tmp.589 = mul i32 %tmp.584, %tmp.588 ; <i32> [#uses=1] %tmp.591 = add i32 %tmp.589, 0 ; <i32> [#uses=1] %inc.28 = add i32 %x.12.0, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll b/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll index 6366c8c..3dda657 100644 --- a/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll +++ b/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll @@ -24,8 +24,8 @@ cond_true: ; preds = %bb2 br label %bb cond_next: ; preds = %bb2 - %tmp2 = getelementptr [5 x i8]* @foo, i32 0, i32 %i.0 ; <i8*> [#uses=1] - %tmp3 = load i8* %tmp2 ; <i8> [#uses=1] + %tmp2 = getelementptr [5 x i8], [5 x i8]* @foo, i32 0, i32 %i.0 ; <i8*> [#uses=1] + %tmp3 = load i8, i8* %tmp2 ; <i8> [#uses=1] %tmp5 = icmp eq i8 %tmp3, 0 ; <i1> [#uses=1] br i1 %tmp5, label %bb6, label %bb diff --git a/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll b/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll index a004831..58934f5 100644 --- a/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll +++ b/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll @@ -1,6 +1,10 @@ ; RUN: opt < %s -indvars -S | grep sext | count 1 ; ModuleID = '<stdin>' +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + %struct.App1Marker = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }> %struct.ComponentInstanceRecord = type <{ [1 x i32] }> %struct.DCPredictors = type { [5 x i16] } @@ -18,18 +22,18 @@ define signext i16 @ExtractBufferedBlocksIgnored(%struct.JPEGGlobals* %globp) nounwind { entry: - %tmp4311 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 70 ; <i32*> [#uses=1] - %tmp4412 = load i32* %tmp4311, align 16 ; <i32> [#uses=2] + %tmp4311 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 70 ; <i32*> [#uses=1] + %tmp4412 = load i32, i32* %tmp4311, align 16 ; <i32> [#uses=2] %tmp4613 = icmp sgt i32 %tmp4412, 0 ; <i1> [#uses=1] br i1 %tmp4613, label %bb, label %bb49 bb: ; preds = %bb28, %entry %component.09 = phi i16 [ 0, %entry ], [ %tmp37, %bb28 ] ; <i16> [#uses=2] %tmp12 = sext i16 %component.09 to i32 ; <i32> [#uses=2] - %tmp6 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 77, i32 %tmp12 ; <i16**> [#uses=2] - %tmp7 = load i16** %tmp6, align 4 ; <i16*> [#uses=2] - %tmp235 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 71, i32 %tmp12 ; <i32*> [#uses=1] - %tmp246 = load i32* %tmp235, align 4 ; <i32> [#uses=2] + %tmp6 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 77, i32 %tmp12 ; <i16**> [#uses=2] + %tmp7 = load i16*, i16** %tmp6, align 4 ; <i16*> [#uses=2] + %tmp235 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 71, i32 %tmp12 ; <i32*> [#uses=1] + %tmp246 = load i32, i32* %tmp235, align 4 ; <i32> [#uses=2] %tmp267 = icmp sgt i32 %tmp246, 0 ; <i1> [#uses=1] br i1 %tmp267, label %bb8, label %bb28 @@ -37,7 +41,7 @@ bb8: ; preds = %bb8, %bb %indvar = phi i32 [ 0, %bb ], [ %indvar.next2, %bb8 ] ; <i32> [#uses=3] %theDCTBufferIter.01.rec = shl i32 %indvar, 6 ; <i32> [#uses=1] %tmp10.rec = add i32 %theDCTBufferIter.01.rec, 64 ; <i32> [#uses=1] - %tmp10 = getelementptr i16* %tmp7, i32 %tmp10.rec ; <i16*> [#uses=1] + %tmp10 = getelementptr i16, i16* %tmp7, i32 %tmp10.rec ; <i16*> [#uses=1] %i.02 = trunc i32 %indvar to i16 ; <i16> [#uses=1] %tmp13 = add i16 %i.02, 1 ; <i16> [#uses=1] %phitmp = sext i16 %tmp13 to i32 ; <i32> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll b/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll index 23e7884..1248154 100644 --- a/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll +++ b/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll @@ -8,7 +8,7 @@ entry: br i1 false, label %bb.nph, label %return bb.nph: ; preds = %entry - %0 = load i32* @foo, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* @foo, align 4 ; <i32> [#uses=1] %1 = sext i32 %0 to i64 ; <i64> [#uses=1] br label %bb diff --git a/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll b/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll index b461566..ab2af32 100644 --- a/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll +++ b/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll @@ -15,95 +15,95 @@ bb1.thread: bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %84, %bb1 ] ; <i32> [#uses=19] - %0 = load i32** @a, align 8 ; <i32*> [#uses=1] - %1 = load i32** @b, align 8 ; <i32*> [#uses=1] + %0 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] + %1 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %2 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %3 = getelementptr i32* %1, i64 %2 ; <i32*> [#uses=1] - %4 = load i32* %3, align 1 ; <i32> [#uses=1] - %5 = load i32** @c, align 8 ; <i32*> [#uses=1] + %3 = getelementptr i32, i32* %1, i64 %2 ; <i32*> [#uses=1] + %4 = load i32, i32* %3, align 1 ; <i32> [#uses=1] + %5 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %6 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %7 = getelementptr i32* %5, i64 %6 ; <i32*> [#uses=1] - %8 = load i32* %7, align 1 ; <i32> [#uses=1] + %7 = getelementptr i32, i32* %5, i64 %6 ; <i32*> [#uses=1] + %8 = load i32, i32* %7, align 1 ; <i32> [#uses=1] %9 = add i32 %8, %4 ; <i32> [#uses=1] %10 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %11 = getelementptr i32* %0, i64 %10 ; <i32*> [#uses=1] + %11 = getelementptr i32, i32* %0, i64 %10 ; <i32*> [#uses=1] store i32 %9, i32* %11, align 1 - %12 = load i32** @a, align 8 ; <i32*> [#uses=1] + %12 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %13 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] - %14 = load i32** @b, align 8 ; <i32*> [#uses=1] + %14 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %15 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %16 = sext i32 %15 to i64 ; <i64> [#uses=1] - %17 = getelementptr i32* %14, i64 %16 ; <i32*> [#uses=1] - %18 = load i32* %17, align 1 ; <i32> [#uses=1] - %19 = load i32** @c, align 8 ; <i32*> [#uses=1] + %17 = getelementptr i32, i32* %14, i64 %16 ; <i32*> [#uses=1] + %18 = load i32, i32* %17, align 1 ; <i32> [#uses=1] + %19 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %20 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %21 = sext i32 %20 to i64 ; <i64> [#uses=1] - %22 = getelementptr i32* %19, i64 %21 ; <i32*> [#uses=1] - %23 = load i32* %22, align 1 ; <i32> [#uses=1] + %22 = getelementptr i32, i32* %19, i64 %21 ; <i32*> [#uses=1] + %23 = load i32, i32* %22, align 1 ; <i32> [#uses=1] %24 = add i32 %23, %18 ; <i32> [#uses=1] %25 = sext i32 %13 to i64 ; <i64> [#uses=1] - %26 = getelementptr i32* %12, i64 %25 ; <i32*> [#uses=1] + %26 = getelementptr i32, i32* %12, i64 %25 ; <i32*> [#uses=1] store i32 %24, i32* %26, align 1 - %27 = load i32** @a, align 8 ; <i32*> [#uses=1] + %27 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %28 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] - %29 = load i32** @b, align 8 ; <i32*> [#uses=1] + %29 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %30 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %31 = sext i32 %30 to i64 ; <i64> [#uses=1] - %32 = getelementptr i32* %29, i64 %31 ; <i32*> [#uses=1] - %33 = load i32* %32, align 1 ; <i32> [#uses=1] - %34 = load i32** @c, align 8 ; <i32*> [#uses=1] + %32 = getelementptr i32, i32* %29, i64 %31 ; <i32*> [#uses=1] + %33 = load i32, i32* %32, align 1 ; <i32> [#uses=1] + %34 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %35 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %36 = sext i32 %35 to i64 ; <i64> [#uses=1] - %37 = getelementptr i32* %34, i64 %36 ; <i32*> [#uses=1] - %38 = load i32* %37, align 1 ; <i32> [#uses=1] + %37 = getelementptr i32, i32* %34, i64 %36 ; <i32*> [#uses=1] + %38 = load i32, i32* %37, align 1 ; <i32> [#uses=1] %39 = add i32 %38, %33 ; <i32> [#uses=1] %40 = sext i32 %28 to i64 ; <i64> [#uses=1] - %41 = getelementptr i32* %27, i64 %40 ; <i32*> [#uses=1] + %41 = getelementptr i32, i32* %27, i64 %40 ; <i32*> [#uses=1] store i32 %39, i32* %41, align 1 - %42 = load i32** @d, align 8 ; <i32*> [#uses=1] - %43 = load i32** @e, align 8 ; <i32*> [#uses=1] + %42 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] + %43 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %44 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %45 = getelementptr i32* %43, i64 %44 ; <i32*> [#uses=1] - %46 = load i32* %45, align 1 ; <i32> [#uses=1] - %47 = load i32** @f, align 8 ; <i32*> [#uses=1] + %45 = getelementptr i32, i32* %43, i64 %44 ; <i32*> [#uses=1] + %46 = load i32, i32* %45, align 1 ; <i32> [#uses=1] + %47 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %48 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %49 = getelementptr i32* %47, i64 %48 ; <i32*> [#uses=1] - %50 = load i32* %49, align 1 ; <i32> [#uses=1] + %49 = getelementptr i32, i32* %47, i64 %48 ; <i32*> [#uses=1] + %50 = load i32, i32* %49, align 1 ; <i32> [#uses=1] %51 = add i32 %50, %46 ; <i32> [#uses=1] %52 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %53 = getelementptr i32* %42, i64 %52 ; <i32*> [#uses=1] + %53 = getelementptr i32, i32* %42, i64 %52 ; <i32*> [#uses=1] store i32 %51, i32* %53, align 1 - %54 = load i32** @d, align 8 ; <i32*> [#uses=1] + %54 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %55 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] - %56 = load i32** @e, align 8 ; <i32*> [#uses=1] + %56 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %57 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %58 = sext i32 %57 to i64 ; <i64> [#uses=1] - %59 = getelementptr i32* %56, i64 %58 ; <i32*> [#uses=1] - %60 = load i32* %59, align 1 ; <i32> [#uses=1] - %61 = load i32** @f, align 8 ; <i32*> [#uses=1] + %59 = getelementptr i32, i32* %56, i64 %58 ; <i32*> [#uses=1] + %60 = load i32, i32* %59, align 1 ; <i32> [#uses=1] + %61 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %62 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %63 = sext i32 %62 to i64 ; <i64> [#uses=1] - %64 = getelementptr i32* %61, i64 %63 ; <i32*> [#uses=1] - %65 = load i32* %64, align 1 ; <i32> [#uses=1] + %64 = getelementptr i32, i32* %61, i64 %63 ; <i32*> [#uses=1] + %65 = load i32, i32* %64, align 1 ; <i32> [#uses=1] %66 = add i32 %65, %60 ; <i32> [#uses=1] %67 = sext i32 %55 to i64 ; <i64> [#uses=1] - %68 = getelementptr i32* %54, i64 %67 ; <i32*> [#uses=1] + %68 = getelementptr i32, i32* %54, i64 %67 ; <i32*> [#uses=1] store i32 %66, i32* %68, align 1 - %69 = load i32** @d, align 8 ; <i32*> [#uses=1] + %69 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %70 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] - %71 = load i32** @e, align 8 ; <i32*> [#uses=1] + %71 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %72 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %73 = sext i32 %72 to i64 ; <i64> [#uses=1] - %74 = getelementptr i32* %71, i64 %73 ; <i32*> [#uses=1] - %75 = load i32* %74, align 1 ; <i32> [#uses=1] - %76 = load i32** @f, align 8 ; <i32*> [#uses=1] + %74 = getelementptr i32, i32* %71, i64 %73 ; <i32*> [#uses=1] + %75 = load i32, i32* %74, align 1 ; <i32> [#uses=1] + %76 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %77 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %78 = sext i32 %77 to i64 ; <i64> [#uses=1] - %79 = getelementptr i32* %76, i64 %78 ; <i32*> [#uses=1] - %80 = load i32* %79, align 1 ; <i32> [#uses=1] + %79 = getelementptr i32, i32* %76, i64 %78 ; <i32*> [#uses=1] + %80 = load i32, i32* %79, align 1 ; <i32> [#uses=1] %81 = add i32 %80, %75 ; <i32> [#uses=1] %82 = sext i32 %70 to i64 ; <i64> [#uses=1] - %83 = getelementptr i32* %69, i64 %82 ; <i32*> [#uses=1] + %83 = getelementptr i32, i32* %69, i64 %82 ; <i32*> [#uses=1] store i32 %81, i32* %83, align 1 %84 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] %85 = icmp sgt i32 %84, 23646 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll b/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll index 0722d89..921a393 100644 --- a/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll +++ b/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll @@ -29,127 +29,127 @@ bb1.thread: bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %116, %bb1 ] ; <i32> [#uses=22] - %0 = load i32** @a, align 8 ; <i32*> [#uses=1] + %0 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %1 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] - %2 = load i32** @b, align 8 ; <i32*> [#uses=1] + %2 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %3 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %4 = zext i32 %3 to i64 ; <i64> [#uses=1] - %5 = getelementptr i32* %2, i64 %4 ; <i32*> [#uses=1] - %6 = load i32* %5, align 1 ; <i32> [#uses=1] - %7 = load i32** @c, align 8 ; <i32*> [#uses=1] + %5 = getelementptr i32, i32* %2, i64 %4 ; <i32*> [#uses=1] + %6 = load i32, i32* %5, align 1 ; <i32> [#uses=1] + %7 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %8 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %9 = zext i32 %8 to i64 ; <i64> [#uses=1] - %10 = getelementptr i32* %7, i64 %9 ; <i32*> [#uses=1] - %11 = load i32* %10, align 1 ; <i32> [#uses=1] + %10 = getelementptr i32, i32* %7, i64 %9 ; <i32*> [#uses=1] + %11 = load i32, i32* %10, align 1 ; <i32> [#uses=1] %12 = add i32 %11, %6 ; <i32> [#uses=1] %13 = zext i32 %1 to i64 ; <i64> [#uses=1] - %14 = getelementptr i32* %0, i64 %13 ; <i32*> [#uses=1] + %14 = getelementptr i32, i32* %0, i64 %13 ; <i32*> [#uses=1] store i32 %12, i32* %14, align 1 - %15 = load i32** @a, align 8 ; <i32*> [#uses=1] + %15 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %16 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %17 = and i32 %16, 15 ; <i32> [#uses=1] - %18 = load i32** @b, align 8 ; <i32*> [#uses=1] + %18 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %19 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %20 = and i32 %19, 15 ; <i32> [#uses=1] %21 = zext i32 %20 to i64 ; <i64> [#uses=1] - %22 = getelementptr i32* %18, i64 %21 ; <i32*> [#uses=1] - %23 = load i32* %22, align 1 ; <i32> [#uses=1] - %24 = load i32** @c, align 8 ; <i32*> [#uses=1] + %22 = getelementptr i32, i32* %18, i64 %21 ; <i32*> [#uses=1] + %23 = load i32, i32* %22, align 1 ; <i32> [#uses=1] + %24 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %25 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %26 = and i32 %25, 15 ; <i32> [#uses=1] %27 = zext i32 %26 to i64 ; <i64> [#uses=1] - %28 = getelementptr i32* %24, i64 %27 ; <i32*> [#uses=1] - %29 = load i32* %28, align 1 ; <i32> [#uses=1] + %28 = getelementptr i32, i32* %24, i64 %27 ; <i32*> [#uses=1] + %29 = load i32, i32* %28, align 1 ; <i32> [#uses=1] %30 = add i32 %29, %23 ; <i32> [#uses=1] %31 = zext i32 %17 to i64 ; <i64> [#uses=1] - %32 = getelementptr i32* %15, i64 %31 ; <i32*> [#uses=1] + %32 = getelementptr i32, i32* %15, i64 %31 ; <i32*> [#uses=1] store i32 %30, i32* %32, align 1 - %33 = load i32** @a, align 8 ; <i32*> [#uses=1] + %33 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %34 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %35 = and i32 %34, 15 ; <i32> [#uses=1] - %36 = load i32** @b, align 8 ; <i32*> [#uses=1] + %36 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %37 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %38 = and i32 %37, 15 ; <i32> [#uses=1] %39 = zext i32 %38 to i64 ; <i64> [#uses=1] - %40 = getelementptr i32* %36, i64 %39 ; <i32*> [#uses=1] - %41 = load i32* %40, align 1 ; <i32> [#uses=1] - %42 = load i32** @c, align 8 ; <i32*> [#uses=1] + %40 = getelementptr i32, i32* %36, i64 %39 ; <i32*> [#uses=1] + %41 = load i32, i32* %40, align 1 ; <i32> [#uses=1] + %42 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %43 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %44 = and i32 %43, 15 ; <i32> [#uses=1] %45 = zext i32 %44 to i64 ; <i64> [#uses=1] - %46 = getelementptr i32* %42, i64 %45 ; <i32*> [#uses=1] - %47 = load i32* %46, align 1 ; <i32> [#uses=1] + %46 = getelementptr i32, i32* %42, i64 %45 ; <i32*> [#uses=1] + %47 = load i32, i32* %46, align 1 ; <i32> [#uses=1] %48 = add i32 %47, %41 ; <i32> [#uses=1] %49 = zext i32 %35 to i64 ; <i64> [#uses=1] - %50 = getelementptr i32* %33, i64 %49 ; <i32*> [#uses=1] + %50 = getelementptr i32, i32* %33, i64 %49 ; <i32*> [#uses=1] store i32 %48, i32* %50, align 1 - %51 = load i32** @d, align 8 ; <i32*> [#uses=1] + %51 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %52 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] - %53 = load i32** @e, align 8 ; <i32*> [#uses=1] + %53 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %54 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %55 = zext i32 %54 to i64 ; <i64> [#uses=1] - %56 = getelementptr i32* %53, i64 %55 ; <i32*> [#uses=1] - %57 = load i32* %56, align 1 ; <i32> [#uses=1] - %58 = load i32** @f, align 8 ; <i32*> [#uses=1] + %56 = getelementptr i32, i32* %53, i64 %55 ; <i32*> [#uses=1] + %57 = load i32, i32* %56, align 1 ; <i32> [#uses=1] + %58 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %59 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %60 = zext i32 %59 to i64 ; <i64> [#uses=1] - %61 = getelementptr i32* %58, i64 %60 ; <i32*> [#uses=1] - %62 = load i32* %61, align 1 ; <i32> [#uses=1] + %61 = getelementptr i32, i32* %58, i64 %60 ; <i32*> [#uses=1] + %62 = load i32, i32* %61, align 1 ; <i32> [#uses=1] %63 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %64 = getelementptr [256 x i32]* @K, i64 0, i64 %63 ; <i32*> [#uses=1] - %65 = load i32* %64, align 4 ; <i32> [#uses=1] + %64 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %63 ; <i32*> [#uses=1] + %65 = load i32, i32* %64, align 4 ; <i32> [#uses=1] %66 = add i32 %62, %57 ; <i32> [#uses=1] %67 = add i32 %66, %65 ; <i32> [#uses=1] %68 = zext i32 %52 to i64 ; <i64> [#uses=1] - %69 = getelementptr i32* %51, i64 %68 ; <i32*> [#uses=1] + %69 = getelementptr i32, i32* %51, i64 %68 ; <i32*> [#uses=1] store i32 %67, i32* %69, align 1 - %70 = load i32** @d, align 8 ; <i32*> [#uses=1] + %70 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %71 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %72 = and i32 %71, 15 ; <i32> [#uses=1] - %73 = load i32** @e, align 8 ; <i32*> [#uses=1] + %73 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %74 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %75 = and i32 %74, 15 ; <i32> [#uses=1] %76 = zext i32 %75 to i64 ; <i64> [#uses=1] - %77 = getelementptr i32* %73, i64 %76 ; <i32*> [#uses=1] - %78 = load i32* %77, align 1 ; <i32> [#uses=1] - %79 = load i32** @f, align 8 ; <i32*> [#uses=1] + %77 = getelementptr i32, i32* %73, i64 %76 ; <i32*> [#uses=1] + %78 = load i32, i32* %77, align 1 ; <i32> [#uses=1] + %79 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %80 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %81 = and i32 %80, 15 ; <i32> [#uses=1] %82 = zext i32 %81 to i64 ; <i64> [#uses=1] - %83 = getelementptr i32* %79, i64 %82 ; <i32*> [#uses=1] - %84 = load i32* %83, align 1 ; <i32> [#uses=1] + %83 = getelementptr i32, i32* %79, i64 %82 ; <i32*> [#uses=1] + %84 = load i32, i32* %83, align 1 ; <i32> [#uses=1] %85 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %86 = sext i32 %85 to i64 ; <i64> [#uses=1] - %87 = getelementptr [256 x i32]* @K, i64 0, i64 %86 ; <i32*> [#uses=1] - %88 = load i32* %87, align 4 ; <i32> [#uses=1] + %87 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %86 ; <i32*> [#uses=1] + %88 = load i32, i32* %87, align 4 ; <i32> [#uses=1] %89 = add i32 %84, %78 ; <i32> [#uses=1] %90 = add i32 %89, %88 ; <i32> [#uses=1] %91 = zext i32 %72 to i64 ; <i64> [#uses=1] - %92 = getelementptr i32* %70, i64 %91 ; <i32*> [#uses=1] + %92 = getelementptr i32, i32* %70, i64 %91 ; <i32*> [#uses=1] store i32 %90, i32* %92, align 1 - %93 = load i32** @d, align 8 ; <i32*> [#uses=1] + %93 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %94 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %95 = and i32 %94, 15 ; <i32> [#uses=1] - %96 = load i32** @e, align 8 ; <i32*> [#uses=1] + %96 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %97 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %98 = and i32 %97, 15 ; <i32> [#uses=1] %99 = zext i32 %98 to i64 ; <i64> [#uses=1] - %100 = getelementptr i32* %96, i64 %99 ; <i32*> [#uses=1] - %101 = load i32* %100, align 1 ; <i32> [#uses=1] - %102 = load i32** @f, align 8 ; <i32*> [#uses=1] + %100 = getelementptr i32, i32* %96, i64 %99 ; <i32*> [#uses=1] + %101 = load i32, i32* %100, align 1 ; <i32> [#uses=1] + %102 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %103 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %104 = and i32 %103, 15 ; <i32> [#uses=1] %105 = zext i32 %104 to i64 ; <i64> [#uses=1] - %106 = getelementptr i32* %102, i64 %105 ; <i32*> [#uses=1] - %107 = load i32* %106, align 1 ; <i32> [#uses=1] + %106 = getelementptr i32, i32* %102, i64 %105 ; <i32*> [#uses=1] + %107 = load i32, i32* %106, align 1 ; <i32> [#uses=1] %108 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %109 = sext i32 %108 to i64 ; <i64> [#uses=1] - %110 = getelementptr [256 x i32]* @K, i64 0, i64 %109 ; <i32*> [#uses=1] - %111 = load i32* %110, align 4 ; <i32> [#uses=1] + %110 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %109 ; <i32*> [#uses=1] + %111 = load i32, i32* %110, align 4 ; <i32> [#uses=1] %112 = add i32 %107, %101 ; <i32> [#uses=1] %113 = add i32 %112, %111 ; <i32> [#uses=1] %114 = zext i32 %95 to i64 ; <i64> [#uses=1] - %115 = getelementptr i32* %93, i64 %114 ; <i32*> [#uses=1] + %115 = getelementptr i32, i32* %93, i64 %114 ; <i32*> [#uses=1] store i32 %113, i32* %115, align 1 %116 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] %117 = icmp sgt i32 %116, 23646 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll b/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll index 47164d8..44c43a3 100644 --- a/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll +++ b/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -indvars -S | FileCheck %s ; PR4086 + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + declare void @foo() define void @test() { diff --git a/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll b/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll index 0737489..f0765e7 100644 --- a/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll +++ b/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll @@ -17,8 +17,8 @@ for.body: %i2.115 = phi i32 [ 0, %entry ], [ %add249, %for.body ] %add174 = add nsw i32 %i2.115, %x %idxprom177 = sext i32 %add174 to i64 - %arrayidx179 = getelementptr inbounds double* %data, i64 %idxprom177 - %tmp180 = load double* %arrayidx179, align 8 + %arrayidx179 = getelementptr inbounds double, double* %data, i64 %idxprom177 + %tmp180 = load double, double* %arrayidx179, align 8 %add249 = add nsw i32 %i2.115, %y %cmp168 = icmp sgt i32 %add249, %n br i1 %cmp168, label %exit, label %for.body diff --git a/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll b/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll index e462712..3d77a36 100644 --- a/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll +++ b/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll @@ -6,7 +6,7 @@ target triple = "thumbv7-apple-darwin" ; CHECK-LABEL: @test( ; CHECK: if.end.i126: -; CHECK: %exitcond = icmp ne i8* %destYPixelPtr.010.i, getelementptr (i8* null, i32 undef) +; CHECK: %exitcond = icmp ne i8* %incdec.ptr.i, getelementptr (i8, i8* null, i32 undef) define void @test() nounwind { entry: br label %while.cond @@ -40,7 +40,7 @@ if.else.i124: ; preds = %for.body21.i br label %if.end.i126 if.end.i126: ; preds = %if.else.i124, %for.body21.i - %incdec.ptr.i = getelementptr inbounds i8* %destYPixelPtr.010.i, i32 1 + %incdec.ptr.i = getelementptr inbounds i8, i8* %destYPixelPtr.010.i, i32 1 %inc.i125 = add i32 %x.09.i, 1 %cmp19.i = icmp ult i32 %inc.i125, undef br i1 %cmp19.i, label %for.body21.i, label %for.end.i129 diff --git a/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll b/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll index 8247886..a0b1e84 100644 --- a/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll +++ b/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll @@ -25,8 +25,8 @@ preheader: loop: %p.01.us.us = phi i8* [ null, %preheader ], [ %gep, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %cmp = icmp ult i8* %gep, %end br i1 %cmp, label %loop, label %exit @@ -50,8 +50,8 @@ preheader: loop: %p.01.us.us = phi i8* [ %buf, %preheader ], [ %gep, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %cmp = icmp ult i8* %gep, %end br i1 %cmp, label %loop, label %exit @@ -79,8 +79,8 @@ loop: %p.01.us.us = phi i8* [ null, %preheader ], [ %gep, %loop ] %iv = phi i32 [ 0, %preheader ], [ %ivnext, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %ivnext = add i32 %iv, 1 %cmp = icmp ult i32 %ivnext, %cnt br i1 %cmp, label %loop, label %exit @@ -109,8 +109,8 @@ loop: %p.01.us.us = phi i8* [ %buf, %preheader ], [ %gep, %loop ] %iv = phi i32 [ %bi, %preheader ], [ %ivnext, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %ivnext = add i32 %iv, 1 %cmp = icmp ult i32 %ivnext, %cnt br i1 %cmp, label %loop, label %exit @@ -122,7 +122,7 @@ exit: ; IV and BECount have two different pointer types here. define void @testnullptr([512 x i8]* %base) nounwind { entry: - %add.ptr1603 = getelementptr [512 x i8]* %base, i64 0, i64 512 + %add.ptr1603 = getelementptr [512 x i8], [512 x i8]* %base, i64 0, i64 512 br label %preheader preheader: @@ -131,7 +131,7 @@ preheader: for.body: %r.17193 = phi i8* [ %incdec.ptr1608, %for.body ], [ null, %preheader ] - %incdec.ptr1608 = getelementptr i8* %r.17193, i64 1 + %incdec.ptr1608 = getelementptr i8, i8* %r.17193, i64 1 %cmp1604 = icmp ult i8* %incdec.ptr1608, %add.ptr1603 br i1 %cmp1604, label %for.body, label %for.end1609 diff --git a/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll b/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll index c74d04e..65b2cf6 100644 --- a/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll +++ b/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll @@ -20,12 +20,12 @@ if.then: ; preds = %entry do.body: ; preds = %if.else, %if.then %firstIV = phi i32* [ %incdec.ptr2, %if.else ], [ %first, %if.then ] - %incdec.ptr1 = getelementptr inbounds i32* %firstIV, i64 1 + %incdec.ptr1 = getelementptr inbounds i32, i32* %firstIV, i64 1 %cmp1 = icmp eq i32* %incdec.ptr1, %last br i1 %cmp1, label %early.exit, label %if.else if.else: ; preds = %do.body - %incdec.ptr2 = getelementptr inbounds i32* %firstIV, i64 2 + %incdec.ptr2 = getelementptr inbounds i32, i32* %firstIV, i64 2 %cmp2 = icmp eq i32* %incdec.ptr2, %last br i1 %cmp2, label %if.end, label %do.body @@ -35,6 +35,6 @@ early.exit: if.end: %tmp = phi i32* [ %first.lcssa, %early.exit ], [ %first, %if.then ], [ %first, %entry ], [ undef, %if.else ] - %val = load i32* %tmp + %val = load i32, i32* %tmp ret i32 %val } diff --git a/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll b/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll index 643d3cb..9fb281f 100644 --- a/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll +++ b/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll @@ -13,7 +13,7 @@ block9: ; preds = %block9,%func_start %undef = phi i64 [ %next_undef, %block9 ], [ undef, %func_start ] %iter = phi i64 [ %next_iter, %block9 ], [ 1, %func_start ] %next_iter = add nsw i64 %iter, 1 - %0 = tail call i32 (i8*, ...)* @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef) + %0 = tail call i32 (i8*, ...)* @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef) %next_undef = add nsw i64 %undef, 1 %_tmp_3 = icmp slt i64 %next_iter, 100 br i1 %_tmp_3, label %block9, label %exit diff --git a/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll b/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll index 2c738de..1d80e75 100644 --- a/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll +++ b/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll @@ -13,9 +13,9 @@ entry: br i1 undef, label %for.end12, label %for.cond.preheader for.cond.preheader: ; preds = %entry - %0 = load i32*** @c, align 8 - %1 = load i32** %0, align 8 - %2 = load i32* %1, align 4 + %0 = load i32**, i32*** @c, align 8 + %1 = load i32*, i32** %0, align 8 + %2 = load i32, i32* %1, align 4 br label %for.body for.body: ; preds = %for.cond.backedge, %for.body9.us, %for.cond.preheader @@ -26,7 +26,7 @@ for.body: ; preds = %for.cond.backedge, br i1 %tobool1, label %if.end, label %for.cond.backedge if.end: ; preds = %for.body - %5 = load i32* %3, align 4 + %5 = load i32, i32* %3, align 4 %tobool4 = icmp eq i32 %5, 0 br i1 %tobool4, label %for.cond3, label %for.body9.preheader @@ -35,8 +35,8 @@ for.body9.preheader: ; preds = %if.end br i1 %tobool8, label %for.body9.us, label %for.body9 for.body9.us: ; preds = %for.body9.preheader - %6 = load i32** undef, align 8 - %7 = load i32* %6, align 4 + %6 = load i32*, i32** undef, align 8 + %7 = load i32, i32* %6, align 4 br label %for.body for.cond3: ; preds = %for.cond3, %if.end diff --git a/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll b/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll index 8744b19..ae2cb7f 100644 --- a/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll +++ b/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll @@ -23,7 +23,7 @@ for.body: ; preds = %for.body.preheader, ; CHECK: phi i32 %mul = mul nsw i32 %i.06, %i.06 %0 = sext i32 %i.06 to i64 - %arrayidx = getelementptr inbounds i32* %output, i64 %0 + %arrayidx = getelementptr inbounds i32, i32* %output, i64 %0 store i32 %mul, i32* %arrayidx, align 4 %add = add nsw i32 %i.06, 3 %cmp = icmp slt i32 %add, %n diff --git a/test/Transforms/IndVarSimplify/ada-loops.ll b/test/Transforms/IndVarSimplify/ada-loops.ll index c093298..e452f03 100644 --- a/test/Transforms/IndVarSimplify/ada-loops.ll +++ b/test/Transforms/IndVarSimplify/ada-loops.ll @@ -18,7 +18,7 @@ target triple = "i686-pc-linux-gnu" define void @kinds__sbytezero([256 x i32]* nocapture %a) nounwind { bb.thread: - %tmp46 = getelementptr [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp46 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %tmp46 br label %bb @@ -27,7 +27,7 @@ bb: ; preds = %bb, %bb.thread %tmp8 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=3] %tmp1 = sext i8 %tmp8 to i32 ; <i32> [#uses=1] %tmp3 = add i32 %tmp1, 128 ; <i32> [#uses=1] - %tmp4 = getelementptr [256 x i32]* %a, i32 0, i32 %tmp3 ; <i32*> [#uses=1] + %tmp4 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 %tmp3 ; <i32*> [#uses=1] store i32 0, i32* %tmp4 %0 = icmp eq i8 %tmp8, 127 ; <i1> [#uses=1] br i1 %0, label %return, label %bb @@ -38,7 +38,7 @@ return: ; preds = %bb define void @kinds__ubytezero([256 x i32]* nocapture %a) nounwind { bb.thread: - %tmp35 = getelementptr [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp35 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %tmp35 br label %bb @@ -46,7 +46,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ 0, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=1] %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=3] %tmp1 = zext i8 %tmp7 to i32 ; <i32> [#uses=1] - %tmp3 = getelementptr [256 x i32]* %a, i32 0, i32 %tmp1 ; <i32*> [#uses=1] + %tmp3 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 %tmp1 ; <i32*> [#uses=1] store i32 0, i32* %tmp3 %0 = icmp eq i8 %tmp7, -1 ; <i1> [#uses=1] br i1 %0, label %return, label %bb @@ -63,7 +63,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ -10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, 10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 10 ; <i1> [#uses=1] @@ -81,7 +81,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ 10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, -10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 30 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/ashr-tripcount.ll b/test/Transforms/IndVarSimplify/ashr-tripcount.ll index b47c8ad..5f33730 100644 --- a/test/Transforms/IndVarSimplify/ashr-tripcount.ll +++ b/test/Transforms/IndVarSimplify/ashr-tripcount.ll @@ -29,10 +29,10 @@ bb2: ; preds = %bb1, %entry %.pn2.in = and i32 %.pn2.in.in, 3 ; <i32> [#uses=1] %.pn3 = sext i32 %.pn3.in to i64 ; <i64> [#uses=1] %.pn2 = zext i32 %.pn2.in to i64 ; <i64> [#uses=1] - %.pn.in = getelementptr [0 x float]* %pow_2_tab.pn, i64 0, i64 %.pn3 ; <float*> [#uses=1] - %.pn1.in = getelementptr [0 x float]* %pow_2_025_tab.pn, i64 0, i64 %.pn2 ; <float*> [#uses=1] - %.pn = load float* %.pn.in ; <float> [#uses=1] - %.pn1 = load float* %.pn1.in ; <float> [#uses=1] + %.pn.in = getelementptr [0 x float], [0 x float]* %pow_2_tab.pn, i64 0, i64 %.pn3 ; <float*> [#uses=1] + %.pn1.in = getelementptr [0 x float], [0 x float]* %pow_2_025_tab.pn, i64 0, i64 %.pn2 ; <float*> [#uses=1] + %.pn = load float, float* %.pn.in ; <float> [#uses=1] + %.pn1 = load float, float* %.pn1.in ; <float> [#uses=1] %invQuantizer.0 = fmul float %.pn, %.pn1 ; <float> [#uses=4] %t3 = ashr i32 %noOfLines, 2 ; <i32> [#uses=1] %t4 = icmp sgt i32 %t3, 0 ; <i1> [#uses=1] @@ -46,50 +46,50 @@ bb3: ; preds = %bb4, %bb.nph %i.05 = phi i32 [ %t49, %bb4 ], [ 0, %bb.nph ] ; <i32> [#uses=9] %k.04 = phi i32 [ %t48, %bb4 ], [ 0, %bb.nph ] ; <i32> [#uses=1] %t6 = sext i32 %i.05 to i64 ; <i64> [#uses=1] - %t7 = getelementptr i32* %quaSpectrum, i64 %t6 ; <i32*> [#uses=1] - %t8 = load i32* %t7, align 4 ; <i32> [#uses=1] + %t7 = getelementptr i32, i32* %quaSpectrum, i64 %t6 ; <i32*> [#uses=1] + %t8 = load i32, i32* %t7, align 4 ; <i32> [#uses=1] %t9 = zext i32 %t8 to i64 ; <i64> [#uses=1] - %t10 = getelementptr float* %pow4_3_tab_ptr, i64 %t9 ; <float*> [#uses=1] - %t11 = load float* %t10, align 4 ; <float> [#uses=1] + %t10 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t9 ; <float*> [#uses=1] + %t11 = load float, float* %t10, align 4 ; <float> [#uses=1] %t12 = or i32 %i.05, 1 ; <i32> [#uses=1] %t13 = sext i32 %t12 to i64 ; <i64> [#uses=1] - %t14 = getelementptr i32* %quaSpectrum, i64 %t13 ; <i32*> [#uses=1] - %t15 = load i32* %t14, align 4 ; <i32> [#uses=1] + %t14 = getelementptr i32, i32* %quaSpectrum, i64 %t13 ; <i32*> [#uses=1] + %t15 = load i32, i32* %t14, align 4 ; <i32> [#uses=1] %t16 = zext i32 %t15 to i64 ; <i64> [#uses=1] - %t17 = getelementptr float* %pow4_3_tab_ptr, i64 %t16 ; <float*> [#uses=1] - %t18 = load float* %t17, align 4 ; <float> [#uses=1] + %t17 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t16 ; <float*> [#uses=1] + %t18 = load float, float* %t17, align 4 ; <float> [#uses=1] %t19 = or i32 %i.05, 2 ; <i32> [#uses=1] %t20 = sext i32 %t19 to i64 ; <i64> [#uses=1] - %t21 = getelementptr i32* %quaSpectrum, i64 %t20 ; <i32*> [#uses=1] - %t22 = load i32* %t21, align 4 ; <i32> [#uses=1] + %t21 = getelementptr i32, i32* %quaSpectrum, i64 %t20 ; <i32*> [#uses=1] + %t22 = load i32, i32* %t21, align 4 ; <i32> [#uses=1] %t23 = zext i32 %t22 to i64 ; <i64> [#uses=1] - %t24 = getelementptr float* %pow4_3_tab_ptr, i64 %t23 ; <float*> [#uses=1] - %t25 = load float* %t24, align 4 ; <float> [#uses=1] + %t24 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t23 ; <float*> [#uses=1] + %t25 = load float, float* %t24, align 4 ; <float> [#uses=1] %t26 = or i32 %i.05, 3 ; <i32> [#uses=1] %t27 = sext i32 %t26 to i64 ; <i64> [#uses=1] - %t28 = getelementptr i32* %quaSpectrum, i64 %t27 ; <i32*> [#uses=1] - %t29 = load i32* %t28, align 4 ; <i32> [#uses=1] + %t28 = getelementptr i32, i32* %quaSpectrum, i64 %t27 ; <i32*> [#uses=1] + %t29 = load i32, i32* %t28, align 4 ; <i32> [#uses=1] %t30 = zext i32 %t29 to i64 ; <i64> [#uses=1] - %t31 = getelementptr float* %pow4_3_tab_ptr, i64 %t30 ; <float*> [#uses=1] - %t32 = load float* %t31, align 4 ; <float> [#uses=1] + %t31 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t30 ; <float*> [#uses=1] + %t32 = load float, float* %t31, align 4 ; <float> [#uses=1] %t33 = fmul float %t11, %invQuantizer.0 ; <float> [#uses=1] %t34 = sext i32 %i.05 to i64 ; <i64> [#uses=1] - %t35 = getelementptr float* %iquaSpectrum, i64 %t34 ; <float*> [#uses=1] + %t35 = getelementptr float, float* %iquaSpectrum, i64 %t34 ; <float*> [#uses=1] store float %t33, float* %t35, align 4 %t36 = or i32 %i.05, 1 ; <i32> [#uses=1] %t37 = fmul float %t18, %invQuantizer.0 ; <float> [#uses=1] %t38 = sext i32 %t36 to i64 ; <i64> [#uses=1] - %t39 = getelementptr float* %iquaSpectrum, i64 %t38 ; <float*> [#uses=1] + %t39 = getelementptr float, float* %iquaSpectrum, i64 %t38 ; <float*> [#uses=1] store float %t37, float* %t39, align 4 %t40 = or i32 %i.05, 2 ; <i32> [#uses=1] %t41 = fmul float %t25, %invQuantizer.0 ; <float> [#uses=1] %t42 = sext i32 %t40 to i64 ; <i64> [#uses=1] - %t43 = getelementptr float* %iquaSpectrum, i64 %t42 ; <float*> [#uses=1] + %t43 = getelementptr float, float* %iquaSpectrum, i64 %t42 ; <float*> [#uses=1] store float %t41, float* %t43, align 4 %t44 = or i32 %i.05, 3 ; <i32> [#uses=1] %t45 = fmul float %t32, %invQuantizer.0 ; <float> [#uses=1] %t46 = sext i32 %t44 to i64 ; <i64> [#uses=1] - %t47 = getelementptr float* %iquaSpectrum, i64 %t46 ; <float*> [#uses=1] + %t47 = getelementptr float, float* %iquaSpectrum, i64 %t46 ; <float*> [#uses=1] store float %t45, float* %t47, align 4 %t48 = add i32 %k.04, 1 ; <i32> [#uses=2] %t49 = add i32 %i.05, 4 ; <i32> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/avoid-i0.ll b/test/Transforms/IndVarSimplify/avoid-i0.ll index 22f2e4b..cc38590 100644 --- a/test/Transforms/IndVarSimplify/avoid-i0.ll +++ b/test/Transforms/IndVarSimplify/avoid-i0.ll @@ -34,25 +34,25 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i32 %_si1, i32* %_si1_addr store i8 %_si2, i8* %_si2_addr - %1 = load i8* %_si2_addr, align 1 ; <i8> [#uses=1] + %1 = load i8, i8* %_si2_addr, align 1 ; <i8> [#uses=1] %2 = sext i8 %1 to i32 ; <i32> [#uses=1] - %3 = load i32* %_si1_addr, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* %_si1_addr, align 4 ; <i32> [#uses=1] %4 = xor i32 %2, %3 ; <i32> [#uses=1] - %5 = load i8* %_si2_addr, align 1 ; <i8> [#uses=1] + %5 = load i8, i8* %_si2_addr, align 1 ; <i8> [#uses=1] %6 = sext i8 %5 to i32 ; <i32> [#uses=1] %7 = sub i32 7, %6 ; <i32> [#uses=1] - %8 = load i32* %_si1_addr, align 4 ; <i32> [#uses=1] + %8 = load i32, i32* %_si1_addr, align 4 ; <i32> [#uses=1] %9 = shl i32 %8, %7 ; <i32> [#uses=1] %10 = and i32 %4, %9 ; <i32> [#uses=1] %11 = icmp slt i32 %10, 0 ; <i1> [#uses=1] %12 = zext i1 %11 to i32 ; <i32> [#uses=1] store i32 %12, i32* %0, align 4 - %13 = load i32* %0, align 4 ; <i32> [#uses=1] + %13 = load i32, i32* %0, align 4 ; <i32> [#uses=1] store i32 %13, i32* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load i32* %retval ; <i32> [#uses=1] + %retval1 = load i32, i32* %retval ; <i32> [#uses=1] %retval12 = trunc i32 %retval1 to i8 ; <i8> [#uses=1] ret i8 %retval12 } @@ -66,15 +66,15 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i32 %_ui1, i32* %_ui1_addr store i32 %_ui2, i32* %_ui2_addr - %1 = load i32* %_ui1_addr, align 4 ; <i32> [#uses=1] + %1 = load i32, i32* %_ui1_addr, align 4 ; <i32> [#uses=1] %2 = sub i32 %1, 1 ; <i32> [#uses=1] store i32 %2, i32* %0, align 4 - %3 = load i32* %0, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* %0, align 4 ; <i32> [#uses=1] store i32 %3, i32* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load i32* %retval ; <i32> [#uses=1] + %retval1 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval1 } @@ -90,31 +90,31 @@ entry: br label %bb4 bb: ; preds = %bb4 - %0 = load volatile i32* @x, align 4 ; <i32> [#uses=1] + %0 = load volatile i32, i32* @x, align 4 ; <i32> [#uses=1] store i32 %0, i32* %vol.0, align 4 store i32 0, i32* %l_52, align 4 br label %bb2 bb1: ; preds = %bb2 - %1 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %1 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %2 = call i32 @safe_sub_func_uint64_t_u_u(i32 %1, i32 1) nounwind ; <i32> [#uses=1] store i32 %2, i32* %l_52, align 4 br label %bb2 bb2: ; preds = %bb1, %bb - %3 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %4 = icmp eq i32 %3, 0 ; <i1> [#uses=1] br i1 %4, label %bb1, label %bb3 bb3: ; preds = %bb2 - %5 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %5 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %6 = call signext i8 @safe_sub_func_int32_t_s_s(i32 %5, i8 signext 1) nounwind ; <i8> [#uses=1] %7 = sext i8 %6 to i32 ; <i32> [#uses=1] store i32 %7, i32* %l_52, align 4 br label %bb4 bb4: ; preds = %bb3, %entry - %8 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %8 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %9 = icmp ne i32 %8, 0 ; <i1> [#uses=1] br i1 %9, label %bb, label %bb5 diff --git a/test/Transforms/IndVarSimplify/backedge-on-min-max.ll b/test/Transforms/IndVarSimplify/backedge-on-min-max.ll index 250ff9a..bb26ca5 100644 --- a/test/Transforms/IndVarSimplify/backedge-on-min-max.ll +++ b/test/Transforms/IndVarSimplify/backedge-on-min-max.ll @@ -18,7 +18,7 @@ define void @min.signed.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -46,7 +46,7 @@ define void @min.signed.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -74,7 +74,7 @@ define void @min.signed.3(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -102,7 +102,7 @@ define void @min.signed.4(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -130,7 +130,7 @@ define void @max.signed.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -158,7 +158,7 @@ define void @max.signed.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -186,7 +186,7 @@ define void @max.signed.3(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -214,7 +214,7 @@ define void @max.signed.4(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -244,7 +244,7 @@ define void @min.unsigned.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -272,7 +272,7 @@ define void @min.unsigned.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -300,7 +300,7 @@ define void @min.unsigned.3(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -328,7 +328,7 @@ define void @min.unsigned.4(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -356,7 +356,7 @@ define void @max.unsigned.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -384,7 +384,7 @@ define void @max.unsigned.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -412,7 +412,7 @@ define void @max.unsigned.3(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -440,7 +440,7 @@ define void @max.unsigned.4(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch diff --git a/test/Transforms/IndVarSimplify/casted-argument.ll b/test/Transforms/IndVarSimplify/casted-argument.ll index a5e002b..9d868e8 100644 --- a/test/Transforms/IndVarSimplify/casted-argument.ll +++ b/test/Transforms/IndVarSimplify/casted-argument.ll @@ -17,7 +17,7 @@ loop: ; preds = %loop, %if.else %pn = phi i8* [ %ge, %loop ], [ null, %entry ] ; <i8*> [#uses=1] %cp = ptrtoint i8* %to to i32 ; <i32> [#uses=1] %su = sub i32 0, %cp ; <i32> [#uses=1] - %ge = getelementptr i8* %pn, i32 %su ; <i8*> [#uses=2] + %ge = getelementptr i8, i8* %pn, i32 %su ; <i8*> [#uses=2] tail call void @bcopy(i8* %ge) nounwind br label %loop } @@ -39,9 +39,9 @@ if.end54: ; preds = %if.end54, %if.else %sub.ptr.rhs.cast46.pn = ptrtoint i8* %from to i32 ; <i32> [#uses=1] %sub.ptr.lhs.cast45.pn = ptrtoint i8* %to to i32 ; <i32> [#uses=1] %sub.ptr.sub47.pn = sub i32 %sub.ptr.rhs.cast46.pn, %sub.ptr.lhs.cast45.pn ; <i32> [#uses=1] - %sub.ptr4912 = getelementptr i8* %sub.ptr4912.pn, i32 %sub.ptr.sub47.pn ; <i8*> [#uses=2] + %sub.ptr4912 = getelementptr i8, i8* %sub.ptr4912.pn, i32 %sub.ptr.sub47.pn ; <i8*> [#uses=2] tail call void @bcopy_4038(i8* %sub.ptr4912, i8* %sub.ptr7, i32 0) nounwind - %sub.ptr = getelementptr i8* %sub.ptr7, i32 %sub.ptr.rhs.cast40 ; <i8*> [#uses=1] + %sub.ptr = getelementptr i8, i8* %sub.ptr7, i32 %sub.ptr.rhs.cast40 ; <i8*> [#uses=1] br label %if.end54 } diff --git a/test/Transforms/IndVarSimplify/dangling-use.ll b/test/Transforms/IndVarSimplify/dangling-use.ll index 51c3120..24a68a9 100644 --- a/test/Transforms/IndVarSimplify/dangling-use.ll +++ b/test/Transforms/IndVarSimplify/dangling-use.ll @@ -15,7 +15,7 @@ bb49: ; preds = %bb48, %entry bb10: ; preds = %bb49 %tmp326 = mul nsw i32 %tmp1, %tmp2 ; <i32> [#uses=1] - %tmp351 = getelementptr inbounds i8* %x_addr.0, i32 %tmp326 ; <i8*> [#uses=1] + %tmp351 = getelementptr inbounds i8, i8* %x_addr.0, i32 %tmp326 ; <i8*> [#uses=1] br i1 false, label %bb.nph, label %bb48 bb.nph: ; preds = %bb10 @@ -25,7 +25,7 @@ bb23: ; preds = %bb28, %bb.nph %pOriginHi.01 = phi i8* [ %tmp351, %bb.nph ], [ %pOriginHi.0, %bb28 ] ; <i8*> [#uses=2] %tmp378 = bitcast i8* %pOriginHi.01 to i8* ; <i8*> [#uses=1] store i8* %tmp378, i8** null - %tmp385 = getelementptr inbounds i8* %pOriginHi.01, i32 %tmp2 ; <i8*> [#uses=1] + %tmp385 = getelementptr inbounds i8, i8* %pOriginHi.01, i32 %tmp2 ; <i8*> [#uses=1] br label %bb28 bb28: ; preds = %bb23 @@ -36,6 +36,6 @@ bb28.bb48_crit_edge: ; preds = %bb28 br label %bb48 bb48: ; preds = %bb28.bb48_crit_edge, %bb10 - %tmp481 = getelementptr inbounds i8* %x_addr.0, i32 1 ; <i8*> [#uses=1] + %tmp481 = getelementptr inbounds i8, i8* %x_addr.0, i32 1 ; <i8*> [#uses=1] br label %bb49 } diff --git a/test/Transforms/IndVarSimplify/elim-extend.ll b/test/Transforms/IndVarSimplify/elim-extend.ll index ad5679f..98701c3 100644 --- a/test/Transforms/IndVarSimplify/elim-extend.ll +++ b/test/Transforms/IndVarSimplify/elim-extend.ll @@ -14,15 +14,15 @@ loop: %iv = phi i32 [ %postiv, %loop ], [ 0, %entry ] %ivnsw = phi i32 [ %postivnsw, %loop ], [ 0, %entry ] %preofs = sext i32 %iv to i64 - %preadr = getelementptr i8* %base, i64 %preofs + %preadr = getelementptr i8, i8* %base, i64 %preofs store i8 0, i8* %preadr %postiv = add i32 %iv, 1 %postofs = sext i32 %postiv to i64 - %postadr = getelementptr i8* %base, i64 %postofs + %postadr = getelementptr i8, i8* %base, i64 %postofs store i8 0, i8* %postadr %postivnsw = add nsw i32 %ivnsw, 1 %postofsnsw = sext i32 %postivnsw to i64 - %postadrnsw = getelementptr i8* %base, i64 %postofsnsw + %postadrnsw = getelementptr i8, i8* %base, i64 %postofsnsw store i8 0, i8* %postadrnsw %cond = icmp sgt i32 %limit, %iv br i1 %cond, label %loop, label %exit @@ -46,15 +46,15 @@ loop: %iv = phi i32 [ %postiv, %loop ], [ %init, %entry ] %ivnsw = phi i32 [ %postivnsw, %loop ], [ %init, %entry ] %preofs = sext i32 %iv to i64 - %preadr = getelementptr i8* %base, i64 %preofs + %preadr = getelementptr i8, i8* %base, i64 %preofs store i8 0, i8* %preadr %postiv = add i32 %iv, 1 %postofs = sext i32 %postiv to i64 - %postadr = getelementptr i8* %base, i64 %postofs + %postadr = getelementptr i8, i8* %base, i64 %postofs store i8 0, i8* %postadr %postivnsw = add nsw i32 %ivnsw, 1 %postofsnsw = sext i32 %postivnsw to i64 - %postadrnsw = getelementptr i8* %base, i64 %postofsnsw + %postadrnsw = getelementptr i8, i8* %base, i64 %postofsnsw store i8 0, i8* %postadrnsw %cond = icmp sgt i32 %limit, %postiv br i1 %cond, label %loop, label %exit @@ -88,7 +88,7 @@ outerloop: %outercountdec = add i32 %outercount, -1 %ofs1 = sext i32 %outercountdec to i64 - %adr1 = getelementptr i8* %address, i64 %ofs1 + %adr1 = getelementptr i8, i8* %address, i64 %ofs1 store i8 0, i8* %adr1 br label %innerpreheader @@ -112,11 +112,11 @@ innerloop: %innerpostiv = add i32 %inneriv, 1 %ofs2 = sext i32 %inneriv to i64 - %adr2 = getelementptr i8* %address, i64 %ofs2 + %adr2 = getelementptr i8, i8* %address, i64 %ofs2 store i8 0, i8* %adr2 %ofs3 = sext i32 %innerpostiv to i64 - %adr3 = getelementptr i8* %address, i64 %ofs3 + %adr3 = getelementptr i8, i8* %address, i64 %ofs3 store i8 0, i8* %adr3 %innercmp = icmp sgt i32 %limitdec, %innerpostiv @@ -137,11 +137,11 @@ outermerge: %innercount.merge = phi i32 [ %innercount.lcssa, %innerexit ], [ %innercount, %innerpreheader ] %ofs4 = sext i32 %outercount to i64 - %adr4 = getelementptr i8* %address, i64 %ofs4 + %adr4 = getelementptr i8, i8* %address, i64 %ofs4 store i8 0, i8* %adr4 %ofs5 = sext i32 %innercount.merge to i64 - %adr5 = getelementptr i8* %address, i64 %ofs5 + %adr5 = getelementptr i8, i8* %address, i64 %ofs5 store i8 0, i8* %adr5 %outerpostcount = add i32 %outercount, 1 diff --git a/test/Transforms/IndVarSimplify/eliminate-comparison.ll b/test/Transforms/IndVarSimplify/eliminate-comparison.ll index b48403e..4d14b36 100644 --- a/test/Transforms/IndVarSimplify/eliminate-comparison.ll +++ b/test/Transforms/IndVarSimplify/eliminate-comparison.ll @@ -16,7 +16,7 @@ entry: br i1 %cmp9, label %pre, label %return pre: - %t3 = load i32* %p + %t3 = load i32, i32* %p %tobool.not = icmp ne i32 %t3, 0 br label %loop @@ -27,7 +27,7 @@ loop: br i1 %cond, label %if.then, label %for.inc if.then: - %arrayidx = getelementptr [0 x double]* @X, i64 0, i64 %i + %arrayidx = getelementptr [0 x double], [0 x double]* @X, i64 0, i64 %i store double 3.200000e+00, double* %arrayidx br label %for.inc @@ -50,22 +50,22 @@ entry: br label %bb18 bb13: - %tmp66 = load i64** %tmp65, align 4 - %tmp68 = getelementptr inbounds i64* %tmp66, i32 %i - %tmp69 = load i64* %tmp68, align 4 - %tmp74 = load i64** %tmp73, align 4 - %tmp76 = getelementptr inbounds i64* %tmp74, i32 %i - %tmp77 = load i64* %tmp76, align 4 + %tmp66 = load i64*, i64** %tmp65, align 4 + %tmp68 = getelementptr inbounds i64, i64* %tmp66, i32 %i + %tmp69 = load i64, i64* %tmp68, align 4 + %tmp74 = load i64*, i64** %tmp73, align 4 + %tmp76 = getelementptr inbounds i64, i64* %tmp74, i32 %i + %tmp77 = load i64, i64* %tmp76, align 4 %tmp78 = icmp ugt i64 %tmp69, %tmp77 br i1 %tmp78, label %bb20.loopexit, label %bb15 bb15: - %tmp83 = load i64** %tmp82, align 4 - %tmp85 = getelementptr inbounds i64* %tmp83, i32 %i - %tmp86 = load i64* %tmp85, align 4 - %tmp91 = load i64** %tmp90, align 4 - %tmp93 = getelementptr inbounds i64* %tmp91, i32 %i - %tmp94 = load i64* %tmp93, align 4 + %tmp83 = load i64*, i64** %tmp82, align 4 + %tmp85 = getelementptr inbounds i64, i64* %tmp83, i32 %i + %tmp86 = load i64, i64* %tmp85, align 4 + %tmp91 = load i64*, i64** %tmp90, align 4 + %tmp93 = getelementptr inbounds i64, i64* %tmp91, i32 %i + %tmp94 = load i64, i64* %tmp93, align 4 %tmp95 = icmp ult i64 %tmp86, %tmp94 br i1 %tmp95, label %bb20.loopexit, label %bb17 diff --git a/test/Transforms/IndVarSimplify/eliminate-max.ll b/test/Transforms/IndVarSimplify/eliminate-max.ll index 98510ea..125ed74 100644 --- a/test/Transforms/IndVarSimplify/eliminate-max.ll +++ b/test/Transforms/IndVarSimplify/eliminate-max.ll @@ -45,7 +45,7 @@ bb14: ; preds = %bb11, %bb7 br i1 %t20, label %bb1, label %bb21 bb21: ; preds = %bb14 - %t22 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind + %t22 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind ret i32 0 } diff --git a/test/Transforms/IndVarSimplify/eliminate-rem.ll b/test/Transforms/IndVarSimplify/eliminate-rem.ll index 64fe710..6f8e6bb 100644 --- a/test/Transforms/IndVarSimplify/eliminate-rem.ll +++ b/test/Transforms/IndVarSimplify/eliminate-rem.ll @@ -18,7 +18,7 @@ bb4: ; preds = %bb bb5: ; preds = %bb4, %bb5 %t6 = phi i64 [ %t9, %bb5 ], [ 0, %bb4 ] ; <i64> [#uses=2] %t7 = srem i64 %t6, %arg ; <i64> [#uses=1] - %t8 = getelementptr inbounds double* %arg3, i64 %t7 ; <double*> [#uses=1] + %t8 = getelementptr inbounds double, double* %arg3, i64 %t7 ; <double*> [#uses=1] store double 0.000000e+00, double* %t8 %t9 = add nsw i64 %t6, 1 ; <i64> [#uses=2] %t10 = icmp slt i64 %t9, %arg ; <i1> [#uses=1] @@ -78,16 +78,16 @@ bb21: ; preds = %bb21, %bb20 %t26 = add nsw i64 %t24, %t22 ; <i64> [#uses=1] %t27 = mul i64 %t11, %arg1 ; <i64> [#uses=1] %t28 = add nsw i64 %t25, %t22 ; <i64> [#uses=1] - %t29 = getelementptr inbounds i64* %arg, i64 %t26 ; <i64*> [#uses=1] + %t29 = getelementptr inbounds i64, i64* %arg, i64 %t26 ; <i64*> [#uses=1] %t30 = add nsw i64 %t27, %t22 ; <i64> [#uses=1] - %t31 = getelementptr inbounds i64* %arg, i64 %t28 ; <i64*> [#uses=1] + %t31 = getelementptr inbounds i64, i64* %arg, i64 %t28 ; <i64*> [#uses=1] %t32 = zext i32 %t23 to i64 ; <i64> [#uses=1] - %t33 = load i64* %t29 ; <i64> [#uses=1] - %t34 = getelementptr inbounds i64* %arg, i64 %t30 ; <i64*> [#uses=1] - %t35 = load i64* %t31 ; <i64> [#uses=1] + %t33 = load i64, i64* %t29 ; <i64> [#uses=1] + %t34 = getelementptr inbounds i64, i64* %arg, i64 %t30 ; <i64*> [#uses=1] + %t35 = load i64, i64* %t31 ; <i64> [#uses=1] %t36 = add nsw i64 %t32, %t33 ; <i64> [#uses=1] %t37 = add nsw i64 %t36, %t35 ; <i64> [#uses=1] - %t38 = load i64* %t34 ; <i64> [#uses=1] + %t38 = load i64, i64* %t34 ; <i64> [#uses=1] %t39 = add nsw i64 %t37, %t38 ; <i64> [#uses=1] %t40 = trunc i64 %t39 to i32 ; <i32> [#uses=2] %t41 = add nsw i64 %t22, 1 ; <i64> [#uses=2] diff --git a/test/Transforms/IndVarSimplify/indirectbr.ll b/test/Transforms/IndVarSimplify/indirectbr.ll index a208ded..d580169 100644 --- a/test/Transforms/IndVarSimplify/indirectbr.ll +++ b/test/Transforms/IndVarSimplify/indirectbr.ll @@ -32,8 +32,8 @@ bb14: ; preds = %bb14, %bb7.preheade bb16: ; preds = %bb16, %bb14, %bb7.preheader %S.31.0 = phi i64 [ %3, %bb16 ], [ 1, %bb7.preheader ], [ 1, %bb14 ] ; <i64> [#uses=2] %0 = add nsw i64 %S.31.0, -1 ; <i64> [#uses=1] - %1 = getelementptr inbounds [3 x double]* undef, i64 0, i64 %0 ; <double*> [#uses=1] - %2 = load double* %1, align 8 ; <double> [#uses=0] + %1 = getelementptr inbounds [3 x double], [3 x double]* undef, i64 0, i64 %0 ; <double*> [#uses=1] + %2 = load double, double* %1, align 8 ; <double> [#uses=0] %3 = add nsw i64 %S.31.0, 1 ; <i64> [#uses=1] br label %bb16 } diff --git a/test/Transforms/IndVarSimplify/iv-fold.ll b/test/Transforms/IndVarSimplify/iv-fold.ll index 41a1f5f..af8a33b 100644 --- a/test/Transforms/IndVarSimplify/iv-fold.ll +++ b/test/Transforms/IndVarSimplify/iv-fold.ll @@ -13,12 +13,12 @@ entry: while.body: %0 = phi i32 [ 0, %entry ], [ %inc.2, %while.body ] %shr = lshr i32 %0, 5 - %arrayidx = getelementptr inbounds i32* %bitmap, i32 %shr - %tmp6 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr + %tmp6 = load i32, i32* %arrayidx, align 4 %inc.1 = add i32 %0, 1 %shr.1 = lshr i32 %inc.1, 5 - %arrayidx.1 = getelementptr inbounds i32* %bitmap, i32 %shr.1 - %tmp6.1 = load i32* %arrayidx.1, align 4 + %arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1 + %tmp6.1 = load i32, i32* %arrayidx.1, align 4 %inc.2 = add i32 %inc.1, 1 %exitcond.3 = icmp eq i32 %inc.2, 128 br i1 %exitcond.3, label %while.end, label %while.body @@ -40,12 +40,12 @@ entry: while.body: %0 = phi i32 [ 0, %entry ], [ %inc.3, %while.body ] %shr = lshr i32 %0, 5 - %arrayidx = getelementptr inbounds i32* %bitmap, i32 %shr - %tmp6 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr + %tmp6 = load i32, i32* %arrayidx, align 4 %inc.1 = add i32 %0, 1 %shr.1 = lshr i32 %inc.1, 5 - %arrayidx.1 = getelementptr inbounds i32* %bitmap, i32 %shr.1 - %tmp6.1 = load i32* %arrayidx.1, align 4 + %arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1 + %tmp6.1 = load i32, i32* %arrayidx.1, align 4 %inc.3 = add i32 %inc.1, 2 %exitcond.3 = icmp eq i32 %inc.3, 96 br i1 %exitcond.3, label %while.end, label %while.body diff --git a/test/Transforms/IndVarSimplify/iv-sext.ll b/test/Transforms/IndVarSimplify/iv-sext.ll index 04df0f9..89e21e1 100644 --- a/test/Transforms/IndVarSimplify/iv-sext.ll +++ b/test/Transforms/IndVarSimplify/iv-sext.ll @@ -8,7 +8,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define void @t(float* %pTmp1, float* %peakWeight, float* %nrgReducePeakrate, i32 %bandEdgeIndex, float %tmp1) nounwind { entry: - %tmp = load float* %peakWeight, align 4 ; <float> [#uses=1] + %tmp = load float, float* %peakWeight, align 4 ; <float> [#uses=1] %tmp2 = icmp sgt i32 %bandEdgeIndex, 0 ; <i1> [#uses=1] br i1 %tmp2, label %bb.nph22, label %return @@ -33,13 +33,13 @@ bb: ; preds = %bb8, %bb.nph22 bb1: ; preds = %bb %tmp5 = add i32 %part.016, -1 ; <i32> [#uses=1] %tmp6 = sext i32 %tmp5 to i64 ; <i64> [#uses=1] - %tmp7 = getelementptr float* %pTmp1, i64 %tmp6 ; <float*> [#uses=1] - %tmp8 = load float* %tmp7, align 4 ; <float> [#uses=1] + %tmp7 = getelementptr float, float* %pTmp1, i64 %tmp6 ; <float*> [#uses=1] + %tmp8 = load float, float* %tmp7, align 4 ; <float> [#uses=1] %tmp9 = fadd float %tmp8, %distERBlo.120 ; <float> [#uses=1] %tmp10 = add i32 %part.016, -1 ; <i32> [#uses=1] %tmp11 = sext i32 %tmp10 to i64 ; <i64> [#uses=1] - %tmp12 = getelementptr float* %pTmp1, i64 %tmp11 ; <float*> [#uses=1] - %tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1] + %tmp12 = getelementptr float, float* %pTmp1, i64 %tmp11 ; <float*> [#uses=1] + %tmp13 = load float, float* %tmp12, align 4 ; <float> [#uses=1] %tmp14 = fsub float %distERBhi.121, %tmp13 ; <float> [#uses=1] br label %bb3.preheader @@ -57,12 +57,12 @@ bb2: ; preds = %bb3, %bb.nph %loPart.02 = phi i32 [ %tmp24, %bb3 ], [ %loPart.118, %bb.nph ] ; <i32> [#uses=3] %peakCount.01 = phi float [ %tmp23, %bb3 ], [ %peakCount.117, %bb.nph ] ; <float> [#uses=1] %tmp16 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1] - %tmp17 = getelementptr float* %pTmp1, i64 %tmp16 ; <float*> [#uses=1] - %tmp18 = load float* %tmp17, align 4 ; <float> [#uses=1] + %tmp17 = getelementptr float, float* %pTmp1, i64 %tmp16 ; <float*> [#uses=1] + %tmp18 = load float, float* %tmp17, align 4 ; <float> [#uses=1] %tmp19 = fsub float %distERBlo.03, %tmp18 ; <float> [#uses=3] %tmp20 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1] - %tmp21 = getelementptr float* %peakWeight, i64 %tmp20 ; <float*> [#uses=1] - %tmp22 = load float* %tmp21, align 4 ; <float> [#uses=1] + %tmp21 = getelementptr float, float* %peakWeight, i64 %tmp20 ; <float*> [#uses=1] + %tmp22 = load float, float* %tmp21, align 4 ; <float> [#uses=1] %tmp23 = fsub float %peakCount.01, %tmp22 ; <float> [#uses=2] %tmp24 = add i32 %loPart.02, 1 ; <i32> [#uses=2] br label %bb3 @@ -97,13 +97,13 @@ bb4: ; preds = %bb5, %bb.nph12 %hiPart.08 = phi i32 [ %tmp31, %bb5 ], [ %hiPart.119, %bb.nph12 ] ; <i32> [#uses=2] %peakCount.27 = phi float [ %tmp35, %bb5 ], [ %peakCount.0.lcssa, %bb.nph12 ] ; <float> [#uses=1] %tmp27 = sext i32 %hiPart.08 to i64 ; <i64> [#uses=1] - %tmp28 = getelementptr float* %pTmp1, i64 %tmp27 ; <float*> [#uses=1] - %tmp29 = load float* %tmp28, align 4 ; <float> [#uses=1] + %tmp28 = getelementptr float, float* %pTmp1, i64 %tmp27 ; <float*> [#uses=1] + %tmp29 = load float, float* %tmp28, align 4 ; <float> [#uses=1] %tmp30 = fadd float %tmp29, %distERBhi.29 ; <float> [#uses=3] %tmp31 = add i32 %hiPart.08, 1 ; <i32> [#uses=4] %tmp32 = sext i32 %tmp31 to i64 ; <i64> [#uses=1] - %tmp33 = getelementptr float* %peakWeight, i64 %tmp32 ; <float*> [#uses=1] - %tmp34 = load float* %tmp33, align 4 ; <float> [#uses=1] + %tmp33 = getelementptr float, float* %peakWeight, i64 %tmp32 ; <float*> [#uses=1] + %tmp34 = load float, float* %tmp33, align 4 ; <float> [#uses=1] %tmp35 = fadd float %tmp34, %peakCount.27 ; <float> [#uses=2] br label %bb5 @@ -132,7 +132,7 @@ bb7: ; preds = %bb5.bb7_crit_edge, %bb5.preheader %tmp42 = fadd float %tmp41, 1.000000e+00 ; <float> [#uses=1] %tmp43 = fdiv float 1.000000e+00, %tmp42 ; <float> [#uses=1] %tmp44 = sext i32 %part.016 to i64 ; <i64> [#uses=1] - %tmp45 = getelementptr float* %nrgReducePeakrate, i64 %tmp44 ; <float*> [#uses=1] + %tmp45 = getelementptr float, float* %nrgReducePeakrate, i64 %tmp44 ; <float*> [#uses=1] store float %tmp43, float* %tmp45, align 4 %tmp46 = add i32 %part.016, 1 ; <i32> [#uses=2] br label %bb8 diff --git a/test/Transforms/IndVarSimplify/iv-widen.ll b/test/Transforms/IndVarSimplify/iv-widen.ll index c899e2f..464b03c 100644 --- a/test/Transforms/IndVarSimplify/iv-widen.ll +++ b/test/Transforms/IndVarSimplify/iv-widen.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -indvars -S | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + target triple = "x86_64-apple-darwin" ; CHECK-LABEL: @sloop @@ -20,8 +24,8 @@ B18: ; preds = %B24, %Prologue %.02 = phi i32 [ 0, %Prologue ], [ %tmp33, %B24 ] %tmp23 = zext i32 %.02 to i64 %tmp33 = add i32 %.02, 1 - %o = getelementptr i32* %a, i32 %.02 - %v = load i32* %o + %o = getelementptr i32, i32* %a, i32 %.02 + %v = load i32, i32* %o %t = icmp eq i32 %v, 0 br i1 %t, label %exit24, label %B24 diff --git a/test/Transforms/IndVarSimplify/iv-zext.ll b/test/Transforms/IndVarSimplify/iv-zext.ll index ed0514b..629a85e 100644 --- a/test/Transforms/IndVarSimplify/iv-zext.ll +++ b/test/Transforms/IndVarSimplify/iv-zext.ll @@ -11,17 +11,17 @@ entry: loop: %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %loop ] %indvar.i8 = and i64 %indvar, 255 - %t0 = getelementptr double* %d, i64 %indvar.i8 - %t1 = load double* %t0 + %t0 = getelementptr double, double* %d, i64 %indvar.i8 + %t1 = load double, double* %t0 %t2 = fmul double %t1, 0.1 store double %t2, double* %t0 %indvar.i24 = and i64 %indvar, 16777215 - %t3 = getelementptr double* %d, i64 %indvar.i24 - %t4 = load double* %t3 + %t3 = getelementptr double, double* %d, i64 %indvar.i24 + %t4 = load double, double* %t3 %t5 = fmul double %t4, 2.3 store double %t5, double* %t3 - %t6 = getelementptr double* %d, i64 %indvar - %t7 = load double* %t6 + %t6 = getelementptr double, double* %d, i64 %indvar + %t7 = load double, double* %t6 %t8 = fmul double %t7, 4.5 store double %t8, double* %t6 %indvar.next = add i64 %indvar, 1 diff --git a/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll b/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll index 9e55a17..feb4b35 100644 --- a/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll +++ b/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll @@ -6,12 +6,12 @@ define void @ptriv_as2(i8 addrspace(2)* %base, i32 %n) nounwind { ; CHECK-LABEL: @ptriv_as2( entry: %idx.trunc = trunc i32 %n to i8 - %add.ptr = getelementptr inbounds i8 addrspace(2)* %base, i8 %idx.trunc + %add.ptr = getelementptr inbounds i8, i8 addrspace(2)* %base, i8 %idx.trunc %cmp1 = icmp ult i8 addrspace(2)* %base, %add.ptr br i1 %cmp1, label %for.body, label %for.end ; Make sure the added GEP has the right index type -; CHECK: %lftr.limit = getelementptr i8 addrspace(2)* %base, i8 +; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(2)* %base, i8 %0 ; CHECK: for.body: ; CHECK: phi i8 addrspace(2)* @@ -26,7 +26,7 @@ for.body: %sub.ptr.rhs.cast = ptrtoint i8 addrspace(2)* %base to i8 %sub.ptr.sub = sub i8 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast store i8 %sub.ptr.sub, i8 addrspace(2)* %p.02 - %incdec.ptr = getelementptr inbounds i8 addrspace(2)* %p.02, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8 addrspace(2)* %p.02, i32 1 %cmp = icmp ult i8 addrspace(2)* %incdec.ptr, %add.ptr br i1 %cmp, label %for.body, label %for.end @@ -38,12 +38,12 @@ define void @ptriv_as3(i8 addrspace(3)* %base, i32 %n) nounwind { ; CHECK-LABEL: @ptriv_as3( entry: %idx.trunc = trunc i32 %n to i16 - %add.ptr = getelementptr inbounds i8 addrspace(3)* %base, i16 %idx.trunc + %add.ptr = getelementptr inbounds i8, i8 addrspace(3)* %base, i16 %idx.trunc %cmp1 = icmp ult i8 addrspace(3)* %base, %add.ptr br i1 %cmp1, label %for.body, label %for.end ; Make sure the added GEP has the right index type -; CHECK: %lftr.limit = getelementptr i8 addrspace(3)* %base, i16 +; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(3)* %base, i16 %0 ; CHECK: for.body: ; CHECK: phi i8 addrspace(3)* @@ -59,7 +59,7 @@ for.body: %sub.ptr.sub = sub i16 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %conv = trunc i16 %sub.ptr.sub to i8 store i8 %conv, i8 addrspace(3)* %p.02 - %incdec.ptr = getelementptr inbounds i8 addrspace(3)* %p.02, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8 addrspace(3)* %p.02, i32 1 %cmp = icmp ult i8 addrspace(3)* %incdec.ptr, %add.ptr br i1 %cmp, label %for.body, label %for.end diff --git a/test/Transforms/IndVarSimplify/lftr-extend-const.ll b/test/Transforms/IndVarSimplify/lftr-extend-const.ll index f12c68c..fa3166d 100644 --- a/test/Transforms/IndVarSimplify/lftr-extend-const.ll +++ b/test/Transforms/IndVarSimplify/lftr-extend-const.ll @@ -1,5 +1,9 @@ ;RUN: opt -S %s -indvars | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; CHECK-LABEL: @foo( ; CHECK-NOT: %lftr.wideiv = trunc i32 %indvars.iv.next to i16 ; CHECK: %exitcond = icmp ne i32 %indvars.iv.next, 512 diff --git a/test/Transforms/IndVarSimplify/lftr-promote.ll b/test/Transforms/IndVarSimplify/lftr-promote.ll index c4ecc84..4fe3191 100644 --- a/test/Transforms/IndVarSimplify/lftr-promote.ll +++ b/test/Transforms/IndVarSimplify/lftr-promote.ll @@ -17,11 +17,11 @@ bb.nph: ; preds = %entry bb2: ; preds = %bb3, %bb.nph %i.01 = phi i32 [ %7, %bb3 ], [ 0, %bb.nph ] ; <i32> [#uses=3] %1 = sext i32 %i.01 to i64 ; <i64> [#uses=1] - %2 = getelementptr double* %p, i64 %1 ; <double*> [#uses=1] - %3 = load double* %2, align 8 ; <double> [#uses=1] + %2 = getelementptr double, double* %p, i64 %1 ; <double*> [#uses=1] + %3 = load double, double* %2, align 8 ; <double> [#uses=1] %4 = fmul double %3, 1.100000e+00 ; <double> [#uses=1] %5 = sext i32 %i.01 to i64 ; <i64> [#uses=1] - %6 = getelementptr double* %p, i64 %5 ; <double*> [#uses=1] + %6 = getelementptr double, double* %p, i64 %5 ; <double*> [#uses=1] store double %4, double* %6, align 8 %7 = add i32 %i.01, 1 ; <i32> [#uses=2] br label %bb3 diff --git a/test/Transforms/IndVarSimplify/lftr-reuse.ll b/test/Transforms/IndVarSimplify/lftr-reuse.ll index efb96bd..b4e1fde 100644 --- a/test/Transforms/IndVarSimplify/lftr-reuse.ll +++ b/test/Transforms/IndVarSimplify/lftr-reuse.ll @@ -12,7 +12,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define void @ptriv(i8* %base, i32 %n) nounwind { entry: %idx.ext = sext i32 %n to i64 - %add.ptr = getelementptr inbounds i8* %base, i64 %idx.ext + %add.ptr = getelementptr inbounds i8, i8* %base, i64 %idx.ext %cmp1 = icmp ult i8* %base, %add.ptr br i1 %cmp1, label %for.body, label %for.end @@ -30,7 +30,7 @@ for.body: %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %conv = trunc i64 %sub.ptr.sub to i8 store i8 %conv, i8* %p.02 - %incdec.ptr = getelementptr inbounds i8* %p.02, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8* %p.02, i32 1 %cmp = icmp ult i8* %incdec.ptr, %add.ptr br i1 %cmp, label %for.body, label %for.end @@ -82,23 +82,15 @@ exit: ; Perform LFTR without generating extra preheader code. define void @guardedloop([0 x double]* %matrix, [0 x double]* %vector, i32 %irow, i32 %ilead) nounwind { -; CHECK-LABEL: @guardedloop( -; CHECK-LABEL: entry: -; CHECK-NEXT: %[[cmp:.*]] = icmp slt i32 1, %irow -; CHECK-NEXT: br i1 %[[cmp]], label %[[loop_preheader:.*]], label %[[return:.*]] - -; CHECK: [[loop_preheader]]: -; CHECK-NEXT: %[[sext:.*]] = sext i32 %ilead to i64 -; CHECK-NEXT: %[[add:.*]] = add i32 %irow, -1 -; CHECK-NEXT: br label %[[loop:.*]] - -; CHECK: [[loop]]: -; CHECK-NEXT: %[[indvars_iv2:.*]] = phi i64 -; CHECK-NEXT: phi i64 +; CHECK: entry: +; CHECK-NOT: zext +; CHECK-NOT: add +; CHECK: loop: +; CHECK: phi i64 +; CHECK: phi i64 ; CHECK-NOT: phi -; CHECK: %[[lftr_wideiv:.*]] = trunc i64 %[[indvars_iv2]] to i32 -; CHECK-NEXT: %[[exitcond:.*]] = icmp ne i32 %[[lftr_wideiv]], %[[add]] -; CHECK-NEXT: br i1 %[[exitcond]], label %[[loop]], label +; CHECK: icmp ne +; CHECK: br i1 entry: %cmp = icmp slt i32 1, %irow br i1 %cmp, label %loop, label %return @@ -108,11 +100,11 @@ loop: %i = phi i32 [ 0, %entry ], [ %i.inc, %loop ] %diagidx = add nsw i32 %rowidx, %i %diagidxw = sext i32 %diagidx to i64 - %matrixp = getelementptr inbounds [0 x double]* %matrix, i32 0, i64 %diagidxw - %v1 = load double* %matrixp + %matrixp = getelementptr inbounds [0 x double], [0 x double]* %matrix, i32 0, i64 %diagidxw + %v1 = load double, double* %matrixp %iw = sext i32 %i to i64 - %vectorp = getelementptr inbounds [0 x double]* %vector, i32 0, i64 %iw - %v2 = load double* %vectorp + %vectorp = getelementptr inbounds [0 x double], [0 x double]* %vector, i32 0, i64 %iw + %v2 = load double, double* %vectorp %row.inc = add nsw i32 %rowidx, %ilead %i.inc = add nsw i32 %i, 1 %cmp196 = icmp slt i32 %i.inc, %irow @@ -142,11 +134,11 @@ loop: %i = phi i32 [ 0, %entry ], [ %i.inc, %loop ] %diagidx = add nsw i32 %rowidx, %i %diagidxw = sext i32 %diagidx to i64 - %matrixp = getelementptr inbounds [0 x double]* %matrix, i32 0, i64 %diagidxw - %v1 = load double* %matrixp + %matrixp = getelementptr inbounds [0 x double], [0 x double]* %matrix, i32 0, i64 %diagidxw + %v1 = load double, double* %matrixp %iw = sext i32 %i to i64 - %vectorp = getelementptr inbounds [0 x double]* %vector, i32 0, i64 %iw - %v2 = load double* %vectorp + %vectorp = getelementptr inbounds [0 x double], [0 x double]* %vector, i32 0, i64 %iw + %v2 = load double, double* %vectorp %row.inc = add nsw i32 %rowidx, %ilead %i.inc = add nsw i32 %i, 1 %cmp196 = icmp slt i32 %i.inc, %irow @@ -165,9 +157,9 @@ return: define void @geplftr(i8* %base, i32 %x, i32 %y, i32 %n) nounwind { entry: %x.ext = sext i32 %x to i64 - %add.ptr = getelementptr inbounds i8* %base, i64 %x.ext + %add.ptr = getelementptr inbounds i8, i8* %base, i64 %x.ext %y.ext = sext i32 %y to i64 - %add.ptr10 = getelementptr inbounds i8* %add.ptr, i64 %y.ext + %add.ptr10 = getelementptr inbounds i8, i8* %add.ptr, i64 %y.ext %lim = add i32 %x, %n %cmp.ph = icmp ult i32 %x, %lim br i1 %cmp.ph, label %loop, label %exit @@ -182,7 +174,7 @@ entry: loop: %i = phi i32 [ %x, %entry ], [ %inc, %loop ] %aptr = phi i8* [ %add.ptr10, %entry ], [ %incdec.ptr, %loop ] - %incdec.ptr = getelementptr inbounds i8* %aptr, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8* %aptr, i32 1 store i8 3, i8* %aptr %inc = add i32 %i, 1 %cmp = icmp ult i32 %inc, %lim @@ -215,8 +207,8 @@ exit: ; Test LFTR on an IV whose recurrence start is a non-unit pointer type. define void @aryptriv([256 x i8]* %base, i32 %n) nounwind { entry: - %ivstart = getelementptr inbounds [256 x i8]* %base, i32 0, i32 0 - %ivend = getelementptr inbounds [256 x i8]* %base, i32 0, i32 %n + %ivstart = getelementptr inbounds [256 x i8], [256 x i8]* %base, i32 0, i32 0 + %ivend = getelementptr inbounds [256 x i8], [256 x i8]* %base, i32 0, i32 %n %cmp.ph = icmp ult i8* %ivstart, %ivend br i1 %cmp.ph, label %loop, label %exit @@ -229,7 +221,7 @@ entry: ; CHECK: br i1 loop: %aptr = phi i8* [ %ivstart, %entry ], [ %incdec.ptr, %loop ] - %incdec.ptr = getelementptr inbounds i8* %aptr, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8* %aptr, i32 1 store i8 3, i8* %aptr %cmp = icmp ult i8* %incdec.ptr, %ivend br i1 %cmp, label %loop, label %exit diff --git a/test/Transforms/IndVarSimplify/lftr-zext.ll b/test/Transforms/IndVarSimplify/lftr-zext.ll index 32fa61a..e654e14 100644 --- a/test/Transforms/IndVarSimplify/lftr-zext.ll +++ b/test/Transforms/IndVarSimplify/lftr-zext.ll @@ -11,11 +11,11 @@ define void @foo(i8* %a) nounwind uwtable ssp { ; <label>:1 ; preds = %0, %1 %i.0 = phi i8 [ 0, %0 ], [ %5, %1 ] - %p.0 = phi i8* [ getelementptr inbounds ([240 x i8]* @data, i64 0, i64 0), %0 ], [ %4, %1 ] + %p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %0 ], [ %4, %1 ] %.0 = phi i8* [ %a, %0 ], [ %2, %1 ] - %2 = getelementptr inbounds i8* %.0, i64 1 - %3 = load i8* %.0, align 1 - %4 = getelementptr inbounds i8* %p.0, i64 1 + %2 = getelementptr inbounds i8, i8* %.0, i64 1 + %3 = load i8, i8* %.0, align 1 + %4 = getelementptr inbounds i8, i8* %p.0, i64 1 store i8 %3, i8* %p.0, align 1 %5 = add i8 %i.0, 1 %6 = icmp ult i8 %5, -16 diff --git a/test/Transforms/IndVarSimplify/lftr_simple.ll b/test/Transforms/IndVarSimplify/lftr_simple.ll index e373013..6a8d937 100644 --- a/test/Transforms/IndVarSimplify/lftr_simple.ll +++ b/test/Transforms/IndVarSimplify/lftr_simple.ll @@ -1,7 +1,11 @@ -; LFTR should eliminate the need for the computation of i*i completely. It +; LFTR should eliminate the need for the computation of i*i completely. It ; is only used to compute the exit value. ; RUN: opt < %s -indvars -dce -S | not grep mul +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + @A = external global i32 ; <i32*> [#uses=1] define i32 @quadratic_setlt() { diff --git a/test/Transforms/IndVarSimplify/loop_evaluate7.ll b/test/Transforms/IndVarSimplify/loop_evaluate7.ll index b9c0b12..333ab7a 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate7.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate7.ll @@ -21,7 +21,7 @@ bb19: ; preds = %bb30 br i1 undef, label %bb20, label %bb29 bb20: ; preds = %bb19 - %0 = load i32* undef, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* undef, align 4 ; <i32> [#uses=1] %1 = sub i32 %0, %n ; <i32> [#uses=1] br label %bb23 @@ -30,7 +30,7 @@ bb21: ; preds = %bb23 br i1 %2, label %bb22, label %overflow2 bb22: ; preds = %bb21 - %3 = getelementptr i8* %q.0, i32 1 ; <i8*> [#uses=1] + %3 = getelementptr i8, i8* %q.0, i32 1 ; <i8*> [#uses=1] br label %bb23 bb23: ; preds = %bb22, %bb20 diff --git a/test/Transforms/IndVarSimplify/loop_evaluate8.ll b/test/Transforms/IndVarSimplify/loop_evaluate8.ll index 2a9d205..28d05df 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate8.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate8.ll @@ -23,7 +23,7 @@ bb19: ; preds = %bb30 br i1 undef, label %bb20, label %bb29 bb20: ; preds = %bb19 - %0 = load i32* undef, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* undef, align 4 ; <i32> [#uses=1] %1 = sub i32 %0, undef ; <i32> [#uses=1] br label %bb23 @@ -32,7 +32,7 @@ bb21: ; preds = %bb23 br i1 %2, label %bb22, label %overflow2 bb22: ; preds = %bb21 - %3 = getelementptr i8* %q.0, i32 1 ; <i8*> [#uses=1] + %3 = getelementptr i8, i8* %q.0, i32 1 ; <i8*> [#uses=1] br label %bb23 bb23: ; preds = %bb22, %bb20 diff --git a/test/Transforms/IndVarSimplify/loop_evaluate9.ll b/test/Transforms/IndVarSimplify/loop_evaluate9.ll index 21fb7ef..7a69bd2 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate9.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate9.ll @@ -28,7 +28,7 @@ bb1.i: ; preds = %bb2.i, %entry br i1 %tmp1, label %bb.i.i, label %bb1.i.i bb.i.i: ; preds = %bb1.i - tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn + tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn unreachable bb1.i.i: ; preds = %bb1.i @@ -39,7 +39,7 @@ bb1.i.i: ; preds = %bb1.i br i1 %tmp3, label %bb2.i.i, label %cc70a02__complex_integers__Oadd.153.exit.i bb2.i.i: ; preds = %bb1.i.i - tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn + tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn unreachable cc70a02__complex_integers__Oadd.153.exit.i: ; preds = %bb1.i.i diff --git a/test/Transforms/IndVarSimplify/masked-iv.ll b/test/Transforms/IndVarSimplify/masked-iv.ll index f1f5af9..24fe33d 100644 --- a/test/Transforms/IndVarSimplify/masked-iv.ll +++ b/test/Transforms/IndVarSimplify/masked-iv.ll @@ -16,7 +16,7 @@ bb.preheader: ; preds = %entry bb: ; preds = %bb, %bb.preheader %i.01 = phi i64 [ %t6, %bb ], [ %a, %bb.preheader ] ; <i64> [#uses=3] %t1 = and i64 %i.01, 255 ; <i64> [#uses=1] - %t2 = getelementptr i64* %A, i64 %t1 ; <i64*> [#uses=1] + %t2 = getelementptr i64, i64* %A, i64 %t1 ; <i64*> [#uses=1] store i64 %i.01, i64* %t2, align 8 %t6 = add i64 %i.01, %s ; <i64> [#uses=1] br label %bb diff --git a/test/Transforms/IndVarSimplify/no-iv-rewrite.ll b/test/Transforms/IndVarSimplify/no-iv-rewrite.ll index a7023f2..ca7b899 100644 --- a/test/Transforms/IndVarSimplify/no-iv-rewrite.ll +++ b/test/Transforms/IndVarSimplify/no-iv-rewrite.ll @@ -28,8 +28,8 @@ loop: %i.02 = phi i32 [ 0, %ph ], [ %iinc, %loop ] %s.01 = phi i32 [ 0, %ph ], [ %sinc, %loop ] %ofs = sext i32 %i.02 to i64 - %adr = getelementptr inbounds i32* %arr, i64 %ofs - %val = load i32* %adr + %adr = getelementptr inbounds i32, i32* %arr, i64 %ofs + %val = load i32, i32* %adr %sinc = add nsw i32 %s.01, %val %iinc = add nsw i32 %i.02, 1 %cond = icmp slt i32 %iinc, %n @@ -69,8 +69,8 @@ loop: %i.02 = phi i32 [ 0, %ph ], [ %iinc, %loop ] %s.01 = phi i64 [ 0, %ph ], [ %sinc, %loop ] %ofs = sext i32 %i.02 to i64 - %adr = getelementptr inbounds i32* %arr, i64 %ofs - %val = load i32* %adr + %adr = getelementptr inbounds i32, i32* %arr, i64 %ofs + %val = load i32, i32* %adr %vall = sext i32 %val to i64 %sinc = add nsw i64 %s.01, %vall %iinc = add nsw i32 %i.02, 1 @@ -106,15 +106,15 @@ ph: ; CHECK-NOT: add ; ; Preserve gep inboundsness, and don't factor it. -; CHECK: getelementptr inbounds i32* %ptriv, i32 1 +; CHECK: getelementptr inbounds i32, i32* %ptriv, i32 1 ; CHECK-NOT: add ; CHECK: exit: loop: %ptriv = phi i32* [ %first, %ph ], [ %ptrpost, %loop ] %ofs = sext i32 %idx to i64 - %adr = getelementptr inbounds i32* %ptriv, i64 %ofs + %adr = getelementptr inbounds i32, i32* %ptriv, i64 %ofs store i32 3, i32* %adr - %ptrpost = getelementptr inbounds i32* %ptriv, i32 1 + %ptrpost = getelementptr inbounds i32, i32* %ptriv, i32 1 %cond = icmp ne i32* %ptrpost, %last br i1 %cond, label %loop, label %exit @@ -143,11 +143,11 @@ entry: loop: %iv = phi i32 [%start, %entry], [%next, %loop] %p = phi %structI* [%base, %entry], [%pinc, %loop] - %adr = getelementptr %structI* %p, i32 0, i32 0 + %adr = getelementptr %structI, %structI* %p, i32 0, i32 0 store i32 3, i32* %adr %pp = bitcast %structI* %p to i32* store i32 4, i32* %pp - %pinc = getelementptr %structI* %p, i32 1 + %pinc = getelementptr %structI, %structI* %p, i32 1 %next = add i32 %iv, 1 %cond = icmp ne i32 %next, %limit br i1 %cond, label %loop, label %exit @@ -170,8 +170,8 @@ loop: %idx = phi i32 [ 0, %entry ], [ %idx.next, %loop.inc ] %max = phi i32 [ 0, %entry ], [ %max.next, %loop.inc ] %idxprom = sext i32 %idx to i64 - %adr = getelementptr inbounds i32* %base, i64 %idxprom - %val = load i32* %adr + %adr = getelementptr inbounds i32, i32* %base, i64 %idxprom + %val = load i32, i32* %adr %cmp19 = icmp sgt i32 %val, %max br i1 %cmp19, label %if.then, label %if.else @@ -239,8 +239,8 @@ entry: loop: %iv = phi i32 [ 0, %entry], [ %iv.next, %loop ] %t1 = sext i32 %iv to i64 - %adr = getelementptr i64* %base, i64 %t1 - %val = load i64* %adr + %adr = getelementptr i64, i64* %base, i64 %t1 + %val = load i64, i64* %adr %t2 = or i32 %iv, 1 %t3 = sext i32 %t2 to i64 %iv.next = add i32 %iv, 2 @@ -333,7 +333,7 @@ return: define void @congruentgepiv(%structIF* %base) nounwind uwtable ssp { entry: - %first = getelementptr inbounds %structIF* %base, i64 0, i32 0 + %first = getelementptr inbounds %structIF, %structIF* %base, i64 0, i32 0 br label %loop ; CHECK: loop: @@ -349,8 +349,8 @@ loop: br i1 undef, label %latch, label %exit latch: ; preds = %for.inc50.i - %ptr.inc = getelementptr inbounds %structIF* %ptr.iv, i64 1 - %next.inc = getelementptr inbounds %structIF* %ptr.inc, i64 0, i32 0 + %ptr.inc = getelementptr inbounds %structIF, %structIF* %ptr.iv, i64 1 + %next.inc = getelementptr inbounds %structIF, %structIF* %ptr.inc, i64 0, i32 0 br label %loop exit: diff --git a/test/Transforms/IndVarSimplify/overflowcheck.ll b/test/Transforms/IndVarSimplify/overflowcheck.ll index 3864c6c..c3c033d 100644 --- a/test/Transforms/IndVarSimplify/overflowcheck.ll +++ b/test/Transforms/IndVarSimplify/overflowcheck.ll @@ -27,8 +27,8 @@ loop0: loop1: %zxt = zext i32 %i to i64 %ofs = shl nuw nsw i64 %zxt, 3 - %gep = getelementptr i64* %a, i64 %zxt - %v = load i64* %gep, align 8 + %gep = getelementptr i64, i64* %a, i64 %zxt + %v = load i64, i64* %gep, align 8 %truncv = trunc i64 %v to i32 %adds = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %s, i32 %truncv) %ovflows = extractvalue { i32, i1 } %adds, 1 diff --git a/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll b/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll index dc36b99..519d34d 100644 --- a/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll +++ b/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll @@ -13,7 +13,7 @@ entry: br label %bb38.i bb14.i27: - %t0 = load i64* @ue, align 8 + %t0 = load i64, i64* @ue, align 8 %t1 = sub i64 %t0, %i.0.i35 %t2 = add i64 %t1, 1 br i1 undef, label %bb15.i28, label %bb19.i31 diff --git a/test/Transforms/IndVarSimplify/polynomial-expand.ll b/test/Transforms/IndVarSimplify/polynomial-expand.ll index 2087f6a..5708c64 100644 --- a/test/Transforms/IndVarSimplify/polynomial-expand.ll +++ b/test/Transforms/IndVarSimplify/polynomial-expand.ll @@ -20,8 +20,8 @@ bb30: ; preds = %bb30, %bb24 %tmp31 = phi i32 [ %tmp39, %bb30 ], [ %tmp28, %bb24 ] ; <i32> [#uses=2] %tmp32 = phi i32 [ %tmp37, %bb30 ], [ %tmp27, %bb24 ] ; <i32> [#uses=2] %tmp33 = sext i32 %tmp32 to i64 ; <i64> [#uses=1] - %tmp35 = getelementptr float* %tmp4, i64 %tmp33 ; <%0*> [#uses=1] - %tmp36 = load float* %tmp35, align 4 ; <%0> [#uses=0] + %tmp35 = getelementptr float, float* %tmp4, i64 %tmp33 ; <%0*> [#uses=1] + %tmp36 = load float, float* %tmp35, align 4 ; <%0> [#uses=0] %tmp37 = add nsw i32 %tmp32, -1 ; <i32> [#uses=1] %tmp39 = add nsw i32 %tmp31, -1 ; <i32> [#uses=1] %tmp38 = icmp eq i32 %tmp31, 1 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/pr18223.ll b/test/Transforms/IndVarSimplify/pr18223.ll index 738f75c..f922aa4 100644 --- a/test/Transforms/IndVarSimplify/pr18223.ll +++ b/test/Transforms/IndVarSimplify/pr18223.ll @@ -8,7 +8,7 @@ define i32 @main() #0 { entry: - %0 = load i32* @c, align 4 + %0 = load i32, i32* @c, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %for.body, label %exit diff --git a/test/Transforms/IndVarSimplify/pr20680.ll b/test/Transforms/IndVarSimplify/pr20680.ll index 716e013..2c9eb54 100644 --- a/test/Transforms/IndVarSimplify/pr20680.ll +++ b/test/Transforms/IndVarSimplify/pr20680.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -indvars -S | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + @a = common global i32 0, align 4 @c = common global i32 0, align 4 @b = common global i32 0, align 4 @@ -13,9 +17,9 @@ define void @f() { ; CHECK-NEXT: %[[indvars_iv:.*]] = phi i32 [ %[[indvars_iv_next:.*]], %[[for_inc13:.*]] ], [ -14, %entry ] ; br i1 {{.*}}, label %[[for_inc13]], label % entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %tobool2 = icmp eq i32 %0, 0 - %1 = load i32* @a, align 4 + %1 = load i32, i32* @a, align 4 %tobool = icmp eq i32 %1, 0 br label %for.cond2.preheader @@ -51,7 +55,7 @@ cond.false.us.us: ; preds = %for.body3.us.us cond.end.us.us: ; preds = %cond.false.us.us, %for.body3.us.us %cond.us.us = phi i32 [ %div, %cond.false.us.us ], [ %conv7, %for.body3.us.us ] - %4 = load i32* @b, align 4 + %4 = load i32, i32* @b, align 4 %cmp91.us.us = icmp slt i32 %4, 1 br i1 %cmp91.us.us, label %for.inc.lr.ph.us.us, label %for.cond2.loopexit.us.us @@ -87,7 +91,7 @@ cond.false.us: ; preds = %for.body3.us cond.end.us: ; preds = %cond.false.us, %for.body3.us %cond.us = phi i32 [ %div, %cond.false.us ], [ %conv7, %for.body3.us ] - %6 = load i32* @b, align 4 + %6 = load i32, i32* @b, align 4 %cmp91.us = icmp slt i32 %6, 1 br i1 %cmp91.us, label %for.inc.lr.ph.us, label %for.cond2.loopexit.us @@ -133,7 +137,7 @@ cond.false.us4: ; preds = %for.body3.us3 cond.end.us5: ; preds = %cond.false.us4, %for.body3.us3 %cond.us6 = phi i32 [ %div, %cond.false.us4 ], [ %conv7, %for.body3.us3 ] - %8 = load i32* @b, align 4 + %8 = load i32, i32* @b, align 4 %cmp91.us7 = icmp slt i32 %8, 1 br i1 %cmp91.us7, label %for.inc.lr.ph.us12, label %for.cond2.loopexit.us11 @@ -177,7 +181,7 @@ cond.false: ; preds = %for.body3 cond.end: ; preds = %cond.false, %for.body3 %cond = phi i32 [ %div, %cond.false ], [ %conv7, %for.body3 ] - %10 = load i32* @b, align 4 + %10 = load i32, i32* @b, align 4 %cmp91 = icmp slt i32 %10, 1 br i1 %cmp91, label %for.inc.lr.ph, label %for.cond2.loopexit diff --git a/test/Transforms/IndVarSimplify/pr22222.ll b/test/Transforms/IndVarSimplify/pr22222.ll index ccdfe53..d1f0490 100644 --- a/test/Transforms/IndVarSimplify/pr22222.ll +++ b/test/Transforms/IndVarSimplify/pr22222.ll @@ -9,7 +9,7 @@ declare void @abort() #1 ; Function Attrs: nounwind ssp uwtable define i32 @main() { entry: - %a.promoted13 = load i32* @a, align 4 + %a.promoted13 = load i32, i32* @a, align 4 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.end diff --git a/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll b/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll index f619e8d..c8d34ac 100644 --- a/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll +++ b/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll @@ -4,6 +4,10 @@ ; sext for the addressing, however it shouldn't eliminate the sext ; on the other phi, since that value undergoes signed wrapping. +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @foo(i32* nocapture %d, i32 %n) nounwind { entry: %0 = icmp sgt i32 %n, 0 ; <i1> [#uses=1] @@ -21,7 +25,7 @@ bb: ; preds = %bb1, %bb.nph %p.01 = phi i8 [ %4, %bb1 ], [ -1, %bb.nph ] ; <i8> [#uses=2] %1 = sext i8 %p.01 to i32 ; <i32> [#uses=1] %2 = sext i32 %i.02 to i64 ; <i64> [#uses=1] - %3 = getelementptr i32* %d, i64 %2 ; <i32*> [#uses=1] + %3 = getelementptr i32, i32* %d, i64 %2 ; <i32*> [#uses=1] store i32 %1, i32* %3, align 4 %4 = add i8 %p.01, 1 ; <i8> [#uses=1] %5 = add i32 %i.02, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll index a007ca6..f2afaf4 100644 --- a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll +++ b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll @@ -1,5 +1,8 @@ -; RUN: opt < %s -indvars -S > %t -; RUN: not grep sext %t +; RUN: opt < %s -indvars -S | not grep sext + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + define i64 @test(i64* nocapture %first, i32 %count) nounwind readonly { entry: @@ -13,8 +16,8 @@ bb: ; preds = %bb1, %bb.nph %result.02 = phi i64 [ %t5, %bb1 ], [ 0, %bb.nph ] ; <i64> [#uses=1] %n.01 = phi i32 [ %t6, %bb1 ], [ 0, %bb.nph ] ; <i32> [#uses=2] %t1 = sext i32 %n.01 to i64 ; <i64> [#uses=1] - %t2 = getelementptr i64* %first, i64 %t1 ; <i64*> [#uses=1] - %t3 = load i64* %t2, align 8 ; <i64> [#uses=1] + %t2 = getelementptr i64, i64* %first, i64 %t1 ; <i64*> [#uses=1] + %t3 = load i64, i64* %t2, align 8 ; <i64> [#uses=1] %t4 = lshr i64 %t3, 4 ; <i64> [#uses=1] %t5 = add i64 %t4, %result.02 ; <i64> [#uses=2] %t6 = add i32 %n.01, 1 ; <i32> [#uses=2] @@ -44,7 +47,7 @@ bb.nph: ; preds = %entry bb: ; preds = %bb1, %bb.nph %i.01 = phi i16 [ %t3, %bb1 ], [ 0, %bb.nph ] ; <i16> [#uses=2] %t1 = sext i16 %i.01 to i64 ; <i64> [#uses=1] - %t2 = getelementptr i32* %P, i64 %t1 ; <i32*> [#uses=1] + %t2 = getelementptr i32, i32* %P, i64 %t1 ; <i32*> [#uses=1] store i32 123, i32* %t2, align 4 %t3 = add i16 %i.01, 1 ; <i16> [#uses=2] br label %bb1 @@ -70,7 +73,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ -10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, 10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 10 ; <i1> [#uses=1] @@ -88,7 +91,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ 10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, -10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 30 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/sharpen-range.ll b/test/Transforms/IndVarSimplify/sharpen-range.ll index 5392dbc..c103da9 100644 --- a/test/Transforms/IndVarSimplify/sharpen-range.ll +++ b/test/Transforms/IndVarSimplify/sharpen-range.ll @@ -8,7 +8,7 @@ declare void @abort() define i1 @bounded_below_slt(i32* nocapture readonly %buffer) { ; CHECK-LABEL: bounded_below_slt entry: - %length = load i32* %buffer, !range !0 + %length = load i32, i32* %buffer, !range !0 %entry.pred = icmp eq i32 %length, 0 br i1 %entry.pred, label %abort, label %loop.preheader @@ -42,7 +42,7 @@ oob: define i1 @bounded_below_sle(i32* nocapture readonly %buffer) { ; CHECK-LABEL: bounded_below_sle entry: - %length = load i32* %buffer, !range !0 + %length = load i32, i32* %buffer, !range !0 %entry.pred = icmp eq i32 %length, 0 br i1 %entry.pred, label %abort, label %loop.preheader @@ -92,7 +92,7 @@ loop.begin: loop: ; CHECK: loop %.sum = add i64 %i.01, -2 - %v = getelementptr inbounds i8* null, i64 %.sum + %v = getelementptr inbounds i8, i8* null, i64 %.sum %r = tail call i32 @check(i8* %v) %c = icmp eq i32 %r, 0 br i1 %c, label %loop.end, label %abort.now diff --git a/test/Transforms/IndVarSimplify/signed-trip-count.ll b/test/Transforms/IndVarSimplify/signed-trip-count.ll index 1a5e64d..992e22e 100644 --- a/test/Transforms/IndVarSimplify/signed-trip-count.ll +++ b/test/Transforms/IndVarSimplify/signed-trip-count.ll @@ -2,6 +2,10 @@ ; RUN: not grep sext %t ; RUN: grep phi %t | count 1 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @foo(i64* nocapture %x, i32 %n) nounwind { entry: %tmp102 = icmp sgt i32 %n, 0 ; <i1> [#uses=1] @@ -13,7 +17,7 @@ bb.nph: ; preds = %entry bb: ; preds = %bb7, %bb.nph %i.01 = phi i32 [ %tmp6, %bb7 ], [ 0, %bb.nph ] ; <i32> [#uses=3] %tmp1 = sext i32 %i.01 to i64 ; <i64> [#uses=1] - %tmp4 = getelementptr i64* %x, i32 %i.01 ; <i64*> [#uses=1] + %tmp4 = getelementptr i64, i64* %x, i32 %i.01 ; <i64*> [#uses=1] store i64 %tmp1, i64* %tmp4, align 8 %tmp6 = add i32 %i.01, 1 ; <i32> [#uses=2] br label %bb7 diff --git a/test/Transforms/IndVarSimplify/single-element-range.ll b/test/Transforms/IndVarSimplify/single-element-range.ll index 4b035ee..e047a0b 100644 --- a/test/Transforms/IndVarSimplify/single-element-range.ll +++ b/test/Transforms/IndVarSimplify/single-element-range.ll @@ -8,7 +8,7 @@ entry: br i1 undef, label %return, label %bb bb: ; preds = %entry - %0 = load i8** undef, align 4 ; <i8*> [#uses=2] + %0 = load i8*, i8** undef, align 4 ; <i8*> [#uses=2] %1 = ptrtoint i8* %0 to i32 ; <i32> [#uses=1] %2 = icmp sgt i8* %0, inttoptr (i32 1 to i8*) ; <i1> [#uses=1] br i1 %2, label %bb1, label %bb5 diff --git a/test/Transforms/IndVarSimplify/sink-alloca.ll b/test/Transforms/IndVarSimplify/sink-alloca.ll index 64207d8..8179470 100644 --- a/test/Transforms/IndVarSimplify/sink-alloca.ll +++ b/test/Transforms/IndVarSimplify/sink-alloca.ll @@ -19,7 +19,7 @@ while.cond: ; preds = %while.cond, %entry while.end: ; preds = %while.cond store volatile i32 0, i32* %result.i - %tmp.i = load volatile i32* %result.i ; <i32> [#uses=0] + %tmp.i = load volatile i32, i32* %result.i ; <i32> [#uses=0] ret i32 0 } declare i32 @bar() @@ -43,7 +43,7 @@ entry: for.body.i: %indvars.iv37.i = phi i64 [ %indvars.iv.next38.i, %for.body.i ], [ 0, %entry ] %call.i = call i8* (...)* @a() nounwind - %arrayidx.i = getelementptr inbounds i8** %vla.i, i64 %indvars.iv37.i + %arrayidx.i = getelementptr inbounds i8*, i8** %vla.i, i64 %indvars.iv37.i store i8* %call.i, i8** %arrayidx.i, align 8 %indvars.iv.next38.i = add i64 %indvars.iv37.i, 1 %exitcond5 = icmp eq i64 %indvars.iv.next38.i, %n diff --git a/test/Transforms/IndVarSimplify/udiv.ll b/test/Transforms/IndVarSimplify/udiv.ll index aee455d..11c5e16 100644 --- a/test/Transforms/IndVarSimplify/udiv.ll +++ b/test/Transforms/IndVarSimplify/udiv.ll @@ -17,8 +17,8 @@ entry: br i1 %cmp, label %cond.true, label %while.cond.preheader cond.true: ; preds = %entry - %arrayidx = getelementptr inbounds i8** %argv, i64 1 ; <i8**> [#uses=1] - %tmp2 = load i8** %arrayidx ; <i8*> [#uses=1] + %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1 ; <i8**> [#uses=1] + %tmp2 = load i8*, i8** %arrayidx ; <i8*> [#uses=1] %call = tail call i32 @atoi(i8* %tmp2) nounwind readonly ; <i32> [#uses=1] br label %while.cond.preheader @@ -59,7 +59,7 @@ bb.nph: ; preds = %for.cond.preheader for.body: ; preds = %bb.nph, %for.cond %i.02 = phi i64 [ 2, %bb.nph ], [ %inc, %for.cond ] ; <i64> [#uses=2] - %arrayidx10 = getelementptr inbounds [8193 x i8]* @main.flags, i64 0, i64 %i.02 ; <i8*> [#uses=1] + %arrayidx10 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %i.02 ; <i8*> [#uses=1] store i8 1, i8* %arrayidx10 %inc = add nsw i64 %i.02, 1 ; <i64> [#uses=2] br label %for.cond @@ -81,8 +81,8 @@ bb.nph16: ; preds = %for.cond12.loopexit for.body15: ; preds = %bb.nph16, %for.cond12 %count.212 = phi i32 [ 0, %bb.nph16 ], [ %count.1, %for.cond12 ] ; <i32> [#uses=2] %i.17 = phi i64 [ 2, %bb.nph16 ], [ %inc37, %for.cond12 ] ; <i64> [#uses=4] - %arrayidx17 = getelementptr inbounds [8193 x i8]* @main.flags, i64 0, i64 %i.17 ; <i8*> [#uses=1] - %tmp18 = load i8* %arrayidx17 ; <i8> [#uses=1] + %arrayidx17 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %i.17 ; <i8*> [#uses=1] + %tmp18 = load i8, i8* %arrayidx17 ; <i8> [#uses=1] %tobool19 = icmp eq i8 %tmp18, 0 ; <i1> [#uses=1] br i1 %tobool19, label %for.inc35, label %if.then @@ -103,7 +103,7 @@ bb.nph5: ; preds = %if.then for.body25: ; preds = %bb.nph5, %for.cond22 %k.04 = phi i64 [ %add, %bb.nph5 ], [ %add31, %for.cond22 ] ; <i64> [#uses=2] - %arrayidx27 = getelementptr inbounds [8193 x i8]* @main.flags, i64 0, i64 %k.04 ; <i8*> [#uses=1] + %arrayidx27 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %k.04 ; <i8*> [#uses=1] store i8 0, i8* %arrayidx27 %add31 = add nsw i64 %k.04, %i.17 ; <i64> [#uses=2] br label %for.cond22 @@ -119,7 +119,7 @@ for.inc35: ; preds = %for.body15, %for.en while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %count.0.lcssa = phi i32 [ %count.2.lcssa.lcssa, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] ; <i32> [#uses=1] - %call40 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0] + %call40 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0] ret i32 0 } @@ -146,7 +146,7 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ] ; <i64> [#uses=2] - %arrayidx = getelementptr inbounds double* %p, i64 %i.03 ; <double*> [#uses=1] + %arrayidx = getelementptr inbounds double, double* %p, i64 %i.03 ; <double*> [#uses=1] store double 0.000000e+00, double* %arrayidx %inc = add i64 %i.03, 1 ; <i64> [#uses=2] %divx = udiv i64 %n, 7 ; <i64> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/uglygep.ll b/test/Transforms/IndVarSimplify/uglygep.ll index 0014b68..e434389 100644 --- a/test/Transforms/IndVarSimplify/uglygep.ll +++ b/test/Transforms/IndVarSimplify/uglygep.ll @@ -27,10 +27,10 @@ bb2: ; preds = %bb1, %bb br i1 %tmp8, label %bb1, label %bb3 bb1: ; preds = %bb2 - %tmp = load double*** @tds, align 8 ; <double**> [#uses=1] + %tmp = load double**, double*** @tds, align 8 ; <double**> [#uses=1] %tmp1 = sext i32 %i.0 to i64 ; <i64> [#uses=1] - %tmp2 = getelementptr inbounds double** %tmp, i64 %tmp1 ; <double**> [#uses=1] - %tmp3 = load double** %tmp2, align 1 ; <double*> [#uses=1] + %tmp2 = getelementptr inbounds double*, double** %tmp, i64 %tmp1 ; <double**> [#uses=1] + %tmp3 = load double*, double** %tmp2, align 1 ; <double*> [#uses=1] %tmp6 = add nsw i32 %j.0, 1 ; <i32> [#uses=1] br label %bb2 diff --git a/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll b/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll index a421003..7272ef1 100644 --- a/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll +++ b/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll @@ -1,5 +1,9 @@ ; RUN: opt -S -indvars < %s | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @test1(float* nocapture %autoc, float* nocapture %data, float %d, i32 %data_len, i32 %sample) nounwind { entry: %sub = sub i32 %data_len, %sample @@ -11,11 +15,11 @@ for.body: ; preds = %entry, %for.body %0 = trunc i64 %indvars.iv to i32 %add = add i32 %0, %sample %idxprom = zext i32 %add to i64 - %arrayidx = getelementptr inbounds float* %data, i64 %idxprom - %1 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %data, i64 %idxprom + %1 = load float, float* %arrayidx, align 4 %mul = fmul float %1, %d - %arrayidx2 = getelementptr inbounds float* %autoc, i64 %indvars.iv - %2 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %autoc, i64 %indvars.iv + %2 = load float, float* %arrayidx2, align 4 %add3 = fadd float %2, %mul store float %add3, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/IndVarSimplify/use-range-metadata.ll b/test/Transforms/IndVarSimplify/use-range-metadata.ll index ea3b12d..1f01426 100644 --- a/test/Transforms/IndVarSimplify/use-range-metadata.ll +++ b/test/Transforms/IndVarSimplify/use-range-metadata.ll @@ -6,7 +6,7 @@ declare void @abort() define i1 @iterate(i32* nocapture readonly %buffer) { entry: - %length = load i32* %buffer, !range !0 + %length = load i32, i32* %buffer, !range !0 br label %loop.preheader loop.preheader: diff --git a/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll b/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll index fb9ef22..5fa4a17 100644 --- a/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll +++ b/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll @@ -6,17 +6,17 @@ define void @vnum_test8(i32* %data) { entry: - %tmp.1 = getelementptr i32* %data, i32 3 ; <i32*> [#uses=1] - %tmp.2 = load i32* %tmp.1 ; <i32> [#uses=2] - %tmp.4 = getelementptr i32* %data, i32 4 ; <i32*> [#uses=1] - %tmp.5 = load i32* %tmp.4 ; <i32> [#uses=2] - %tmp.8 = getelementptr i32* %data, i32 2 ; <i32*> [#uses=1] - %tmp.9 = load i32* %tmp.8 ; <i32> [#uses=3] + %tmp.1 = getelementptr i32, i32* %data, i32 3 ; <i32*> [#uses=1] + %tmp.2 = load i32, i32* %tmp.1 ; <i32> [#uses=2] + %tmp.4 = getelementptr i32, i32* %data, i32 4 ; <i32*> [#uses=1] + %tmp.5 = load i32, i32* %tmp.4 ; <i32> [#uses=2] + %tmp.8 = getelementptr i32, i32* %data, i32 2 ; <i32*> [#uses=1] + %tmp.9 = load i32, i32* %tmp.8 ; <i32> [#uses=3] %tmp.125 = icmp sgt i32 %tmp.2, 0 ; <i1> [#uses=1] br i1 %tmp.125, label %no_exit.preheader, label %return no_exit.preheader: ; preds = %entry - %tmp.16 = getelementptr i32* %data, i32 %tmp.9 ; <i32*> [#uses=1] + %tmp.16 = getelementptr i32, i32* %data, i32 %tmp.9 ; <i32*> [#uses=1] br label %no_exit ; CHECK: store i32 0 diff --git a/test/Transforms/IndVarSimplify/verify-scev.ll b/test/Transforms/IndVarSimplify/verify-scev.ll index b9ce3d6..ddf2e7f 100644 --- a/test/Transforms/IndVarSimplify/verify-scev.ll +++ b/test/Transforms/IndVarSimplify/verify-scev.ll @@ -175,7 +175,7 @@ if.end250: ; preds = %for.cond246 br i1 undef, label %if.end256, label %for.end562 if.end256: ; preds = %if.end250 - %0 = load i32* undef, align 4 + %0 = load i32, i32* undef, align 4 br i1 undef, label %if.then274, label %for.cond404.preheader for.cond404.preheader: ; preds = %if.end256 @@ -379,7 +379,7 @@ for.body48: ; preds = %for.inc221, %for.bo br i1 undef, label %for.inc221, label %for.body65.lr.ph for.body65.lr.ph: ; preds = %for.body48 - %0 = load i32* undef, align 4 + %0 = load i32, i32* undef, align 4 %1 = sext i32 %0 to i64 br label %for.body65.us diff --git a/test/Transforms/IndVarSimplify/widen-loop-comp.ll b/test/Transforms/IndVarSimplify/widen-loop-comp.ll index 0930a0c..eb81ceb 100644 --- a/test/Transforms/IndVarSimplify/widen-loop-comp.ll +++ b/test/Transforms/IndVarSimplify/widen-loop-comp.ll @@ -1,6 +1,10 @@ ; RUN: opt < %s -indvars -S | FileCheck %s target triple = "aarch64--linux-gnu" +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; Check the loop exit i32 compare instruction and operand are widened to i64 ; instead of truncating IV before its use in the i32 compare instruction. @@ -19,13 +23,13 @@ target triple = "aarch64--linux-gnu" define i32 @test1() { entry: store i32 -1, i32* @idx, align 4 - %0 = load i32* @e, align 4 + %0 = load i32, i32* @e, align 4 %cmp4 = icmp slt i32 %0, 0 br i1 %cmp4, label %for.end.loopexit, label %for.body.lr.ph for.body.lr.ph: - %1 = load i32** @ptr, align 8 - %2 = load i32* @e, align 4 + %1 = load i32*, i32** @ptr, align 8 + %2 = load i32, i32* @e, align 4 br label %for.body for.cond: @@ -36,8 +40,8 @@ for.cond: for.body: %i.05 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.cond ] %idxprom = sext i32 %i.05 to i64 - %arrayidx = getelementptr inbounds i32* %1, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %1, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %3, 0 br i1 %tobool, label %if.then, label %for.cond @@ -53,7 +57,7 @@ for.end.loopexit: br label %for.end for.end: - %4 = load i32* @idx, align 4 + %4 = load i32, i32* @idx, align 4 ret i32 %4 } @@ -81,11 +85,11 @@ for.inc13.us: for.body4.us: %storemerge14.us = phi i32 [ 0, %for.body4.lr.ph.us ], [ %inc.us, %for.body4.us ] %idxprom.us = sext i32 %storemerge14.us to i64 - %arrayidx6.us = getelementptr inbounds [8 x i8]* %a, i64 %idxprom5.us, i64 %idxprom.us - %0 = load i8* %arrayidx6.us, align 1 + %arrayidx6.us = getelementptr inbounds [8 x i8], [8 x i8]* %a, i64 %idxprom5.us, i64 %idxprom.us + %0 = load i8, i8* %arrayidx6.us, align 1 %idxprom7.us = zext i8 %0 to i64 - %arrayidx8.us = getelementptr inbounds i8* %b, i64 %idxprom7.us - %1 = load i8* %arrayidx8.us, align 1 + %arrayidx8.us = getelementptr inbounds i8, i8* %b, i64 %idxprom7.us + %1 = load i8, i8* %arrayidx8.us, align 1 store i8 %1, i8* %arrayidx6.us, align 1 %inc.us = add nsw i32 %storemerge14.us, 1 %cmp2.us = icmp slt i32 %inc.us, %conv @@ -126,8 +130,8 @@ for.cond: for.body: %idxprom = sext i32 %i.0 to i64 - %arrayidx = getelementptr inbounds i32* %a, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %sum.0, %0 %inc = add nsw i32 %i.0, 1 br label %for.cond @@ -180,8 +184,8 @@ for.cond: for.body: %idxprom = zext i32 %i.0 to i64 - %arrayidx = getelementptr inbounds i32* %a, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %sum.0, %0 %inc = add nsw i32 %i.0, 1 br label %for.cond diff --git a/test/Transforms/IndVarSimplify/widen-nsw.ll b/test/Transforms/IndVarSimplify/widen-nsw.ll index 56c3c0d..8dbbb51 100644 --- a/test/Transforms/IndVarSimplify/widen-nsw.ll +++ b/test/Transforms/IndVarSimplify/widen-nsw.ll @@ -16,8 +16,8 @@ for.cond: ; preds = %for.body, %entry for.body: ; preds = %for.cond %idxprom = sext i32 %i.0 to i64 - %arrayidx = getelementptr inbounds i32* %a, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %sum.0, %0 %inc = add nsw i32 %i.0, 1 br label %for.cond 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 +} diff --git a/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll b/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll index f550c83..b381545 100644 --- a/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll +++ b/test/Transforms/InstCombine/2003-07-21-ExternalConstant.ll @@ -31,14 +31,14 @@ entry: %a.0 = alloca i32 ; <i32*> [#uses=2] %result = alloca i32 ; <i32*> [#uses=2] store i32 %a.1, i32* %a.0 - %tmp.0 = load i32* %a.0 ; <i32> [#uses=1] - %tmp.1 = load i32* @silly ; <i32> [#uses=1] + %tmp.0 = load i32, i32* %a.0 ; <i32> [#uses=1] + %tmp.1 = load i32, i32* @silly ; <i32> [#uses=1] %tmp.2 = add i32 %tmp.0, %tmp.1 ; <i32> [#uses=1] store i32 %tmp.2, i32* %result br label %return return: ; preds = %entry - %tmp.3 = load i32* %result ; <i32> [#uses=1] + %tmp.3 = load i32, i32* %result ; <i32> [#uses=1] ret i32 %tmp.3 } diff --git a/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll b/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll index 7f73908..3e0cf12 100644 --- a/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll +++ b/test/Transforms/InstCombine/2003-09-09-VolatileLoadElim.ll @@ -2,6 +2,6 @@ define void @test(i32* %P) { ; Dead but not deletable! - %X = load volatile i32* %P ; <i32> [#uses=0] + %X = load volatile i32, i32* %P ; <i32> [#uses=0] ret void } diff --git a/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll b/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll index 6df30c7..a086c01 100644 --- a/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll +++ b/test/Transforms/InstCombine/2004-01-13-InstCombineInvokePHI.ll @@ -19,7 +19,7 @@ call: ; preds = %entry cont: ; preds = %call, %entry %P2 = phi i32* [ %P, %call ], [ null, %entry ] ; <i32*> [#uses=1] - %V = load i32* %P2 ; <i32> [#uses=1] + %V = load i32, i32* %P2 ; <i32> [#uses=1] ret i32 %V N: ; preds = %call diff --git a/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll b/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll index 8b54937..ff855dc 100644 --- a/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll +++ b/test/Transforms/InstCombine/2004-05-07-UnsizedCastLoad.ll @@ -4,7 +4,7 @@ define i32 @test(%Ty* %X) { %Y = bitcast %Ty* %X to i32* ; <i32*> [#uses=1] - %Z = load i32* %Y ; <i32> [#uses=1] + %Z = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %Z } diff --git a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll index d17db8d..10122e4 100644 --- a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll +++ b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.ll @@ -12,7 +12,7 @@ define i32 @test(i1 %C) { store i32 2, i32* %X2 %Y = select i1 %C, i32* %X, i32* %X2 ; <i32*> [#uses=1] store i32 3, i32* %X - %Z = load i32* %Y ; <i32> [#uses=1] + %Z = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %Z } diff --git a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll index 0d5fc81..981a4f3 100644 --- a/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll +++ b/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll @@ -18,7 +18,7 @@ cond_true.i: ; preds = %entry cond_continue.i: ; preds = %cond_true.i, %entry %mem_tmp.i.0 = phi i32* [ %X, %cond_true.i ], [ %X2, %entry ] ; <i32*> [#uses=1] store i32 3, i32* %X - %tmp.3 = load i32* %mem_tmp.i.0 ; <i32> [#uses=1] + %tmp.3 = load i32, i32* %mem_tmp.i.0 ; <i32> [#uses=1] ret i32 %tmp.3 } diff --git a/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll b/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll index 0a513c6..9c989b9 100644 --- a/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll +++ b/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll @@ -5,7 +5,7 @@ @g_07918478 = external global i32 ; <i32*> [#uses=1] define i1 @test() { - %tmp.0 = load i32* @g_07918478 ; <i32> [#uses=2] + %tmp.0 = load i32, i32* @g_07918478 ; <i32> [#uses=2] %tmp.1 = icmp ne i32 %tmp.0, 0 ; <i1> [#uses=1] %tmp.4 = icmp ult i32 %tmp.0, 4111 ; <i1> [#uses=1] %bothcond = or i1 %tmp.1, %tmp.4 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2006-09-15-CastToBool.ll b/test/Transforms/InstCombine/2006-09-15-CastToBool.ll index ee261ce..2eb28a3 100644 --- a/test/Transforms/InstCombine/2006-09-15-CastToBool.ll +++ b/test/Transforms/InstCombine/2006-09-15-CastToBool.ll @@ -2,7 +2,7 @@ ; PR913 define i32 @test(i32* %tmp1) { - %tmp.i = load i32* %tmp1 ; <i32> [#uses=1] + %tmp.i = load i32, i32* %tmp1 ; <i32> [#uses=1] %tmp = bitcast i32 %tmp.i to i32 ; <i32> [#uses=1] %tmp2.ui = lshr i32 %tmp, 5 ; <i32> [#uses=1] %tmp2 = bitcast i32 %tmp2.ui to i32 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll b/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll index 295006c..60113fb 100644 --- a/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll +++ b/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll @@ -12,24 +12,24 @@ entry: %p3_addr = alloca %struct.point ; <%struct.point*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] %tmp = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp.upgrd.1 = getelementptr { i64 }* %tmp, i64 0, i32 0 ; <i64*> [#uses=1] + %tmp.upgrd.1 = getelementptr { i64 }, { i64 }* %tmp, i64 0, i32 0 ; <i64*> [#uses=1] store i64 %p1.0, i64* %tmp.upgrd.1 %tmp1 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp2 = getelementptr { i64 }* %tmp1, i64 0, i32 0 ; <i64*> [#uses=1] + %tmp2 = getelementptr { i64 }, { i64 }* %tmp1, i64 0, i32 0 ; <i64*> [#uses=1] store i64 %p2.0, i64* %tmp2 %tmp3 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp4 = getelementptr { i64 }* %tmp3, i64 0, i32 0 ; <i64*> [#uses=1] + %tmp4 = getelementptr { i64 }, { i64 }* %tmp3, i64 0, i32 0 ; <i64*> [#uses=1] store i64 %p3.0, i64* %tmp4 %tmp.upgrd.2 = icmp eq i32 %direction, 0 ; <i1> [#uses=1] %tmp5 = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp6 = getelementptr { i64 }* %tmp5, i64 0, i32 0 ; <i64*> [#uses=1] - %tmp.upgrd.3 = load i64* %tmp6 ; <i64> [#uses=1] + %tmp6 = getelementptr { i64 }, { i64 }* %tmp5, i64 0, i32 0 ; <i64*> [#uses=1] + %tmp.upgrd.3 = load i64, i64* %tmp6 ; <i64> [#uses=1] %tmp7 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp8 = getelementptr { i64 }* %tmp7, i64 0, i32 0 ; <i64*> [#uses=1] - %tmp9 = load i64* %tmp8 ; <i64> [#uses=1] + %tmp8 = getelementptr { i64 }, { i64 }* %tmp7, i64 0, i32 0 ; <i64*> [#uses=1] + %tmp9 = load i64, i64* %tmp8 ; <i64> [#uses=1] %tmp10 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp11 = getelementptr { i64 }* %tmp10, i64 0, i32 0 ; <i64*> [#uses=1] - %tmp12 = load i64* %tmp11 ; <i64> [#uses=1] + %tmp11 = getelementptr { i64 }, { i64 }* %tmp10, i64 0, i32 0 ; <i64*> [#uses=1] + %tmp12 = load i64, i64* %tmp11 ; <i64> [#uses=1] %tmp13 = call i32 @determinant( i64 %tmp.upgrd.3, i64 %tmp9, i64 %tmp12 ) ; <i32> [#uses=2] br i1 %tmp.upgrd.2, label %cond_true, label %cond_false diff --git a/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll b/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll index 272753c..f54416d 100644 --- a/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll +++ b/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll @@ -12,24 +12,24 @@ entry: %p2_addr = alloca %struct.point ; <%struct.point*> [#uses=2] %p3_addr = alloca %struct.point ; <%struct.point*> [#uses=2] %tmp = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp.upgrd.1 = getelementptr { i64 }* %tmp, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp.upgrd.1 = getelementptr { i64 }, { i64 }* %tmp, i32 0, i32 0 ; <i64*> [#uses=1] store i64 %p1.0, i64* %tmp.upgrd.1 %tmp1 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp2 = getelementptr { i64 }* %tmp1, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp2 = getelementptr { i64 }, { i64 }* %tmp1, i32 0, i32 0 ; <i64*> [#uses=1] store i64 %p2.0, i64* %tmp2 %tmp3 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp4 = getelementptr { i64 }* %tmp3, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp4 = getelementptr { i64 }, { i64 }* %tmp3, i32 0, i32 0 ; <i64*> [#uses=1] store i64 %p3.0, i64* %tmp4 %tmp.upgrd.2 = icmp eq i32 %direction, 0 ; <i1> [#uses=1] %tmp5 = bitcast %struct.point* %p1_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp6 = getelementptr { i64 }* %tmp5, i32 0, i32 0 ; <i64*> [#uses=1] - %tmp.upgrd.3 = load i64* %tmp6 ; <i64> [#uses=1] + %tmp6 = getelementptr { i64 }, { i64 }* %tmp5, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp.upgrd.3 = load i64, i64* %tmp6 ; <i64> [#uses=1] %tmp7 = bitcast %struct.point* %p2_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp8 = getelementptr { i64 }* %tmp7, i32 0, i32 0 ; <i64*> [#uses=1] - %tmp9 = load i64* %tmp8 ; <i64> [#uses=1] + %tmp8 = getelementptr { i64 }, { i64 }* %tmp7, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp9 = load i64, i64* %tmp8 ; <i64> [#uses=1] %tmp10 = bitcast %struct.point* %p3_addr to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp11 = getelementptr { i64 }* %tmp10, i32 0, i32 0 ; <i64*> [#uses=1] - %tmp12 = load i64* %tmp11 ; <i64> [#uses=1] + %tmp11 = getelementptr { i64 }, { i64 }* %tmp10, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp12 = load i64, i64* %tmp11 ; <i64> [#uses=1] %tmp13 = call i32 @determinant( i64 %tmp.upgrd.3, i64 %tmp9, i64 %tmp12 ) ; <i32> [#uses=2] %tmp14 = icmp slt i32 %tmp13, 0 ; <i1> [#uses=1] %tmp26 = icmp sgt i32 %tmp13, 0 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2006-12-15-Range-Test.ll b/test/Transforms/InstCombine/2006-12-15-Range-Test.ll index 0c8eece..784b3e4 100644 --- a/test/Transforms/InstCombine/2006-12-15-Range-Test.ll +++ b/test/Transforms/InstCombine/2006-12-15-Range-Test.ll @@ -21,8 +21,8 @@ cond_next23.exitStub: ; preds = %cond_true ret i1 false cond_true: ; preds = %newFuncRoot - %tmp15 = getelementptr [17 x i32]* @r, i32 0, i32 %tmp12.reload ; <i32*> [#uses=1] - %tmp16 = load i32* %tmp15 ; <i32> [#uses=4] + %tmp15 = getelementptr [17 x i32], [17 x i32]* @r, i32 0, i32 %tmp12.reload ; <i32*> [#uses=1] + %tmp16 = load i32, i32* %tmp15 ; <i32> [#uses=4] %tmp18 = icmp slt i32 %tmp16, -31 ; <i1> [#uses=1] %tmp21 = icmp sgt i32 %tmp16, 31 ; <i1> [#uses=1] %bothcond = or i1 %tmp18, %tmp21 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll b/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll index eba1ac1..9251e9b 100644 --- a/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll +++ b/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll @@ -14,9 +14,9 @@ target triple = "i686-pc-linux-gnu" define void @mng_write_basi() { entry: - %tmp = load i8* null ; <i8> [#uses=1] + %tmp = load i8, i8* null ; <i8> [#uses=1] %tmp.upgrd.1 = icmp ugt i8 %tmp, 8 ; <i1> [#uses=1] - %tmp.upgrd.2 = load i16* null ; <i16> [#uses=2] + %tmp.upgrd.2 = load i16, i16* null ; <i16> [#uses=2] %tmp3 = icmp eq i16 %tmp.upgrd.2, 255 ; <i1> [#uses=1] %tmp7 = icmp eq i16 %tmp.upgrd.2, -1 ; <i1> [#uses=1] %bOpaque.0.in = select i1 %tmp.upgrd.1, i1 %tmp7, i1 %tmp3 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll b/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll index e2bebec..20bbd28 100644 --- a/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll +++ b/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll @@ -11,14 +11,14 @@ entry: %A = alloca i32 %B = alloca i32 %tmp = call i32 (...)* @bar( i32* %A ) ; <i32> [#uses=0] - %T = load i32* %A ; <i32> [#uses=1] + %T = load i32, i32* %A ; <i32> [#uses=1] %tmp2 = icmp eq i32 %C, 0 ; <i1> [#uses=1] br i1 %tmp2, label %cond_next, label %cond_true cond_true: ; preds = %entry store i32 123, i32* %B call i32 @test2( i32 123 ) ; <i32>:0 [#uses=0] - %T1 = load i32* %B ; <i32> [#uses=1] + %T1 = load i32, i32* %B ; <i32> [#uses=1] br label %cond_next cond_next: ; preds = %cond_true, %entry diff --git a/test/Transforms/InstCombine/2007-02-07-PointerCast.ll b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll index bf60991..760b6dc 100644 --- a/test/Transforms/InstCombine/2007-02-07-PointerCast.ll +++ b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll @@ -12,8 +12,8 @@ declare i32 @printf(i8*, ...) define i32 @main(i32 %x, i8** %a) { entry: - %tmp = getelementptr [6 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1] - %tmp1 = load i8** %a ; <i8*> [#uses=1] + %tmp = getelementptr [6 x i8], [6 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1] + %tmp1 = load i8*, i8** %a ; <i8*> [#uses=1] %tmp2 = ptrtoint i8* %tmp1 to i32 ; <i32> [#uses=1] %tmp3 = zext i32 %tmp2 to i64 ; <i64> [#uses=1] %tmp.upgrd.1 = call i32 (i8*, ...)* @printf( i8* %tmp, i64 %tmp3 ) ; <i32> [#uses=0] diff --git a/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll b/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll index 7e9c9e2..adaaf78 100644 --- a/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll +++ b/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll @@ -7,12 +7,12 @@ define i32 @main() { entry: %u = alloca %struct..1anon, align 8 ; <%struct..1anon*> [#uses=4] - %tmp1 = getelementptr %struct..1anon* %u, i32 0, i32 0 ; <double*> [#uses=1] + %tmp1 = getelementptr %struct..1anon, %struct..1anon* %u, i32 0, i32 0 ; <double*> [#uses=1] store double 0x7FF0000000000000, double* %tmp1 - %tmp3 = getelementptr %struct..1anon* %u, i32 0, i32 0 ; <double*> [#uses=1] + %tmp3 = getelementptr %struct..1anon, %struct..1anon* %u, i32 0, i32 0 ; <double*> [#uses=1] %tmp34 = bitcast double* %tmp3 to %struct..0anon* ; <%struct..0anon*> [#uses=1] - %tmp5 = getelementptr %struct..0anon* %tmp34, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp6 = load i32* %tmp5 ; <i32> [#uses=1] + %tmp5 = getelementptr %struct..0anon, %struct..0anon* %tmp34, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp6 = load i32, i32* %tmp5 ; <i32> [#uses=1] %tmp7 = shl i32 %tmp6, 1 ; <i32> [#uses=1] %tmp8 = lshr i32 %tmp7, 21 ; <i32> [#uses=1] %tmp89 = trunc i32 %tmp8 to i16 ; <i16> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-05-14-Crash.ll b/test/Transforms/InstCombine/2007-05-14-Crash.ll index a3c010d..a3d2165 100644 --- a/test/Transforms/InstCombine/2007-05-14-Crash.ll +++ b/test/Transforms/InstCombine/2007-05-14-Crash.ll @@ -10,7 +10,7 @@ target triple = "powerpc-apple-darwin8.8.0" define i8* @foo(%struct.anon* %deviceRef, %struct.abc* %pCap) { entry: %tmp1 = bitcast %struct.anon* %deviceRef to %struct.def* - %tmp3 = getelementptr %struct.def* %tmp1, i32 0, i32 1 + %tmp3 = getelementptr %struct.def, %struct.def* %tmp1, i32 0, i32 1 %tmp35 = bitcast %struct.abc* %tmp3 to i8* ret i8* %tmp35 } diff --git a/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll b/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll index 082b215..2b89a9d 100644 --- a/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll +++ b/test/Transforms/InstCombine/2007-06-06-AshrSignBit.ll @@ -9,13 +9,13 @@ return.exitStub: ; preds = %cond_true ret void cond_true: ; preds = %newFuncRoot - %tmp30 = load i64* %tmp10 ; <i64> [#uses=1] + %tmp30 = load i64, i64* %tmp10 ; <i64> [#uses=1] %.cast = zext i32 63 to i64 ; <i64> [#uses=1] %tmp31 = ashr i64 %tmp30, %.cast ; <i64> [#uses=1] %tmp3132 = trunc i64 %tmp31 to i32 ; <i32> [#uses=1] %tmp33 = or i32 %tmp3132, 1 ; <i32> [#uses=1] store i32 %tmp33, i32* %tmp9 - %tmp34 = load i32* %tmp9 ; <i32> [#uses=1] + %tmp34 = load i32, i32* %tmp9 ; <i32> [#uses=1] store i32 %tmp34, i32* %retval br label %return.exitStub } diff --git a/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll b/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll index 6259893..7f06f00 100644 --- a/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll +++ b/test/Transforms/InstCombine/2007-09-10-AliasConstFold.ll @@ -9,7 +9,7 @@ define weak i32 @pthread_cancel(i32) { define i1 @__gthread_active_p() { entry: - %tmp1 = load i8** @__gthread_active_ptr.5335, align 4 ; <i8*> [#uses=1] + %tmp1 = load i8*, i8** @__gthread_active_ptr.5335, align 4 ; <i8*> [#uses=1] %tmp2 = icmp ne i8* %tmp1, null ; <i1> [#uses=1] ret i1 %tmp2 } diff --git a/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll b/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll index 656fb34..67a94e5 100644 --- a/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll +++ b/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll @@ -8,8 +8,8 @@ define void @foo(i8* %P) { entry: %P_addr = alloca i8* store i8* %P, i8** %P_addr - %tmp = load i8** %P_addr, align 4 - %tmp1 = getelementptr [4 x i8]* @.str, i32 0, i32 0 + %tmp = load i8*, i8** %P_addr, align 4 + %tmp1 = getelementptr [4 x i8], [4 x i8]* @.str, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* %tmp1, i32 4, i32 1, i1 false) br label %return diff --git a/test/Transforms/InstCombine/2007-10-12-Crash.ll b/test/Transforms/InstCombine/2007-10-12-Crash.ll index b3d9f02..33d55e7 100644 --- a/test/Transforms/InstCombine/2007-10-12-Crash.ll +++ b/test/Transforms/InstCombine/2007-10-12-Crash.ll @@ -14,7 +14,7 @@ entry: bb29: ; preds = %bb62 %tmp322 = bitcast %struct.Ray* %tmp3 to %struct.Vec* ; <%struct.Vec*> [#uses=1] - %tmp322.0 = getelementptr %struct.Vec* %tmp322, i32 0, i32 0 ; <double*> [#uses=1] + %tmp322.0 = getelementptr %struct.Vec, %struct.Vec* %tmp322, i32 0, i32 0 ; <double*> [#uses=1] store double 0.000000e+00, double* %tmp322.0 %tmp57 = call double @_Z9ray_traceRK3VecRK3RayRK5Scene( %struct.Vec* null, %struct.Ray* %tmp3, %struct.Scene* null ) ; <double> [#uses=0] br label %bb62 diff --git a/test/Transforms/InstCombine/2007-10-28-stacksave.ll b/test/Transforms/InstCombine/2007-10-28-stacksave.ll index 95a445c..48e8765 100644 --- a/test/Transforms/InstCombine/2007-10-28-stacksave.ll +++ b/test/Transforms/InstCombine/2007-10-28-stacksave.ll @@ -23,7 +23,7 @@ lab: ; preds = %cleanup31, %entry %tmp17 = mul i32 %tmp5, 4 ; <i32> [#uses=1] %tmp18 = alloca i8, i32 %tmp17 ; <i8*> [#uses=1] %tmp1819 = bitcast i8* %tmp18 to i32* ; <i32*> [#uses=2] - %tmp21 = getelementptr i32* %tmp1819, i32 0 ; <i32*> [#uses=1] + %tmp21 = getelementptr i32, i32* %tmp1819, i32 0 ; <i32*> [#uses=1] store i32 1, i32* %tmp21, align 4 %tmp2223 = bitcast i32* %tmp1819 to i8* ; <i8*> [#uses=1] store volatile i8* %tmp2223, i8** @p, align 4 diff --git a/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll b/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll index 8105b4b..8c2cb07 100644 --- a/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll +++ b/test/Transforms/InstCombine/2007-10-31-RangeCrash.ll @@ -11,7 +11,7 @@ bb.i: ; preds = %entry br label %bb51.i.i bb27.i.i: ; preds = %bb51.i.i - %tmp31.i.i = load i16* null, align 2 ; <i16> [#uses=2] + %tmp31.i.i = load i16, i16* null, align 2 ; <i16> [#uses=2] %tmp35.i.i = icmp ult i16 %tmp31.i.i, 1 ; <i1> [#uses=1] %tmp41.i.i = icmp ugt i16 %tmp31.i.i, -1 ; <i1> [#uses=1] %bothcond.i.i = or i1 %tmp35.i.i, %tmp41.i.i ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-10-31-StringCrash.ll b/test/Transforms/InstCombine/2007-10-31-StringCrash.ll index 220f3e2..876cdd5 100644 --- a/test/Transforms/InstCombine/2007-10-31-StringCrash.ll +++ b/test/Transforms/InstCombine/2007-10-31-StringCrash.ll @@ -7,7 +7,7 @@ declare void @__darwin_gcc3_preregister_frame_info() define void @_start(i32 %argc, i8** %argv, i8** %envp) { entry: %tmp1 = bitcast void ()* @__darwin_gcc3_preregister_frame_info to i32* ; <i32*> [#uses=1] - %tmp2 = load i32* %tmp1, align 4 ; <i32> [#uses=1] + %tmp2 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1] %tmp3 = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1] %tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1] %toBool = icmp ne i8 %tmp34, 0 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll b/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll index e6c9bcd..ff31072 100644 --- a/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll +++ b/test/Transforms/InstCombine/2007-11-07-OpaqueAlignCrash.ll @@ -13,8 +13,8 @@ target triple = "i686-pc-linux-gnu" define i32 @foo() { entry: - %x = load i8* bitcast (%opaque_t* @g to i8*) - %y = load i32* bitcast (%op_ts* @h to i32*) + %x = load i8, i8* bitcast (%opaque_t* @g to i8*) + %y = load i32, i32* bitcast (%op_ts* @h to i32*) %z = zext i8 %x to i32 %r = add i32 %y, %z ret i32 %r diff --git a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll index e3192a9..04a5aaa 100644 --- a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll +++ b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll @@ -5,7 +5,7 @@ define i32 @main(i32 %argc, i8** %argv) { entry: - %tmp32 = tail call i32 (i8* , ...) * bitcast (i32 (i8*, ...) * @printf to i32 (i8* , ...) *)( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0) , i32 0 ) nounwind ; <i32> [#uses=0] + %tmp32 = tail call i32 (i8* , ...) * bitcast (i32 (i8*, ...) * @printf to i32 (i8* , ...) *)( i8* getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0) , i32 0 ) nounwind ; <i32> [#uses=0] ret i32 undef } diff --git a/test/Transforms/InstCombine/2007-12-12-GEPScale.ll b/test/Transforms/InstCombine/2007-12-12-GEPScale.ll index cea87f2..60f715e 100644 --- a/test/Transforms/InstCombine/2007-12-12-GEPScale.ll +++ b/test/Transforms/InstCombine/2007-12-12-GEPScale.ll @@ -5,6 +5,6 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i8* @foo([100 x {i8,i8,i8}]* %x) { entry: %p = bitcast [100 x {i8,i8,i8}]* %x to i8* - %q = getelementptr i8* %p, i32 -4 + %q = getelementptr i8, i8* %p, i32 -4 ret i8* %q } diff --git a/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll b/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll index 8721c83..7260c00 100644 --- a/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll +++ b/test/Transforms/InstCombine/2007-12-28-IcmpSub2.ll @@ -4,7 +4,7 @@ define i32 @test1() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp ule i32 %sub, 0 %retval = select i1 %cmp, i32 0, i32 1 @@ -15,7 +15,7 @@ define i32 @test2() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp ugt i32 %sub, 0 %retval = select i1 %cmp, i32 1, i32 0 @@ -26,7 +26,7 @@ define i32 @test3() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp slt i32 %sub, 0 %retval = select i1 %cmp, i32 1, i32 0 @@ -37,7 +37,7 @@ define i32 @test4() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp sle i32 %sub, 0 %retval = select i1 %cmp, i32 1, i32 0 @@ -48,7 +48,7 @@ define i32 @test5() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp sge i32 %sub, 0 %retval = select i1 %cmp, i32 0, i32 1 @@ -59,7 +59,7 @@ define i32 @test6() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp sgt i32 %sub, 0 %retval = select i1 %cmp, i32 0, i32 1 @@ -70,7 +70,7 @@ define i32 @test7() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp eq i32 %sub, 0 %retval = select i1 %cmp, i32 0, i32 1 @@ -81,7 +81,7 @@ define i32 @test8() { entry: %z = alloca i32 store i32 0, i32* %z - %tmp = load i32* %z + %tmp = load i32, i32* %z %sub = sub i32 %tmp, 1 %cmp = icmp ne i32 %sub, 0 %retval = select i1 %cmp, i32 1, i32 0 diff --git a/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll b/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll index aacea9d..46d0694 100644 --- a/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll +++ b/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll @@ -12,13 +12,13 @@ define i32 @nest(i32 %n) { entry: %FRAME.0 = alloca %struct.FRAME.nest, align 8 ; <%struct.FRAME.nest*> [#uses=3] %TRAMP.216 = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1] - %TRAMP.216.sub = getelementptr [10 x i8]* %TRAMP.216, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp3 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 0 ; <i32*> [#uses=1] + %TRAMP.216.sub = getelementptr [10 x i8], [10 x i8]* %TRAMP.216, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp3 = getelementptr %struct.FRAME.nest, %struct.FRAME.nest* %FRAME.0, i32 0, i32 0 ; <i32*> [#uses=1] store i32 %n, i32* %tmp3, align 8 %FRAME.06 = bitcast %struct.FRAME.nest* %FRAME.0 to i8* ; <i8*> [#uses=1] call void @llvm.init.trampoline( i8* %TRAMP.216.sub, i8* bitcast (i32 (%struct.FRAME.nest*, ...)* @f to i8*), i8* %FRAME.06 ) ; <i8*> [#uses=1] %tramp = call i8* @llvm.adjust.trampoline( i8* %TRAMP.216.sub) - %tmp7 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (...)**> [#uses=1] + %tmp7 = getelementptr %struct.FRAME.nest, %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (...)**> [#uses=1] %tmp89 = bitcast i8* %tramp to i32 (...)* ; <i32 (...)*> [#uses=2] store i32 (...)* %tmp89, i32 (...)** %tmp7, align 8 %tmp2.i = call i32 (...)* %tmp89( i32 zeroext 0 ) ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll b/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll index 0fa4d71..d086f4b 100644 --- a/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll +++ b/test/Transforms/InstCombine/2008-03-13-IntToPtr.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -instcombine -S | grep "16" | count 1 define i8* @bork(i8** %qux) { - %tmp275 = load i8** %qux, align 1 + %tmp275 = load i8*, i8** %qux, align 1 %tmp275276 = ptrtoint i8* %tmp275 to i32 %tmp277 = add i32 %tmp275276, 16 %tmp277278 = inttoptr i32 %tmp277 to i8* diff --git a/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll b/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll index fd0217e..af662bd 100644 --- a/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll +++ b/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll @@ -6,7 +6,7 @@ target triple = "i386-apple-darwin8" define i32 @main() nounwind { entry: %tmp93 = icmp slt i32 0, 10 ; <i1> [#uses=0] - %tmp34 = load volatile i32* @g_1, align 4 ; <i32> [#uses=1] + %tmp34 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1] br label %bb bb: ; preds = %bb, %entry @@ -16,7 +16,7 @@ bb: ; preds = %bb, %entry store volatile i32 %tmp4, i32* @g_1, align 4 %tmp6 = add i32 %b.0.reg2mem.0, 1 ; <i32> [#uses=2] %tmp9 = icmp slt i32 %tmp6, 10 ; <i1> [#uses=1] - %tmp3 = load volatile i32* @g_1, align 4 ; <i32> [#uses=1] + %tmp3 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1] br i1 %tmp9, label %bb, label %bb11 bb11: ; preds = %bb diff --git a/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll b/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll index 8022414..3c67e51 100644 --- a/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll +++ b/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll @@ -7,11 +7,11 @@ target triple = "i386-apple-darwin8" define i32 @main(i32 %i) nounwind { entry: %tmp93 = icmp slt i32 %i, 10 ; <i1> [#uses=0] - %tmp34 = load volatile i32* @g_1, align 4 ; <i32> [#uses=1] + %tmp34 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1] br i1 %tmp93, label %bb11, label %bb bb: ; preds = %bb, %entry - %tmp3 = load volatile i32* @g_1, align 4 ; <i32> [#uses=1] + %tmp3 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1] br label %bb11 bb11: ; preds = %bb diff --git a/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll b/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll index 7a1c844..e007e6f 100644 --- a/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll +++ b/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll @@ -7,12 +7,12 @@ define i32 @a() nounwind { entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] %tmp1 = call i8* @malloc( i32 10 ) nounwind ; <i8*> [#uses=5] - %tmp3 = getelementptr i8* %tmp1, i32 1 ; <i8*> [#uses=1] + %tmp3 = getelementptr i8, i8* %tmp1, i32 1 ; <i8*> [#uses=1] store i8 0, i8* %tmp3, align 1 - %tmp5 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1] + %tmp5 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1] store i8 1, i8* %tmp5, align 1 %tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1] - %tmp9 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1] + %tmp9 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1] store i8 0, i8* %tmp9, align 1 %tmp11 = call i32 (...)* @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0] ret i32 %tmp7 diff --git a/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll b/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll index d266164..af0ffeb 100644 --- a/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll +++ b/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll @@ -7,16 +7,16 @@ define i32 @a() nounwind { entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] %tmp1 = call i8* @malloc( i32 10 ) nounwind ; <i8*> [#uses=5] - %tmp3 = getelementptr i8* %tmp1, i32 1 ; <i8*> [#uses=1] + %tmp3 = getelementptr i8, i8* %tmp1, i32 1 ; <i8*> [#uses=1] store i8 0, i8* %tmp3, align 1 - %tmp5 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1] + %tmp5 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1] store i8 1, i8* %tmp5, align 1 ; CHECK: store ; CHECK: store ; CHECK-NEXT: strlen ; CHECK-NEXT: store %tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1] - %tmp9 = getelementptr i8* %tmp1, i32 0 ; <i8*> [#uses=1] + %tmp9 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1] store i8 0, i8* %tmp9, align 1 %tmp11 = call i32 (...)* @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0] br label %return diff --git a/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll b/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll index f6eb248..722f8f0 100644 --- a/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll +++ b/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll @@ -23,8 +23,8 @@ invcont31: ; preds = %invcont to label %invcont37 unwind label %lpad ; <i32**> [#uses=1] invcont37: ; preds = %invcont31 - %tmp39 = load i32** %tmp38, align 8 ; <i32*> [#uses=1] - %tmp41 = getelementptr %"struct.std::ctype<char>"* %this, i32 0, i32 4 ; <i32**> [#uses=1] + %tmp39 = load i32*, i32** %tmp38, align 8 ; <i32*> [#uses=1] + %tmp41 = getelementptr %"struct.std::ctype<char>", %"struct.std::ctype<char>"* %this, i32 0, i32 4 ; <i32**> [#uses=1] store i32* %tmp39, i32** %tmp41, align 8 ret void diff --git a/test/Transforms/InstCombine/2008-05-17-InfLoop.ll b/test/Transforms/InstCombine/2008-05-17-InfLoop.ll index 2939a48..af0f2a4 100644 --- a/test/Transforms/InstCombine/2008-05-17-InfLoop.ll +++ b/test/Transforms/InstCombine/2008-05-17-InfLoop.ll @@ -10,11 +10,11 @@ entry: %blockSize100k = alloca i32 ; <i32*> [#uses=2] store i32 %0, i32* %blockSize100k %n = alloca i32 ; <i32*> [#uses=2] - load i32* %blockSize100k ; <i32>:1 [#uses=1] + load i32, i32* %blockSize100k ; <i32>:1 [#uses=1] store i32 %1, i32* %n - load i32* %n ; <i32>:2 [#uses=1] + load i32, i32* %n ; <i32>:2 [#uses=1] add i32 %2, 2 ; <i32>:3 [#uses=1] - mul i32 %3, ptrtoint (i32* getelementptr (i32* null, i32 1) to i32) ; <i32>:4 [#uses=1] + mul i32 %3, ptrtoint (i32* getelementptr (i32, i32* null, i32 1) to i32) ; <i32>:4 [#uses=1] call void @BZALLOC( i32 %4 ) br label %return diff --git a/test/Transforms/InstCombine/2008-05-23-CompareFold.ll b/test/Transforms/InstCombine/2008-05-23-CompareFold.ll index b729677..b10aac9 100644 --- a/test/Transforms/InstCombine/2008-05-23-CompareFold.ll +++ b/test/Transforms/InstCombine/2008-05-23-CompareFold.ll @@ -5,7 +5,7 @@ ; CHECK: ret i1 false define i1 @f(i8* %x) { entry: - %tmp462 = load i8* %x, align 1 ; <i8> [#uses=1] + %tmp462 = load i8, i8* %x, align 1 ; <i8> [#uses=1] %tmp462463 = sitofp i8 %tmp462 to float ; <float> [#uses=1] %tmp464 = fcmp ugt float %tmp462463, 0x47EFFFFFE0000000 ; <i1> ret i1 %tmp464 diff --git a/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll b/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll index 05f1c52..c3aab46 100644 --- a/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll +++ b/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll @@ -4,13 +4,13 @@ declare i32 @x(i32*) define i32 @b(i32* %a, i32* %b) { entry: - %tmp1 = load i32* %a - %tmp3 = load i32* %b + %tmp1 = load i32, i32* %a + %tmp3 = load i32, i32* %b %add = add i32 %tmp1, %tmp3 %call = call i32 @x( i32* %a ) %tobool = icmp ne i32 %add, 0 ; not safe to turn into an uncond load %cond = select i1 %tobool, i32* %b, i32* %a - %tmp8 = load i32* %cond + %tmp8 = load i32, i32* %cond ret i32 %tmp8 } diff --git a/test/Transforms/InstCombine/2008-06-24-StackRestore.ll b/test/Transforms/InstCombine/2008-06-24-StackRestore.ll index 9c4c1b5..f963b00 100644 --- a/test/Transforms/InstCombine/2008-06-24-StackRestore.ll +++ b/test/Transforms/InstCombine/2008-06-24-StackRestore.ll @@ -27,7 +27,7 @@ bb44: ; preds = %bb44, %entry %tmp27 = alloca i32, i32 %tmp5 ; <i32*> [#uses=3] %tmpcast = bitcast i32* %tmp27 to i8* ; <i8*> [#uses=1] store i32 1, i32* %tmp27, align 4 - %tmp34 = getelementptr i32* %tmp27, i32 %tmp4 ; <i32*> [#uses=1] + %tmp34 = getelementptr i32, i32* %tmp27, i32 %tmp4 ; <i32*> [#uses=1] store i32 2, i32* %tmp34, align 4 store volatile i8* %tmpcast, i8** @p, align 4 %exitcond = icmp eq i32 %tmp3857, 999999 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll b/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll index dcf4bef..17ec9cd 100644 --- a/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll +++ b/test/Transforms/InstCombine/2008-07-08-VolatileLoadMerge.ll @@ -7,7 +7,7 @@ target triple = "i386-apple-darwin8" define i32 @main() nounwind { entry: %tmp93 = icmp slt i32 0, 10 ; <i1> [#uses=0] - %tmp34 = load volatile i32* @g_1, align 4 ; <i32> [#uses=1] + %tmp34 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1] br label %bb bb: ; preds = %bb, %entry @@ -17,7 +17,7 @@ bb: ; preds = %bb, %entry store volatile i32 %tmp4, i32* @g_1, align 4 %tmp6 = add i32 %b.0.reg2mem.0, 1 ; <i32> [#uses=2] %tmp9 = icmp slt i32 %tmp6, 10 ; <i1> [#uses=1] - %tmp3 = load volatile i32* @g_1, align 4 ; <i32> [#uses=1] + %tmp3 = load volatile i32, i32* @g_1, align 4 ; <i32> [#uses=1] br i1 %tmp9, label %bb, label %bb11 bb11: ; preds = %bb diff --git a/test/Transforms/InstCombine/2008-08-05-And.ll b/test/Transforms/InstCombine/2008-08-05-And.ll index 9773c2d..91f1c0b 100644 --- a/test/Transforms/InstCombine/2008-08-05-And.ll +++ b/test/Transforms/InstCombine/2008-08-05-And.ll @@ -6,8 +6,8 @@ entry: br label %bb bb: - %g1 = getelementptr i8* %x, i32 0 - %l1 = load i8* %g1, align 1 + %g1 = getelementptr i8, i8* %x, i32 0 + %l1 = load i8, i8* %g1, align 1 %s1 = sub i8 %l1, 6 %c1 = icmp ugt i8 %s1, 2 %s2 = sub i8 %l1, 10 diff --git a/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll b/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll index 50ea2f4..23ed5aa 100644 --- a/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll +++ b/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll @@ -12,16 +12,16 @@ entry: %iospec = alloca %struct.Key ; <%struct.Key*> [#uses=3] %ret = alloca i32 ; <i32*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - %0 = getelementptr %struct.Key* %iospec, i32 0, i32 0 ; <{ i32, i32 }*> [#uses=2] - %1 = getelementptr { i32, i32 }* %0, i32 0, i32 0 ; <i32*> [#uses=1] + %0 = getelementptr %struct.Key, %struct.Key* %iospec, i32 0, i32 0 ; <{ i32, i32 }*> [#uses=2] + %1 = getelementptr { i32, i32 }, { i32, i32 }* %0, i32 0, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %1, align 4 - %2 = getelementptr { i32, i32 }* %0, i32 0, i32 1 ; <i32*> [#uses=1] + %2 = getelementptr { i32, i32 }, { i32, i32 }* %0, i32 0, i32 1 ; <i32*> [#uses=1] store i32 0, i32* %2, align 4 - %3 = getelementptr %struct.Key* %iospec, i32 0, i32 0 ; <{ i32, i32 }*> [#uses=1] + %3 = getelementptr %struct.Key, %struct.Key* %iospec, i32 0, i32 0 ; <{ i32, i32 }*> [#uses=1] %4 = bitcast { i32, i32 }* %3 to i64* ; <i64*> [#uses=1] store i64 %key_token2, i64* %4, align 4 %5 = call i32 (...)* @foo(%struct.Key* byval align 4 %iospec, i32* %ret) nounwind ; <i32> [#uses=0] - %6 = load i32* %ret, align 4 ; <i32> [#uses=1] + %6 = load i32, i32* %ret, align 4 ; <i32> [#uses=1] ret i32 %6 } diff --git a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll index 68c51b4..cb7431b 100644 --- a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll +++ b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll @@ -15,12 +15,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF0000000000000, float* %x, align 4 store float 0x7FF8000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -36,12 +36,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF0000000000000, float* %x, align 4 store float 0.000000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -55,12 +55,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF0000000000000, float* %x, align 4 store float 3.500000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -74,12 +74,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF0000000000000, float* %x, align 4 store float 0x7FF0000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -93,12 +93,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF8000000000000, float* %x, align 4 store float 0x7FF0000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -112,12 +112,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF8000000000000, float* %x, align 4 store float 0.000000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -131,12 +131,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF8000000000000, float* %x, align 4 store float 3.500000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -150,12 +150,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0x7FF8000000000000, float* %x, align 4 store float 0x7FF8000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -169,12 +169,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0.000000e+00, float* %x, align 4 store float 0x7FF8000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -188,12 +188,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0.000000e+00, float* %x, align 4 store float 0x7FF0000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -207,12 +207,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0.000000e+00, float* %x, align 4 store float 0.000000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -226,12 +226,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 0.000000e+00, float* %x, align 4 store float 3.500000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -245,12 +245,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 3.500000e+00, float* %x, align 4 store float 0x7FF8000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -264,12 +264,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 3.500000e+00, float* %x, align 4 store float 0x7FF0000000000000, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -283,12 +283,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 3.500000e+00, float* %x, align 4 store float 0.000000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry @@ -302,12 +302,12 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store float 3.500000e+00, float* %x, align 4 store float 3.500000e+00, float* %y, align 4 - %0 = load float* %y, align 4 ; <float> [#uses=1] + %0 = load float, float* %y, align 4 ; <float> [#uses=1] %1 = fpext float %0 to double ; <double> [#uses=1] - %2 = load float* %x, align 4 ; <float> [#uses=1] + %2 = load float, float* %x, align 4 ; <float> [#uses=1] %3 = fpext float %2 to double ; <double> [#uses=1] %4 = frem double %3, %1 ; <double> [#uses=1] - %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] + %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0] br label %return return: ; preds = %entry diff --git a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll index 6bc7ce3..5adcb6b 100644 --- a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll +++ b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float.ll @@ -14,12 +14,12 @@ entry: %1 = frem double 1.000000e-01, 1.000000e+00 ; <double> [#uses=1] %2 = fptrunc double %1 to float ; <float> [#uses=1] store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; <float> [#uses=1] + %3 = load float, float* %0, align 4 ; <float> [#uses=1] store float %3, float* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load float* %retval ; <float> [#uses=1] + %retval1 = load float, float* %retval ; <float> [#uses=1] ret float %retval1 } @@ -31,12 +31,12 @@ entry: %1 = frem double -1.000000e-01, 1.000000e+00 ; <double> [#uses=1] %2 = fptrunc double %1 to float ; <float> [#uses=1] store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; <float> [#uses=1] + %3 = load float, float* %0, align 4 ; <float> [#uses=1] store float %3, float* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load float* %retval ; <float> [#uses=1] + %retval1 = load float, float* %retval ; <float> [#uses=1] ret float %retval1 } @@ -48,12 +48,12 @@ entry: %1 = frem double 1.000000e-01, -1.000000e+00 ; <double> [#uses=1] %2 = fptrunc double %1 to float ; <float> [#uses=1] store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; <float> [#uses=1] + %3 = load float, float* %0, align 4 ; <float> [#uses=1] store float %3, float* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load float* %retval ; <float> [#uses=1] + %retval1 = load float, float* %retval ; <float> [#uses=1] ret float %retval1 } @@ -65,11 +65,11 @@ entry: %1 = frem double -1.000000e-01, -1.000000e+00 ; <double> [#uses=1] %2 = fptrunc double %1 to float ; <float> [#uses=1] store float %2, float* %0, align 4 - %3 = load float* %0, align 4 ; <float> [#uses=1] + %3 = load float, float* %0, align 4 ; <float> [#uses=1] store float %3, float* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load float* %retval ; <float> [#uses=1] + %retval1 = load float, float* %retval ; <float> [#uses=1] ret float %retval1 } diff --git a/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll b/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll index 4b64b48..3f3535b 100644 --- a/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll +++ b/test/Transforms/InstCombine/2009-01-24-EmptyStruct.ll @@ -11,7 +11,7 @@ target triple = "x86_64-unknown-linux-gnu" define void @handle_event(%struct.inode* %bar) nounwind { entry: - %0 = getelementptr %struct.inode* %bar, i64 -1, i32 1, i32 1 ; <%struct.rwlock_t*> [#uses=1] + %0 = getelementptr %struct.inode, %struct.inode* %bar, i64 -1, i32 1, i32 1 ; <%struct.rwlock_t*> [#uses=1] %1 = bitcast %struct.rwlock_t* %0 to i32* ; <i32*> [#uses=1] store i32 1, i32* %1, align 4 ret void diff --git a/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll b/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll index 9146a8e..0f8b38c 100644 --- a/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll +++ b/test/Transforms/InstCombine/2009-02-20-InstCombine-SROA.ll @@ -27,53 +27,53 @@ entry: %4 = alloca i32 %"alloca point" = bitcast i32 0 to i32 store i32 42, i32* %4, align 4 - %5 = getelementptr %"struct.std::vector<int,std::allocator<int> >"* %X, i32 0, i32 0 - %6 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >"* %5, i32 0, i32 0 - %7 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl"* %6, i32 0, i32 1 - %8 = load i32** %7, align 4 - %9 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %3, i32 0, i32 0 + %5 = getelementptr %"struct.std::vector<int,std::allocator<int> >", %"struct.std::vector<int,std::allocator<int> >"* %X, i32 0, i32 0 + %6 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >", %"struct.std::_Vector_base<int,std::allocator<int> >"* %5, i32 0, i32 0 + %7 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl", %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl"* %6, i32 0, i32 1 + %8 = load i32*, i32** %7, align 4 + %9 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %3, i32 0, i32 0 store i32* %8, i32** %9, align 4 - %10 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %3, i32 0, i32 0 - %11 = load i32** %10, align 4 + %10 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %3, i32 0, i32 0 + %11 = load i32*, i32** %10, align 4 %tmp2.i = ptrtoint i32* %11 to i32 %tmp1.i = inttoptr i32 %tmp2.i to i32* %tmp3 = ptrtoint i32* %tmp1.i to i32 %tmp2 = inttoptr i32 %tmp3 to i32* - %12 = getelementptr %"struct.std::vector<int,std::allocator<int> >"* %X, i32 0, i32 0 - %13 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >"* %12, i32 0, i32 0 - %14 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl"* %13, i32 0, i32 0 - %15 = load i32** %14, align 4 - %16 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %0, i32 0, i32 0 + %12 = getelementptr %"struct.std::vector<int,std::allocator<int> >", %"struct.std::vector<int,std::allocator<int> >"* %X, i32 0, i32 0 + %13 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >", %"struct.std::_Vector_base<int,std::allocator<int> >"* %12, i32 0, i32 0 + %14 = getelementptr %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl", %"struct.std::_Vector_base<int,std::allocator<int> >::_Vector_impl"* %13, i32 0, i32 0 + %15 = load i32*, i32** %14, align 4 + %16 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %0, i32 0, i32 0 store i32* %15, i32** %16, align 4 - %17 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %0, i32 0, i32 0 - %18 = load i32** %17, align 4 + %17 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %0, i32 0, i32 0 + %18 = load i32*, i32** %17, align 4 %tmp2.i17 = ptrtoint i32* %18 to i32 %tmp1.i18 = inttoptr i32 %tmp2.i17 to i32* %tmp8 = ptrtoint i32* %tmp1.i18 to i32 %tmp6 = inttoptr i32 %tmp8 to i32* - %19 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i, i32 0, i32 0 + %19 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i, i32 0, i32 0 store i32* %tmp6, i32** %19 - %20 = getelementptr %"struct.std::bidirectional_iterator_tag"* %1, i32 0, i32 0 - %21 = load i8* %20, align 1 + %20 = getelementptr %"struct.std::bidirectional_iterator_tag", %"struct.std::bidirectional_iterator_tag"* %1, i32 0, i32 0 + %21 = load i8, i8* %20, align 1 %22 = or i8 %21, 0 %23 = or i8 %22, 0 %24 = or i8 %23, 0 - %25 = getelementptr %"struct.std::bidirectional_iterator_tag"* %2, i32 0, i32 0 + %25 = getelementptr %"struct.std::bidirectional_iterator_tag", %"struct.std::bidirectional_iterator_tag"* %2, i32 0, i32 0 store i8 0, i8* %25, align 1 - %elt.i = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i, i32 0, i32 0 - %val.i = load i32** %elt.i + %elt.i = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i, i32 0, i32 0 + %val.i = load i32*, i32** %elt.i %tmp.i = bitcast %"struct.std::bidirectional_iterator_tag"* %unnamed_arg.i to i8* %tmp9.i = bitcast %"struct.std::bidirectional_iterator_tag"* %2 to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp.i, i8* %tmp9.i, i64 1, i32 1, i1 false) - %26 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %26 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %val.i, i32** %26 - %27 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 + %27 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 store i32* %tmp2, i32** %27 - %28 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 - %29 = load i32** %28, align 4 + %28 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 + %29 = load i32*, i32** %28, align 4 %30 = ptrtoint i32* %29 to i32 - %31 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %32 = load i32** %31, align 4 + %31 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %32 = load i32*, i32** %31, align 4 %33 = ptrtoint i32* %32 to i32 %34 = sub i32 %30, %33 %35 = ashr i32 %34, 2 @@ -81,85 +81,85 @@ entry: br label %bb12.i.i bb.i.i: ; preds = %bb12.i.i - %37 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %38 = load i32** %37, align 4 - %39 = load i32* %38, align 4 - %40 = load i32* %4, align 4 + %37 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %38 = load i32*, i32** %37, align 4 + %39 = load i32, i32* %38, align 4 + %40 = load i32, i32* %4, align 4 %41 = icmp eq i32 %39, %40 %42 = zext i1 %41 to i8 %toBool.i.i = icmp ne i8 %42, 0 br i1 %toBool.i.i, label %bb1.i.i, label %bb2.i.i bb1.i.i: ; preds = %bb.i.i - %43 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %44 = load i32** %43, align 4 + %43 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %44 = load i32*, i32** %43, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit bb2.i.i: ; preds = %bb.i.i - %45 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %46 = load i32** %45, align 4 - %47 = getelementptr i32* %46, i64 1 - %48 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %45 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %46 = load i32*, i32** %45, align 4 + %47 = getelementptr i32, i32* %46, i64 1 + %48 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %47, i32** %48, align 4 - %49 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %50 = load i32** %49, align 4 - %51 = load i32* %50, align 4 - %52 = load i32* %4, align 4 + %49 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %50 = load i32*, i32** %49, align 4 + %51 = load i32, i32* %50, align 4 + %52 = load i32, i32* %4, align 4 %53 = icmp eq i32 %51, %52 %54 = zext i1 %53 to i8 %toBool3.i.i = icmp ne i8 %54, 0 br i1 %toBool3.i.i, label %bb4.i.i, label %bb5.i.i bb4.i.i: ; preds = %bb2.i.i - %55 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %56 = load i32** %55, align 4 + %55 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %56 = load i32*, i32** %55, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit bb5.i.i: ; preds = %bb2.i.i - %57 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %58 = load i32** %57, align 4 - %59 = getelementptr i32* %58, i64 1 - %60 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %57 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %58 = load i32*, i32** %57, align 4 + %59 = getelementptr i32, i32* %58, i64 1 + %60 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %59, i32** %60, align 4 - %61 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %62 = load i32** %61, align 4 - %63 = load i32* %62, align 4 - %64 = load i32* %4, align 4 + %61 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %62 = load i32*, i32** %61, align 4 + %63 = load i32, i32* %62, align 4 + %64 = load i32, i32* %4, align 4 %65 = icmp eq i32 %63, %64 %66 = zext i1 %65 to i8 %toBool6.i.i = icmp ne i8 %66, 0 br i1 %toBool6.i.i, label %bb7.i.i, label %bb8.i.i bb7.i.i: ; preds = %bb5.i.i - %67 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %68 = load i32** %67, align 4 + %67 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %68 = load i32*, i32** %67, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit bb8.i.i: ; preds = %bb5.i.i - %69 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %70 = load i32** %69, align 4 - %71 = getelementptr i32* %70, i64 1 - %72 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %69 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %70 = load i32*, i32** %69, align 4 + %71 = getelementptr i32, i32* %70, i64 1 + %72 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %71, i32** %72, align 4 - %73 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %74 = load i32** %73, align 4 - %75 = load i32* %74, align 4 - %76 = load i32* %4, align 4 + %73 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %74 = load i32*, i32** %73, align 4 + %75 = load i32, i32* %74, align 4 + %76 = load i32, i32* %4, align 4 %77 = icmp eq i32 %75, %76 %78 = zext i1 %77 to i8 %toBool9.i.i = icmp ne i8 %78, 0 br i1 %toBool9.i.i, label %bb10.i.i, label %bb11.i.i bb10.i.i: ; preds = %bb8.i.i - %79 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %80 = load i32** %79, align 4 + %79 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %80 = load i32*, i32** %79, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit bb11.i.i: ; preds = %bb8.i.i - %81 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %82 = load i32** %81, align 4 - %83 = getelementptr i32* %82, i64 1 - %84 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %81 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %82 = load i32*, i32** %81, align 4 + %83 = getelementptr i32, i32* %82, i64 1 + %84 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %83, i32** %84, align 4 %85 = sub i32 %__trip_count.0.i.i, 1 br label %bb12.i.i @@ -170,11 +170,11 @@ bb12.i.i: ; preds = %bb11.i.i, %entry br i1 %86, label %bb.i.i, label %bb13.i.i bb13.i.i: ; preds = %bb12.i.i - %87 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 - %88 = load i32** %87, align 4 + %87 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 + %88 = load i32*, i32** %87, align 4 %89 = ptrtoint i32* %88 to i32 - %90 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %91 = load i32** %90, align 4 + %90 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %91 = load i32*, i32** %90, align 4 %92 = ptrtoint i32* %91 to i32 %93 = sub i32 %89, %92 %94 = ashr i32 %93, 2 @@ -185,77 +185,77 @@ bb13.i.i: ; preds = %bb12.i.i ] bb14.i.i: ; preds = %bb13.i.i - %95 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %96 = load i32** %95, align 4 - %97 = load i32* %96, align 4 - %98 = load i32* %4, align 4 + %95 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %96 = load i32*, i32** %95, align 4 + %97 = load i32, i32* %96, align 4 + %98 = load i32, i32* %4, align 4 %99 = icmp eq i32 %97, %98 %100 = zext i1 %99 to i8 %toBool15.i.i = icmp ne i8 %100, 0 br i1 %toBool15.i.i, label %bb16.i.i, label %bb17.i.i bb16.i.i: ; preds = %bb14.i.i - %101 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %102 = load i32** %101, align 4 + %101 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %102 = load i32*, i32** %101, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit bb17.i.i: ; preds = %bb14.i.i - %103 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %104 = load i32** %103, align 4 - %105 = getelementptr i32* %104, i64 1 - %106 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %103 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %104 = load i32*, i32** %103, align 4 + %105 = getelementptr i32, i32* %104, i64 1 + %106 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %105, i32** %106, align 4 br label %bb18.i.i bb18.i.i: ; preds = %bb17.i.i, %bb13.i.i - %107 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %108 = load i32** %107, align 4 - %109 = load i32* %108, align 4 - %110 = load i32* %4, align 4 + %107 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %108 = load i32*, i32** %107, align 4 + %109 = load i32, i32* %108, align 4 + %110 = load i32, i32* %4, align 4 %111 = icmp eq i32 %109, %110 %112 = zext i1 %111 to i8 %toBool19.i.i = icmp ne i8 %112, 0 br i1 %toBool19.i.i, label %bb20.i.i, label %bb21.i.i bb20.i.i: ; preds = %bb18.i.i - %113 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %114 = load i32** %113, align 4 + %113 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %114 = load i32*, i32** %113, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit bb21.i.i: ; preds = %bb18.i.i - %115 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %116 = load i32** %115, align 4 - %117 = getelementptr i32* %116, i64 1 - %118 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %115 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %116 = load i32*, i32** %115, align 4 + %117 = getelementptr i32, i32* %116, i64 1 + %118 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %117, i32** %118, align 4 br label %bb22.i.i bb22.i.i: ; preds = %bb21.i.i, %bb13.i.i - %119 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %120 = load i32** %119, align 4 - %121 = load i32* %120, align 4 - %122 = load i32* %4, align 4 + %119 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %120 = load i32*, i32** %119, align 4 + %121 = load i32, i32* %120, align 4 + %122 = load i32, i32* %4, align 4 %123 = icmp eq i32 %121, %122 %124 = zext i1 %123 to i8 %toBool23.i.i = icmp ne i8 %124, 0 br i1 %toBool23.i.i, label %bb24.i.i, label %bb25.i.i bb24.i.i: ; preds = %bb22.i.i - %125 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %126 = load i32** %125, align 4 + %125 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %126 = load i32*, i32** %125, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit bb25.i.i: ; preds = %bb22.i.i - %127 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 - %128 = load i32** %127, align 4 - %129 = getelementptr i32* %128, i64 1 - %130 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %127 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 + %128 = load i32*, i32** %127, align 4 + %129 = getelementptr i32, i32* %128, i64 1 + %130 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__first_addr.i.i, i32 0, i32 0 store i32* %129, i32** %130, align 4 br label %bb26.i.i bb26.i.i: ; preds = %bb25.i.i, %bb13.i.i - %131 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 - %132 = load i32** %131, align 4 + %131 = getelementptr %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >", %"struct.__gnu_cxx::__normal_iterator<int*,std::vector<int, std::allocator<int> > >"* %__last_addr.i.i, i32 0, i32 0 + %132 = load i32*, i32** %131, align 4 br label %_ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit _ZSt4findIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_.exit: ; preds = %bb26.i.i, %bb24.i.i, %bb20.i.i, %bb16.i.i, %bb10.i.i, %bb7.i.i, %bb4.i.i, %bb1.i.i diff --git a/test/Transforms/InstCombine/2009-02-21-LoadCST.ll b/test/Transforms/InstCombine/2009-02-21-LoadCST.ll index cb8a77c..90ec6d5 100644 --- a/test/Transforms/InstCombine/2009-02-21-LoadCST.ll +++ b/test/Transforms/InstCombine/2009-02-21-LoadCST.ll @@ -7,6 +7,6 @@ target triple = "i386-pc-linux-gnu" @.str1 = internal constant [4 x i8] c"\B5%8\00" define i32 @test() { - %rhsv = load i32* bitcast ([4 x i8]* @.str1 to i32*), align 1 + %rhsv = load i32, i32* bitcast ([4 x i8]* @.str1 to i32*), align 1 ret i32 %rhsv } diff --git a/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll b/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll index a8349f0..ef1734b 100644 --- a/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll +++ b/test/Transforms/InstCombine/2009-02-25-CrashZeroSizeArray.ll @@ -9,18 +9,18 @@ entry: %tmp6 = mul i32 %max289, 4 ; <i32> [#uses=1] %tmp7 = alloca i8, i32 0 ; <i8*> [#uses=1] %tmp8 = bitcast i8* %tmp7 to [0 x [0 x i32]]* ; <[0 x [0 x i32]]*> [#uses=1] - %tmp11 = load i32* null, align 1 ; <i32> [#uses=1] + %tmp11 = load i32, i32* null, align 1 ; <i32> [#uses=1] %tmp12 = icmp eq i32 %tmp11, 3 ; <i1> [#uses=1] %tmp13 = zext i1 %tmp12 to i8 ; <i8> [#uses=1] %tmp14 = ashr i32 %tmp6, 2 ; <i32> [#uses=1] %tmp15 = bitcast [0 x [0 x i32]]* %tmp8 to i8* ; <i8*> [#uses=1] %tmp16 = mul i32 %tmp14, 4 ; <i32> [#uses=1] %tmp17 = mul i32 1, %tmp16 ; <i32> [#uses=1] - %tmp18 = getelementptr i8* %tmp15, i32 %tmp17 ; <i8*> [#uses=1] + %tmp18 = getelementptr i8, i8* %tmp15, i32 %tmp17 ; <i8*> [#uses=1] %tmp19 = bitcast i8* %tmp18 to [0 x i32]* ; <[0 x i32]*> [#uses=1] %tmp20 = bitcast [0 x i32]* %tmp19 to i32* ; <i32*> [#uses=1] - %tmp21 = getelementptr i32* %tmp20, i32 0 ; <i32*> [#uses=1] - %tmp22 = load i32* %tmp21, align 1 ; <i32> [#uses=1] + %tmp21 = getelementptr i32, i32* %tmp20, i32 0 ; <i32*> [#uses=1] + %tmp22 = load i32, i32* %tmp21, align 1 ; <i32> [#uses=1] %tmp23 = icmp eq i32 %tmp22, 4 ; <i1> [#uses=1] %tmp24 = zext i1 %tmp23 to i8 ; <i8> [#uses=1] %toBool709 = icmp ne i8 %tmp13, 0 ; <i1> [#uses=1] diff --git a/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll b/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll index c617ca4..3847abd 100644 --- a/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll +++ b/test/Transforms/InstCombine/2009-03-18-vector-ashr-crash.ll @@ -3,9 +3,9 @@ define void @0(<4 x i16>*, <4 x i16>*) { %3 = alloca <4 x i16>* ; <<4 x i16>**> [#uses=1] - %4 = load <4 x i16>* null, align 1 ; <<4 x i16>> [#uses=1] + %4 = load <4 x i16>, <4 x i16>* null, align 1 ; <<4 x i16>> [#uses=1] %5 = ashr <4 x i16> %4, <i16 5, i16 5, i16 5, i16 5> ; <<4 x i16>> [#uses=1] - %6 = load <4 x i16>** %3 ; <<4 x i16>*> [#uses=1] + %6 = load <4 x i16>*, <4 x i16>** %3 ; <<4 x i16>*> [#uses=1] store <4 x i16> %5, <4 x i16>* %6, align 1 ret void } diff --git a/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll b/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll index dd14c6b..ced317c 100644 --- a/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll +++ b/test/Transforms/InstCombine/2009-05-23-FCmpToICmp.ll @@ -2,7 +2,7 @@ ; rdar://6903175 define i1 @f0(i32 *%a) nounwind { - %b = load i32* %a, align 4 + %b = load i32, i32* %a, align 4 %c = uitofp i32 %b to double %d = fcmp ogt double %c, 0x41EFFFFFFFE00000 ret i1 %d diff --git a/test/Transforms/InstCombine/2009-12-17-CmpSelectNull.ll b/test/Transforms/InstCombine/2009-12-17-CmpSelectNull.ll index fb7497b..c438ca5 100644 --- a/test/Transforms/InstCombine/2009-12-17-CmpSelectNull.ll +++ b/test/Transforms/InstCombine/2009-12-17-CmpSelectNull.ll @@ -6,9 +6,9 @@ define i8* @demangle_qualified(i32 %isfuncname) nounwind { entry: %tobool272 = icmp ne i32 %isfuncname, 0 - %cond276 = select i1 %tobool272, i8* getelementptr inbounds ([2 x i8]* @.str254, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8]* @.str557, i32 0, i32 0) ; <i8*> [#uses=4] + %cond276 = select i1 %tobool272, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str254, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str557, i32 0, i32 0) ; <i8*> [#uses=4] %cmp.i504 = icmp eq i8* %cond276, null - %rval = getelementptr i8* %cond276, i1 %cmp.i504 + %rval = getelementptr i8, i8* %cond276, i1 %cmp.i504 ret i8* %rval } diff --git a/test/Transforms/InstCombine/2010-03-03-ExtElim.ll b/test/Transforms/InstCombine/2010-03-03-ExtElim.ll index e0def99..ad0fe5a 100644 --- a/test/Transforms/InstCombine/2010-03-03-ExtElim.ll +++ b/test/Transforms/InstCombine/2010-03-03-ExtElim.ll @@ -4,11 +4,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 target triple = "i386-unknown-linux-gnu" @g_92 = common global [2 x i32*] zeroinitializer, align 4 ; <[2 x i32*]*> [#uses=1] -@g_177 = constant i32** bitcast (i8* getelementptr (i8* bitcast ([2 x i32*]* @g_92 to i8*), i64 4) to i32**), align 4 ; <i32***> [#uses=1] +@g_177 = constant i32** bitcast (i8* getelementptr (i8, i8* bitcast ([2 x i32*]* @g_92 to i8*), i64 4) to i32**), align 4 ; <i32***> [#uses=1] define i1 @PR6486() nounwind { ; CHECK-LABEL: @PR6486( - %tmp = load i32*** @g_177 ; <i32**> [#uses=1] + %tmp = load i32**, i32*** @g_177 ; <i32**> [#uses=1] %cmp = icmp ne i32** null, %tmp ; <i1> [#uses=1] %conv = zext i1 %cmp to i32 ; <i32> [#uses=1] %cmp1 = icmp sle i32 0, %conv ; <i1> [#uses=1] @@ -21,12 +21,12 @@ define i1 @PR6486() nounwind { define i1 @PR16462_1() nounwind { ; CHECK-LABEL: @PR16462_1( - ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 65535) + ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32], [1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 65535) ; CHECK: ret i1 false } define i1 @PR16462_2() nounwind { ; CHECK-LABEL: @PR16462_2( - ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 42) + ret i1 icmp sgt (i32 sext (i16 trunc (i32 select (i1 icmp eq (i32* getelementptr inbounds ([1 x i32], [1 x i32]* @a, i32 0, i32 0), i32* @d), i32 0, i32 1) to i16) to i32), i32 42) ; CHECK: ret i1 false } diff --git a/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll b/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll index 09a9674..29ceb6d 100644 --- a/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll +++ b/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll @@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu" define void @CopyEventArg(%union.anon* %ev) nounwind { entry: - %call = call i32 (i8*, i8*, ...)* @sprintf(i8* undef, i8* getelementptr inbounds ([3 x i8]* @.str, i64 0, i64 0), %union.anon* %ev) nounwind + %call = call i32 (i8*, i8*, ...)* @sprintf(i8* undef, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %union.anon* %ev) nounwind ; CHECK: bitcast %union.anon* %ev to i8* ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64 ret void diff --git a/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll b/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll index 80983ef..798c726 100644 --- a/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll +++ b/test/Transforms/InstCombine/2010-11-21-SizeZeroTypeGEP.ll @@ -5,13 +5,13 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define {}* @foo({}* %x, i32 %n) { ; CHECK-LABEL: @foo( ; CHECK-NOT: getelementptr - %p = getelementptr {}* %x, i32 %n + %p = getelementptr {}, {}* %x, i32 %n ret {}* %p } define i8* @bar(i64 %n, {{}, [0 x {[0 x i8]}]}* %p) { ; CHECK-LABEL: @bar( - %g = getelementptr {{}, [0 x {[0 x i8]}]}* %p, i64 %n, i32 1, i64 %n, i32 0, i64 %n + %g = getelementptr {{}, [0 x {[0 x i8]}]}, {{}, [0 x {[0 x i8]}]}* %p, i64 %n, i32 1, i64 %n, i32 0, i64 %n ; CHECK: %p, i64 0, i32 1, i64 0, i32 0, i64 %n ret i8* %g } diff --git a/test/Transforms/InstCombine/2011-05-02-VectorBoolean.ll b/test/Transforms/InstCombine/2011-05-02-VectorBoolean.ll index 02b64e3..116c971 100644 --- a/test/Transforms/InstCombine/2011-05-02-VectorBoolean.ll +++ b/test/Transforms/InstCombine/2011-05-02-VectorBoolean.ll @@ -6,9 +6,9 @@ entry: %a.addr = alloca <2 x i16>, align 4 %.compoundliteral = alloca <2 x i16>, align 4 store <2 x i16> %a, <2 x i16>* %a.addr, align 4 - %tmp = load <2 x i16>* %a.addr, align 4 + %tmp = load <2 x i16>, <2 x i16>* %a.addr, align 4 store <2 x i16> zeroinitializer, <2 x i16>* %.compoundliteral - %tmp1 = load <2 x i16>* %.compoundliteral + %tmp1 = load <2 x i16>, <2 x i16>* %.compoundliteral %cmp = icmp uge <2 x i16> %tmp, %tmp1 %sext = sext <2 x i1> %cmp to <2 x i16> ret <2 x i16> %sext diff --git a/test/Transforms/InstCombine/2011-05-13-InBoundsGEP.ll b/test/Transforms/InstCombine/2011-05-13-InBoundsGEP.ll index fba7239..6956870 100644 --- a/test/Transforms/InstCombine/2011-05-13-InBoundsGEP.ll +++ b/test/Transforms/InstCombine/2011-05-13-InBoundsGEP.ll @@ -9,9 +9,9 @@ entry: %tmp2 = add i32 %argc, 1879048192 %p = alloca i8 ; CHECK: getelementptr - %p1 = getelementptr i8* %p, i32 %tmp1 + %p1 = getelementptr i8, i8* %p, i32 %tmp1 ; CHECK: getelementptr - %p2 = getelementptr i8* %p, i32 %tmp2 + %p2 = getelementptr i8, i8* %p, i32 %tmp2 %cmp = icmp ult i8* %p1, %p2 br i1 %cmp, label %bbtrue, label %bbfalse bbtrue: ; preds = %entry diff --git a/test/Transforms/InstCombine/2011-05-28-swapmulsub.ll b/test/Transforms/InstCombine/2011-05-28-swapmulsub.ll index b096d1f..639b64a 100644 --- a/test/Transforms/InstCombine/2011-05-28-swapmulsub.ll +++ b/test/Transforms/InstCombine/2011-05-28-swapmulsub.ll @@ -7,14 +7,14 @@ entry: %on_off.addr = alloca i32, align 4 %a = alloca i32, align 4 store i32 %on_off, i32* %on_off.addr, align 4 - %tmp = load i32* %on_off.addr, align 4 + %tmp = load i32, i32* %on_off.addr, align 4 %sub = sub i32 1, %tmp ; CHECK-NOT: mul i32 %mul = mul i32 %sub, -2 ; CHECK: shl ; CHECK-NEXT: add store i32 %mul, i32* %a, align 4 - %tmp1 = load i32* %a, align 4 + %tmp1 = load i32, i32* %a, align 4 %conv = trunc i32 %tmp1 to i16 ret i16 %conv } @@ -26,15 +26,15 @@ entry: %a = alloca i32, align 4 store i32 %on_off, i32* %on_off.addr, align 4 store i32 %q, i32* %q.addr, align 4 - %tmp = load i32* %q.addr, align 4 - %tmp1 = load i32* %on_off.addr, align 4 + %tmp = load i32, i32* %q.addr, align 4 + %tmp1 = load i32, i32* %on_off.addr, align 4 %sub = sub i32 %tmp, %tmp1 ; CHECK-NOT: mul i32 %mul = mul i32 %sub, -4 ; CHECK: sub i32 ; CHECK-NEXT: shl store i32 %mul, i32* %a, align 4 - %tmp2 = load i32* %a, align 4 + %tmp2 = load i32, i32* %a, align 4 %conv = trunc i32 %tmp2 to i16 ret i16 %conv } @@ -44,14 +44,14 @@ entry: %on_off.addr = alloca i32, align 4 %a = alloca i32, align 4 store i32 %on_off, i32* %on_off.addr, align 4 - %tmp = load i32* %on_off.addr, align 4 + %tmp = load i32, i32* %on_off.addr, align 4 %sub = sub i32 7, %tmp ; CHECK-NOT: mul i32 %mul = mul i32 %sub, -4 ; CHECK: shl ; CHECK-NEXT: add store i32 %mul, i32* %a, align 4 - %tmp1 = load i32* %a, align 4 + %tmp1 = load i32, i32* %a, align 4 %conv = trunc i32 %tmp1 to i16 ret i16 %conv } diff --git a/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll b/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll index c8f0351..15c11db 100644 --- a/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll +++ b/test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll @@ -9,12 +9,12 @@ define void @fu1(i32 %parm) nounwind ssp { %ptr = alloca double*, align 4 store i32 %parm, i32* %1, align 4 store double* null, double** %ptr, align 4 - %2 = load i32* %1, align 4 + %2 = load i32, i32* %1, align 4 %3 = icmp ne i32 %2, 0 br i1 %3, label %4, label %10 ; <label>:4 ; preds = %0 - %5 = load i32* %1, align 4 + %5 = load i32, i32* %1, align 4 %6 = shl nsw i32 %5, 3 ; With "nsw", the alloca and its bitcast can be fused: %7 = add nsw i32 %6, 2048 @@ -25,7 +25,7 @@ define void @fu1(i32 %parm) nounwind ssp { store double* %9, double** %ptr, align 4 br label %10 ; <label>:10 ; preds = %4, %0 - %11 = load double** %ptr, align 4 + %11 = load double*, double** %ptr, align 4 call void @bar(double* %11) ; CHECK: ret ret void @@ -39,12 +39,12 @@ define void @fu2(i32 %parm) nounwind ssp { %ptr = alloca double*, align 4 store i32 %parm, i32* %1, align 4 store double* null, double** %ptr, align 4 - %2 = load i32* %1, align 4 + %2 = load i32, i32* %1, align 4 %3 = icmp ne i32 %2, 0 br i1 %3, label %4, label %10 ; <label>:4 ; preds = %0 - %5 = load i32* %1, align 4 + %5 = load i32, i32* %1, align 4 %6 = mul nsw i32 %5, 8 ; Without "nsw", the alloca and its bitcast cannot be fused: %7 = add i32 %6, 2048 @@ -57,7 +57,7 @@ define void @fu2(i32 %parm) nounwind ssp { br label %10 ; <label>:10 ; preds = %4, %0 - %11 = load double** %ptr, align 4 + %11 = load double*, double** %ptr, align 4 call void @bar(double* %11) ret void } diff --git a/test/Transforms/InstCombine/2011-09-03-Trampoline.ll b/test/Transforms/InstCombine/2011-09-03-Trampoline.ll index 5456e03..1833558 100644 --- a/test/Transforms/InstCombine/2011-09-03-Trampoline.ll +++ b/test/Transforms/InstCombine/2011-09-03-Trampoline.ll @@ -7,7 +7,7 @@ declare i32 @f(i8 * nest, i32) ; Most common case define i32 @test0(i32 %n) { %alloca = alloca [10 x i8], align 16 - %gep = getelementptr [10 x i8]* %alloca, i32 0, i32 0 + %gep = getelementptr [10 x i8], [10 x i8]* %alloca, i32 0, i32 0 call void @llvm.init.trampoline(i8* %gep, i8* bitcast (i32 (i8*, i32)* @f to i8*), i8* null) %tramp = call i8* @llvm.adjust.trampoline(i8* %gep) @@ -62,7 +62,7 @@ define i32 @test3(i32 %n, i8* %trampmem) { define i32 @test4(i32 %n) { %alloca = alloca [10 x i8], align 16 - %gep = getelementptr [10 x i8]* %alloca, i32 0, i32 0 + %gep = getelementptr [10 x i8], [10 x i8]* %alloca, i32 0, i32 0 call void @llvm.init.trampoline(i8* %gep, i8* bitcast (i32 (i8*, i32)* @f to i8*), i8* null) diff --git a/test/Transforms/InstCombine/2011-10-07-AlignPromotion.ll b/test/Transforms/InstCombine/2011-10-07-AlignPromotion.ll index 22061b2..122669e 100644 --- a/test/Transforms/InstCombine/2011-10-07-AlignPromotion.ll +++ b/test/Transforms/InstCombine/2011-10-07-AlignPromotion.ll @@ -10,7 +10,7 @@ define void @t(%struct.CGPoint* %a) nounwind { %Point = alloca %struct.CGPoint, align 4 %1 = bitcast %struct.CGPoint* %a to i64* %2 = bitcast %struct.CGPoint* %Point to i64* - %3 = load i64* %1, align 4 + %3 = load i64, i64* %1, align 4 store i64 %3, i64* %2, align 4 call void @foo(i64* %2) nounwind ret void diff --git a/test/Transforms/InstCombine/2012-02-13-FCmp.ll b/test/Transforms/InstCombine/2012-02-13-FCmp.ll index 39b0594..3c4c6de 100644 --- a/test/Transforms/InstCombine/2012-02-13-FCmp.ll +++ b/test/Transforms/InstCombine/2012-02-13-FCmp.ll @@ -6,9 +6,9 @@ declare i32 @printf(i8*, ...) define i64 @_Z8tempCastj(i32 %val) uwtable ssp { entry: - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8]* @.str1, i64 0, i64 0), i32 %val) + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str1, i64 0, i64 0), i32 %val) %conv = uitofp i32 %val to double - %call.i = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8]* @.str, i64 0, i64 0), double %conv) + %call.i = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %conv) %cmp.i = fcmp oge double %conv, -1.000000e+00 br i1 %cmp.i, label %land.rhs.i, label %if.end.critedge ; CHECK: br i1 true, label %land.rhs.i, label %if.end.critedge diff --git a/test/Transforms/InstCombine/2012-05-27-Negative-Shift-Crash.ll b/test/Transforms/InstCombine/2012-05-27-Negative-Shift-Crash.ll index ba83fe9..ba57baf 100644 --- a/test/Transforms/InstCombine/2012-05-27-Negative-Shift-Crash.ll +++ b/test/Transforms/InstCombine/2012-05-27-Negative-Shift-Crash.ll @@ -20,7 +20,7 @@ entry: define void @fn4() nounwind uwtable ssp { entry: - %0 = load i32* @d, align 4 + %0 = load i32, i32* @d, align 4 %cmp = icmp eq i32 %0, 0 %conv = zext i1 %cmp to i32 store i32 %conv, i32* @c, align 4 @@ -34,12 +34,12 @@ entry: store i32 %and, i32* @e, align 4 %sub = add nsw i32 %and, -1 store i32 %sub, i32* @f, align 4 - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %if.else, label %if.then if.then: ; preds = %entry - %1 = load i32* @b, align 4 + %1 = load i32, i32* @b, align 4 %.lobit = lshr i32 %1, 31 %2 = trunc i32 %.lobit to i8 %.not = xor i8 %2, 1 diff --git a/test/Transforms/InstCombine/2012-05-28-select-hang.ll b/test/Transforms/InstCombine/2012-05-28-select-hang.ll index db1dbd5..c514dd1 100644 --- a/test/Transforms/InstCombine/2012-05-28-select-hang.ll +++ b/test/Transforms/InstCombine/2012-05-28-select-hang.ll @@ -6,7 +6,7 @@ define void @func() nounwind uwtable ssp { entry: - %0 = load i8* @c, align 1 + %0 = load i8, i8* @c, align 1 %conv = zext i8 %0 to i32 %or = or i32 %conv, 1 %conv1 = trunc i32 %or to i8 @@ -16,7 +16,7 @@ entry: %and = and i32 1, %neg %conv3 = trunc i32 %and to i8 store i8 %conv3, i8* @b, align 1 - %1 = load i8* @a, align 1 + %1 = load i8, i8* @a, align 1 %conv4 = zext i8 %1 to i32 %conv5 = zext i8 %conv3 to i32 %tobool = icmp ne i32 %conv4, 0 diff --git a/test/Transforms/InstCombine/2012-06-06-LoadOfPHIs.ll b/test/Transforms/InstCombine/2012-06-06-LoadOfPHIs.ll index 22466a9..4af1ca8 100644 --- a/test/Transforms/InstCombine/2012-06-06-LoadOfPHIs.ll +++ b/test/Transforms/InstCombine/2012-06-06-LoadOfPHIs.ll @@ -34,16 +34,16 @@ bb11: ; preds = %bb8 bb12: ; preds = %bb11, %bb10, %bb7, %bb6 %max.0 = phi double* [ %tmp, %bb6 ], [ %tmp2, %bb7 ], [ %tmp1, %bb10 ], [ %tmp2, %bb11 ] -; CHECK: %tmp13 = load double* %tmp, align 8 -; CHECK: %tmp14 = load double* %tmp1, align 8 +; CHECK: %tmp13 = load double, double* %tmp, align 8 +; CHECK: %tmp14 = load double, double* %tmp1, align 8 ; CHECK: %tmp15 = fcmp olt double %tmp13, %tmp14 - %tmp13 = load double* %tmp, align 8 - %tmp14 = load double* %tmp1, align 8 + %tmp13 = load double, double* %tmp, align 8 + %tmp14 = load double, double* %tmp1, align 8 %tmp15 = fcmp olt double %tmp13, %tmp14 br i1 %tmp15, label %bb16, label %bb21 bb16: ; preds = %bb12 - %tmp17 = load double* %tmp2, align 8 + %tmp17 = load double, double* %tmp2, align 8 %tmp18 = fcmp olt double %tmp13, %tmp17 br i1 %tmp18, label %bb19, label %bb20 @@ -54,7 +54,7 @@ bb20: ; preds = %bb16 br label %bb26 bb21: ; preds = %bb12 - %tmp22 = load double* %tmp2, align 8 + %tmp22 = load double, double* %tmp2, align 8 %tmp23 = fcmp olt double %tmp14, %tmp22 br i1 %tmp23, label %bb24, label %bb25 @@ -66,16 +66,16 @@ bb25: ; preds = %bb21 bb26: ; preds = %bb25, %bb24, %bb20, %bb19 %min.0 = phi double* [ %tmp, %bb19 ], [ %tmp2, %bb20 ], [ %tmp1, %bb24 ], [ %tmp2, %bb25 ] -; CHECK: %tmp27 = load double* %min.0, align 8 -; CHECK: %tmp28 = load double* %max.0 +; CHECK: %tmp27 = load double, double* %min.0, align 8 +; CHECK: %tmp28 = load double, double* %max.0 ; CHECK: %tmp29 = fadd double %tmp27, %tmp28 - %tmp27 = load double* %min.0, align 8 - %tmp28 = load double* %max.0 + %tmp27 = load double, double* %min.0, align 8 + %tmp28 = load double, double* %max.0 %tmp29 = fadd double %tmp27, %tmp28 %tmp30 = fdiv double %tmp29, 2.000000e+00 store double %tmp30, double* %outL - %tmp31 = load double* %min.0 - %tmp32 = load double* %max.0 + %tmp31 = load double, double* %min.0 + %tmp32 = load double, double* %max.0 %tmp33 = fcmp oeq double %tmp31, %tmp32 br i1 %tmp33, label %bb34, label %bb35 @@ -107,11 +107,11 @@ bb45: ; preds = %bb41, %bb38 br i1 %tmp46, label %bb47, label %bb55 bb47: ; preds = %bb45 - %tmp48 = load double* %tmp1, align 8 - %tmp49 = load double* %tmp2, align 8 + %tmp48 = load double, double* %tmp1, align 8 + %tmp49 = load double, double* %tmp2, align 8 %tmp50 = fsub double %tmp48, %tmp49 - %tmp51 = load double* %max.0 - %tmp52 = load double* %min.0 + %tmp51 = load double, double* %max.0 + %tmp52 = load double, double* %min.0 %tmp53 = fsub double %tmp51, %tmp52 %tmp54 = fdiv double %tmp50, %tmp53 store double %tmp54, double* %outH @@ -122,11 +122,11 @@ bb55: ; preds = %bb45 br i1 %tmp56, label %bb57, label %bb66 bb57: ; preds = %bb55 - %tmp58 = load double* %tmp2, align 8 - %tmp59 = load double* %tmp, align 8 + %tmp58 = load double, double* %tmp2, align 8 + %tmp59 = load double, double* %tmp, align 8 %tmp60 = fsub double %tmp58, %tmp59 - %tmp61 = load double* %max.0 - %tmp62 = load double* %min.0 + %tmp61 = load double, double* %max.0 + %tmp62 = load double, double* %min.0 %tmp63 = fsub double %tmp61, %tmp62 %tmp64 = fdiv double %tmp60, %tmp63 %tmp65 = fadd double 2.000000e+00, %tmp64 @@ -134,11 +134,11 @@ bb57: ; preds = %bb55 br label %bb75 bb66: ; preds = %bb55 - %tmp67 = load double* %tmp, align 8 - %tmp68 = load double* %tmp1, align 8 + %tmp67 = load double, double* %tmp, align 8 + %tmp68 = load double, double* %tmp1, align 8 %tmp69 = fsub double %tmp67, %tmp68 - %tmp70 = load double* %max.0 - %tmp71 = load double* %min.0 + %tmp70 = load double, double* %max.0 + %tmp71 = load double, double* %min.0 %tmp72 = fsub double %tmp70, %tmp71 %tmp73 = fdiv double %tmp69, %tmp72 %tmp74 = fadd double 4.000000e+00, %tmp73 @@ -146,7 +146,7 @@ bb66: ; preds = %bb55 br label %bb75 bb75: ; preds = %bb66, %bb57, %bb47 - %tmp76 = load double* %outH + %tmp76 = load double, double* %outH %tmp77 = fdiv double %tmp76, 6.000000e+00 store double %tmp77, double* %outH %tmp78 = fcmp olt double %tmp77, 0.000000e+00 diff --git a/test/Transforms/InstCombine/2012-07-25-LoadPart.ll b/test/Transforms/InstCombine/2012-07-25-LoadPart.ll index 18aab7f..14fcf52 100644 --- a/test/Transforms/InstCombine/2012-07-25-LoadPart.ll +++ b/test/Transforms/InstCombine/2012-07-25-LoadPart.ll @@ -5,7 +5,7 @@ @test = constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] define i64 @foo() { - %ret = load i64* bitcast (i8* getelementptr (i8* bitcast ([4 x i32]* @test to i8*), i64 2) to i64*), align 1 + %ret = load i64, i64* bitcast (i8* getelementptr (i8, i8* bitcast ([4 x i32]* @test to i8*), i64 2) to i64*), align 1 ret i64 %ret ; 0x00030000_00020000 in [01 00/00 00 02 00 00 00 03 00/00 00 04 00 00 00] ; LE: ret i64 844424930263040 diff --git a/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll b/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll index ac9c555..6665380 100644 --- a/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll +++ b/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll @@ -5,6 +5,6 @@ declare void @foo(i32*) define void @test() nounwind { - call void @foo(i32* getelementptr (i32* addrspacecast ([16 x i32] addrspace(3)* @base to i32*), i64 2147483647)) nounwind + call void @foo(i32* getelementptr (i32, i32* addrspacecast ([16 x i32] addrspace(3)* @base to i32*), i64 2147483647)) nounwind ret void } diff --git a/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll b/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll index 7015725..1c5a981 100644 --- a/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll +++ b/test/Transforms/InstCombine/2012-09-17-ZeroSizedAlloca.ll @@ -16,8 +16,8 @@ target triple = "x86_64-apple-macosx10.8.0" define void @f() { %1 = alloca [0 x i8], align 1 %2 = alloca [0 x i8], align 1024 - %3 = getelementptr inbounds [0 x i8]* %1, i64 0, i64 0 - %4 = getelementptr inbounds [0 x i8]* %2, i64 0, i64 0 + %3 = getelementptr inbounds [0 x i8], [0 x i8]* %1, i64 0, i64 0 + %4 = getelementptr inbounds [0 x i8], [0 x i8]* %2, i64 0, i64 0 store i8* %3, i8** @x, align 8 store i8* %4, i8** @y, align 8 ret void diff --git a/test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll b/test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll deleted file mode 100644 index 35b6285..0000000 --- a/test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll +++ /dev/null @@ -1,19 +0,0 @@ -; RUN: opt < %s -instcombine -S | FileCheck %s - -; Check we don't crash due to lack of target data. - -@G = constant [100 x i8] zeroinitializer - -declare void @bar(i8*) -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind - -define void @test() { -; CHECK-LABEL: @test( -; CHECK: llvm.memcpy -; CHECK: ret void - %A = alloca [100 x i8] - %a = getelementptr inbounds [100 x i8]* %A, i64 0, i64 0 - call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* getelementptr inbounds ([100 x i8]* @G, i64 0, i32 0), i64 100, i32 4, i1 false) - call void @bar(i8* %a) readonly - ret void -} diff --git a/test/Transforms/InstCombine/2012-10-25-vector-of-pointers.ll b/test/Transforms/InstCombine/2012-10-25-vector-of-pointers.ll index 20ea282..2321065 100644 --- a/test/Transforms/InstCombine/2012-10-25-vector-of-pointers.ll +++ b/test/Transforms/InstCombine/2012-10-25-vector-of-pointers.ll @@ -9,7 +9,7 @@ target triple = "x86_64-apple-macosx10.8.0" define void @widget(%struct.hoge* nocapture %arg) nounwind uwtable ssp { bb: - %tmp = getelementptr inbounds %struct.hoge* %arg, i64 0, i32 0 + %tmp = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i64 0, i32 0 br i1 undef, label %bb1, label %bb17 bb1: ; preds = %bb @@ -20,7 +20,7 @@ bb2: ; preds = %bb1 bb3: ; preds = %bb1 %tmp4 = bitcast double** %tmp to <2 x double*>* - %tmp5 = load <2 x double*>* %tmp4, align 8 + %tmp5 = load <2 x double*>, <2 x double*>* %tmp4, align 8 %tmp6 = ptrtoint <2 x double*> %tmp5 to <2 x i64> %tmp7 = sub <2 x i64> zeroinitializer, %tmp6 %tmp8 = ashr exact <2 x i64> %tmp7, <i64 3, i64 3> diff --git a/test/Transforms/InstCombine/2012-12-14-simp-vgep.ll b/test/Transforms/InstCombine/2012-12-14-simp-vgep.ll index fc29b09..46702f8 100644 --- a/test/Transforms/InstCombine/2012-12-14-simp-vgep.ll +++ b/test/Transforms/InstCombine/2012-12-14-simp-vgep.ll @@ -3,7 +3,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" define <4 x i32> @foo(<4 x i32*>* %in) { - %t17 = load <4 x i32*>* %in, align 8 + %t17 = load <4 x i32*>, <4 x i32*>* %in, align 8 %t18 = icmp eq <4 x i32*> %t17, zeroinitializer %t19 = zext <4 x i1> %t18 to <4 x i32> ret <4 x i32> %t19 diff --git a/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll b/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll index 789e317..9425c29 100644 --- a/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll +++ b/test/Transforms/InstCombine/2013-03-05-Combine-BitcastTy-Into-Alloca.ll @@ -16,8 +16,8 @@ define { i64, i64 } @function(i32 %x, i32 %y, i32 %z) nounwind { ; CHECK-NOT: bitcast i96* %retval to %struct._my_struct* entry: %retval = alloca %struct._my_struct, align 8 - %k.sroa.0.0.copyload = load i96* bitcast (%struct._my_struct* @initval to i96*), align 1 - %k.sroa.1.12.copyload = load i32* bitcast ([4 x i8]* getelementptr inbounds (%struct._my_struct* @initval, i64 0, i32 1) to i32*), align 1 + %k.sroa.0.0.copyload = load i96, i96* bitcast (%struct._my_struct* @initval to i96*), align 1 + %k.sroa.1.12.copyload = load i32, i32* bitcast ([4 x i8]* getelementptr inbounds (%struct._my_struct, %struct._my_struct* @initval, i64 0, i32 1) to i32*), align 1 %0 = zext i32 %x to i96 %bf.value = shl nuw nsw i96 %0, 6 %bf.clear = and i96 %k.sroa.0.0.copyload, -288230376151711744 @@ -32,14 +32,14 @@ entry: %bf.set10 = or i96 %bf.set5, %bf.clear %retval.0.cast7 = bitcast %struct._my_struct* %retval to i96* store i96 %bf.set10, i96* %retval.0.cast7, align 8 - %retval.12.idx8 = getelementptr inbounds %struct._my_struct* %retval, i64 0, i32 1 + %retval.12.idx8 = getelementptr inbounds %struct._my_struct, %struct._my_struct* %retval, i64 0, i32 1 %retval.12.cast9 = bitcast [4 x i8]* %retval.12.idx8 to i32* store i32 %k.sroa.1.12.copyload, i32* %retval.12.cast9, align 4 %trunc = trunc i96 %bf.set10 to i64 %.fca.0.insert = insertvalue { i64, i64 } undef, i64 %trunc, 0 - %retval.8.idx12 = getelementptr inbounds %struct._my_struct* %retval, i64 0, i32 0, i64 8 + %retval.8.idx12 = getelementptr inbounds %struct._my_struct, %struct._my_struct* %retval, i64 0, i32 0, i64 8 %retval.8.cast13 = bitcast i8* %retval.8.idx12 to i64* - %retval.8.load14 = load i64* %retval.8.cast13, align 8 + %retval.8.load14 = load i64, i64* %retval.8.cast13, align 8 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.8.load14, 1 ret { i64, i64 } %.fca.1.insert } diff --git a/test/Transforms/InstCombine/CPP_min_max.ll b/test/Transforms/InstCombine/CPP_min_max.ll index b3d081b..04bf0ce 100644 --- a/test/Transforms/InstCombine/CPP_min_max.ll +++ b/test/Transforms/InstCombine/CPP_min_max.ll @@ -10,11 +10,11 @@ define void @_Z5test1RiS_(i32* %x, i32* %y) { entry: - %tmp.1.i = load i32* %y ; <i32> [#uses=1] - %tmp.3.i = load i32* %x ; <i32> [#uses=1] + %tmp.1.i = load i32, i32* %y ; <i32> [#uses=1] + %tmp.3.i = load i32, i32* %x ; <i32> [#uses=1] %tmp.4.i = icmp slt i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1] %retval.i = select i1 %tmp.4.i, i32* %y, i32* %x ; <i32*> [#uses=1] - %tmp.4 = load i32* %retval.i ; <i32> [#uses=1] + %tmp.4 = load i32, i32* %retval.i ; <i32> [#uses=1] store i32 %tmp.4, i32* %x ret void } @@ -22,12 +22,12 @@ entry: define void @_Z5test2RiS_(i32* %x, i32* %y) { entry: %tmp.0 = alloca i32 ; <i32*> [#uses=2] - %tmp.2 = load i32* %x ; <i32> [#uses=2] + %tmp.2 = load i32, i32* %x ; <i32> [#uses=2] store i32 %tmp.2, i32* %tmp.0 - %tmp.3.i = load i32* %y ; <i32> [#uses=1] + %tmp.3.i = load i32, i32* %y ; <i32> [#uses=1] %tmp.4.i = icmp slt i32 %tmp.2, %tmp.3.i ; <i1> [#uses=1] %retval.i = select i1 %tmp.4.i, i32* %y, i32* %tmp.0 ; <i32*> [#uses=1] - %tmp.6 = load i32* %retval.i ; <i32> [#uses=1] + %tmp.6 = load i32, i32* %retval.i ; <i32> [#uses=1] store i32 %tmp.6, i32* %y ret void } diff --git a/test/Transforms/InstCombine/PR7357.ll b/test/Transforms/InstCombine/PR7357.ll index c397c5e..616c822 100644 --- a/test/Transforms/InstCombine/PR7357.ll +++ b/test/Transforms/InstCombine/PR7357.ll @@ -8,7 +8,7 @@ ; CHECK: call arm_aapcscc i8* @strchr define arm_aapcscc i32 @foo(i32 %argc) nounwind { bb.nph: - %c = call arm_aapcscc i8* @strchr(i8* getelementptr ([11 x i8]* @.str1, i32 0, + %c = call arm_aapcscc i8* @strchr(i8* getelementptr ([11 x i8], [11 x i8]* @.str1, i32 0, i32 0), i32 %argc) nounwind readonly %p = ptrtoint i8* %c to i32 ret i32 %p diff --git a/test/Transforms/InstCombine/add3.ll b/test/Transforms/InstCombine/add3.ll index cde3e24..9d3842f 100644 --- a/test/Transforms/InstCombine/add3.ll +++ b/test/Transforms/InstCombine/add3.ll @@ -12,8 +12,8 @@ EntryBlock: store i32 1, i32* %1 add i32 %.val24, -16 inttoptr i32 %2 to i32* - getelementptr i32* %3, i32 1 - load i32* %4 + getelementptr i32, i32* %3, i32 1 + load i32, i32* %4 tail call i32 @callee( i32 %5 ) ret void } diff --git a/test/Transforms/InstCombine/addrspacecast.ll b/test/Transforms/InstCombine/addrspacecast.ll index c168436..27f6b72 100644 --- a/test/Transforms/InstCombine/addrspacecast.ll +++ b/test/Transforms/InstCombine/addrspacecast.ll @@ -104,12 +104,12 @@ define <4 x float addrspace(2)*> @combine_addrspacecast_types_vector(<4 x i32 ad define i32 @canonicalize_addrspacecast([16 x i32] addrspace(1)* %arr) { ; CHECK-LABEL: @canonicalize_addrspacecast( -; CHECK-NEXT: getelementptr inbounds [16 x i32] addrspace(1)* %arr, i32 0, i32 0 +; CHECK-NEXT: getelementptr inbounds [16 x i32], [16 x i32] addrspace(1)* %arr, i32 0, i32 0 ; CHECK-NEXT: addrspacecast i32 addrspace(1)* %{{[a-zA-Z0-9]+}} to i32* -; CHECK-NEXT: load i32* +; CHECK-NEXT: load i32, i32* ; CHECK-NEXT: ret i32 %p = addrspacecast [16 x i32] addrspace(1)* %arr to i32* - %v = load i32* %p + %v = load i32, i32* %p ret i32 %v } @@ -127,14 +127,14 @@ declare void @foo(i8*) nounwind define i32 @memcpy_addrspacecast() nounwind { entry: %alloca = alloca i8, i32 48 - call void @llvm.memcpy.p0i8.p1i8.i32(i8* %alloca, i8 addrspace(1)* addrspacecast (i8 addrspace(2)* getelementptr inbounds ([60 x i8] addrspace(2)* @const_array, i16 0, i16 4) to i8 addrspace(1)*), i32 48, i32 4, i1 false) nounwind + call void @llvm.memcpy.p0i8.p1i8.i32(i8* %alloca, i8 addrspace(1)* addrspacecast (i8 addrspace(2)* getelementptr inbounds ([60 x i8], [60 x i8] addrspace(2)* @const_array, i16 0, i16 4) to i8 addrspace(1)*), i32 48, i32 4, i1 false) nounwind br label %loop.body loop.body: %i = phi i32 [ 0, %entry ], [ %i.inc, %loop.body ] %sum = phi i32 [ 0, %entry ], [ %sum.inc, %loop.body] - %ptr = getelementptr i8* %alloca, i32 %i - %load = load i8* %ptr + %ptr = getelementptr i8, i8* %alloca, i32 %i + %load = load i8, i8* %ptr %ext = zext i8 %load to i32 %sum.inc = add i32 %sum, %ext %i.inc = add i32 %i, 1 diff --git a/test/Transforms/InstCombine/alias-recursion.ll b/test/Transforms/InstCombine/alias-recursion.ll index fa63726..74254f3 100644 --- a/test/Transforms/InstCombine/alias-recursion.ll +++ b/test/Transforms/InstCombine/alias-recursion.ll @@ -7,7 +7,7 @@ target triple = "x86_64-pc-windows-msvc" @0 = constant [1 x i8*] zeroinitializer -@vtbl = alias getelementptr inbounds ([1 x i8*]* @0, i32 0, i32 0) +@vtbl = alias getelementptr inbounds ([1 x i8*], [1 x i8*]* @0, i32 0, i32 0) define i32 (%class.A*)* @test() { ; CHECK-LABEL: test @@ -19,6 +19,6 @@ for.body: ; preds = %for.body, %entry for.end: ; preds = %for.body, %entry %A = phi i32 (%class.A*)** [ bitcast (i8** @vtbl to i32 (%class.A*)**), %for.body ], [ null, %entry ] - %B = load i32 (%class.A*)** %A + %B = load i32 (%class.A*)*, i32 (%class.A*)** %A ret i32 (%class.A*)* %B } diff --git a/test/Transforms/InstCombine/align-2d-gep.ll b/test/Transforms/InstCombine/align-2d-gep.ll index f6a8776..bbdb3f9 100644 --- a/test/Transforms/InstCombine/align-2d-gep.ll +++ b/test/Transforms/InstCombine/align-2d-gep.ll @@ -22,11 +22,11 @@ bb7.outer: bb1: %j = phi i64 [ 0, %bb7.outer ], [ %indvar.next, %bb1 ] - %t4 = getelementptr [1001 x [20000 x double]]* @Nice, i64 0, i64 %i, i64 %j + %t4 = getelementptr [1001 x [20000 x double]], [1001 x [20000 x double]]* @Nice, i64 0, i64 %i, i64 %j %q = bitcast double* %t4 to <2 x double>* store <2 x double><double 0.0, double 0.0>, <2 x double>* %q, align 8 - %s4 = getelementptr [1001 x [20001 x double]]* @Awkward, i64 0, i64 %i, i64 %j + %s4 = getelementptr [1001 x [20001 x double]], [1001 x [20001 x double]]* @Awkward, i64 0, i64 %i, i64 %j %r = bitcast double* %s4 to <2 x double>* store <2 x double><double 0.0, double 0.0>, <2 x double>* %r, align 8 diff --git a/test/Transforms/InstCombine/align-addr.ll b/test/Transforms/InstCombine/align-addr.ll index 4d22c2c..ab0ae39 100644 --- a/test/Transforms/InstCombine/align-addr.ll +++ b/test/Transforms/InstCombine/align-addr.ll @@ -21,7 +21,7 @@ bb: %i = phi i64 [ %indvar.next, %bb ], [ 20, %entry ] %j = mul i64 %i, %v %h = add i64 %j, %z - %t8 = getelementptr double* %e, i64 %h + %t8 = getelementptr double, double* %e, i64 %h %p = bitcast double* %t8 to <2 x double>* store <2 x double><double 0.0, double 0.0>, <2 x double>* %p, align 8 %indvar.next = add i64 %i, 1 @@ -43,7 +43,7 @@ return: define <16 x i8> @test1(<2 x i64> %x) { entry: - %tmp = load <16 x i8>* bitcast ([4 x i32]* @GLOBAL to <16 x i8>*), align 1 + %tmp = load <16 x i8>, <16 x i8>* bitcast ([4 x i32]* @GLOBAL to <16 x i8>*), align 1 ret <16 x i8> %tmp } @@ -53,7 +53,7 @@ define <16 x i8> @test1_as1(<2 x i64> %x) { ; CHECK-LABEL: @test1_as1( ; CHECK: tmp = load ; CHECK: GLOBAL_as1{{.*}}align 16 - %tmp = load <16 x i8> addrspace(1)* bitcast ([4 x i32] addrspace(1)* @GLOBAL_as1 to <16 x i8> addrspace(1)*), align 1 + %tmp = load <16 x i8>, <16 x i8> addrspace(1)* bitcast ([4 x i32] addrspace(1)* @GLOBAL_as1 to <16 x i8> addrspace(1)*), align 1 ret <16 x i8> %tmp } @@ -63,7 +63,7 @@ define <16 x i8> @test1_as1_gep(<2 x i64> %x) { ; CHECK-LABEL: @test1_as1_gep( ; CHECK: tmp = load ; CHECK: GLOBAL_as1_gep{{.*}}align 16 - %tmp = load <16 x i8> addrspace(1)* bitcast (i32 addrspace(1)* getelementptr ([8 x i32] addrspace(1)* @GLOBAL_as1_gep, i16 0, i16 4) to <16 x i8> addrspace(1)*), align 1 + %tmp = load <16 x i8>, <16 x i8> addrspace(1)* bitcast (i32 addrspace(1)* getelementptr ([8 x i32], [8 x i32] addrspace(1)* @GLOBAL_as1_gep, i16 0, i16 4) to <16 x i8> addrspace(1)*), align 1 ret <16 x i8> %tmp } @@ -71,11 +71,11 @@ define <16 x i8> @test1_as1_gep(<2 x i64> %x) { ; When a load or store lacks an explicit alignment, add one. ; CHECK-LABEL: @test2( -; CHECK: load double* %p, align 8 +; CHECK: load double, double* %p, align 8 ; CHECK: store double %n, double* %p, align 8 define double @test2(double* %p, double %n) nounwind { - %t = load double* %p + %t = load double, double* %p store double %n, double* %p ret double %t } diff --git a/test/Transforms/InstCombine/align-attr.ll b/test/Transforms/InstCombine/align-attr.ll index 9f366bf..99a17db1 100644 --- a/test/Transforms/InstCombine/align-attr.ll +++ b/test/Transforms/InstCombine/align-attr.ll @@ -5,11 +5,11 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable define i32 @foo1(i32* align 32 %a) #0 { entry: - %0 = load i32* %a, align 4 + %0 = load i32, i32* %a, align 4 ret i32 %0 ; CHECK-LABEL: @foo1 -; CHECK-DAG: load i32* %a, align 32 +; CHECK-DAG: load i32, i32* %a, align 32 ; CHECK: ret i32 } diff --git a/test/Transforms/InstCombine/align-external.ll b/test/Transforms/InstCombine/align-external.ll index 66ff9c1..ee98a01 100644 --- a/test/Transforms/InstCombine/align-external.ll +++ b/test/Transforms/InstCombine/align-external.ll @@ -23,7 +23,7 @@ define i64 @foo(i64 %a) { define i32 @bar() { ; CHECK-LABEL: @bar( - %r = load i32* @B, align 1 + %r = load i32, i32* @B, align 1 ; CHECK: align 1 ret i32 %r } diff --git a/test/Transforms/InstCombine/aligned-altivec.ll b/test/Transforms/InstCombine/aligned-altivec.ll index 6ac2691..10b4e4d 100644 --- a/test/Transforms/InstCombine/aligned-altivec.ll +++ b/test/Transforms/InstCombine/aligned-altivec.ll @@ -6,7 +6,7 @@ declare <4 x i32> @llvm.ppc.altivec.lvx(i8*) #1 define <4 x i32> @test1(<4 x i32>* %h) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* %vl = call <4 x i32> @llvm.ppc.altivec.lvx(i8* %hv) @@ -14,14 +14,14 @@ entry: ; CHECK: @llvm.ppc.altivec.lvx ; CHECK: ret <4 x i32> - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 %a = add <4 x i32> %v0, %vl ret <4 x i32> %a } define <4 x i32> @test1a(<4 x i32>* align 16 %h) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* %vl = call <4 x i32> @llvm.ppc.altivec.lvx(i8* %hv) @@ -29,7 +29,7 @@ entry: ; CHECK-NOT: @llvm.ppc.altivec.lvx ; CHECK: ret <4 x i32> - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 %a = add <4 x i32> %v0, %vl ret <4 x i32> %a } @@ -38,11 +38,11 @@ declare void @llvm.ppc.altivec.stvx(<4 x i32>, i8*) #0 define <4 x i32> @test2(<4 x i32>* %h, <4 x i32> %d) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* call void @llvm.ppc.altivec.stvx(<4 x i32> %d, i8* %hv) - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 ret <4 x i32> %v0 ; CHECK-LABEL: @test2 @@ -52,11 +52,11 @@ entry: define <4 x i32> @test2a(<4 x i32>* align 16 %h, <4 x i32> %d) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* call void @llvm.ppc.altivec.stvx(<4 x i32> %d, i8* %hv) - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 ret <4 x i32> %v0 ; CHECK-LABEL: @test2 @@ -68,7 +68,7 @@ declare <4 x i32> @llvm.ppc.altivec.lvxl(i8*) #1 define <4 x i32> @test1l(<4 x i32>* %h) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* %vl = call <4 x i32> @llvm.ppc.altivec.lvxl(i8* %hv) @@ -76,14 +76,14 @@ entry: ; CHECK: @llvm.ppc.altivec.lvxl ; CHECK: ret <4 x i32> - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 %a = add <4 x i32> %v0, %vl ret <4 x i32> %a } define <4 x i32> @test1la(<4 x i32>* align 16 %h) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* %vl = call <4 x i32> @llvm.ppc.altivec.lvxl(i8* %hv) @@ -91,7 +91,7 @@ entry: ; CHECK-NOT: @llvm.ppc.altivec.lvxl ; CHECK: ret <4 x i32> - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 %a = add <4 x i32> %v0, %vl ret <4 x i32> %a } @@ -100,11 +100,11 @@ declare void @llvm.ppc.altivec.stvxl(<4 x i32>, i8*) #0 define <4 x i32> @test2l(<4 x i32>* %h, <4 x i32> %d) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* call void @llvm.ppc.altivec.stvxl(<4 x i32> %d, i8* %hv) - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 ret <4 x i32> %v0 ; CHECK-LABEL: @test2l @@ -114,11 +114,11 @@ entry: define <4 x i32> @test2la(<4 x i32>* align 16 %h, <4 x i32> %d) #0 { entry: - %h1 = getelementptr <4 x i32>* %h, i64 1 + %h1 = getelementptr <4 x i32>, <4 x i32>* %h, i64 1 %hv = bitcast <4 x i32>* %h1 to i8* call void @llvm.ppc.altivec.stvxl(<4 x i32> %d, i8* %hv) - %v0 = load <4 x i32>* %h, align 8 + %v0 = load <4 x i32>, <4 x i32>* %h, align 8 ret <4 x i32> %v0 ; CHECK-LABEL: @test2l diff --git a/test/Transforms/InstCombine/aligned-qpx.ll b/test/Transforms/InstCombine/aligned-qpx.ll index c8a1f6f..e303ddd 100644 --- a/test/Transforms/InstCombine/aligned-qpx.ll +++ b/test/Transforms/InstCombine/aligned-qpx.ll @@ -6,7 +6,7 @@ declare <4 x double> @llvm.ppc.qpx.qvlfs(i8*) #1 define <4 x double> @test1(<4 x float>* %h) #0 { entry: - %h1 = getelementptr <4 x float>* %h, i64 1 + %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1 %hv = bitcast <4 x float>* %h1 to i8* %vl = call <4 x double> @llvm.ppc.qpx.qvlfs(i8* %hv) @@ -14,7 +14,7 @@ entry: ; CHECK: @llvm.ppc.qpx.qvlfs ; CHECK: ret <4 x double> - %v0 = load <4 x float>* %h, align 8 + %v0 = load <4 x float>, <4 x float>* %h, align 8 %v0e = fpext <4 x float> %v0 to <4 x double> %a = fadd <4 x double> %v0e, %vl ret <4 x double> %a @@ -22,7 +22,7 @@ entry: define <4 x double> @test1a(<4 x float>* align 16 %h) #0 { entry: - %h1 = getelementptr <4 x float>* %h, i64 1 + %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1 %hv = bitcast <4 x float>* %h1 to i8* %vl = call <4 x double> @llvm.ppc.qpx.qvlfs(i8* %hv) @@ -30,7 +30,7 @@ entry: ; CHECK-NOT: @llvm.ppc.qpx.qvlfs ; CHECK: ret <4 x double> - %v0 = load <4 x float>* %h, align 8 + %v0 = load <4 x float>, <4 x float>* %h, align 8 %v0e = fpext <4 x float> %v0 to <4 x double> %a = fadd <4 x double> %v0e, %vl ret <4 x double> %a @@ -40,11 +40,11 @@ declare void @llvm.ppc.qpx.qvstfs(<4 x double>, i8*) #0 define <4 x float> @test2(<4 x float>* %h, <4 x double> %d) #0 { entry: - %h1 = getelementptr <4 x float>* %h, i64 1 + %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1 %hv = bitcast <4 x float>* %h1 to i8* call void @llvm.ppc.qpx.qvstfs(<4 x double> %d, i8* %hv) - %v0 = load <4 x float>* %h, align 8 + %v0 = load <4 x float>, <4 x float>* %h, align 8 ret <4 x float> %v0 ; CHECK-LABEL: @test2 @@ -54,11 +54,11 @@ entry: define <4 x float> @test2a(<4 x float>* align 16 %h, <4 x double> %d) #0 { entry: - %h1 = getelementptr <4 x float>* %h, i64 1 + %h1 = getelementptr <4 x float>, <4 x float>* %h, i64 1 %hv = bitcast <4 x float>* %h1 to i8* call void @llvm.ppc.qpx.qvstfs(<4 x double> %d, i8* %hv) - %v0 = load <4 x float>* %h, align 8 + %v0 = load <4 x float>, <4 x float>* %h, align 8 ret <4 x float> %v0 ; CHECK-LABEL: @test2 @@ -70,7 +70,7 @@ declare <4 x double> @llvm.ppc.qpx.qvlfd(i8*) #1 define <4 x double> @test1l(<4 x double>* %h) #0 { entry: - %h1 = getelementptr <4 x double>* %h, i64 1 + %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1 %hv = bitcast <4 x double>* %h1 to i8* %vl = call <4 x double> @llvm.ppc.qpx.qvlfd(i8* %hv) @@ -78,14 +78,14 @@ entry: ; CHECK: @llvm.ppc.qpx.qvlfd ; CHECK: ret <4 x double> - %v0 = load <4 x double>* %h, align 8 + %v0 = load <4 x double>, <4 x double>* %h, align 8 %a = fadd <4 x double> %v0, %vl ret <4 x double> %a } define <4 x double> @test1ln(<4 x double>* align 16 %h) #0 { entry: - %h1 = getelementptr <4 x double>* %h, i64 1 + %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1 %hv = bitcast <4 x double>* %h1 to i8* %vl = call <4 x double> @llvm.ppc.qpx.qvlfd(i8* %hv) @@ -93,14 +93,14 @@ entry: ; CHECK: @llvm.ppc.qpx.qvlfd ; CHECK: ret <4 x double> - %v0 = load <4 x double>* %h, align 8 + %v0 = load <4 x double>, <4 x double>* %h, align 8 %a = fadd <4 x double> %v0, %vl ret <4 x double> %a } define <4 x double> @test1la(<4 x double>* align 32 %h) #0 { entry: - %h1 = getelementptr <4 x double>* %h, i64 1 + %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1 %hv = bitcast <4 x double>* %h1 to i8* %vl = call <4 x double> @llvm.ppc.qpx.qvlfd(i8* %hv) @@ -108,7 +108,7 @@ entry: ; CHECK-NOT: @llvm.ppc.qpx.qvlfd ; CHECK: ret <4 x double> - %v0 = load <4 x double>* %h, align 8 + %v0 = load <4 x double>, <4 x double>* %h, align 8 %a = fadd <4 x double> %v0, %vl ret <4 x double> %a } @@ -117,11 +117,11 @@ declare void @llvm.ppc.qpx.qvstfd(<4 x double>, i8*) #0 define <4 x double> @test2l(<4 x double>* %h, <4 x double> %d) #0 { entry: - %h1 = getelementptr <4 x double>* %h, i64 1 + %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1 %hv = bitcast <4 x double>* %h1 to i8* call void @llvm.ppc.qpx.qvstfd(<4 x double> %d, i8* %hv) - %v0 = load <4 x double>* %h, align 8 + %v0 = load <4 x double>, <4 x double>* %h, align 8 ret <4 x double> %v0 ; CHECK-LABEL: @test2l @@ -131,11 +131,11 @@ entry: define <4 x double> @test2ln(<4 x double>* align 16 %h, <4 x double> %d) #0 { entry: - %h1 = getelementptr <4 x double>* %h, i64 1 + %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1 %hv = bitcast <4 x double>* %h1 to i8* call void @llvm.ppc.qpx.qvstfd(<4 x double> %d, i8* %hv) - %v0 = load <4 x double>* %h, align 8 + %v0 = load <4 x double>, <4 x double>* %h, align 8 ret <4 x double> %v0 ; CHECK-LABEL: @test2ln @@ -145,11 +145,11 @@ entry: define <4 x double> @test2la(<4 x double>* align 32 %h, <4 x double> %d) #0 { entry: - %h1 = getelementptr <4 x double>* %h, i64 1 + %h1 = getelementptr <4 x double>, <4 x double>* %h, i64 1 %hv = bitcast <4 x double>* %h1 to i8* call void @llvm.ppc.qpx.qvstfd(<4 x double> %d, i8* %hv) - %v0 = load <4 x double>* %h, align 8 + %v0 = load <4 x double>, <4 x double>* %h, align 8 ret <4 x double> %v0 ; CHECK-LABEL: @test2l diff --git a/test/Transforms/InstCombine/alloca.ll b/test/Transforms/InstCombine/alloca.ll index 6d0c131..81e2083 100644 --- a/test/Transforms/InstCombine/alloca.ll +++ b/test/Transforms/InstCombine/alloca.ll @@ -1,6 +1,6 @@ -; RUN: opt < %s -instcombine -S -default-data-layout="E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -; RUN: opt < %s -instcombine -S -default-data-layout="E-p:32:32:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefix=P32 -; RUN: opt < %s -instcombine -S | FileCheck %s -check-prefix=NODL +; RUN: opt < %s -instcombine -S -default-data-layout="E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefix=CHECK -check-prefix=ALL +; RUN: opt < %s -instcombine -S -default-data-layout="E-p:32:32:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" | FileCheck %s -check-prefix=P32 -check-prefix=ALL +; RUN: opt < %s -instcombine -S | FileCheck %s -check-prefix=NODL -check-prefix=ALL declare void @use(...) @@ -18,7 +18,7 @@ define void @test() { call void (...)* @use( i32* %Y ) %Z = alloca { } ; <{ }*> [#uses=1] call void (...)* @use( { }* %Z ) - %size = load i32* @int + %size = load i32, i32* @int %A = alloca {{}}, i32 %size call void (...)* @use( {{}}* %A ) ret void @@ -38,7 +38,7 @@ define void @test2() { ; CHECK-NOT: alloca define void @test3() { %A = alloca { i32 } ; <{ i32 }*> [#uses=1] - %B = getelementptr { i32 }* %A, i32 0, i32 0 ; <i32*> [#uses=1] + %B = getelementptr { i32 }, { i32 }* %A, i32 0, i32 0 ; <i32*> [#uses=1] store i32 123, i32* %B ret void } @@ -62,16 +62,16 @@ define void @test5() { entry: %a = alloca { i32 } %b = alloca i32* - %a.1 = getelementptr { i32 }* %a, i32 0, i32 0 + %a.1 = getelementptr { i32 }, { i32 }* %a, i32 0, i32 0 store i32 123, i32* %a.1 store i32* %a.1, i32** %b %b.1 = bitcast i32** %b to i32* store i32 123, i32* %b.1 - %a.2 = getelementptr { i32 }* %a, i32 0, i32 0 + %a.2 = getelementptr { i32 }, { i32 }* %a, i32 0, i32 0 store atomic i32 2, i32* %a.2 unordered, align 4 - %a.3 = getelementptr { i32 }* %a, i32 0, i32 0 + %a.3 = getelementptr { i32 }, { i32 }* %a, i32 0, i32 0 store atomic i32 3, i32* %a.3 release, align 4 - %a.4 = getelementptr { i32 }* %a, i32 0, i32 0 + %a.4 = getelementptr { i32 }, { i32 }* %a, i32 0, i32 0 store atomic i32 4, i32* %a.4 seq_cst, align 4 ret void } @@ -89,7 +89,7 @@ define void @test6() { entry: %a = alloca { i32 } %b = alloca i32 - %a.1 = getelementptr { i32 }* %a, i32 0, i32 0 + %a.1 = getelementptr { i32 }, { i32 }* %a, i32 0, i32 0 store volatile i32 123, i32* %a.1 tail call void @f(i32* %b) ret void @@ -116,15 +116,15 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, define void @test8() { ; CHECK-LABEL: @test8( ; CHECK: alloca [100 x i32] -; CHECK: getelementptr inbounds [100 x i32]* %x1, i64 0, i64 0 +; CHECK: getelementptr inbounds [100 x i32], [100 x i32]* %x1, i64 0, i64 0 ; P32-LABEL: @test8( ; P32: alloca [100 x i32] -; P32: getelementptr inbounds [100 x i32]* %x1, i32 0, i32 0 +; P32: getelementptr inbounds [100 x i32], [100 x i32]* %x1, i32 0, i32 0 ; NODL-LABEL: @test8( ; NODL: alloca [100 x i32] -; NODL: getelementptr inbounds [100 x i32]* %x1, i64 0, i64 0 +; NODL: getelementptr inbounds [100 x i32], [100 x i32]* %x1, i64 0, i64 0 %x = alloca i32, i32 100 call void (...)* @use(i32* %x) ret void @@ -142,7 +142,7 @@ entry: %inalloca.save = call i8* @llvm.stacksave() %argmem = alloca inalloca <{ %struct_type }> ; CHECK: alloca inalloca i64, align 8 - %0 = getelementptr inbounds <{ %struct_type }>* %argmem, i32 0, i32 0 + %0 = getelementptr inbounds <{ %struct_type }>, <{ %struct_type }>* %argmem, i32 0, i32 0 %1 = bitcast %struct_type* %0 to i8* %2 = bitcast %struct_type* %a to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1, i8* %2, i32 8, i32 4, i1 false) @@ -150,3 +150,16 @@ entry: call void @llvm.stackrestore(i8* %inalloca.save) ret void } + +define void @test10() { +entry: +; ALL-LABEL: @test10( +; ALL: %v32 = alloca i1, align 8 +; ALL: %v64 = alloca i1, align 8 +; ALL: %v33 = alloca i1, align 8 + %v32 = alloca i1, align 8 + %v64 = alloca i1, i64 1, align 8 + %v33 = alloca i1, i33 1, align 8 + call void (...)* @use(i1* %v32, i1* %v64, i1* %v33) + ret void +} diff --git a/test/Transforms/InstCombine/assume-loop-align.ll b/test/Transforms/InstCombine/assume-loop-align.ll index 19190de..e803ba6 100644 --- a/test/Transforms/InstCombine/assume-loop-align.ll +++ b/test/Transforms/InstCombine/assume-loop-align.ll @@ -19,16 +19,16 @@ entry: br label %for.body ; CHECK-LABEL: @foo -; CHECK: load i32* {{.*}} align 64 +; CHECK: load i32, i32* {{.*}} align 64 ; CHECK: store i32 {{.*}} align 64 ; CHECK: ret for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, 1 - %arrayidx5 = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx5 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %add, i32* %arrayidx5, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 16 %1 = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/InstCombine/assume-redundant.ll b/test/Transforms/InstCombine/assume-redundant.ll index 81fe094..4b869ef 100644 --- a/test/Transforms/InstCombine/assume-redundant.ll +++ b/test/Transforms/InstCombine/assume-redundant.ll @@ -15,8 +15,8 @@ define void @_Z3fooR1s(%struct.s* nocapture readonly dereferenceable(8) %x) #0 { ; CHECK-NOT: call void @llvm.assume entry: - %a = getelementptr inbounds %struct.s* %x, i64 0, i32 0 - %0 = load double** %a, align 8 + %a = getelementptr inbounds %struct.s, %struct.s* %x, i64 0, i32 0 + %0 = load double*, double** %a, align 8 %ptrint = ptrtoint double* %0 to i64 %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 @@ -25,16 +25,16 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.1, %for.body ] tail call void @llvm.assume(i1 %maskcond) - %arrayidx = getelementptr inbounds double* %0, i64 %indvars.iv - %1 = load double* %arrayidx, align 16 + %arrayidx = getelementptr inbounds double, double* %0, i64 %indvars.iv + %1 = load double, double* %arrayidx, align 16 %add = fadd double %1, 1.000000e+00 tail call void @llvm.assume(i1 %maskcond) %mul = fmul double %add, 2.000000e+00 store double %mul, double* %arrayidx, align 16 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 tail call void @llvm.assume(i1 %maskcond) - %arrayidx.1 = getelementptr inbounds double* %0, i64 %indvars.iv.next - %2 = load double* %arrayidx.1, align 8 + %arrayidx.1 = getelementptr inbounds double, double* %0, i64 %indvars.iv.next + %2 = load double, double* %arrayidx.1, align 8 %add.1 = fadd double %2, 1.000000e+00 tail call void @llvm.assume(i1 %maskcond) %mul.1 = fmul double %add.1, 2.000000e+00 diff --git a/test/Transforms/InstCombine/assume.ll b/test/Transforms/InstCombine/assume.ll index 7e45c04..2f92138 100644 --- a/test/Transforms/InstCombine/assume.ll +++ b/test/Transforms/InstCombine/assume.ll @@ -5,12 +5,12 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable define i32 @foo1(i32* %a) #0 { entry: - %0 = load i32* %a, align 4 + %0 = load i32, i32* %a, align 4 ; Check that the alignment has been upgraded and that the assume has not ; been removed: ; CHECK-LABEL: @foo1 -; CHECK-DAG: load i32* %a, align 32 +; CHECK-DAG: load i32, i32* %a, align 32 ; CHECK-DAG: call void @llvm.assume ; CHECK: ret i32 @@ -27,7 +27,7 @@ define i32 @foo2(i32* %a) #0 { entry: ; Same check as in @foo1, but make sure it works if the assume is first too. ; CHECK-LABEL: @foo2 -; CHECK-DAG: load i32* %a, align 32 +; CHECK-DAG: load i32, i32* %a, align 32 ; CHECK-DAG: call void @llvm.assume ; CHECK: ret i32 @@ -36,7 +36,7 @@ entry: %maskcond = icmp eq i64 %maskedptr, 0 tail call void @llvm.assume(i1 %maskcond) - %0 = load i32* %a, align 4 + %0 = load i32, i32* %a, align 4 ret i32 %0 } @@ -192,7 +192,7 @@ declare void @escape(i32* %a) ; metadata form? define i1 @nonnull1(i32** %a) { entry: - %load = load i32** %a + %load = load i32*, i32** %a %cmp = icmp ne i32* %load, null tail call void @llvm.assume(i1 %cmp) tail call void @escape(i32* %load) @@ -209,7 +209,7 @@ entry: ; to pointer types. Doing otherwise would be illegal. define i1 @nonnull2(i32* %a) { entry: - %load = load i32* %a + %load = load i32, i32* %a %cmp = icmp ne i32 %load, 0 tail call void @llvm.assume(i1 %cmp) %rval = icmp eq i32 %load, 0 @@ -224,7 +224,7 @@ entry: ; if the assume is control dependent on something else define i1 @nonnull3(i32** %a, i1 %control) { entry: - %load = load i32** %a + %load = load i32*, i32** %a %cmp = icmp ne i32* %load, null br i1 %control, label %taken, label %not_taken taken: @@ -244,7 +244,7 @@ not_taken: ; interrupted by an exception being thrown define i1 @nonnull4(i32** %a) { entry: - %load = load i32** %a + %load = load i32*, i32** %a ;; This call may throw! tail call void @escape(i32* %load) %cmp = icmp ne i32* %load, null diff --git a/test/Transforms/InstCombine/atomic.ll b/test/Transforms/InstCombine/atomic.ll index 98cecef..5754a5a 100644 --- a/test/Transforms/InstCombine/atomic.ll +++ b/test/Transforms/InstCombine/atomic.ll @@ -7,10 +7,10 @@ target triple = "x86_64-apple-macosx10.7.0" define i32 @test2(i32* %p) { ; CHECK-LABEL: define i32 @test2( -; CHECK: %x = load atomic i32* %p seq_cst, align 4 +; CHECK: %x = load atomic i32, i32* %p seq_cst, align 4 ; CHECK: shl i32 %x, 1 - %x = load atomic i32* %p seq_cst, align 4 - %y = load i32* %p, align 4 + %x = load atomic i32, i32* %p seq_cst, align 4 + %y = load i32, i32* %p, align 4 %z = add i32 %x, %y ret i32 %z } diff --git a/test/Transforms/InstCombine/bitcast-alias-function.ll b/test/Transforms/InstCombine/bitcast-alias-function.ll index cfec092..1a598a5 100644 --- a/test/Transforms/InstCombine/bitcast-alias-function.ll +++ b/test/Transforms/InstCombine/bitcast-alias-function.ll @@ -91,12 +91,12 @@ define void @bitcast_alias_scalar(float* noalias %source, float* noalias %dest) entry: ; CHECK-LABEL: @bitcast_alias_scalar ; CHECK: bitcast float* %source to i32* -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK-NOT: fptoui ; CHECK-NOT: uitofp ; CHECK: bitcast float* %dest to i32* ; CHECK: store i32 - %tmp = load float* %source, align 8 + %tmp = load float, float* %source, align 8 %call = call float @alias_i32_to_f32(float %tmp) nounwind store float %call, float* %dest, align 8 ret void @@ -107,12 +107,12 @@ define void @bitcast_alias_vector(<2 x float>* noalias %source, <2 x float>* noa entry: ; CHECK-LABEL: @bitcast_alias_vector ; CHECK: bitcast <2 x float>* %source to <2 x i32>* -; CHECK: load <2 x i32>* +; CHECK: load <2 x i32>, <2 x i32>* ; CHECK-NOT: fptoui ; CHECK-NOT: uitofp ; CHECK: bitcast <2 x float>* %dest to <2 x i32>* ; CHECK: store <2 x i32> - %tmp = load <2 x float>* %source, align 8 + %tmp = load <2 x float>, <2 x float>* %source, align 8 %call = call <2 x float> @alias_v2i32_to_v2f32(<2 x float> %tmp) nounwind store <2 x float> %call, <2 x float>* %dest, align 8 ret void @@ -123,11 +123,11 @@ define void @bitcast_alias_vector_scalar_same_size(<2 x float>* noalias %source, entry: ; CHECK-LABEL: @bitcast_alias_vector_scalar_same_size ; CHECK: bitcast <2 x float>* %source to i64* -; CHECK: load i64* +; CHECK: load i64, i64* ; CHECK: %call = call i64 @func_i64 ; CHECK: bitcast <2 x float>* %dest to i64* ; CHECK: store i64 - %tmp = load <2 x float>* %source, align 8 + %tmp = load <2 x float>, <2 x float>* %source, align 8 %call = call <2 x float> @alias_v2f32_to_i64(<2 x float> %tmp) nounwind store <2 x float> %call, <2 x float>* %dest, align 8 ret void @@ -137,11 +137,11 @@ define void @bitcast_alias_scalar_vector_same_size(i64* noalias %source, i64* no entry: ; CHECK-LABEL: @bitcast_alias_scalar_vector_same_size ; CHECK: bitcast i64* %source to <2 x float>* -; CHECK: load <2 x float>* +; CHECK: load <2 x float>, <2 x float>* ; CHECK: call <2 x float> @func_v2f32 ; CHECK: bitcast i64* %dest to <2 x float>* ; CHECK: store <2 x float> - %tmp = load i64* %source, align 8 + %tmp = load i64, i64* %source, align 8 %call = call i64 @alias_i64_to_v2f32(i64 %tmp) nounwind store i64 %call, i64* %dest, align 8 ret void @@ -151,11 +151,11 @@ define void @bitcast_alias_vector_ptrs_same_size(<2 x i64*>* noalias %source, <2 entry: ; CHECK-LABEL: @bitcast_alias_vector_ptrs_same_size ; CHECK: bitcast <2 x i64*>* %source to <2 x i32*>* -; CHECK: load <2 x i32*>* +; CHECK: load <2 x i32*>, <2 x i32*>* ; CHECK: call <2 x i32*> @func_v2i32p ; CHECK: bitcast <2 x i64*>* %dest to <2 x i32*>* ; CHECK: store <2 x i32*> - %tmp = load <2 x i64*>* %source, align 8 + %tmp = load <2 x i64*>, <2 x i64*>* %source, align 8 %call = call <2 x i64*> @alias_v2i32p_to_v2i64p(<2 x i64*> %tmp) nounwind store <2 x i64*> %call, <2 x i64*>* %dest, align 8 ret void @@ -169,7 +169,7 @@ entry: ; CHECK-NOT: fptoui ; CHECK: @alias_i64_to_f32 ; CHECK-NOT: uitofp - %tmp = load float* %source, align 8 + %tmp = load float, float* %source, align 8 %call = call float @alias_i64_to_f32(float %tmp) nounwind store float %call, float* %dest, align 8 ret void @@ -181,7 +181,7 @@ entry: ; CHECK-NOT: fptoui <2 x float> %tmp to <2 x i64> ; CHECK: @alias_v2i64_to_v2f32 ; CHECK-NOT: uitofp <2 x i64> %call to <2 x float> - %tmp = load <2 x float>* %source, align 8 + %tmp = load <2 x float>, <2 x float>* %source, align 8 %call = call <2 x float> @alias_v2i64_to_v2f32(<2 x float> %tmp) nounwind store <2 x float> %call, <2 x float>* %dest, align 8 ret void @@ -191,7 +191,7 @@ define void @bitcast_alias_vector_mismatched_number_elements(<4 x float>* noalia entry: ; CHECK-LABEL: @bitcast_alias_vector_mismatched_number_elements ; CHECK: %call = call <4 x float> @alias_v2i32_to_v4f32 - %tmp = load <4 x float>* %source, align 8 + %tmp = load <4 x float>, <4 x float>* %source, align 8 %call = call <4 x float> @alias_v2i32_to_v4f32(<4 x float> %tmp) nounwind store <4 x float> %call, <4 x float>* %dest, align 8 ret void @@ -201,7 +201,7 @@ define void @bitcast_alias_vector_scalar_mismatched_bit_size(<4 x float>* noalia entry: ; CHECK-LABEL: @bitcast_alias_vector_scalar_mismatched_bit_size ; CHECK: %call = call <4 x float> @alias_v4f32_to_i64 - %tmp = load <4 x float>* %source, align 8 + %tmp = load <4 x float>, <4 x float>* %source, align 8 %call = call <4 x float> @alias_v4f32_to_i64(<4 x float> %tmp) nounwind store <4 x float> %call, <4 x float>* %dest, align 8 ret void @@ -211,7 +211,7 @@ define void @bitcast_alias_vector_ptrs_scalar_mismatched_bit_size(<4 x i32*>* no entry: ; CHECK-LABEL: @bitcast_alias_vector_ptrs_scalar_mismatched_bit_size ; CHECK: @alias_v4i32p_to_i64 - %tmp = load <4 x i32*>* %source, align 8 + %tmp = load <4 x i32*>, <4 x i32*>* %source, align 8 %call = call <4 x i32*> @alias_v4i32p_to_i64(<4 x i32*> %tmp) nounwind store <4 x i32*> %call, <4 x i32*>* %dest, align 8 ret void @@ -221,7 +221,7 @@ define void @bitcast_alias_scalar_vector_ptrs_same_size(i64* noalias %source, i6 entry: ; CHECK-LABEL: @bitcast_alias_scalar_vector_ptrs_same_size ; CHECK: @alias_i64_to_v2i32p - %tmp = load i64* %source, align 8 + %tmp = load i64, i64* %source, align 8 %call = call i64 @alias_i64_to_v2i32p(i64 %tmp) nounwind store i64 %call, i64* %dest, align 8 ret void @@ -231,7 +231,7 @@ define void @bitcast_alias_scalar_vector_mismatched_bit_size(i64* noalias %sourc entry: ; CHECK-LABEL: @bitcast_alias_scalar_vector_mismatched_bit_size ; CHECK: call i64 @alias_i64_to_v4f32 - %tmp = load i64* %source, align 8 + %tmp = load i64, i64* %source, align 8 %call = call i64 @alias_i64_to_v4f32(i64 %tmp) nounwind store i64 %call, i64* %dest, align 8 ret void diff --git a/test/Transforms/InstCombine/bitcast.ll b/test/Transforms/InstCombine/bitcast.ll index c7a520b..579839e 100644 --- a/test/Transforms/InstCombine/bitcast.ll +++ b/test/Transforms/InstCombine/bitcast.ll @@ -148,7 +148,7 @@ define <2 x i16> @BitcastInsert(i32 %a) { ; PR17293 define <2 x i64> @test7(<2 x i8*>* %arg) nounwind { %cast = bitcast <2 x i8*>* %arg to <2 x i64>* - %load = load <2 x i64>* %cast, align 16 + %load = load <2 x i64>, <2 x i64>* %cast, align 16 ret <2 x i64> %load ; CHECK: @test7 ; CHECK: bitcast diff --git a/test/Transforms/InstCombine/bittest.ll b/test/Transforms/InstCombine/bittest.ll index 84ee7dd..edf65d5 100644 --- a/test/Transforms/InstCombine/bittest.ll +++ b/test/Transforms/InstCombine/bittest.ll @@ -5,7 +5,7 @@ define void @_Z12h000007_testv(i32* %P) { entry: - %tmp.2 = load i32* @b_rec.0 ; <i32> [#uses=1] + %tmp.2 = load i32, i32* @b_rec.0 ; <i32> [#uses=1] %tmp.9 = or i32 %tmp.2, -989855744 ; <i32> [#uses=2] %tmp.16 = and i32 %tmp.9, -805306369 ; <i32> [#uses=2] %tmp.17 = and i32 %tmp.9, -973078529 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/branch.ll b/test/Transforms/InstCombine/branch.ll new file mode 100644 index 0000000..5be93cc --- /dev/null +++ b/test/Transforms/InstCombine/branch.ll @@ -0,0 +1,16 @@ +; RUN: opt -instcombine -S < %s | FileCheck %s + +define i32 @test(i32 %x) { +; CHECK-LABEL: @test +entry: +; CHECK-NOT: icmp +; CHECK: br i1 undef, + %cmp = icmp ult i32 %x, 7 + br i1 %cmp, label %merge, label %merge +merge: +; CHECK-LABEL: merge: +; CHECK: ret i32 %x + ret i32 %x +} + + diff --git a/test/Transforms/InstCombine/call-cast-target.ll b/test/Transforms/InstCombine/call-cast-target.ll index 4a5c949..881e807 100644 --- a/test/Transforms/InstCombine/call-cast-target.ll +++ b/test/Transforms/InstCombine/call-cast-target.ll @@ -72,3 +72,18 @@ entry: %call = tail call i32 bitcast (i32 (i32)* @fn4 to i32 (i32*)*)(i32* %a) ret i32 %call } + +declare i1 @fn5({ i32, i32 }* byval align 4 %r) + +define i1 @test5() { +; CHECK-LABEL: @test5 +; CHECK: %[[call:.*]] = call i1 bitcast (i1 ({ i32, i32 }*)* @fn5 to i1 (i32, i32)*)(i32 {{.*}}, i32 {{.*}}) +; CHECK-NEXT: ret i1 %[[call]] + %1 = alloca { i32, i32 }, align 4 + %2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0 + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 1 + %5 = load i32, i32* %4, align 4 + %6 = call i1 bitcast (i1 ({ i32, i32 }*)* @fn5 to i1 (i32, i32)*)(i32 %3, i32 %5) + ret i1 %6 +} diff --git a/test/Transforms/InstCombine/call2.ll b/test/Transforms/InstCombine/call2.ll index 1f45c7a..467eb07 100644 --- a/test/Transforms/InstCombine/call2.ll +++ b/test/Transforms/InstCombine/call2.ll @@ -8,7 +8,7 @@ entry: br label %return return: ; preds = %entry - %retval1 = load i32* %retval ; <i32> [#uses=1] + %retval1 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval1 } @@ -20,6 +20,6 @@ entry: br label %return return: ; preds = %entry - %retval1 = load i32* %retval ; <i32> [#uses=1] + %retval1 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval1 } diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index aac7a53..c577501 100644 --- a/test/Transforms/InstCombine/cast.ll +++ b/test/Transforms/InstCombine/cast.ll @@ -120,9 +120,9 @@ lpad: ; preds = %entry } define i8* @test13(i64 %A) { - %c = getelementptr [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1] + %c = getelementptr [0 x i8], [0 x i8]* bitcast ([32832 x i8]* @inbuf to [0 x i8]*), i64 0, i64 %A ; <i8*> [#uses=1] ret i8* %c -; CHECK: %c = getelementptr [32832 x i8]* @inbuf, i64 0, i64 %A +; CHECK: %c = getelementptr [32832 x i8], [32832 x i8]* @inbuf, i64 0, i64 %A ; CHECK: ret i8* %c } @@ -231,14 +231,14 @@ define i32 @test26(float %F) { define [4 x float]* @test27([9 x [4 x float]]* %A) { %c = bitcast [9 x [4 x float]]* %A to [4 x float]* ; <[4 x float]*> [#uses=1] ret [4 x float]* %c -; CHECK: %c = getelementptr inbounds [9 x [4 x float]]* %A, i64 0, i64 0 +; CHECK: %c = getelementptr inbounds [9 x [4 x float]], [9 x [4 x float]]* %A, i64 0, i64 0 ; CHECK: ret [4 x float]* %c } define float* @test28([4 x float]* %A) { %c = bitcast [4 x float]* %A to float* ; <float*> [#uses=1] ret float* %c -; CHECK: %c = getelementptr inbounds [4 x float]* %A, i64 0, i64 0 +; CHECK: %c = getelementptr inbounds [4 x float], [4 x float]* %A, i64 0, i64 0 ; CHECK: ret float* %c } @@ -359,7 +359,7 @@ define i16 @test40(i16 %a) { ; PR1263 define i32* @test41(i32* %tmp1) { %tmp64 = bitcast i32* %tmp1 to { i32 }* - %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0 + %tmp65 = getelementptr { i32 }, { i32 }* %tmp64, i32 0, i32 0 ret i32* %tmp65 ; CHECK-LABEL: @test41( ; CHECK: ret i32* %tmp1 @@ -367,7 +367,7 @@ define i32* @test41(i32* %tmp1) { define i32 addrspace(1)* @test41_addrspacecast_smaller(i32* %tmp1) { %tmp64 = addrspacecast i32* %tmp1 to { i32 } addrspace(1)* - %tmp65 = getelementptr { i32 } addrspace(1)* %tmp64, i32 0, i32 0 + %tmp65 = getelementptr { i32 }, { i32 } addrspace(1)* %tmp64, i32 0, i32 0 ret i32 addrspace(1)* %tmp65 ; CHECK-LABEL: @test41_addrspacecast_smaller( ; CHECK: addrspacecast i32* %tmp1 to i32 addrspace(1)* @@ -376,7 +376,7 @@ define i32 addrspace(1)* @test41_addrspacecast_smaller(i32* %tmp1) { define i32* @test41_addrspacecast_larger(i32 addrspace(1)* %tmp1) { %tmp64 = addrspacecast i32 addrspace(1)* %tmp1 to { i32 }* - %tmp65 = getelementptr { i32 }* %tmp64, i32 0, i32 0 + %tmp65 = getelementptr { i32 }, { i32 }* %tmp64, i32 0, i32 0 ret i32* %tmp65 ; CHECK-LABEL: @test41_addrspacecast_larger( ; CHECK: addrspacecast i32 addrspace(1)* %tmp1 to i32* @@ -728,11 +728,11 @@ define %s @test68(%s *%p, i64 %i) { ; CHECK-LABEL: @test68( %o = mul i64 %i, 12 %q = bitcast %s* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %o -; CHECK-NEXT: getelementptr %s* + %pp = getelementptr inbounds i8, i8* %q, i64 %o +; CHECK-NEXT: getelementptr %s, %s* %r = bitcast i8* %pp to %s* - %l = load %s* %r -; CHECK-NEXT: load %s* + %l = load %s, %s* %r +; CHECK-NEXT: load %s, %s* ret %s %l ; CHECK-NEXT: ret %s } @@ -740,28 +740,28 @@ define %s @test68(%s *%p, i64 %i) { ; addrspacecasts should be eliminated. define %s @test68_addrspacecast(%s* %p, i64 %i) { ; CHECK-LABEL: @test68_addrspacecast( -; CHECK-NEXT: getelementptr %s* -; CHECK-NEXT: load %s* +; CHECK-NEXT: getelementptr %s, %s* +; CHECK-NEXT: load %s, %s* ; CHECK-NEXT: ret %s %o = mul i64 %i, 12 %q = addrspacecast %s* %p to i8 addrspace(2)* - %pp = getelementptr inbounds i8 addrspace(2)* %q, i64 %o + %pp = getelementptr inbounds i8, i8 addrspace(2)* %q, i64 %o %r = addrspacecast i8 addrspace(2)* %pp to %s* - %l = load %s* %r + %l = load %s, %s* %r ret %s %l } define %s @test68_addrspacecast_2(%s* %p, i64 %i) { ; CHECK-LABEL: @test68_addrspacecast_2( -; CHECK-NEXT: getelementptr %s* %p +; CHECK-NEXT: getelementptr %s, %s* %p ; CHECK-NEXT: addrspacecast -; CHECK-NEXT: load %s addrspace(1)* +; CHECK-NEXT: load %s, %s addrspace(1)* ; CHECK-NEXT: ret %s %o = mul i64 %i, 12 %q = addrspacecast %s* %p to i8 addrspace(2)* - %pp = getelementptr inbounds i8 addrspace(2)* %q, i64 %o + %pp = getelementptr inbounds i8, i8 addrspace(2)* %q, i64 %o %r = addrspacecast i8 addrspace(2)* %pp to %s addrspace(1)* - %l = load %s addrspace(1)* %r + %l = load %s, %s addrspace(1)* %r ret %s %l } @@ -769,11 +769,11 @@ define %s @test68_as1(%s addrspace(1)* %p, i32 %i) { ; CHECK-LABEL: @test68_as1( %o = mul i32 %i, 12 %q = bitcast %s addrspace(1)* %p to i8 addrspace(1)* - %pp = getelementptr inbounds i8 addrspace(1)* %q, i32 %o -; CHECK-NEXT: getelementptr %s addrspace(1)* + %pp = getelementptr inbounds i8, i8 addrspace(1)* %q, i32 %o +; CHECK-NEXT: getelementptr %s, %s addrspace(1)* %r = bitcast i8 addrspace(1)* %pp to %s addrspace(1)* - %l = load %s addrspace(1)* %r -; CHECK-NEXT: load %s addrspace(1)* + %l = load %s, %s addrspace(1)* %r +; CHECK-NEXT: load %s, %s addrspace(1)* ret %s %l ; CHECK-NEXT: ret %s } @@ -782,11 +782,11 @@ define double @test69(double *%p, i64 %i) { ; CHECK-LABEL: @test69( %o = shl nsw i64 %i, 3 %q = bitcast double* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %o -; CHECK-NEXT: getelementptr inbounds double* + %pp = getelementptr inbounds i8, i8* %q, i64 %o +; CHECK-NEXT: getelementptr inbounds double, double* %r = bitcast i8* %pp to double* - %l = load double* %r -; CHECK-NEXT: load double* + %l = load double, double* %r +; CHECK-NEXT: load double, double* ret double %l ; CHECK-NEXT: ret double } @@ -796,11 +796,11 @@ define %s @test70(%s *%p, i64 %i) { %o = mul nsw i64 %i, 36 ; CHECK-NEXT: mul nsw i64 %i, 3 %q = bitcast %s* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %o -; CHECK-NEXT: getelementptr inbounds %s* + %pp = getelementptr inbounds i8, i8* %q, i64 %o +; CHECK-NEXT: getelementptr inbounds %s, %s* %r = bitcast i8* %pp to %s* - %l = load %s* %r -; CHECK-NEXT: load %s* + %l = load %s, %s* %r +; CHECK-NEXT: load %s, %s* ret %s %l ; CHECK-NEXT: ret %s } @@ -810,11 +810,11 @@ define double @test71(double *%p, i64 %i) { %o = shl i64 %i, 5 ; CHECK-NEXT: shl i64 %i, 2 %q = bitcast double* %p to i8* - %pp = getelementptr i8* %q, i64 %o -; CHECK-NEXT: getelementptr double* + %pp = getelementptr i8, i8* %q, i64 %o +; CHECK-NEXT: getelementptr double, double* %r = bitcast i8* %pp to double* - %l = load double* %r -; CHECK-NEXT: load double* + %l = load double, double* %r +; CHECK-NEXT: load double, double* ret double %l ; CHECK-NEXT: ret double } @@ -825,11 +825,11 @@ define double @test72(double *%p, i32 %i) { %o = sext i32 %so to i64 ; CHECK-NEXT: sext i32 %i to i64 %q = bitcast double* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %o -; CHECK-NEXT: getelementptr inbounds double* + %pp = getelementptr inbounds i8, i8* %q, i64 %o +; CHECK-NEXT: getelementptr inbounds double, double* %r = bitcast i8* %pp to double* - %l = load double* %r -; CHECK-NEXT: load double* + %l = load double, double* %r +; CHECK-NEXT: load double, double* ret double %l ; CHECK-NEXT: ret double } @@ -840,11 +840,11 @@ define double @test73(double *%p, i128 %i) { %o = trunc i128 %lo to i64 ; CHECK-NEXT: trunc i128 %i to i64 %q = bitcast double* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %o -; CHECK-NEXT: getelementptr double* + %pp = getelementptr inbounds i8, i8* %q, i64 %o +; CHECK-NEXT: getelementptr double, double* %r = bitcast i8* %pp to double* - %l = load double* %r -; CHECK-NEXT: load double* + %l = load double, double* %r +; CHECK-NEXT: load double, double* ret double %l ; CHECK-NEXT: ret double } @@ -852,11 +852,11 @@ define double @test73(double *%p, i128 %i) { define double @test74(double *%p, i64 %i) { ; CHECK-LABEL: @test74( %q = bitcast double* %p to i64* - %pp = getelementptr inbounds i64* %q, i64 %i -; CHECK-NEXT: getelementptr inbounds double* + %pp = getelementptr inbounds i64, i64* %q, i64 %i +; CHECK-NEXT: getelementptr inbounds double, double* %r = bitcast i64* %pp to double* - %l = load double* %r -; CHECK-NEXT: load double* + %l = load double, double* %r +; CHECK-NEXT: load double, double* ret double %l ; CHECK-NEXT: ret double } @@ -868,7 +868,7 @@ define i32* @test75(i32* %p, i32 %x) { %z = sext i32 %y to i64 ; CHECK-NEXT: sext i32 %y to i64 %q = bitcast i32* %p to i8* - %r = getelementptr i8* %q, i64 %z + %r = getelementptr i8, i8* %q, i64 %z %s = bitcast i8* %r to i32* ret i32* %s } @@ -879,11 +879,11 @@ define %s @test76(%s *%p, i64 %i, i64 %j) { %o2 = mul nsw i64 %o, %j ; CHECK-NEXT: %o2 = mul i64 %i, %j %q = bitcast %s* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %o2 -; CHECK-NEXT: getelementptr %s* %p, i64 %o2 + %pp = getelementptr inbounds i8, i8* %q, i64 %o2 +; CHECK-NEXT: getelementptr %s, %s* %p, i64 %o2 %r = bitcast i8* %pp to %s* - %l = load %s* %r -; CHECK-NEXT: load %s* + %l = load %s, %s* %r +; CHECK-NEXT: load %s, %s* ret %s %l ; CHECK-NEXT: ret %s } @@ -895,11 +895,11 @@ define %s @test77(%s *%p, i64 %i, i64 %j) { ; CHECK-NEXT: %o = mul nsw i64 %i, 3 ; CHECK-NEXT: %o2 = mul nsw i64 %o, %j %q = bitcast %s* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %o2 -; CHECK-NEXT: getelementptr inbounds %s* %p, i64 %o2 + %pp = getelementptr inbounds i8, i8* %q, i64 %o2 +; CHECK-NEXT: getelementptr inbounds %s, %s* %p, i64 %o2 %r = bitcast i8* %pp to %s* - %l = load %s* %r -; CHECK-NEXT: load %s* + %l = load %s, %s* %r +; CHECK-NEXT: load %s, %s* ret %s %l ; CHECK-NEXT: ret %s } @@ -923,11 +923,11 @@ define %s @test78(%s *%p, i64 %i, i64 %j, i32 %k, i32 %l, i128 %m, i128 %n) { %h = mul nsw i64 %g, %j ; CHECK-NEXT: mul i64 %g, %j %q = bitcast %s* %p to i8* - %pp = getelementptr inbounds i8* %q, i64 %h -; CHECK-NEXT: getelementptr %s* %p, i64 %h + %pp = getelementptr inbounds i8, i8* %q, i64 %h +; CHECK-NEXT: getelementptr %s, %s* %p, i64 %h %r = bitcast i8* %pp to %s* - %load = load %s* %r -; CHECK-NEXT: load %s* + %load = load %s, %s* %r +; CHECK-NEXT: load %s, %s* ret %s %load ; CHECK-NEXT: ret %s } @@ -940,9 +940,9 @@ define %s @test79(%s *%p, i64 %i, i32 %j) { %c = mul i32 %b, %j %q = bitcast %s* %p to i8* ; CHECK: bitcast - %pp = getelementptr inbounds i8* %q, i32 %c + %pp = getelementptr inbounds i8, i8* %q, i32 %c %r = bitcast i8* %pp to %s* - %l = load %s* %r + %l = load %s, %s* %r ret %s %l } @@ -951,39 +951,39 @@ define double @test80([100 x double]* %p, i32 %i) { %tmp = shl nsw i32 %i, 3 ; CHECK-NEXT: sext i32 %i to i64 %q = bitcast [100 x double]* %p to i8* - %pp = getelementptr i8* %q, i32 %tmp -; CHECK-NEXT: getelementptr [100 x double]* + %pp = getelementptr i8, i8* %q, i32 %tmp +; CHECK-NEXT: getelementptr [100 x double], [100 x double]* %r = bitcast i8* %pp to double* - %l = load double* %r -; CHECK-NEXT: load double* + %l = load double, double* %r +; CHECK-NEXT: load double, double* ret double %l ; CHECK-NEXT: ret double } define double @test80_addrspacecast([100 x double] addrspace(1)* %p, i32 %i) { ; CHECK-LABEL: @test80_addrspacecast( -; CHECK-NEXT: getelementptr [100 x double] addrspace(1)* %p -; CHECK-NEXT: load double addrspace(1)* +; CHECK-NEXT: getelementptr [100 x double], [100 x double] addrspace(1)* %p +; CHECK-NEXT: load double, double addrspace(1)* ; CHECK-NEXT: ret double %tmp = shl nsw i32 %i, 3 %q = addrspacecast [100 x double] addrspace(1)* %p to i8 addrspace(2)* - %pp = getelementptr i8 addrspace(2)* %q, i32 %tmp + %pp = getelementptr i8, i8 addrspace(2)* %q, i32 %tmp %r = addrspacecast i8 addrspace(2)* %pp to double addrspace(1)* - %l = load double addrspace(1)* %r + %l = load double, double addrspace(1)* %r ret double %l } define double @test80_addrspacecast_2([100 x double] addrspace(1)* %p, i32 %i) { ; CHECK-LABEL: @test80_addrspacecast_2( -; CHECK-NEXT: getelementptr [100 x double] addrspace(1)* +; CHECK-NEXT: getelementptr [100 x double], [100 x double] addrspace(1)* ; CHECK-NEXT: addrspacecast double addrspace(1)* -; CHECK-NEXT: load double addrspace(3)* +; CHECK-NEXT: load double, double addrspace(3)* ; CHECK-NEXT: ret double %tmp = shl nsw i32 %i, 3 %q = addrspacecast [100 x double] addrspace(1)* %p to i8 addrspace(2)* - %pp = getelementptr i8 addrspace(2)* %q, i32 %tmp + %pp = getelementptr i8, i8 addrspace(2)* %q, i32 %tmp %r = addrspacecast i8 addrspace(2)* %pp to double addrspace(3)* - %l = load double addrspace(3)* %r + %l = load double, double addrspace(3)* %r ret double %l } @@ -992,11 +992,11 @@ define double @test80_as1([100 x double] addrspace(1)* %p, i16 %i) { %tmp = shl nsw i16 %i, 3 ; CHECK-NEXT: sext i16 %i to i32 %q = bitcast [100 x double] addrspace(1)* %p to i8 addrspace(1)* - %pp = getelementptr i8 addrspace(1)* %q, i16 %tmp -; CHECK-NEXT: getelementptr [100 x double] addrspace(1)* + %pp = getelementptr i8, i8 addrspace(1)* %q, i16 %tmp +; CHECK-NEXT: getelementptr [100 x double], [100 x double] addrspace(1)* %r = bitcast i8 addrspace(1)* %pp to double addrspace(1)* - %l = load double addrspace(1)* %r -; CHECK-NEXT: load double addrspace(1)* + %l = load double, double addrspace(1)* %r +; CHECK-NEXT: load double, double addrspace(1)* ret double %l ; CHECK-NEXT: ret double } @@ -1004,9 +1004,9 @@ define double @test80_as1([100 x double] addrspace(1)* %p, i16 %i) { define double @test81(double *%p, float %f) { %i = fptosi float %f to i64 %q = bitcast double* %p to i8* - %pp = getelementptr i8* %q, i64 %i + %pp = getelementptr i8, i8* %q, i64 %i %r = bitcast i8* %pp to double* - %l = load double* %r + %l = load double, double* %r ret double %l } diff --git a/test/Transforms/InstCombine/cast_ptr.ll b/test/Transforms/InstCombine/cast_ptr.ll index cc7a2bf..eaf946e 100644 --- a/test/Transforms/InstCombine/cast_ptr.ll +++ b/test/Transforms/InstCombine/cast_ptr.ll @@ -107,7 +107,7 @@ define i1 @test4_as2(i16 %A) { declare %op* @foo(%op* %X) define %unop* @test5(%op* %O) { - %tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1] + %tmp = load %unop* (%op*)*, %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1] %tmp.2 = call %unop* %tmp( %op* %O ) ; <%unop*> [#uses=1] ret %unop* %tmp.2 ; CHECK-LABEL: @test5( @@ -122,8 +122,8 @@ define %unop* @test5(%op* %O) { define i8 @test6(i8 addrspace(1)* %source) { entry: %arrayidx223 = addrspacecast i8 addrspace(1)* %source to i8* - %tmp4 = load i8* %arrayidx223 + %tmp4 = load i8, i8* %arrayidx223 ret i8 %tmp4 ; CHECK-LABEL: @test6( -; CHECK: load i8* %arrayidx223 +; CHECK: load i8, i8* %arrayidx223 } diff --git a/test/Transforms/InstCombine/constant-expr-datalayout.ll b/test/Transforms/InstCombine/constant-expr-datalayout.ll index 9a72c77..cdecfc9 100644 --- a/test/Transforms/InstCombine/constant-expr-datalayout.ll +++ b/test/Transforms/InstCombine/constant-expr-datalayout.ll @@ -6,7 +6,7 @@ target triple = "x86_64-unknown-linux-gnu" %test1.struct = type { i32, i32 } @test1.aligned_glbl = global %test1.struct zeroinitializer, align 4 define void @test1(i64 *%ptr) { - store i64 and (i64 ptrtoint (i32* getelementptr (%test1.struct* @test1.aligned_glbl, i32 0, i32 1) to i64), i64 3), i64* %ptr + store i64 and (i64 ptrtoint (i32* getelementptr (%test1.struct, %test1.struct* @test1.aligned_glbl, i32 0, i32 1) to i64), i64 3), i64* %ptr ; CHECK: store i64 0, i64* %ptr ret void } diff --git a/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll b/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll index bb61f02..0ab76be 100644 --- a/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll +++ b/test/Transforms/InstCombine/constant-fold-address-space-pointer.ll @@ -149,22 +149,22 @@ define i1 @constant_fold_inttoptr() { define float @constant_fold_bitcast_ftoi_load() { ; CHECK-LABEL: @constant_fold_bitcast_ftoi_load( -; CHECK: load float addrspace(3)* bitcast (i32 addrspace(3)* @g to float addrspace(3)*), align 4 - %a = load float addrspace(3)* bitcast (i32 addrspace(3)* @g to float addrspace(3)*), align 4 +; CHECK: load float, float addrspace(3)* bitcast (i32 addrspace(3)* @g to float addrspace(3)*), align 4 + %a = load float, float addrspace(3)* bitcast (i32 addrspace(3)* @g to float addrspace(3)*), align 4 ret float %a } define i32 @constant_fold_bitcast_itof_load() { ; CHECK-LABEL: @constant_fold_bitcast_itof_load( -; CHECK: load i32 addrspace(3)* bitcast (float addrspace(3)* @g_float_as3 to i32 addrspace(3)*), align 4 - %a = load i32 addrspace(3)* bitcast (float addrspace(3)* @g_float_as3 to i32 addrspace(3)*), align 4 +; CHECK: load i32, i32 addrspace(3)* bitcast (float addrspace(3)* @g_float_as3 to i32 addrspace(3)*), align 4 + %a = load i32, i32 addrspace(3)* bitcast (float addrspace(3)* @g_float_as3 to i32 addrspace(3)*), align 4 ret i32 %a } define <4 x float> @constant_fold_bitcast_vector_as() { ; CHECK-LABEL: @constant_fold_bitcast_vector_as( -; CHECK: load <4 x float> addrspace(3)* @g_v4f_as3, align 16 - %a = load <4 x float> addrspace(3)* bitcast (<4 x i32> addrspace(3)* bitcast (<4 x float> addrspace(3)* @g_v4f_as3 to <4 x i32> addrspace(3)*) to <4 x float> addrspace(3)*), align 4 +; CHECK: load <4 x float>, <4 x float> addrspace(3)* @g_v4f_as3, align 16 + %a = load <4 x float>, <4 x float> addrspace(3)* bitcast (<4 x i32> addrspace(3)* bitcast (<4 x float> addrspace(3)* @g_v4f_as3 to <4 x i32> addrspace(3)*) to <4 x float> addrspace(3)*), align 4 ret <4 x float> %a } @@ -172,9 +172,9 @@ define <4 x float> @constant_fold_bitcast_vector_as() { define i32 @test_cast_gep_small_indices_as() { ; CHECK-LABEL: @test_cast_gep_small_indices_as( -; CHECK: load i32 addrspace(3)* getelementptr inbounds ([10 x i32] addrspace(3)* @i32_array_as3, i16 0, i16 0), align 16 - %p = getelementptr [10 x i32] addrspace(3)* @i32_array_as3, i7 0, i7 0 - %x = load i32 addrspace(3)* %p, align 4 +; CHECK: load i32, i32 addrspace(3)* getelementptr inbounds ([10 x i32], [10 x i32] addrspace(3)* @i32_array_as3, i16 0, i16 0), align 16 + %p = getelementptr [10 x i32], [10 x i32] addrspace(3)* @i32_array_as3, i7 0, i7 0 + %x = load i32, i32 addrspace(3)* %p, align 4 ret i32 %x } @@ -184,22 +184,22 @@ define i32 @test_cast_gep_small_indices_as() { float 0.0, float 0.0, [4 x i32] zeroinitializer, - i32 addrspace(3)* getelementptr ([10 x i32] addrspace(3)* @i32_array_as3, i64 0, i64 0) + i32 addrspace(3)* getelementptr ([10 x i32], [10 x i32] addrspace(3)* @i32_array_as3, i64 0, i64 0) } define i32 @test_cast_gep_large_indices_as() { ; CHECK-LABEL: @test_cast_gep_large_indices_as( -; CHECK: load i32 addrspace(3)* getelementptr inbounds ([10 x i32] addrspace(3)* @i32_array_as3, i16 0, i16 0), align 16 - %p = getelementptr [10 x i32] addrspace(3)* @i32_array_as3, i64 0, i64 0 - %x = load i32 addrspace(3)* %p, align 4 +; CHECK: load i32, i32 addrspace(3)* getelementptr inbounds ([10 x i32], [10 x i32] addrspace(3)* @i32_array_as3, i16 0, i16 0), align 16 + %p = getelementptr [10 x i32], [10 x i32] addrspace(3)* @i32_array_as3, i64 0, i64 0 + %x = load i32, i32 addrspace(3)* %p, align 4 ret i32 %x } define i32 @test_constant_cast_gep_struct_indices_as() { ; CHECK-LABEL: @test_constant_cast_gep_struct_indices_as( -; CHECK: load i32 addrspace(3)* getelementptr inbounds (%struct.foo addrspace(3)* @constant_fold_global_ptr, i16 0, i32 2, i16 2), align 8 - %x = getelementptr %struct.foo addrspace(3)* @constant_fold_global_ptr, i18 0, i32 2, i12 2 - %y = load i32 addrspace(3)* %x, align 4 +; CHECK: load i32, i32 addrspace(3)* getelementptr inbounds (%struct.foo, %struct.foo addrspace(3)* @constant_fold_global_ptr, i16 0, i32 2, i16 2), align 8 + %x = getelementptr %struct.foo, %struct.foo addrspace(3)* @constant_fold_global_ptr, i18 0, i32 2, i12 2 + %y = load i32, i32 addrspace(3)* %x, align 4 ret i32 %y } @@ -208,8 +208,8 @@ define i32 @test_constant_cast_gep_struct_indices_as() { define i32 @test_read_data_from_global_as3() { ; CHECK-LABEL: @test_read_data_from_global_as3( ; CHECK-NEXT: ret i32 2 - %x = getelementptr [5 x i32] addrspace(3)* @constant_data_as3, i32 0, i32 1 - %y = load i32 addrspace(3)* %x, align 4 + %x = getelementptr [5 x i32], [5 x i32] addrspace(3)* @constant_data_as3, i32 0, i32 1 + %y = load i32, i32 addrspace(3)* %x, align 4 ret i32 %y } @@ -219,14 +219,14 @@ define i32 @test_read_data_from_global_as3() { @d = addrspace(1) constant i32 99 @ptr_array = addrspace(2) constant [4 x i32 addrspace(1)*] [ i32 addrspace(1)* @a, i32 addrspace(1)* @b, i32 addrspace(1)* @c, i32 addrspace(1)* @d] -@indirect = addrspace(0) constant i32 addrspace(1)* addrspace(2)* getelementptr inbounds ([4 x i32 addrspace(1)*] addrspace(2)* @ptr_array, i1 0, i32 2) +@indirect = addrspace(0) constant i32 addrspace(1)* addrspace(2)* getelementptr inbounds ([4 x i32 addrspace(1)*], [4 x i32 addrspace(1)*] addrspace(2)* @ptr_array, i1 0, i32 2) define i32 @constant_through_array_as_ptrs() { ; CHECK-LABEL: @constant_through_array_as_ptrs( ; CHECK-NEXT: ret i32 34 - %p = load i32 addrspace(1)* addrspace(2)* addrspace(0)* @indirect, align 4 - %a = load i32 addrspace(1)* addrspace(2)* %p, align 4 - %b = load i32 addrspace(1)* %a, align 4 + %p = load i32 addrspace(1)* addrspace(2)*, i32 addrspace(1)* addrspace(2)* addrspace(0)* @indirect, align 4 + %a = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(2)* %p, align 4 + %b = load i32, i32 addrspace(1)* %a, align 4 ret i32 %b } @@ -234,8 +234,8 @@ define i32 @constant_through_array_as_ptrs() { define float @canonicalize_addrspacecast(i32 %i) { ; CHECK-LABEL: @canonicalize_addrspacecast -; CHECK-NEXT: getelementptr inbounds float* addrspacecast (float addrspace(3)* bitcast ([0 x i8] addrspace(3)* @shared_mem to float addrspace(3)*) to float*), i32 %i - %p = getelementptr inbounds float* addrspacecast ([0 x i8] addrspace(3)* @shared_mem to float*), i32 %i - %v = load float* %p +; CHECK-NEXT: getelementptr inbounds float, float* addrspacecast (float addrspace(3)* bitcast ([0 x i8] addrspace(3)* @shared_mem to float addrspace(3)*) to float*), i32 %i + %p = getelementptr inbounds float, float* addrspacecast ([0 x i8] addrspace(3)* @shared_mem to float*), i32 %i + %v = load float, float* %p ret float %v } diff --git a/test/Transforms/InstCombine/constant-fold-alias.ll b/test/Transforms/InstCombine/constant-fold-alias.ll index 13da0f4..c872f57 100644 --- a/test/Transforms/InstCombine/constant-fold-alias.ll +++ b/test/Transforms/InstCombine/constant-fold-alias.ll @@ -6,8 +6,8 @@ target datalayout = "e-p1:16:16-p2:32:32-p3:64:64" @G2 = global i32 42 @G3 = global [4 x i8] zeroinitializer, align 1 -@A1 = alias bitcast (i8* getelementptr inbounds ([4 x i8]* @G3, i32 0, i32 2) to i32*) -@A2 = alias inttoptr (i64 and (i64 ptrtoint (i8* getelementptr inbounds ([4 x i8]* @G3, i32 0, i32 3) to i64), i64 -4) to i32*) +@A1 = alias bitcast (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @G3, i32 0, i32 2) to i32*) +@A2 = alias inttoptr (i64 and (i64 ptrtoint (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @G3, i32 0, i32 3) to i64), i64 -4) to i32*) define i64 @f1() { ; This cannot be constant folded because G1 is underaligned. diff --git a/test/Transforms/InstCombine/constant-fold-gep.ll b/test/Transforms/InstCombine/constant-fold-gep.ll index 5fb5602..7709052 100644 --- a/test/Transforms/InstCombine/constant-fold-gep.ll +++ b/test/Transforms/InstCombine/constant-fold-gep.ll @@ -9,48 +9,48 @@ target datalayout = "E-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32- @Y = internal global [3 x %struct.X] zeroinitializer define void @frob() { -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0), align 16 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 1), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 1), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 2), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 2), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 3), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 1), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 4), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 2), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 5), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 0), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 6), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 7), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 2), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 8), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 0), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 9), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 10), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 2), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 11), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 0), align 16 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 12), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 1), align 4 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 13), align 4 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 14), align 8 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 0), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 15), align 8 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 1), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 16), align 8 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 17), align 8 -; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X]* @Y, i64 1, i64 0, i32 0, i64 0), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 18), align 8 -; CHECK: store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 2, i64 0, i32 0, i64 0), align 16 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 36), align 8 -; CHECK: store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 1, i64 0, i32 0, i64 1), align 8 - store i32 1, i32* getelementptr ([3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 19), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0), align 16 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 0), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 1), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 2), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 0), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 3), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 4), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 1, i64 2), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 5), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 6), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 7), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 0, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 8), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 0), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 9), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 10), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 1, i32 1, i64 2), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 11), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 0), align 16 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 12), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 1), align 4 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 13), align 4 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 0, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 14), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 15), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 1), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 16), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 2, i32 1, i64 2), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 17), align 8 +; CHECK: store i32 1, i32* getelementptr inbounds ([3 x %struct.X], [3 x %struct.X]* @Y, i64 1, i64 0, i32 0, i64 0), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 18), align 8 +; CHECK: store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 2, i64 0, i32 0, i64 0), align 16 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 36), align 8 +; CHECK: store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 1, i64 0, i32 0, i64 1), align 8 + store i32 1, i32* getelementptr ([3 x %struct.X], [3 x %struct.X]* @Y, i64 0, i64 0, i32 0, i64 19), align 8 ret void } @@ -61,12 +61,12 @@ define void @frob() { define i64 @test2() { entry: - %A = bitcast i8* getelementptr inbounds ([1000 x i8]* @X, i64 1, i64 0) to i8* - %B = bitcast i8* getelementptr inbounds ([1000 x i8]* @X, i64 0, i64 0) to i8* + %A = bitcast i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @X, i64 1, i64 0) to i8* + %B = bitcast i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @X, i64 0, i64 0) to i8* %B2 = ptrtoint i8* %B to i64 %C = sub i64 0, %B2 - %D = getelementptr i8* %A, i64 %C + %D = getelementptr i8, i8* %A, i64 %C %E = ptrtoint i8* %D to i64 ret i64 %E @@ -80,12 +80,12 @@ define i16 @test2_as1() { ; CHECK: ret i16 1000 entry: - %A = bitcast i8 addrspace(1)* getelementptr inbounds ([1000 x i8] addrspace(1)* @X_as1, i64 1, i64 0) to i8 addrspace(1)* - %B = bitcast i8 addrspace(1)* getelementptr inbounds ([1000 x i8] addrspace(1)* @X_as1, i64 0, i64 0) to i8 addrspace(1)* + %A = bitcast i8 addrspace(1)* getelementptr inbounds ([1000 x i8], [1000 x i8] addrspace(1)* @X_as1, i64 1, i64 0) to i8 addrspace(1)* + %B = bitcast i8 addrspace(1)* getelementptr inbounds ([1000 x i8], [1000 x i8] addrspace(1)* @X_as1, i64 0, i64 0) to i8 addrspace(1)* %B2 = ptrtoint i8 addrspace(1)* %B to i16 %C = sub i16 0, %B2 - %D = getelementptr i8 addrspace(1)* %A, i16 %C + %D = getelementptr i8, i8 addrspace(1)* %A, i16 %C %E = ptrtoint i8 addrspace(1)* %D to i16 ret i16 %E diff --git a/test/Transforms/InstCombine/constant-fold-hang.ll b/test/Transforms/InstCombine/constant-fold-hang.ll new file mode 100644 index 0000000..2ca6b86 --- /dev/null +++ b/test/Transforms/InstCombine/constant-fold-hang.ll @@ -0,0 +1,14 @@ +; RUN: opt -instcombine < %s + +; Function Attrs: nounwind readnone ssp +define void @mulByZero(<4 x i16> %x) #0 { +entry: + %a = tail call <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16> %x, <4 x i16> zeroinitializer) #2 + ret void +} + +; Function Attrs: nounwind readnone +declare <4 x i32> @llvm.arm.neon.vmulls.v4i32(<4 x i16>, <4 x i16>) #1 + +attributes #0 = { nounwind readnone ssp } +attributes #1 = { nounwind readnone } diff --git a/test/Transforms/InstCombine/crash.ll b/test/Transforms/InstCombine/crash.ll index 2ef6ac6..2d93ecd 100644 --- a/test/Transforms/InstCombine/crash.ll +++ b/test/Transforms/InstCombine/crash.ll @@ -35,12 +35,12 @@ entry: ; PR4908 define void @test2(<1 x i16>* nocapture %b, i32* nocapture %c) nounwind ssp { entry: - %arrayidx = getelementptr inbounds <1 x i16>* %b, i64 undef ; <<1 x i16>*> - %tmp2 = load <1 x i16>* %arrayidx ; <<1 x i16>> [#uses=1] + %arrayidx = getelementptr inbounds <1 x i16>, <1 x i16>* %b, i64 undef ; <<1 x i16>*> + %tmp2 = load <1 x i16>, <1 x i16>* %arrayidx ; <<1 x i16>> [#uses=1] %tmp6 = bitcast <1 x i16> %tmp2 to i16 ; <i16> [#uses=1] %tmp7 = zext i16 %tmp6 to i32 ; <i32> [#uses=1] %ins = or i32 0, %tmp7 ; <i32> [#uses=1] - %arrayidx20 = getelementptr inbounds i32* %c, i64 undef ; <i32*> [#uses=1] + %arrayidx20 = getelementptr inbounds i32, i32* %c, i64 undef ; <i32*> [#uses=1] store i32 %ins, i32* %arrayidx20 ret void } @@ -60,7 +60,7 @@ define void @foo(i1) nounwind align 2 { ; <label>:3 ; preds = %2, %1 %4 = phi i8 [ 1, %2 ], [ 0, %1 ] ; <i8> [#uses=1] %5 = icmp eq i8 %4, 0 ; <i1> [#uses=1] - %6 = load i64* @tmp2, align 8 ; <i64> [#uses=1] + %6 = load i64, i64* @tmp2, align 8 ; <i64> [#uses=1] %7 = select i1 %5, i64 0, i64 %6 ; <i64> [#uses=1] br label %8 @@ -79,9 +79,9 @@ define void @bar3(i1, i1) nounwind align 2 { br i1 %1, label %10, label %3 ; <label>:3 ; preds = %2 - %4 = getelementptr inbounds %t0* null, i64 0, i32 1 ; <i32*> [#uses=0] - %5 = getelementptr inbounds %t1* null, i64 0, i32 4 ; <i32**> [#uses=1] - %6 = load i32** %5, align 8 ; <i32*> [#uses=1] + %4 = getelementptr inbounds %t0, %t0* null, i64 0, i32 1 ; <i32*> [#uses=0] + %5 = getelementptr inbounds %t1, %t1* null, i64 0, i32 4 ; <i32**> [#uses=1] + %6 = load i32*, i32** %5, align 8 ; <i32*> [#uses=1] %7 = icmp ne i32* %6, null ; <i1> [#uses=1] %8 = zext i1 %7 to i32 ; <i32> [#uses=1] %9 = add i32 %8, 0 ; <i32> [#uses=1] @@ -115,7 +115,7 @@ BB1: BB2: %v5_ = phi i1 [ true, %BB0], [false, %BB1] - %v6 = load i64* %P + %v6 = load i64, i64* %P br label %l8 l8: @@ -149,7 +149,7 @@ exit: define arm_aapcs_vfpcc i32 @test6(i32 %argc, i8** %argv) nounwind { entry: - store i32* getelementptr (i32* bitcast (i32 (i32, i8**)* @test6 to i32*), i32 -2048), i32** @test6g, align 4 + store i32* getelementptr (i32, i32* bitcast (i32 (i32, i8**)* @test6 to i32*), i32 -2048), i32** @test6g, align 4 unreachable } @@ -182,8 +182,8 @@ cont: ; preds = %ehcleanup resume { i8*, i32 } %exc1 cond.false: ; preds = %entry - %tmp4 = getelementptr inbounds %class.RuleBasedBreakIterator* %this, i32 0, i32 0 ; <i64 ()**> [#uses=1] - %tmp5 = load i64 ()** %tmp4 ; <i64 ()*> [#uses=1] + %tmp4 = getelementptr inbounds %class.RuleBasedBreakIterator, %class.RuleBasedBreakIterator* %this, i32 0, i32 0 ; <i64 ()**> [#uses=1] + %tmp5 = load i64 ()*, i64 ()** %tmp4 ; <i64 ()*> [#uses=1] %call = invoke i64 %tmp5() to label %cond.end unwind label %ehcleanup ; <i64> [#uses=1] @@ -242,10 +242,10 @@ entry: ; PR6503 define void @test12(i32* %A) nounwind { entry: - %tmp1 = load i32* %A + %tmp1 = load i32, i32* %A %cmp = icmp ugt i32 1, %tmp1 ; <i1> [#uses=1] %conv = zext i1 %cmp to i32 ; <i32> [#uses=1] - %tmp2 = load i32* %A + %tmp2 = load i32, i32* %A %cmp3 = icmp ne i32 %tmp2, 0 ; <i1> [#uses=1] %conv4 = zext i1 %cmp3 to i32 ; <i32> [#uses=1] %or = or i32 %conv, %conv4 ; <i32> [#uses=1] @@ -258,10 +258,10 @@ entry: %s2 = type { i64 } define void @test13() nounwind ssp { entry: - %0 = getelementptr inbounds %s1* null, i64 0, i32 2, i64 0, i32 0 + %0 = getelementptr inbounds %s1, %s1* null, i64 0, i32 2, i64 0, i32 0 %1 = bitcast i64* %0 to i32* - %2 = getelementptr inbounds %s1* null, i64 0, i32 2, i64 1, i32 0 - %.pre = load i32* %1, align 8 + %2 = getelementptr inbounds %s1, %s1* null, i64 0, i32 2, i64 1, i32 0 + %.pre = load i32, i32* %1, align 8 %3 = lshr i32 %.pre, 19 %brmerge = or i1 undef, undef %4 = and i32 %3, 3 @@ -269,7 +269,7 @@ entry: %6 = shl i32 %5, 19 %7 = add i32 %6, 1572864 %8 = and i32 %7, 1572864 - %9 = load i64* %2, align 8 + %9 = load i64, i64* %2, align 8 %trunc156 = trunc i64 %9 to i32 %10 = and i32 %trunc156, -1537 %11 = and i32 %10, -6145 @@ -304,7 +304,7 @@ entry: define void @test15(i32* %p_92) nounwind { entry: -%0 = load i32* %p_92, align 4 +%0 = load i32, i32* %p_92, align 4 %1 = icmp ne i32 %0, 0 %2 = zext i1 %1 to i32 %3 = call i32 @func_14() nounwind @@ -349,7 +349,7 @@ define double @test16(i32 %a) nounwind { define %struct.basic_ios *@test17() ssp { entry: - %add.ptr.i = getelementptr i8* null, i64 undef + %add.ptr.i = getelementptr i8, i8* null, i64 undef %0 = bitcast i8* %add.ptr.i to %struct.basic_ios* ret %struct.basic_ios* %0 } diff --git a/test/Transforms/InstCombine/debug-line.ll b/test/Transforms/InstCombine/debug-line.ll index 1946576..a36487a 100644 --- a/test/Transforms/InstCombine/debug-line.ll +++ b/test/Transforms/InstCombine/debug-line.ll @@ -5,7 +5,7 @@ define void @foo() nounwind ssp { ;CHECK: call i32 @putchar{{.+}} !dbg - %1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i32 97), !dbg !5 + %1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i32 97), !dbg !5 ret void, !dbg !7 } @@ -15,14 +15,14 @@ declare i32 @printf(i8*, ...) !llvm.module.flags = !{!10} !llvm.dbg.sp = !{!0} -!0 = !{!"0x2e\00foo\00foo\00\004\000\001\000\006\000\000\000", !8, !1, !3, null, void ()* @foo, null, null, null} ; [ DW_TAG_subprogram ] -!1 = !{!"0x29", !8} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00clang\001\00\000\00\000", !8, !4, !4, !9, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !8, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !1, type: !3, function: void ()* @foo) +!1 = !MDFile(filename: "m.c", directory: "/private/tmp") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: 0, file: !8, enums: !4, retainedTypes: !4, subprograms: !9) +!3 = !MDSubroutineType(types: !4) !4 = !{null} !5 = !MDLocation(line: 5, column: 2, scope: !6) -!6 = !{!"0xb\004\0012\000", !8, !0} ; [ DW_TAG_lexical_block ] +!6 = distinct !MDLexicalBlock(line: 4, column: 12, file: !8, scope: !0) !7 = !MDLocation(line: 6, column: 1, scope: !6) -!8 = !{!"m.c", !"/private/tmp"} +!8 = !MDFile(filename: "m.c", directory: "/private/tmp") !9 = !{!0} -!10 = !{i32 1, !"Debug Info Version", i32 2} +!10 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/InstCombine/debuginfo.ll b/test/Transforms/InstCombine/debuginfo.ll index ae72f70..ee02c89 100644 --- a/test/Transforms/InstCombine/debuginfo.ll +++ b/test/Transforms/InstCombine/debuginfo.ll @@ -14,15 +14,15 @@ entry: store i8* %__dest, i8** %__dest.addr, align 8 ; CHECK-NOT: call void @llvm.dbg.declare ; CHECK: call void @llvm.dbg.value - call void @llvm.dbg.declare(metadata i8** %__dest.addr, metadata !0, metadata !{}), !dbg !16 + call void @llvm.dbg.declare(metadata i8** %__dest.addr, metadata !0, metadata !MDExpression()), !dbg !16 store i32 %__val, i32* %__val.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %__val.addr, metadata !7, metadata !{}), !dbg !18 + call void @llvm.dbg.declare(metadata i32* %__val.addr, metadata !7, metadata !MDExpression()), !dbg !18 store i64 %__len, i64* %__len.addr, align 8 - call void @llvm.dbg.declare(metadata i64* %__len.addr, metadata !9, metadata !{}), !dbg !20 - %tmp = load i8** %__dest.addr, align 8, !dbg !21 - %tmp1 = load i32* %__val.addr, align 4, !dbg !21 - %tmp2 = load i64* %__len.addr, align 8, !dbg !21 - %tmp3 = load i8** %__dest.addr, align 8, !dbg !21 + call void @llvm.dbg.declare(metadata i64* %__len.addr, metadata !9, metadata !MDExpression()), !dbg !20 + %tmp = load i8*, i8** %__dest.addr, align 8, !dbg !21 + %tmp1 = load i32, i32* %__val.addr, align 4, !dbg !21 + %tmp2 = load i64, i64* %__len.addr, align 8, !dbg !21 + %tmp3 = load i8*, i8** %__dest.addr, align 8, !dbg !21 %0 = call i64 @llvm.objectsize.i64.p0i8(i8* %tmp3, i1 false), !dbg !21 %call = call i8* @foo(i8* %tmp, i32 %tmp1, i64 %tmp2, i64 %0), !dbg !21 ret i8* %call, !dbg !21 @@ -31,29 +31,29 @@ entry: !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!30} -!0 = !{!"0x101\00__dest\0016777294\000", !1, !2, !6} ; [ DW_TAG_arg_variable ] -!1 = !{!"0x2e\00foobar\00foobar\00\0079\001\001\000\006\00256\001\0079", !27, !2, !4, null, i8* (i8*, i32, i64)* @foobar, null, null, !25} ; [ DW_TAG_subprogram ] [line 79] [local] [def] [foobar] -!2 = !{!"0x29", !27} ; [ DW_TAG_file_type ] -!3 = !{!"0x11\0012\00clang version 3.0 (trunk 127710)\001\00\000\00\000", !28, !29, !29, !24, null, null} ; [ DW_TAG_compile_unit ] -!4 = !{!"0x15\00\000\000\000\000\000\000", !27, !2, null, !5, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "__dest", line: 78, arg: 1, scope: !1, file: !2, type: !6) +!1 = !MDSubprogram(name: "foobar", line: 79, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 79, file: !27, scope: !2, type: !4, function: i8* (i8*, i32, i64)* @foobar, variables: !25) +!2 = !MDFile(filename: "string.h", directory: "Game") +!3 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 127710)", isOptimized: true, emissionKind: 0, file: !28, enums: !29, retainedTypes: !29, subprograms: !24) +!4 = !MDSubroutineType(types: !5) !5 = !{!6} -!6 = !{!"0xf\00\000\0064\0064\000\000", null, !3, null} ; [ DW_TAG_pointer_type ] -!7 = !{!"0x101\00__val\0033554510\000", !1, !2, !8} ; [ DW_TAG_arg_variable ] -!8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !3} ; [ DW_TAG_base_type ] -!9 = !{!"0x101\00__len\0050331726\000", !1, !2, !10} ; [ DW_TAG_arg_variable ] -!10 = !{!"0x16\00size_t\0080\000\000\000\000", !27, !3, !11} ; [ DW_TAG_typedef ] -!11 = !{!"0x16\00__darwin_size_t\0090\000\000\000\000", !27, !3, !12} ; [ DW_TAG_typedef ] -!12 = !{!"0x24\00long unsigned int\000\0064\0064\000\000\007", null, !3} ; [ DW_TAG_base_type ] +!6 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !3, baseType: null) +!7 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "__val", line: 78, arg: 2, scope: !1, file: !2, type: !8) +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "__len", line: 78, arg: 3, scope: !1, file: !2, type: !10) +!10 = !MDDerivedType(tag: DW_TAG_typedef, name: "size_t", line: 80, file: !27, scope: !3, baseType: !11) +!11 = !MDDerivedType(tag: DW_TAG_typedef, name: "__darwin_size_t", line: 90, file: !27, scope: !3, baseType: !12) +!12 = !MDBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) !16 = !MDLocation(line: 78, column: 28, scope: !1) !18 = !MDLocation(line: 78, column: 40, scope: !1) !20 = !MDLocation(line: 78, column: 54, scope: !1) !21 = !MDLocation(line: 80, column: 3, scope: !22) -!22 = !{!"0xb\0080\003\007", !27, !23} ; [ DW_TAG_lexical_block ] -!23 = !{!"0xb\0079\001\006", !27, !1} ; [ DW_TAG_lexical_block ] +!22 = distinct !MDLexicalBlock(line: 80, column: 3, file: !27, scope: !23) +!23 = distinct !MDLexicalBlock(line: 79, column: 1, file: !27, scope: !1) !24 = !{!1} !25 = !{!0, !7, !9} -!26 = !{!"0x29", !28} ; [ DW_TAG_file_type ] -!27 = !{!"string.h", !"Game"} -!28 = !{!"bits.c", !"Game"} +!26 = !MDFile(filename: "bits.c", directory: "Game") +!27 = !MDFile(filename: "string.h", directory: "Game") +!28 = !MDFile(filename: "bits.c", directory: "Game") !29 = !{i32 0} -!30 = !{i32 1, !"Debug Info Version", i32 2} +!30 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/InstCombine/default-alignment.ll b/test/Transforms/InstCombine/default-alignment.ll new file mode 100644 index 0000000..718da21 --- /dev/null +++ b/test/Transforms/InstCombine/default-alignment.ll @@ -0,0 +1,10 @@ +; RUN: opt -verify -instcombine < %s +%Foo = type <{ i8, x86_fp80 }> + +define i8 @t(%Foo* %arg) { +entry: + %0 = getelementptr %Foo, %Foo* %arg, i32 0, i32 0 + %1 = load i8, i8* %0, align 1 + ret i8 %1 +} + diff --git a/test/Transforms/InstCombine/descale-zero.ll b/test/Transforms/InstCombine/descale-zero.ll index 4656837..4347be4 100644 --- a/test/Transforms/InstCombine/descale-zero.ll +++ b/test/Transforms/InstCombine/descale-zero.ll @@ -5,16 +5,16 @@ target triple = "x86_64-apple-macosx10.10.0" define internal i8* @descale_zero() { entry: -; CHECK: load i8** inttoptr (i64 48 to i8**), align 16 +; CHECK: load i8*, i8** inttoptr (i64 48 to i8**), align 16 ; CHECK-NEXT: ret i8* - %i16_ptr = load i16** inttoptr (i64 48 to i16**), align 16 - %num = load i64* inttoptr (i64 64 to i64*), align 64 + %i16_ptr = load i16*, i16** inttoptr (i64 48 to i16**), align 16 + %num = load i64, i64* inttoptr (i64 64 to i64*), align 64 %num_times_2 = shl i64 %num, 1 %num_times_2_plus_4 = add i64 %num_times_2, 4 %i8_ptr = bitcast i16* %i16_ptr to i8* - %i8_ptr_num_times_2_plus_4 = getelementptr i8* %i8_ptr, i64 %num_times_2_plus_4 + %i8_ptr_num_times_2_plus_4 = getelementptr i8, i8* %i8_ptr, i64 %num_times_2_plus_4 %num_times_neg2 = mul i64 %num, -2 %num_times_neg2_minus_4 = add i64 %num_times_neg2, -4 - %addr = getelementptr i8* %i8_ptr_num_times_2_plus_4, i64 %num_times_neg2_minus_4 + %addr = getelementptr i8, i8* %i8_ptr_num_times_2_plus_4, i64 %num_times_neg2_minus_4 ret i8* %addr } diff --git a/test/Transforms/InstCombine/disable-simplify-libcalls.ll b/test/Transforms/InstCombine/disable-simplify-libcalls.ll index 6652788..e25ce31 100644 --- a/test/Transforms/InstCombine/disable-simplify-libcalls.ll +++ b/test/Transforms/InstCombine/disable-simplify-libcalls.ll @@ -87,7 +87,7 @@ define double @t5(double %x) { define i8* @t6(i8* %x) { ; CHECK-LABEL: @t6( - %empty = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %empty = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 %ret = call i8* @strcat(i8* %x, i8* %empty) ret i8* %ret ; CHECK: call i8* @strcat @@ -95,7 +95,7 @@ define i8* @t6(i8* %x) { define i8* @t7(i8* %x) { ; CHECK-LABEL: @t7( - %empty = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %empty = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 %ret = call i8* @strncat(i8* %x, i8* %empty, i32 1) ret i8* %ret ; CHECK: call i8* @strncat @@ -103,7 +103,7 @@ define i8* @t7(i8* %x) { define i8* @t8() { ; CHECK-LABEL: @t8( - %x = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 + %x = getelementptr inbounds [13 x i8], [13 x i8]* @.str1, i32 0, i32 0 %ret = call i8* @strchr(i8* %x, i32 119) ret i8* %ret ; CHECK: call i8* @strchr @@ -111,7 +111,7 @@ define i8* @t8() { define i8* @t9() { ; CHECK-LABEL: @t9( - %x = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 + %x = getelementptr inbounds [13 x i8], [13 x i8]* @.str1, i32 0, i32 0 %ret = call i8* @strrchr(i8* %x, i32 119) ret i8* %ret ; CHECK: call i8* @strrchr @@ -119,8 +119,8 @@ define i8* @t9() { define i32 @t10() { ; CHECK-LABEL: @t10( - %x = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 - %y = getelementptr inbounds [4 x i8]* @.str3, i32 0, i32 0 + %x = getelementptr inbounds [4 x i8], [4 x i8]* @.str2, i32 0, i32 0 + %y = getelementptr inbounds [4 x i8], [4 x i8]* @.str3, i32 0, i32 0 %ret = call i32 @strcmp(i8* %x, i8* %y) ret i32 %ret ; CHECK: call i32 @strcmp @@ -128,8 +128,8 @@ define i32 @t10() { define i32 @t11() { ; CHECK-LABEL: @t11( - %x = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 - %y = getelementptr inbounds [4 x i8]* @.str3, i32 0, i32 0 + %x = getelementptr inbounds [4 x i8], [4 x i8]* @.str2, i32 0, i32 0 + %y = getelementptr inbounds [4 x i8], [4 x i8]* @.str3, i32 0, i32 0 %ret = call i32 @strncmp(i8* %x, i8* %y, i64 3) ret i32 %ret ; CHECK: call i32 @strncmp @@ -137,7 +137,7 @@ define i32 @t11() { define i8* @t12(i8* %x) { ; CHECK-LABEL: @t12( - %y = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 + %y = getelementptr inbounds [4 x i8], [4 x i8]* @.str2, i32 0, i32 0 %ret = call i8* @strcpy(i8* %x, i8* %y) ret i8* %ret ; CHECK: call i8* @strcpy @@ -145,7 +145,7 @@ define i8* @t12(i8* %x) { define i8* @t13(i8* %x) { ; CHECK-LABEL: @t13( - %y = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 + %y = getelementptr inbounds [4 x i8], [4 x i8]* @.str2, i32 0, i32 0 %ret = call i8* @stpcpy(i8* %x, i8* %y) ret i8* %ret ; CHECK: call i8* @stpcpy @@ -153,7 +153,7 @@ define i8* @t13(i8* %x) { define i8* @t14(i8* %x) { ; CHECK-LABEL: @t14( - %y = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 + %y = getelementptr inbounds [4 x i8], [4 x i8]* @.str2, i32 0, i32 0 %ret = call i8* @strncpy(i8* %x, i8* %y, i64 3) ret i8* %ret ; CHECK: call i8* @strncpy @@ -161,7 +161,7 @@ define i8* @t14(i8* %x) { define i64 @t15() { ; CHECK-LABEL: @t15( - %x = getelementptr inbounds [4 x i8]* @.str2, i32 0, i32 0 + %x = getelementptr inbounds [4 x i8], [4 x i8]* @.str2, i32 0, i32 0 %ret = call i64 @strlen(i8* %x) ret i64 %ret ; CHECK: call i64 @strlen @@ -169,7 +169,7 @@ define i64 @t15() { define i8* @t16(i8* %x) { ; CHECK-LABEL: @t16( - %y = getelementptr inbounds [1 x i8]* @.str, i32 0, i32 0 + %y = getelementptr inbounds [1 x i8], [1 x i8]* @.str, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %x, i8* %y) ret i8* %ret ; CHECK: call i8* @strpbrk @@ -177,7 +177,7 @@ define i8* @t16(i8* %x) { define i64 @t17(i8* %x) { ; CHECK-LABEL: @t17( - %y = getelementptr inbounds [1 x i8]* @.str, i32 0, i32 0 + %y = getelementptr inbounds [1 x i8], [1 x i8]* @.str, i32 0, i32 0 %ret = call i64 @strspn(i8* %x, i8* %y) ret i64 %ret ; CHECK: call i64 @strspn @@ -185,7 +185,7 @@ define i64 @t17(i8* %x) { define double @t18(i8** %y) { ; CHECK-LABEL: @t18( - %x = getelementptr inbounds [6 x i8]* @.str4, i64 0, i64 0 + %x = getelementptr inbounds [6 x i8], [6 x i8]* @.str4, i64 0, i64 0 %ret = call double @strtod(i8* %x, i8** %y) ret double %ret ; CHECK: call double @strtod @@ -193,7 +193,7 @@ define double @t18(i8** %y) { define float @t19(i8** %y) { ; CHECK-LABEL: @t19( - %x = getelementptr inbounds [6 x i8]* @.str4, i64 0, i64 0 + %x = getelementptr inbounds [6 x i8], [6 x i8]* @.str4, i64 0, i64 0 %ret = call float @strtof(i8* %x, i8** %y) ret float %ret ; CHECK: call float @strtof @@ -201,7 +201,7 @@ define float @t19(i8** %y) { define x86_fp80 @t20(i8** %y) { ; CHECK-LABEL: @t20( - %x = getelementptr inbounds [6 x i8]* @.str4, i64 0, i64 0 + %x = getelementptr inbounds [6 x i8], [6 x i8]* @.str4, i64 0, i64 0 %ret = call x86_fp80 @strtold(i8* %x, i8** %y) ret x86_fp80 %ret ; CHECK: call x86_fp80 @strtold @@ -209,7 +209,7 @@ define x86_fp80 @t20(i8** %y) { define i64 @t21(i8** %y) { ; CHECK-LABEL: @t21( - %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 + %x = getelementptr inbounds [5 x i8], [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtol(i8* %x, i8** %y, i32 10) ret i64 %ret ; CHECK: call i64 @strtol @@ -217,7 +217,7 @@ define i64 @t21(i8** %y) { define i64 @t22(i8** %y) { ; CHECK-LABEL: @t22( - %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 + %x = getelementptr inbounds [5 x i8], [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtoll(i8* %x, i8** %y, i32 10) ret i64 %ret ; CHECK: call i64 @strtoll @@ -225,7 +225,7 @@ define i64 @t22(i8** %y) { define i64 @t23(i8** %y) { ; CHECK-LABEL: @t23( - %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 + %x = getelementptr inbounds [5 x i8], [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtoul(i8* %x, i8** %y, i32 10) ret i64 %ret ; CHECK: call i64 @strtoul @@ -233,7 +233,7 @@ define i64 @t23(i8** %y) { define i64 @t24(i8** %y) { ; CHECK-LABEL: @t24( - %x = getelementptr inbounds [5 x i8]* @.str5, i64 0, i64 0 + %x = getelementptr inbounds [5 x i8], [5 x i8]* @.str5, i64 0, i64 0 %ret = call i64 @strtoull(i8* %x, i8** %y, i32 10) ret i64 %ret ; CHECK: call i64 @strtoull @@ -241,7 +241,7 @@ define i64 @t24(i8** %y) { define i64 @t25(i8* %y) { ; CHECK-LABEL: @t25( - %x = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %x = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 %ret = call i64 @strcspn(i8* %x, i8* %y) ret i64 %ret ; CHECK: call i64 @strcspn @@ -277,7 +277,7 @@ define i32 @t29(i64 %y) { define void @t30() { ; CHECK-LABEL: @t30( - %x = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 + %x = getelementptr inbounds [13 x i8], [13 x i8]* @.str1, i32 0, i32 0 call i32 @fprintf(i8* null, i8* %x) ret void ; CHECK: call i32 @fprintf @@ -320,7 +320,7 @@ define i64 @t35(i64 %y) { define void @t36() { ; CHECK-LABEL: @t36( - %x = getelementptr inbounds [1 x i8]* @empty, i32 0, i32 0 + %x = getelementptr inbounds [1 x i8], [1 x i8]* @empty, i32 0, i32 0 call i32 @printf(i8* %x) ret void ; CHECK: call i32 @printf @@ -328,7 +328,7 @@ define void @t36() { define void @t37(i8* %x) { ; CHECK-LABEL: @t37( - %y = getelementptr inbounds [13 x i8]* @.str1, i32 0, i32 0 + %y = getelementptr inbounds [13 x i8], [13 x i8]* @.str1, i32 0, i32 0 call i32 @sprintf(i8* %x, i8* %y) ret void ; CHECK: call i32 @sprintf diff --git a/test/Transforms/InstCombine/div-shift-crash.ll b/test/Transforms/InstCombine/div-shift-crash.ll index a619724..936173c 100644 --- a/test/Transforms/InstCombine/div-shift-crash.ll +++ b/test/Transforms/InstCombine/div-shift-crash.ll @@ -14,7 +14,7 @@ land.lhs.true: ; preds = %entry br label %for.cond.i for.cond.i: ; preds = %land.lhs.true, %entry - %0 = getelementptr inbounds %struct.S0.0.1.2.3.4.13.22.31.44.48.53.54.55.56.58.59.60.66.68.70.74.77.106.107.108.109.110.113.117.118.128.129* %l_819.i.i, i64 0, i32 0 + %0 = getelementptr inbounds %struct.S0.0.1.2.3.4.13.22.31.44.48.53.54.55.56.58.59.60.66.68.70.74.77.106.107.108.109.110.113.117.118.128.129, %struct.S0.0.1.2.3.4.13.22.31.44.48.53.54.55.56.58.59.60.66.68.70.74.77.106.107.108.109.110.113.117.118.128.129* %l_819.i.i, i64 0, i32 0 br label %for.cond.i6.i.i for.cond.i6.i.i: ; preds = %for.body.i8.i.i, %for.cond.i @@ -39,7 +39,7 @@ for.body4.i.i.i.i: ; preds = %for.cond1.i.i.i.i br label %for.cond1.i.i.i.i func_39.exit.i.i: ; preds = %for.cond1.i.i.i.i - %l_8191.sroa.0.0.copyload.i.i = load i64* %0, align 1 + %l_8191.sroa.0.0.copyload.i.i = load i64, i64* %0, align 1 br label %for.cond1.i.i.i for.cond1.i.i.i: ; preds = %safe_div_func_uint32_t_u_u.exit.i.i.i, %func_39.exit.i.i diff --git a/test/Transforms/InstCombine/dom-conditions.ll b/test/Transforms/InstCombine/dom-conditions.ll new file mode 100644 index 0000000..4264043 --- /dev/null +++ b/test/Transforms/InstCombine/dom-conditions.ll @@ -0,0 +1,152 @@ +; RUN: opt -instcombine -value-tracking-dom-conditions=1 -S < %s | FileCheck %s + +target datalayout = "e-p:64:64:64-p1:16:16:16-p2:32:32:32-p3:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" + +define i1 @test_cmp_ult(i64 %A) { +; CHECK-LABEL: @test_cmp_ult +entry: + %cmp = icmp ult i64 %A, 64 + br i1 %cmp, label %taken, label %untaken + +taken: +; CHECK-LABEL: taken: +; CHECK-NEXT: ret i1 false + %cmp2 = icmp ugt i64 %A, 64 + ret i1 %cmp2 +untaken: + ret i1 true +} + +define i1 @test_cmp_ule(i64 %A) { +; CHECK-LABEL: @test_cmp_ule +entry: + %cmp = icmp ule i64 %A, 64 + br i1 %cmp, label %taken, label %untaken + +taken: +; CHECK-LABEL: taken: +; CHECK-NEXT: ret i1 false + %cmp2 = icmp ugt i64 %A, 128 + ret i1 %cmp2 +untaken: + ret i1 true +} + +define i1 @test_cmp_sgt(i32 %A) { +; CHECK-LABEL: @test_cmp_sgt +entry: + %cmp = icmp sgt i32 %A, 10 + br i1 %cmp, label %taken, label %untaken + +taken: +; CHECK-LABEL: taken: +; CHECK-NEXT: ret i1 true + %cmp2 = icmp sgt i32 %A, -1 + ret i1 %cmp2 +untaken: + ret i1 true +} + +define i64 @test_add_zero_bits(i64 %A) { +; CHECK-LABEL: @test_add_zero_bits +entry: + %cmp = icmp eq i64 %A, 2 + br i1 %cmp, label %taken, label %untaken + +taken: +; CHECK-LABEL: taken: +; CHECK-NEXT: ret i64 3 + %add = add i64 %A, 1 + ret i64 %add +untaken: + ret i64 %A +} + +define i64 @test_add_nsw(i64 %A) { +; CHECK-LABEL: @test_add_nsw +entry: + %cmp = icmp ult i64 %A, 20 + br i1 %cmp, label %taken, label %untaken + +taken: +; CHECK-LABEL: taken: +; CHECK-NEXT: %add = add nuw nsw i64 %A, 1 +; CHECK-NEXT: ret i64 %add + %add = add i64 %A, 1 + ret i64 %add +untaken: + ret i64 %A +} + +; After sinking the instructions into the if block, check that we +; can simplify some of them using dominating conditions. +define i32 @test_add_zero_bits_sink(i32 %x) nounwind ssp { +; CHECK-LABEL: @test_add_zero_bits_sink( +; CHECK-NOT: sdiv i32 +entry: + %a = add nsw i32 %x, 16 + %b = sdiv i32 %a, %x + %cmp = icmp ult i32 %x, 7 + br i1 %cmp, label %bb1, label %bb2 + +bb1: +; CHECK-LABEL: bb1: +; CHECK-NEXT: or i32 %x, 16 +; CHECK-NEXT: udiv i32 + ret i32 %b + +bb2: + ret i32 %x +} + +; A condition in the same block gives no information +define i32 @test_neg1(i32 %x) nounwind ssp { +; CHECK-LABEL: @test_neg1 +; CHECK: add +; CHECK: sdiv +; CHECK: icmp +; CHECK: select +entry: + %a = add nsw i32 %x, 16 + %b = sdiv i32 %a, %x + %cmp = icmp ult i32 %x, 7 + %ret = select i1 %cmp, i32 %a, i32 %b + ret i32 %ret +} + +; A non-dominating edge gives no information +define i32 @test_neg2(i32 %x) { +; CHECK-LABEL: @test_neg2 +entry: + %cmp = icmp ult i32 %x, 7 + br i1 %cmp, label %bb1, label %merge + +bb1: + br label %merge + +merge: +; CHECK-LABEL: merge: +; CHECK: icmp +; CHECK: select + %cmp2 = icmp ult i32 %x, 7 + %ret = select i1 %cmp2, i32 %x, i32 0 + ret i32 %ret +} + +; A unconditional branch expressed as a condition one gives no +; information (and shouldn't trip any asserts.) +define i32 @test_neg3(i32 %x) { +; CHECK-LABEL: @test_neg3 +entry: + %cmp = icmp ult i32 %x, 7 + br i1 %cmp, label %merge, label %merge +merge: +; CHECK-LABEL: merge: +; CHECK: icmp +; CHECK: select + %cmp2 = icmp ult i32 %x, 7 + %ret = select i1 %cmp2, i32 %x, i32 0 + ret i32 %ret +} + +declare i32 @bar() diff --git a/test/Transforms/InstCombine/enforce-known-alignment.ll b/test/Transforms/InstCombine/enforce-known-alignment.ll index 46bb605..323a7ec 100644 --- a/test/Transforms/InstCombine/enforce-known-alignment.ll +++ b/test/Transforms/InstCombine/enforce-known-alignment.ll @@ -8,12 +8,12 @@ define void @foo(i32) { ; CHECK: alloca ; CHECK: align 16 %2 = alloca [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], align 16 ; <[3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>]*> [#uses=1] - %3 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>]* %2, i32 0, i32 0 ; <<{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>*> [#uses=1] - %4 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>* %3, i32 0, i32 0 ; <{ { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }*> [#uses=1] - %5 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }* %4, i32 0, i32 0 ; <{ [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 }*> [#uses=1] + %3 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>]* %2, i32 0, i32 0 ; <<{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>*> [#uses=1] + %4 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>, <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>* %3, i32 0, i32 0 ; <{ { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }*> [#uses=1] + %5 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }, { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }* %4, i32 0, i32 0 ; <{ [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 }*> [#uses=1] %6 = bitcast { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 }* %5 to { [8 x i16] }* ; <{ [8 x i16] }*> [#uses=1] - %7 = getelementptr { [8 x i16] }* %6, i32 0, i32 0 ; <[8 x i16]*> [#uses=1] - %8 = getelementptr [8 x i16]* %7, i32 0, i32 0 ; <i16*> [#uses=1] + %7 = getelementptr { [8 x i16] }, { [8 x i16] }* %6, i32 0, i32 0 ; <[8 x i16]*> [#uses=1] + %8 = getelementptr [8 x i16], [8 x i16]* %7, i32 0, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %8, align 16 call void @bar(i16* %8) ret void @@ -24,12 +24,12 @@ declare void @bar(i16*) define void @foo_as1(i32 %a, [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>] addrspace(1)* %b) { ; CHECK-LABEL: @foo_as1( ; CHECK: align 16 - %1 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>] addrspace(1)* %b, i32 0, i32 0 ; <<{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>*> [#uses=1] - %2 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }> addrspace(1)* %1, i32 0, i32 0 ; <{ { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }*> [#uses=1] - %3 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } addrspace(1)* %2, i32 0, i32 0 ; <{ [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 }*> [#uses=1] + %1 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>] addrspace(1)* %b, i32 0, i32 0 ; <<{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>*> [#uses=1] + %2 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>, <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }> addrspace(1)* %1, i32 0, i32 0 ; <{ { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }*> [#uses=1] + %3 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }, { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } addrspace(1)* %2, i32 0, i32 0 ; <{ [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 }*> [#uses=1] %4 = bitcast { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } addrspace(1)* %3 to { [8 x i16] } addrspace(1)* ; <{ [8 x i16] }*> [#uses=1] - %5 = getelementptr { [8 x i16] } addrspace(1)* %4, i32 0, i32 0 ; <[8 x i16]*> [#uses=1] - %6 = getelementptr [8 x i16] addrspace(1)* %5, i32 0, i32 0 ; <i16*> [#uses=1] + %5 = getelementptr { [8 x i16] }, { [8 x i16] } addrspace(1)* %4, i32 0, i32 0 ; <[8 x i16]*> [#uses=1] + %6 = getelementptr [8 x i16], [8 x i16] addrspace(1)* %5, i32 0, i32 0 ; <i16*> [#uses=1] store i16 0, i16 addrspace(1)* %6, align 16 call void @bar_as1(i16 addrspace(1)* %6) ret void diff --git a/test/Transforms/InstCombine/err-rep-cold.ll b/test/Transforms/InstCombine/err-rep-cold.ll index 0cbafc4..e4399ab 100644 --- a/test/Transforms/InstCombine/err-rep-cold.ll +++ b/test/Transforms/InstCombine/err-rep-cold.ll @@ -18,11 +18,11 @@ entry: br i1 %cmp, label %if.then, label %return if.then: ; preds = %entry - %0 = load %struct._IO_FILE** @stderr, align 8 - %call = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8]* @.str, i64 0, i64 0), i32 %a) #1 + %0 = load %struct._IO_FILE*, %struct._IO_FILE** @stderr, align 8 + %call = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %a) #1 br label %return -; CHECK: %call = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8]* @.str, i64 0, i64 0), i32 %a) #[[AT1:[0-9]+]] +; CHECK: %call = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %a) #[[AT1:[0-9]+]] return: ; preds = %entry, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ] @@ -38,11 +38,11 @@ entry: br i1 %cmp, label %if.then, label %return if.then: ; preds = %entry - %0 = load %struct._IO_FILE** @stderr, align 8 - %1 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) + %0 = load %struct._IO_FILE*, %struct._IO_FILE** @stderr, align 8 + %1 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) br label %return -; CHECK: tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) #[[AT2:[0-9]+]] +; CHECK: tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) #[[AT2:[0-9]+]] return: ; preds = %entry, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ] @@ -58,11 +58,11 @@ entry: br i1 %cmp, label %if.then, label %return if.then: ; preds = %entry - %0 = load %struct._IO_FILE** @stdout, align 8 - %1 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) + %0 = load %struct._IO_FILE*, %struct._IO_FILE** @stdout, align 8 + %1 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) br label %return -; CHECK-NOT: tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) #[[AT2]] +; CHECK-NOT: tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i64 0, i64 0), i64 8, i64 1, %struct._IO_FILE* %0) #[[AT2]] return: ; preds = %entry, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ] diff --git a/test/Transforms/InstCombine/extractvalue.ll b/test/Transforms/InstCombine/extractvalue.ll index 04c7ffa..6319590 100644 --- a/test/Transforms/InstCombine/extractvalue.ll +++ b/test/Transforms/InstCombine/extractvalue.ll @@ -13,7 +13,7 @@ define i32 @foo(i32 %a, i32 %b) { %s1 = insertvalue {i32, i32} %s1.1, i32 %b, 1 %v1 = extractvalue {i32, i32} %s1, 0 %v2 = extractvalue {i32, i32} %s1, 1 - + ; Build a nested struct and pull a sub struct out of it ; This requires instcombine to insert a few insertvalue instructions %ns1.1 = insertvalue {i32, {i32, i32}} undef, i32 %v1, 0 @@ -40,8 +40,8 @@ define i32 @foo(i32 %a, i32 %b) { } ; CHECK-LABEL: define i32 @extract2gep( -; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %pair, i32 0, i32 1 -; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]] +; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}, {{.*}}* %pair, i64 0, i32 1 +; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32, i32* [[GEP]] ; CHECK-NEXT: store ; CHECK-NEXT: br label %loop ; CHECK-NOT: extractvalue @@ -52,7 +52,7 @@ define i32 @extract2gep({i32, i32}* %pair, i32* %P) { ; The load + extractvalue should be converted ; to an inbounds gep + smaller load. ; The new load should be in the same spot as the old load. - %L = load {i32, i32}* %pair + %L = load {i32, i32}, {i32, i32}* %pair store i32 0, i32* %P br label %loop @@ -68,13 +68,13 @@ end: } ; CHECK-LABEL: define i32 @doubleextract2gep( -; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %arg, i32 0, i32 1, i32 1 -; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]] +; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}, {{.*}}* %arg, i64 0, i32 1, i32 1 +; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32, i32* [[GEP]] ; CHECK-NEXT: ret i32 [[LOAD]] define i32 @doubleextract2gep({i32, {i32, i32}}* %arg) { ; The load + extractvalues should be converted ; to a 3-index inbounds gep + smaller load. - %L = load {i32, {i32, i32}}* %arg + %L = load {i32, {i32, i32}}, {i32, {i32, i32}}* %arg %E1 = extractvalue {i32, {i32, i32}} %L, 1 %E2 = extractvalue {i32, i32} %E1, 1 ret i32 %E2 @@ -88,7 +88,7 @@ define i32 @doubleextract2gep({i32, {i32, i32}}* %arg) { ; CHECK-NEXT: ret define i32 @nogep-multiuse({i32, i32}* %pair) { ; The load should be left unchanged since both parts are needed. - %L = load volatile {i32, i32}* %pair + %L = load volatile {i32, i32}, {i32, i32}* %pair %LHS = extractvalue {i32, i32} %L, 0 %RHS = extractvalue {i32, i32} %L, 1 %R = add i32 %LHS, %RHS @@ -101,7 +101,7 @@ define i32 @nogep-multiuse({i32, i32}* %pair) { ; CHECK-NEXT: ret define i32 @nogep-volatile({i32, i32}* %pair) { ; The load volatile should be left unchanged. - %L = load volatile {i32, i32}* %pair + %L = load volatile {i32, i32}, {i32, i32}* %pair %E = extractvalue {i32, i32} %L, 1 ret i32 %E } diff --git a/test/Transforms/InstCombine/fast-math.ll b/test/Transforms/InstCombine/fast-math.ll index c6081c3..4eebdbd 100644 --- a/test/Transforms/InstCombine/fast-math.ll +++ b/test/Transforms/InstCombine/fast-math.ll @@ -267,6 +267,14 @@ define <4 x float> @fmul3_vec(<4 x float> %f1, <4 x float> %f2) { ; CHECK: fmul fast <4 x float> %f1, <float 3.000000e+00, float 2.000000e+00, float 1.000000e+00, float 1.000000e+00> } +; Make sure fmul with constant expression doesn't assert. +define <4 x float> @fmul3_vec_constexpr(<4 x float> %f1, <4 x float> %f2) { + %constExprMul = bitcast i128 trunc (i160 bitcast (<5 x float> <float 6.0e+3, float 6.0e+3, float 2.0e+3, float 1.0e+3, float undef> to i160) to i128) to <4 x float> + %t1 = fdiv <4 x float> %f1, <float 2.0e+3, float 3.0e+3, float 2.0e+3, float 1.0e+3> + %t3 = fmul fast <4 x float> %t1, %constExprMul + ret <4 x float> %t3 +} + ; Rule "X/C1 * C2 => X * (C2/C1) is not applicable if C2/C1 is either a special ; value of a denormal. The 0x3810000000000000 here take value FLT_MIN ; diff --git a/test/Transforms/InstCombine/fcmp.ll b/test/Transforms/InstCombine/fcmp.ll index ee39d10..7fd46f2 100644 --- a/test/Transforms/InstCombine/fcmp.ll +++ b/test/Transforms/InstCombine/fcmp.ll @@ -240,3 +240,38 @@ define i32 @test17(double %a, double (double)* %p) nounwind { %conv = zext i1 %cmp to i32 ret i32 %conv } + +; Can fold fcmp with undef on one side by choosing NaN for the undef +define i32 @test18_undef_unordered(float %a) nounwind { +; CHECK-LABEL: @test18_undef_unordered +; CHECK: ret i32 1 + %cmp = fcmp ueq float %a, undef + %conv = zext i1 %cmp to i32 + ret i32 %conv +} +; Can fold fcmp with undef on one side by choosing NaN for the undef +define i32 @test18_undef_ordered(float %a) nounwind { +; CHECK-LABEL: @test18_undef_ordered +; CHECK: ret i32 0 + %cmp = fcmp oeq float %a, undef + %conv = zext i1 %cmp to i32 + ret i32 %conv +} + +; Can fold fcmp with undef on both side +; fcmp u_pred undef, undef -> true +; fcmp o_pred undef, undef -> false +; because whatever you choose for the first undef +; you can choose NaN for the other undef +define i1 @test19_undef_unordered() nounwind { +; CHECK-LABEL: @test19_undef +; CHECK: ret i1 true + %cmp = fcmp ueq float undef, undef + ret i1 %cmp +} +define i1 @test19_undef_ordered() nounwind { +; CHECK-LABEL: @test19_undef +; CHECK: ret i1 false + %cmp = fcmp oeq float undef, undef + ret i1 %cmp +} diff --git a/test/Transforms/InstCombine/fmul.ll b/test/Transforms/InstCombine/fmul.ll index a776765..ac3000f 100644 --- a/test/Transforms/InstCombine/fmul.ll +++ b/test/Transforms/InstCombine/fmul.ll @@ -74,7 +74,7 @@ define float @test7(float %x, float %y) { ; Don't crash when attempting to cast a constant FMul to an instruction. define void @test8(i32* %inout) { entry: - %0 = load i32* %inout, align 4 + %0 = load i32, i32* %inout, align 4 %conv = uitofp i32 %0 to float %vecinit = insertelement <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float undef>, float %conv, i32 3 %sub = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %vecinit diff --git a/test/Transforms/InstCombine/fold-vector-zero.ll b/test/Transforms/InstCombine/fold-vector-zero.ll index e1d86b6..bf661df 100644 --- a/test/Transforms/InstCombine/fold-vector-zero.ll +++ b/test/Transforms/InstCombine/fold-vector-zero.ll @@ -9,7 +9,7 @@ bb30: %l0 = phi i64 [ -2222, %bb8 ], [ %r23, %bb30 ] %r2 = add i64 %s0, %B %r3 = inttoptr i64 %r2 to <2 x double>* - %r4 = load <2 x double>* %r3, align 8 + %r4 = load <2 x double>, <2 x double>* %r3, align 8 %r6 = bitcast <2 x double> %r4 to <2 x i64> %r7 = bitcast <2 x double> zeroinitializer to <2 x i64> %r8 = insertelement <2 x i64> undef, i64 9223372036854775807, i32 0 diff --git a/test/Transforms/InstCombine/fp-ret-bitcast.ll b/test/Transforms/InstCombine/fp-ret-bitcast.ll index b2fbc0b..7106933 100644 --- a/test/Transforms/InstCombine/fp-ret-bitcast.ll +++ b/test/Transforms/InstCombine/fp-ret-bitcast.ll @@ -13,11 +13,11 @@ define void @bork() nounwind { entry: %color = alloca %struct.NSArray* %color.466 = alloca %struct.NSObject* - %tmp103 = load %struct.NSArray** %color, align 4 - %tmp103104 = getelementptr %struct.NSArray* %tmp103, i32 0, i32 0 + %tmp103 = load %struct.NSArray*, %struct.NSArray** %color, align 4 + %tmp103104 = getelementptr %struct.NSArray, %struct.NSArray* %tmp103, i32 0, i32 0 store %struct.NSObject* %tmp103104, %struct.NSObject** %color.466, align 4 - %tmp105 = load %struct.objc_selector** @"\01L_OBJC_SELECTOR_REFERENCES_81", align 4 - %tmp106 = load %struct.NSObject** %color.466, align 4 + %tmp105 = load %struct.objc_selector*, %struct.objc_selector** @"\01L_OBJC_SELECTOR_REFERENCES_81", align 4 + %tmp106 = load %struct.NSObject*, %struct.NSObject** %color.466, align 4 %tmp107 = call float bitcast (void (%struct.NSObject*, ...)* @objc_msgSend_fpret to float (%struct.NSObject*, %struct.objc_selector*)*)( %struct.NSObject* %tmp106, %struct.objc_selector* %tmp105 ) nounwind br label %exit diff --git a/test/Transforms/InstCombine/fpextend.ll b/test/Transforms/InstCombine/fpextend.ll index 8640cd2..775caad 100644 --- a/test/Transforms/InstCombine/fpextend.ll +++ b/test/Transforms/InstCombine/fpextend.ll @@ -5,7 +5,7 @@ define void @test() nounwind { entry: - %tmp = load float* @X, align 4 ; <float> [#uses=1] + %tmp = load float, float* @X, align 4 ; <float> [#uses=1] %tmp1 = fpext float %tmp to double ; <double> [#uses=1] %tmp3 = fadd double %tmp1, 0.000000e+00 ; <double> [#uses=1] %tmp34 = fptrunc double %tmp3 to float ; <float> [#uses=1] @@ -15,9 +15,9 @@ entry: define void @test2() nounwind { entry: - %tmp = load float* @X, align 4 ; <float> [#uses=1] + %tmp = load float, float* @X, align 4 ; <float> [#uses=1] %tmp1 = fpext float %tmp to double ; <double> [#uses=1] - %tmp2 = load float* @Y, align 4 ; <float> [#uses=1] + %tmp2 = load float, float* @Y, align 4 ; <float> [#uses=1] %tmp23 = fpext float %tmp2 to double ; <double> [#uses=1] %tmp5 = fmul double %tmp1, %tmp23 ; <double> [#uses=1] %tmp56 = fptrunc double %tmp5 to float ; <float> [#uses=1] @@ -27,9 +27,9 @@ entry: define void @test3() nounwind { entry: - %tmp = load float* @X, align 4 ; <float> [#uses=1] + %tmp = load float, float* @X, align 4 ; <float> [#uses=1] %tmp1 = fpext float %tmp to double ; <double> [#uses=1] - %tmp2 = load float* @Y, align 4 ; <float> [#uses=1] + %tmp2 = load float, float* @Y, align 4 ; <float> [#uses=1] %tmp23 = fpext float %tmp2 to double ; <double> [#uses=1] %tmp5 = fdiv double %tmp1, %tmp23 ; <double> [#uses=1] %tmp56 = fptrunc double %tmp5 to float ; <float> [#uses=1] @@ -39,7 +39,7 @@ entry: define void @test4() nounwind { entry: - %tmp = load float* @X, align 4 ; <float> [#uses=1] + %tmp = load float, float* @X, align 4 ; <float> [#uses=1] %tmp1 = fpext float %tmp to double ; <double> [#uses=1] %tmp2 = fsub double -0.000000e+00, %tmp1 ; <double> [#uses=1] %tmp34 = fptrunc double %tmp2 to float ; <float> [#uses=1] diff --git a/test/Transforms/InstCombine/fprintf-1.ll b/test/Transforms/InstCombine/fprintf-1.ll index 6741345..32203b2 100644 --- a/test/Transforms/InstCombine/fprintf-1.ll +++ b/test/Transforms/InstCombine/fprintf-1.ll @@ -19,9 +19,9 @@ declare i32 @fprintf(%FILE*, i8*, ...) define void @test_simplify1(%FILE* %fp) { ; CHECK-LABEL: @test_simplify1( - %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt) -; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0), i32 12, i32 1, %FILE* %fp) +; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 12, i32 1, %FILE* %fp) ret void ; CHECK-NEXT: ret void } @@ -30,7 +30,7 @@ define void @test_simplify1(%FILE* %fp) { define void @test_simplify2(%FILE* %fp) { ; CHECK-LABEL: @test_simplify2( - %fmt = getelementptr [3 x i8]* @percent_c, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_c, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i8 104) ; CHECK-NEXT: call i32 @fputc(i32 104, %FILE* %fp) ret void @@ -42,10 +42,10 @@ define void @test_simplify2(%FILE* %fp) { define void @test_simplify3(%FILE* %fp) { ; CHECK-LABEL: @test_simplify3( - %fmt = getelementptr [3 x i8]* @percent_s, i32 0, i32 0 - %str = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0 + %str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i8* %str) -; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0), i32 12, i32 1, %FILE* %fp) +; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 12, i32 1, %FILE* %fp) ret void ; CHECK-NEXT: ret void } @@ -54,36 +54,36 @@ define void @test_simplify3(%FILE* %fp) { define void @test_simplify4(%FILE* %fp) { ; CHECK-IPRINTF-LABEL: @test_simplify4( - %fmt = getelementptr [3 x i8]* @percent_d, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_d, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i32 187) -; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...)* @fiprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8]* @percent_d, i32 0, i32 0), i32 187) +; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...)* @fiprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187) ret void ; CHECK-IPRINTF-NEXT: ret void } define void @test_no_simplify1(%FILE* %fp) { ; CHECK-IPRINTF-LABEL: @test_no_simplify1( - %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, double 1.87) -; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) +; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) ret void ; CHECK-IPRINTF-NEXT: ret void } define void @test_no_simplify2(%FILE* %fp, double %d) { ; CHECK-LABEL: @test_no_simplify2( - %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0 call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, double %d) -; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double %d) +; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double %d) ret void ; CHECK-NEXT: ret void } define i32 @test_no_simplify3(%FILE* %fp) { ; CHECK-LABEL: @test_no_simplify3( - %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 %1 = call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt) -; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0)) +; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0)) ret i32 %1 ; CHECK-NEXT: ret i32 %1 } diff --git a/test/Transforms/InstCombine/fputs-1.ll b/test/Transforms/InstCombine/fputs-1.ll index 473610e..1c24575 100644 --- a/test/Transforms/InstCombine/fputs-1.ll +++ b/test/Transforms/InstCombine/fputs-1.ll @@ -16,7 +16,7 @@ declare i32 @fputs(i8*, %FILE*) define void @test_simplify1(%FILE* %fp) { ; CHECK-LABEL: @test_simplify1( - %str = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 call i32 @fputs(i8* %str, %FILE* %fp) ret void ; CHECK-NEXT: ret void @@ -26,7 +26,7 @@ define void @test_simplify1(%FILE* %fp) { define void @test_simplify2(%FILE* %fp) { ; CHECK-LABEL: @test_simplify2( - %str = getelementptr [2 x i8]* @A, i32 0, i32 0 + %str = getelementptr [2 x i8], [2 x i8]* @A, i32 0, i32 0 call i32 @fputs(i8* %str, %FILE* %fp) ; CHECK-NEXT: call i32 @fputc(i32 65, %FILE* %fp) ret void @@ -35,9 +35,9 @@ define void @test_simplify2(%FILE* %fp) { define void @test_simplify3(%FILE* %fp) { ; CHECK-LABEL: @test_simplify3( - %str = getelementptr [7 x i8]* @hello, i32 0, i32 0 + %str = getelementptr [7 x i8], [7 x i8]* @hello, i32 0, i32 0 call i32 @fputs(i8* %str, %FILE* %fp) -; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([7 x i8]* @hello, i32 0, i32 0), i32 6, i32 1, %FILE* %fp) +; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @hello, i32 0, i32 0), i32 6, i32 1, %FILE* %fp) ret void ; CHECK-NEXT: ret void } diff --git a/test/Transforms/InstCombine/fwrite-1.ll b/test/Transforms/InstCombine/fwrite-1.ll index 6f9a8e4..10f0b23 100644 --- a/test/Transforms/InstCombine/fwrite-1.ll +++ b/test/Transforms/InstCombine/fwrite-1.ll @@ -15,7 +15,7 @@ declare i64 @fwrite(i8*, i64, i64, %FILE *) define void @test_simplify1(%FILE* %fp) { ; CHECK-LABEL: @test_simplify1( - %str = getelementptr inbounds [1 x i8]* @str, i64 0, i64 0 + %str = getelementptr inbounds [1 x i8], [1 x i8]* @str, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 1, i64 1, %FILE* %fp) ; CHECK-NEXT: call i32 @fputc(i32 0, %FILE* %fp) ret void @@ -24,7 +24,7 @@ define void @test_simplify1(%FILE* %fp) { define void @test_simplify2(%FILE* %fp) { ; CHECK-LABEL: @test_simplify2( - %str = getelementptr inbounds [0 x i8]* @empty, i64 0, i64 0 + %str = getelementptr inbounds [0 x i8], [0 x i8]* @empty, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 1, i64 0, %FILE* %fp) ret void ; CHECK-NEXT: ret void @@ -32,7 +32,7 @@ define void @test_simplify2(%FILE* %fp) { define void @test_simplify3(%FILE* %fp) { ; CHECK-LABEL: @test_simplify3( - %str = getelementptr inbounds [0 x i8]* @empty, i64 0, i64 0 + %str = getelementptr inbounds [0 x i8], [0 x i8]* @empty, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 0, i64 1, %FILE* %fp) ret void ; CHECK-NEXT: ret void @@ -40,7 +40,7 @@ define void @test_simplify3(%FILE* %fp) { define i64 @test_no_simplify1(%FILE* %fp) { ; CHECK-LABEL: @test_no_simplify1( - %str = getelementptr inbounds [1 x i8]* @str, i64 0, i64 0 + %str = getelementptr inbounds [1 x i8], [1 x i8]* @str, i64 0, i64 0 %ret = call i64 @fwrite(i8* %str, i64 1, i64 1, %FILE* %fp) ; CHECK-NEXT: call i64 @fwrite ret i64 %ret @@ -49,7 +49,7 @@ define i64 @test_no_simplify1(%FILE* %fp) { define void @test_no_simplify2(%FILE* %fp, i64 %size) { ; CHECK-LABEL: @test_no_simplify2( - %str = getelementptr inbounds [1 x i8]* @str, i64 0, i64 0 + %str = getelementptr inbounds [1 x i8], [1 x i8]* @str, i64 0, i64 0 call i64 @fwrite(i8* %str, i64 %size, i64 1, %FILE* %fp) ; CHECK-NEXT: call i64 @fwrite ret void diff --git a/test/Transforms/InstCombine/gc.relocate.ll b/test/Transforms/InstCombine/gc.relocate.ll index d10ef5f..4a7ea2c 100644 --- a/test/Transforms/InstCombine/gc.relocate.ll +++ b/test/Transforms/InstCombine/gc.relocate.ll @@ -1,4 +1,5 @@ -; RUN: opt < %s -datalayout -instcombine -S | FileCheck %s +; RUN: opt < %s -instcombine -S | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" ; Uses InstCombine with DataLayout to propagate dereferenceable ; attribute via gc.relocate: if the derived ptr is dereferenceable(N), @@ -13,7 +14,7 @@ define i32 addrspace(1)* @deref(i32 addrspace(1)* dereferenceable(8) %dparam) { ; CHECK-LABEL: @deref ; CHECK: call dereferenceable(8) entry: - %load = load i32 addrspace(1)* %dparam + %load = load i32, i32 addrspace(1)* %dparam %tok = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam) %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %tok, i32 4, i32 4) ret i32 addrspace(1)* %relocate diff --git a/test/Transforms/InstCombine/gep-addrspace.ll b/test/Transforms/InstCombine/gep-addrspace.ll index 29511a3..aa46ea6 100644 --- a/test/Transforms/InstCombine/gep-addrspace.ll +++ b/test/Transforms/InstCombine/gep-addrspace.ll @@ -8,11 +8,11 @@ target triple = "x86_64-pc-win32" ; make sure that we are not crashing when creating an illegal type define void @func(%myStruct addrspace(1)* nocapture %p) nounwind { ST: - %A = getelementptr inbounds %myStruct addrspace(1)* %p, i64 0 + %A = getelementptr inbounds %myStruct, %myStruct addrspace(1)* %p, i64 0 %B = addrspacecast %myStruct addrspace(1)* %A to %myStruct* - %C = getelementptr inbounds %myStruct* %B, i32 0, i32 1 - %D = getelementptr inbounds [3 x float]* %C, i32 0, i32 2 - %E = load float* %D, align 4 + %C = getelementptr inbounds %myStruct, %myStruct* %B, i32 0, i32 1 + %D = getelementptr inbounds [3 x float], [3 x float]* %C, i32 0, i32 2 + %E = load float, float* %D, align 4 %F = fsub float %E, undef ret void } @@ -23,9 +23,9 @@ ST: define void @keep_necessary_addrspacecast(i64 %i, float** %out0, float** %out1) { entry: ; CHECK-LABEL: @keep_necessary_addrspacecast - %0 = getelementptr [256 x float]* addrspacecast ([256 x float] addrspace(3)* @array to [256 x float]*), i64 0, i64 %i + %0 = getelementptr [256 x float], [256 x float]* addrspacecast ([256 x float] addrspace(3)* @array to [256 x float]*), i64 0, i64 %i ; CHECK: addrspacecast float addrspace(3)* %{{[0-9]+}} to float* - %1 = getelementptr [0 x float]* addrspacecast (float addrspace(3)* @scalar to [0 x float]*), i64 0, i64 %i + %1 = getelementptr [0 x float], [0 x float]* addrspacecast (float addrspace(3)* @scalar to [0 x float]*), i64 0, i64 %i ; CHECK: addrspacecast float addrspace(3)* %{{[0-9]+}} to float* store float* %0, float** %out0, align 4 store float* %1, float** %out1, align 4 diff --git a/test/Transforms/InstCombine/gep-sext.ll b/test/Transforms/InstCombine/gep-sext.ll index 3d23dab..36e2aef 100644 --- a/test/Transforms/InstCombine/gep-sext.ll +++ b/test/Transforms/InstCombine/gep-sext.ll @@ -8,9 +8,9 @@ declare void @use(i32) readonly define void @test(i32* %p, i32 %index) { ; CHECK-LABEL: @test ; CHECK-NEXT: %1 = sext i32 %index to i64 -; CHECK-NEXT: %addr = getelementptr i32* %p, i64 %1 - %addr = getelementptr i32* %p, i32 %index - %val = load i32* %addr +; CHECK-NEXT: %addr = getelementptr i32, i32* %p, i64 %1 + %addr = getelementptr i32, i32* %p, i32 %index + %val = load i32, i32* %addr call void @use(i32 %val) ret void } @@ -18,10 +18,10 @@ define void @test(i32* %p, i32 %index) { define void @test2(i32* %p, i32 %index) { ; CHECK-LABEL: @test2 ; CHECK-NEXT: %i = zext i32 %index to i64 -; CHECK-NEXT: %addr = getelementptr i32* %p, i64 %i +; CHECK-NEXT: %addr = getelementptr i32, i32* %p, i64 %i %i = zext i32 %index to i64 - %addr = getelementptr i32* %p, i64 %i - %val = load i32* %addr + %addr = getelementptr i32, i32* %p, i64 %i + %val = load i32, i32* %addr call void @use(i32 %val) ret void } @@ -31,11 +31,11 @@ define void @test3(i32* %p, i32 %index) { ; CHECK-LABEL: @test3 ; CHECK: zext ; CHECK-NOT: sext - %addr_begin = getelementptr i32* %p, i64 40 - %addr_fixed = getelementptr i32* %addr_begin, i64 48 - %val_fixed = load i32* %addr_fixed, !range !0 - %addr = getelementptr i32* %addr_begin, i32 %val_fixed - %val = load i32* %addr + %addr_begin = getelementptr i32, i32* %p, i64 40 + %addr_fixed = getelementptr i32, i32* %addr_begin, i64 48 + %val_fixed = load i32, i32* %addr_fixed, !range !0 + %addr = getelementptr i32, i32* %addr_begin, i32 %val_fixed + %val = load i32, i32* %addr call void @use(i32 %val) ret void } @@ -44,12 +44,12 @@ define void @test4(i32* %p, i32 %index) { ; CHECK-LABEL: @test4 ; CHECK: zext ; CHECK-NOT: sext - %addr_begin = getelementptr i32* %p, i64 40 - %addr_fixed = getelementptr i32* %addr_begin, i64 48 - %val_fixed = load i32* %addr_fixed, !range !0 + %addr_begin = getelementptr i32, i32* %p, i64 40 + %addr_fixed = getelementptr i32, i32* %addr_begin, i64 48 + %val_fixed = load i32, i32* %addr_fixed, !range !0 %i = sext i32 %val_fixed to i64 - %addr = getelementptr i32* %addr_begin, i64 %i - %val = load i32* %addr + %addr = getelementptr i32, i32* %addr_begin, i64 %i + %val = load i32, i32* %addr call void @use(i32 %val) ret void } diff --git a/test/Transforms/InstCombine/gepgep.ll b/test/Transforms/InstCombine/gepgep.ll index 9e681d2..24b81aa 100644 --- a/test/Transforms/InstCombine/gepgep.ll +++ b/test/Transforms/InstCombine/gepgep.ll @@ -8,6 +8,6 @@ target triple = "x86_64-unknown-linux-gnu" declare void @use(i8*) define void @f() { - call void @use(i8* getelementptr (i8* getelementptr (i8* bitcast ([64 x float]* @buffer to i8*), i64 and (i64 sub (i64 0, i64 ptrtoint ([64 x float]* @buffer to i64)), i64 63)), i64 64)) + call void @use(i8* getelementptr (i8, i8* getelementptr (i8, i8* bitcast ([64 x float]* @buffer to i8*), i64 and (i64 sub (i64 0, i64 ptrtoint ([64 x float]* @buffer to i64)), i64 63)), i64 64)) ret void } diff --git a/test/Transforms/InstCombine/gepphigep.ll b/test/Transforms/InstCombine/gepphigep.ll index 86295e4..5ae3171 100644 --- a/test/Transforms/InstCombine/gepphigep.ll +++ b/test/Transforms/InstCombine/gepphigep.ll @@ -7,72 +7,72 @@ define i32 @test1(%struct1* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19) { bb: - %tmp = getelementptr inbounds %struct1* %dm, i64 0, i32 0 - %tmp1 = load %struct2** %tmp, align 8 + %tmp = getelementptr inbounds %struct1, %struct1* %dm, i64 0, i32 0 + %tmp1 = load %struct2*, %struct2** %tmp, align 8 br i1 %tmp4, label %bb1, label %bb2 bb1: - %tmp10 = getelementptr inbounds %struct2* %tmp1, i64 %tmp9 - %tmp11 = getelementptr inbounds %struct2* %tmp10, i64 0, i32 0 + %tmp10 = getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp9 + %tmp11 = getelementptr inbounds %struct2, %struct2* %tmp10, i64 0, i32 0 store i32 0, i32* %tmp11, align 4 br label %bb3 bb2: - %tmp20 = getelementptr inbounds %struct2* %tmp1, i64 %tmp19 - %tmp21 = getelementptr inbounds %struct2* %tmp20, i64 0, i32 0 + %tmp20 = getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp19 + %tmp21 = getelementptr inbounds %struct2, %struct2* %tmp20, i64 0, i32 0 store i32 0, i32* %tmp21, align 4 br label %bb3 bb3: %phi = phi %struct2* [ %tmp10, %bb1 ], [ %tmp20, %bb2 ] - %tmp24 = getelementptr inbounds %struct2* %phi, i64 0, i32 1 - %tmp25 = load i32* %tmp24, align 4 + %tmp24 = getelementptr inbounds %struct2, %struct2* %phi, i64 0, i32 1 + %tmp25 = load i32, i32* %tmp24, align 4 ret i32 %tmp25 ; CHECK-LABEL: @test1( -; CHECK: getelementptr inbounds %struct2* %tmp1, i64 %tmp9, i32 0 -; CHECK: getelementptr inbounds %struct2* %tmp1, i64 %tmp19, i32 0 +; CHECK: getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp9, i32 0 +; CHECK: getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp19, i32 0 ; CHECK: %[[PHI:[0-9A-Za-z]+]] = phi i64 [ %tmp9, %bb1 ], [ %tmp19, %bb2 ] -; CHECK: getelementptr inbounds %struct2* %tmp1, i64 %[[PHI]], i32 1 +; CHECK: getelementptr inbounds %struct2, %struct2* %tmp1, i64 %[[PHI]], i32 1 } define i32 @test2(%struct1* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19) { bb: - %tmp = getelementptr inbounds %struct1* %dm, i64 0, i32 0 - %tmp1 = load %struct2** %tmp, align 8 - %tmp10 = getelementptr inbounds %struct2* %tmp1, i64 %tmp9 - %tmp11 = getelementptr inbounds %struct2* %tmp10, i64 0, i32 0 + %tmp = getelementptr inbounds %struct1, %struct1* %dm, i64 0, i32 0 + %tmp1 = load %struct2*, %struct2** %tmp, align 8 + %tmp10 = getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp9 + %tmp11 = getelementptr inbounds %struct2, %struct2* %tmp10, i64 0, i32 0 store i32 0, i32* %tmp11, align 4 - %tmp20 = getelementptr inbounds %struct2* %tmp1, i64 %tmp19 - %tmp21 = getelementptr inbounds %struct2* %tmp20, i64 0, i32 0 + %tmp20 = getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp19 + %tmp21 = getelementptr inbounds %struct2, %struct2* %tmp20, i64 0, i32 0 store i32 0, i32* %tmp21, align 4 - %tmp24 = getelementptr inbounds %struct2* %tmp10, i64 0, i32 1 - %tmp25 = load i32* %tmp24, align 4 + %tmp24 = getelementptr inbounds %struct2, %struct2* %tmp10, i64 0, i32 1 + %tmp25 = load i32, i32* %tmp24, align 4 ret i32 %tmp25 ; CHECK-LABEL: @test2( -; CHECK: getelementptr inbounds %struct2* %tmp1, i64 %tmp9, i32 0 -; CHECK: getelementptr inbounds %struct2* %tmp1, i64 %tmp19, i32 0 -; CHECK: getelementptr inbounds %struct2* %tmp1, i64 %tmp9, i32 1 +; CHECK: getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp9, i32 0 +; CHECK: getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp19, i32 0 +; CHECK: getelementptr inbounds %struct2, %struct2* %tmp1, i64 %tmp9, i32 1 } ; Check that instcombine doesn't insert GEPs before landingpad. define i32 @test3(%struct3* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19, i64 %tmp20, i64 %tmp21) { bb: - %tmp = getelementptr inbounds %struct3* %dm, i64 0 + %tmp = getelementptr inbounds %struct3, %struct3* %dm, i64 0 br i1 %tmp4, label %bb1, label %bb2 bb1: - %tmp1 = getelementptr inbounds %struct3* %tmp, i64 %tmp19, i32 1 - %tmp11 = getelementptr inbounds %struct4* %tmp1, i64 0, i32 0, i32 0 + %tmp1 = getelementptr inbounds %struct3, %struct3* %tmp, i64 %tmp19, i32 1 + %tmp11 = getelementptr inbounds %struct4, %struct4* %tmp1, i64 0, i32 0, i32 0 store i32 0, i32* %tmp11, align 4 br label %bb3 bb2: - %tmp2 = getelementptr inbounds %struct3* %tmp, i64 %tmp20, i32 1 - %tmp12 = getelementptr inbounds %struct4* %tmp2, i64 0, i32 0, i32 1 + %tmp2 = getelementptr inbounds %struct3, %struct3* %tmp, i64 %tmp20, i32 1 + %tmp12 = getelementptr inbounds %struct4, %struct4* %tmp2, i64 0, i32 0, i32 1 store i32 0, i32* %tmp12, align 4 br label %bb3 @@ -85,9 +85,9 @@ bb4: bb5: %tmp27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* bitcast (i8** @_ZTIi to i8*) - %tmp34 = getelementptr inbounds %struct4* %phi, i64 %tmp21, i32 1 - %tmp35 = getelementptr inbounds %struct2* %tmp34, i64 0, i32 1 - %tmp25 = load i32* %tmp35, align 4 + %tmp34 = getelementptr inbounds %struct4, %struct4* %phi, i64 %tmp21, i32 1 + %tmp35 = getelementptr inbounds %struct2, %struct2* %tmp34, i64 0, i32 1 + %tmp25 = load i32, i32* %tmp35, align 4 ret i32 %tmp25 ; CHECK-LABEL: @test3( @@ -98,3 +98,39 @@ bb5: @_ZTIi = external constant i8* declare i32 @__gxx_personality_v0(...) declare i32 @foo1(i32) + + +; Check that instcombine doesn't fold GEPs into themselves through a loop +; back-edge. + +define i8* @test4(i32 %value, i8* %buffer) { +entry: + %incptr = getelementptr inbounds i8, i8* %buffer, i64 1 + %cmp = icmp ugt i32 %value, 127 + br i1 %cmp, label %loop.header, label %exit + +loop.header: + br label %loop.body + +loop.body: + %loopptr = phi i8* [ %incptr, %loop.header ], [ %incptr2, %loop.body ] + %newval = phi i32 [ %value, %loop.header ], [ %shr, %loop.body ] + %shr = lshr i32 %newval, 7 + %incptr2 = getelementptr inbounds i8, i8* %loopptr, i64 1 + %cmp2 = icmp ugt i32 %shr, 127 + br i1 %cmp2, label %loop.body, label %loop.exit + +loop.exit: + %exitptr = phi i8* [ %incptr2, %loop.body ] + br label %exit + +exit: + %ptr2 = phi i8* [ %exitptr, %loop.exit ], [ %incptr, %entry ] + %incptr3 = getelementptr inbounds i8, i8* %ptr2, i64 1 + ret i8* %incptr3 + +; CHECK-LABEL: @test4( +; CHECK: loop.body: +; CHECK: getelementptr{{.*}}i64 1 +; CHECK: exit: +} diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll index 94cc180..2e605fb 100644 --- a/test/Transforms/InstCombine/getelementptr.ll +++ b/test/Transforms/InstCombine/getelementptr.ll @@ -14,14 +14,14 @@ target datalayout = "e-p:64:64-p1:16:16-p2:32:32:32-p3:64:64:64" ; Test noop elimination define i32* @test1(i32* %I) { - %A = getelementptr i32* %I, i64 0 + %A = getelementptr i32, i32* %I, i64 0 ret i32* %A ; CHECK-LABEL: @test1( ; CHECK: ret i32* %I } define i32 addrspace(1)* @test1_as1(i32 addrspace(1)* %I) { - %A = getelementptr i32 addrspace(1)* %I, i64 0 + %A = getelementptr i32, i32 addrspace(1)* %I, i64 0 ret i32 addrspace(1)* %A ; CHECK-LABEL: @test1_as1( ; CHECK: ret i32 addrspace(1)* %I @@ -29,7 +29,7 @@ define i32 addrspace(1)* @test1_as1(i32 addrspace(1)* %I) { ; Test noop elimination define i32* @test2(i32* %I) { - %A = getelementptr i32* %I + %A = getelementptr i32, i32* %I ret i32* %A ; CHECK-LABEL: @test2( ; CHECK: ret i32* %I @@ -37,38 +37,38 @@ define i32* @test2(i32* %I) { ; Test that two array indexing geps fold define i32* @test3(i32* %I) { - %A = getelementptr i32* %I, i64 17 - %B = getelementptr i32* %A, i64 4 + %A = getelementptr i32, i32* %I, i64 17 + %B = getelementptr i32, i32* %A, i64 4 ret i32* %B ; CHECK-LABEL: @test3( -; CHECK: getelementptr i32* %I, i64 21 +; CHECK: getelementptr i32, i32* %I, i64 21 } ; Test that two getelementptr insts fold define i32* @test4({ i32 }* %I) { - %A = getelementptr { i32 }* %I, i64 1 - %B = getelementptr { i32 }* %A, i64 0, i32 0 + %A = getelementptr { i32 }, { i32 }* %I, i64 1 + %B = getelementptr { i32 }, { i32 }* %A, i64 0, i32 0 ret i32* %B ; CHECK-LABEL: @test4( -; CHECK: getelementptr { i32 }* %I, i64 1, i32 0 +; CHECK: getelementptr { i32 }, { i32 }* %I, i64 1, i32 0 } define void @test5(i8 %B) { ; This should be turned into a constexpr instead of being an instruction - %A = getelementptr [10 x i8]* @Global, i64 0, i64 4 + %A = getelementptr [10 x i8], [10 x i8]* @Global, i64 0, i64 4 store i8 %B, i8* %A ret void ; CHECK-LABEL: @test5( -; CHECK: store i8 %B, i8* getelementptr inbounds ([10 x i8]* @Global, i64 0, i64 4) +; CHECK: store i8 %B, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @Global, i64 0, i64 4) } define void @test5_as1(i8 %B) { ; This should be turned into a constexpr instead of being an instruction - %A = getelementptr [10 x i8] addrspace(1)* @Global_as1, i16 0, i16 4 + %A = getelementptr [10 x i8], [10 x i8] addrspace(1)* @Global_as1, i16 0, i16 4 store i8 %B, i8 addrspace(1)* %A ret void ; CHECK-LABEL: @test5_as1( -; CHECK: store i8 %B, i8 addrspace(1)* getelementptr inbounds ([10 x i8] addrspace(1)* @Global_as1, i16 0, i16 4) +; CHECK: store i8 %B, i8 addrspace(1)* getelementptr inbounds ([10 x i8], [10 x i8] addrspace(1)* @Global_as1, i16 0, i16 4) } %as1_ptr_struct = type { i32 addrspace(1)* } @@ -80,9 +80,9 @@ define void @test5_as1(i8 %B) { ; This should be turned into a constexpr instead of being an instruction define void @test_evaluate_gep_nested_as_ptrs(i32 addrspace(2)* %B) { ; CHECK-LABEL: @test_evaluate_gep_nested_as_ptrs( -; CHECK-NEXT: store i32 addrspace(2)* %B, i32 addrspace(2)* addrspace(1)* getelementptr inbounds (%as2_ptr_struct addrspace(1)* @global_as1_as2_ptr, i16 0, i32 0), align 8 +; CHECK-NEXT: store i32 addrspace(2)* %B, i32 addrspace(2)* addrspace(1)* getelementptr inbounds (%as2_ptr_struct, %as2_ptr_struct addrspace(1)* @global_as1_as2_ptr, i16 0, i32 0), align 8 ; CHECK-NEXT: ret void - %A = getelementptr %as2_ptr_struct addrspace(1)* @global_as1_as2_ptr, i16 0, i32 0 + %A = getelementptr %as2_ptr_struct, %as2_ptr_struct addrspace(1)* @global_as1_as2_ptr, i16 0, i32 0 store i32 addrspace(2)* %B, i32 addrspace(2)* addrspace(1)* %A ret void } @@ -91,26 +91,26 @@ define void @test_evaluate_gep_nested_as_ptrs(i32 addrspace(2)* %B) { define void @test_evaluate_gep_as_ptrs_array(i8 addrspace(2)* %B) { ; CHECK-LABEL: @test_evaluate_gep_as_ptrs_array( -; CHECK-NEXT: store i8 addrspace(2)* %B, i8 addrspace(2)* addrspace(1)* getelementptr inbounds ([4 x i8 addrspace(2)*] addrspace(1)* @arst, i16 0, i16 2), align 4 +; CHECK-NEXT: store i8 addrspace(2)* %B, i8 addrspace(2)* addrspace(1)* getelementptr inbounds ([4 x i8 addrspace(2)*], [4 x i8 addrspace(2)*] addrspace(1)* @arst, i16 0, i16 2), align 4 ; CHECK-NEXT: ret void - %A = getelementptr [4 x i8 addrspace(2)*] addrspace(1)* @arst, i16 0, i16 2 + %A = getelementptr [4 x i8 addrspace(2)*], [4 x i8 addrspace(2)*] addrspace(1)* @arst, i16 0, i16 2 store i8 addrspace(2)* %B, i8 addrspace(2)* addrspace(1)* %A ret void } define i32* @test7(i32* %I, i64 %C, i64 %D) { - %A = getelementptr i32* %I, i64 %C - %B = getelementptr i32* %A, i64 %D + %A = getelementptr i32, i32* %I, i64 %C + %B = getelementptr i32, i32* %A, i64 %D ret i32* %B ; CHECK-LABEL: @test7( ; CHECK: %A.sum = add i64 %C, %D -; CHECK: getelementptr i32* %I, i64 %A.sum +; CHECK: getelementptr i32, i32* %I, i64 %A.sum } define i8* @test8([10 x i32]* %X) { ;; Fold into the cast. - %A = getelementptr [10 x i32]* %X, i64 0, i64 0 + %A = getelementptr [10 x i32], [10 x i32]* %X, i64 0, i64 0 %B = bitcast i32* %A to i8* ret i8* %B ; CHECK-LABEL: @test8( @@ -118,7 +118,7 @@ define i8* @test8([10 x i32]* %X) { } define i32 @test9() { - %A = getelementptr { i32, double }* null, i32 0, i32 1 + %A = getelementptr { i32, double }, { i32, double }* null, i32 0, i32 1 %B = ptrtoint double* %A to i32 ret i32 %B ; CHECK-LABEL: @test9( @@ -126,8 +126,8 @@ define i32 @test9() { } define i1 @test10({ i32, i32 }* %x, { i32, i32 }* %y) { - %tmp.1 = getelementptr { i32, i32 }* %x, i32 0, i32 1 - %tmp.3 = getelementptr { i32, i32 }* %y, i32 0, i32 1 + %tmp.1 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 1 + %tmp.3 = getelementptr { i32, i32 }, { i32, i32 }* %y, i32 0, i32 1 ;; seteq x, y %tmp.4 = icmp eq i32* %tmp.1, %tmp.3 ret i1 %tmp.4 @@ -136,7 +136,7 @@ define i1 @test10({ i32, i32 }* %x, { i32, i32 }* %y) { } define i1 @test11({ i32, i32 }* %X) { - %P = getelementptr { i32, i32 }* %X, i32 0, i32 0 + %P = getelementptr { i32, i32 }, { i32, i32 }* %X, i32 0, i32 0 %Q = icmp eq i32* %P, null ret i1 %Q ; CHECK-LABEL: @test11( @@ -147,18 +147,18 @@ define i1 @test11({ i32, i32 }* %X) { ; PR4748 define i32 @test12(%struct.A* %a) { entry: - %g3 = getelementptr %struct.A* %a, i32 0, i32 1 + %g3 = getelementptr %struct.A, %struct.A* %a, i32 0, i32 1 store i32 10, i32* %g3, align 4 - %g4 = getelementptr %struct.A* %a, i32 0, i32 0 + %g4 = getelementptr %struct.A, %struct.A* %a, i32 0, i32 0 %new_a = bitcast %struct.B* %g4 to %struct.A* - %g5 = getelementptr %struct.A* %new_a, i32 0, i32 1 - %a_a = load i32* %g5, align 4 + %g5 = getelementptr %struct.A, %struct.A* %new_a, i32 0, i32 1 + %a_a = load i32, i32* %g5, align 4 ret i32 %a_a ; CHECK-LABEL: @test12( -; CHECK: getelementptr %struct.A* %a, i64 0, i32 1 +; CHECK: getelementptr %struct.A, %struct.A* %a, i64 0, i32 1 ; CHECK-NEXT: store i32 10, i32* %g3 ; CHECK-NEXT: ret i32 10 } @@ -167,8 +167,8 @@ entry: ; PR2235 %S = type { i32, [ 100 x i32] } define i1 @test13(i64 %X, %S* %P) { - %A = getelementptr inbounds %S* %P, i32 0, i32 1, i64 %X - %B = getelementptr inbounds %S* %P, i32 0, i32 0 + %A = getelementptr inbounds %S, %S* %P, i32 0, i32 1, i64 %X + %B = getelementptr inbounds %S, %S* %P, i32 0, i32 0 %C = icmp eq i32* %A, %B ret i1 %C ; CHECK-LABEL: @test13( @@ -180,8 +180,8 @@ define <2 x i1> @test13_vector(<2 x i64> %X, <2 x %S*> %P) nounwind { ; CHECK-NEXT: shl nuw <2 x i64> %X, <i64 2, i64 2> ; CHECK-NEXT: add <2 x i64> %A.idx, <i64 4, i64 4> ; CHECK-NEXT: icmp eq <2 x i64> %A.offs, zeroinitializer - %A = getelementptr inbounds <2 x %S*> %P, <2 x i64> zeroinitializer, <2 x i32> <i32 1, i32 1>, <2 x i64> %X - %B = getelementptr inbounds <2 x %S*> %P, <2 x i64> <i64 0, i64 0>, <2 x i32> <i32 0, i32 0> + %A = getelementptr inbounds %S, <2 x %S*> %P, <2 x i64> zeroinitializer, <2 x i32> <i32 1, i32 1>, <2 x i64> %X + %B = getelementptr inbounds %S, <2 x %S*> %P, <2 x i64> <i64 0, i64 0>, <2 x i32> <i32 0, i32 0> %C = icmp eq <2 x i32*> %A, %B ret <2 x i1> %C } @@ -190,8 +190,8 @@ define i1 @test13_as1(i16 %X, %S addrspace(1)* %P) { ; CHECK-LABEL: @test13_as1( ; CHECK-NEXT: %C = icmp eq i16 %X, -1 ; CHECK-NEXT: ret i1 %C - %A = getelementptr inbounds %S addrspace(1)* %P, i16 0, i32 1, i16 %X - %B = getelementptr inbounds %S addrspace(1)* %P, i16 0, i32 0 + %A = getelementptr inbounds %S, %S addrspace(1)* %P, i16 0, i32 1, i16 %X + %B = getelementptr inbounds %S, %S addrspace(1)* %P, i16 0, i32 0 %C = icmp eq i32 addrspace(1)* %A, %B ret i1 %C } @@ -202,8 +202,8 @@ define <2 x i1> @test13_vector_as1(<2 x i16> %X, <2 x %S addrspace(1)*> %P) { ; CHECK-NEXT: add <2 x i16> %A.idx, <i16 4, i16 4> ; CHECK-NEXT: icmp eq <2 x i16> %A.offs, zeroinitializer ; CHECK-NEXT: ret <2 x i1> - %A = getelementptr inbounds <2 x %S addrspace(1)*> %P, <2 x i16> <i16 0, i16 0>, <2 x i32> <i32 1, i32 1>, <2 x i16> %X - %B = getelementptr inbounds <2 x %S addrspace(1)*> %P, <2 x i16> <i16 0, i16 0>, <2 x i32> <i32 0, i32 0> + %A = getelementptr inbounds %S, <2 x %S addrspace(1)*> %P, <2 x i16> <i16 0, i16 0>, <2 x i32> <i32 1, i32 1>, <2 x i16> %X + %B = getelementptr inbounds %S, <2 x %S addrspace(1)*> %P, <2 x i16> <i16 0, i16 0>, <2 x i32> <i32 0, i32 0> %C = icmp eq <2 x i32 addrspace(1)*> %A, %B ret <2 x i1> %C } @@ -211,8 +211,8 @@ define <2 x i1> @test13_vector_as1(<2 x i16> %X, <2 x %S addrspace(1)*> %P) { define i1 @test13_i32(i32 %X, %S* %P) { ; CHECK-LABEL: @test13_i32( ; CHECK: %C = icmp eq i32 %X, -1 - %A = getelementptr inbounds %S* %P, i32 0, i32 1, i32 %X - %B = getelementptr inbounds %S* %P, i32 0, i32 0 + %A = getelementptr inbounds %S, %S* %P, i32 0, i32 1, i32 %X + %B = getelementptr inbounds %S, %S* %P, i32 0, i32 0 %C = icmp eq i32* %A, %B ret i1 %C } @@ -220,8 +220,8 @@ define i1 @test13_i32(i32 %X, %S* %P) { define i1 @test13_i16(i16 %X, %S* %P) { ; CHECK-LABEL: @test13_i16( ; CHECK: %C = icmp eq i16 %X, -1 - %A = getelementptr inbounds %S* %P, i16 0, i32 1, i16 %X - %B = getelementptr inbounds %S* %P, i16 0, i32 0 + %A = getelementptr inbounds %S, %S* %P, i16 0, i32 1, i16 %X + %B = getelementptr inbounds %S, %S* %P, i16 0, i32 0 %C = icmp eq i32* %A, %B ret i1 %C } @@ -229,8 +229,8 @@ define i1 @test13_i16(i16 %X, %S* %P) { define i1 @test13_i128(i128 %X, %S* %P) { ; CHECK-LABEL: @test13_i128( ; CHECK: %C = icmp eq i64 %1, -1 - %A = getelementptr inbounds %S* %P, i128 0, i32 1, i128 %X - %B = getelementptr inbounds %S* %P, i128 0, i32 0 + %A = getelementptr inbounds %S, %S* %P, i128 0, i32 1, i128 %X + %B = getelementptr inbounds %S, %S* %P, i128 0, i32 0 %C = icmp eq i32* %A, %B ret i1 %C } @@ -239,25 +239,25 @@ define i1 @test13_i128(i128 %X, %S* %P) { @G = external global [3 x i8] define i8* @test14(i32 %Idx) { %idx = zext i32 %Idx to i64 - %tmp = getelementptr i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i64 %idx + %tmp = getelementptr i8, i8* getelementptr ([3 x i8], [3 x i8]* @G, i32 0, i32 0), i64 %idx ret i8* %tmp ; CHECK-LABEL: @test14( -; CHECK: getelementptr [3 x i8]* @G, i64 0, i64 %idx +; CHECK: getelementptr [3 x i8], [3 x i8]* @G, i64 0, i64 %idx } ; Test folding of constantexpr geps into normal geps. @Array = external global [40 x i32] define i32 *@test15(i64 %X) { - %A = getelementptr i32* getelementptr ([40 x i32]* @Array, i64 0, i64 0), i64 %X + %A = getelementptr i32, i32* getelementptr ([40 x i32], [40 x i32]* @Array, i64 0, i64 0), i64 %X ret i32* %A ; CHECK-LABEL: @test15( -; CHECK: getelementptr [40 x i32]* @Array, i64 0, i64 %X +; CHECK: getelementptr [40 x i32], [40 x i32]* @Array, i64 0, i64 %X } define i32* @test16(i32* %X, i32 %Idx) { - %R = getelementptr i32* %X, i32 %Idx + %R = getelementptr i32, i32* %X, i32 %Idx ret i32* %R ; CHECK-LABEL: @test16( ; CHECK: sext i32 %Idx to i64 @@ -265,8 +265,8 @@ define i32* @test16(i32* %X, i32 %Idx) { define i1 @test17(i16* %P, i32 %I, i32 %J) { - %X = getelementptr inbounds i16* %P, i32 %I - %Y = getelementptr inbounds i16* %P, i32 %J + %X = getelementptr inbounds i16, i16* %P, i32 %I + %Y = getelementptr inbounds i16, i16* %P, i32 %J %C = icmp ult i16* %X, %Y ret i1 %C ; CHECK-LABEL: @test17( @@ -274,7 +274,7 @@ define i1 @test17(i16* %P, i32 %I, i32 %J) { } define i1 @test18(i16* %P, i32 %I) { - %X = getelementptr inbounds i16* %P, i32 %I + %X = getelementptr inbounds i16, i16* %P, i32 %I %C = icmp ult i16* %X, %P ret i1 %C ; CHECK-LABEL: @test18( @@ -287,7 +287,7 @@ define i1 @test18_as1(i16 addrspace(1)* %P, i32 %I) { ; CHECK-NEXT: %1 = trunc i32 %I to i16 ; CHECK-NEXT: %C = icmp slt i16 %1, 0 ; CHECK-NEXT: ret i1 %C - %X = getelementptr inbounds i16 addrspace(1)* %P, i32 %I + %X = getelementptr inbounds i16, i16 addrspace(1)* %P, i32 %I %C = icmp ult i16 addrspace(1)* %X, %P ret i1 %C } @@ -298,7 +298,7 @@ define i1 @test18_as1_i32(i16 addrspace(1)* %P, i32 %I) { ; CHECK-NEXT: %1 = trunc i32 %I to i16 ; CHECK-NEXT: %C = icmp slt i16 %1, 0 ; CHECK-NEXT: ret i1 %C - %X = getelementptr inbounds i16 addrspace(1)* %P, i32 %I + %X = getelementptr inbounds i16, i16 addrspace(1)* %P, i32 %I %C = icmp ult i16 addrspace(1)* %X, %P ret i1 %C } @@ -307,7 +307,7 @@ define i1 @test18_as1_i32(i16 addrspace(1)* %P, i32 %I) { define i1 @test18_i16(i16* %P, i16 %I) { ; CHECK-LABEL: @test18_i16( ; CHECK: %C = icmp slt i16 %I, 0 - %X = getelementptr inbounds i16* %P, i16 %I + %X = getelementptr inbounds i16, i16* %P, i16 %I %C = icmp ult i16* %X, %P ret i1 %C } @@ -316,7 +316,7 @@ define i1 @test18_i16(i16* %P, i16 %I) { define i1 @test18_i64(i16* %P, i64 %I) { ; CHECK-LABEL: @test18_i64( ; CHECK: %C = icmp slt i64 %I, 0 - %X = getelementptr inbounds i16* %P, i64 %I + %X = getelementptr inbounds i16, i16* %P, i64 %I %C = icmp ult i16* %X, %P ret i1 %C } @@ -325,14 +325,14 @@ define i1 @test18_i64(i16* %P, i64 %I) { define i1 @test18_i128(i16* %P, i128 %I) { ; CHECK-LABEL: @test18_i128( ; CHECK: %C = icmp slt i64 %1, 0 - %X = getelementptr inbounds i16* %P, i128 %I + %X = getelementptr inbounds i16, i16* %P, i128 %I %C = icmp ult i16* %X, %P ret i1 %C } define i32 @test19(i32* %P, i32 %A, i32 %B) { - %tmp.4 = getelementptr inbounds i32* %P, i32 %A - %tmp.9 = getelementptr inbounds i32* %P, i32 %B + %tmp.4 = getelementptr inbounds i32, i32* %P, i32 %A + %tmp.9 = getelementptr inbounds i32, i32* %P, i32 %B %tmp.10 = icmp eq i32* %tmp.4, %tmp.9 %tmp.11 = zext i1 %tmp.10 to i32 ret i32 %tmp.11 @@ -341,7 +341,7 @@ define i32 @test19(i32* %P, i32 %A, i32 %B) { } define i32 @test20(i32* %P, i32 %A, i32 %B) { - %tmp.4 = getelementptr inbounds i32* %P, i32 %A + %tmp.4 = getelementptr inbounds i32, i32* %P, i32 %A %tmp.6 = icmp eq i32* %tmp.4, %P %tmp.7 = zext i1 %tmp.6 to i32 ret i32 %tmp.7 @@ -350,7 +350,7 @@ define i32 @test20(i32* %P, i32 %A, i32 %B) { } define i32 @test20_as1(i32 addrspace(1)* %P, i32 %A, i32 %B) { - %tmp.4 = getelementptr inbounds i32 addrspace(1)* %P, i32 %A + %tmp.4 = getelementptr inbounds i32, i32 addrspace(1)* %P, i32 %A %tmp.6 = icmp eq i32 addrspace(1)* %tmp.4, %P %tmp.7 = zext i1 %tmp.6 to i32 ret i32 %tmp.7 @@ -361,12 +361,12 @@ define i32 @test20_as1(i32 addrspace(1)* %P, i32 %A, i32 %B) { define i32 @test21() { %pbob1 = alloca %intstruct - %pbob2 = getelementptr %intstruct* %pbob1 - %pbobel = getelementptr %intstruct* %pbob2, i64 0, i32 0 - %rval = load i32* %pbobel + %pbob2 = getelementptr %intstruct, %intstruct* %pbob1 + %pbobel = getelementptr %intstruct, %intstruct* %pbob2, i64 0, i32 0 + %rval = load i32, i32* %pbobel ret i32 %rval ; CHECK-LABEL: @test21( -; CHECK: getelementptr %intstruct* %pbob1, i64 0, i32 0 +; CHECK: getelementptr %intstruct, %intstruct* %pbob1, i64 0, i32 0 } @@ -374,18 +374,18 @@ define i32 @test21() { @B = global i32 2 ; <i32*> [#uses=1] define i1 @test22() { - %C = icmp ult i32* getelementptr (i32* @A, i64 1), - getelementptr (i32* @B, i64 2) + %C = icmp ult i32* getelementptr (i32, i32* @A, i64 1), + getelementptr (i32, i32* @B, i64 2) ret i1 %C ; CHECK-LABEL: @test22( -; CHECK: icmp ult (i32* getelementptr inbounds (i32* @A, i64 1), i32* getelementptr (i32* @B, i64 2)) +; CHECK: icmp ult (i32* getelementptr inbounds (i32, i32* @A, i64 1), i32* getelementptr (i32, i32* @B, i64 2)) } %X = type { [10 x i32], float } define i1 @test23() { - %A = getelementptr %X* null, i64 0, i32 0, i64 0 ; <i32*> [#uses=1] + %A = getelementptr %X, %X* null, i64 0, i32 0, i64 0 ; <i32*> [#uses=1] %B = icmp ne i32* %A, null ; <i1> [#uses=1] ret i1 %B ; CHECK-LABEL: @test23( @@ -394,9 +394,9 @@ define i1 @test23() { define void @test25() { entry: - %tmp = getelementptr { i64, i64, i64, i64 }* null, i32 0, i32 3 ; <i64*> [#uses=1] - %tmp.upgrd.1 = load i64* %tmp ; <i64> [#uses=1] - %tmp8.ui = load i64* null ; <i64> [#uses=1] + %tmp = getelementptr { i64, i64, i64, i64 }, { i64, i64, i64, i64 }* null, i32 0, i32 3 ; <i64*> [#uses=1] + %tmp.upgrd.1 = load i64, i64* %tmp ; <i64> [#uses=1] + %tmp8.ui = load i64, i64* null ; <i64> [#uses=1] %tmp8 = bitcast i64 %tmp8.ui to i64 ; <i64> [#uses=1] %tmp9 = and i64 %tmp8, %tmp.upgrd.1 ; <i64> [#uses=1] %sext = trunc i64 %tmp9 to i32 ; <i32> [#uses=1] @@ -411,8 +411,8 @@ declare void @foo25(i32, i64) ; PR1637 define i1 @test26(i8* %arr) { - %X = getelementptr i8* %arr, i32 1 - %Y = getelementptr i8* %arr, i32 1 + %X = getelementptr i8, i8* %arr, i32 1 + %Y = getelementptr i8, i8* %arr, i32 1 %test = icmp uge i8* %X, %Y ret i1 %test ; CHECK-LABEL: @test26( @@ -427,14 +427,14 @@ define i1 @test26(i8* %arr) { define i32 @test27(%struct.compat_siginfo* %to, %struct.siginfo_t* %from) { entry: %from_addr = alloca %struct.siginfo_t* - %tmp344 = load %struct.siginfo_t** %from_addr, align 8 - %tmp345 = getelementptr %struct.siginfo_t* %tmp344, i32 0, i32 3 - %tmp346 = getelementptr { { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] }* %tmp345, i32 0, i32 0 + %tmp344 = load %struct.siginfo_t*, %struct.siginfo_t** %from_addr, align 8 + %tmp345 = getelementptr %struct.siginfo_t, %struct.siginfo_t* %tmp344, i32 0, i32 3 + %tmp346 = getelementptr { { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] }, { { i32, i32, [0 x i8], %struct.sigval_t, i32 }, [88 x i8] }* %tmp345, i32 0, i32 0 %tmp346347 = bitcast { i32, i32, [0 x i8], %struct.sigval_t, i32 }* %tmp346 to { i32, i32, %struct.sigval_t }* - %tmp348 = getelementptr { i32, i32, %struct.sigval_t }* %tmp346347, i32 0, i32 2 - %tmp349 = getelementptr %struct.sigval_t* %tmp348, i32 0, i32 0 + %tmp348 = getelementptr { i32, i32, %struct.sigval_t }, { i32, i32, %struct.sigval_t }* %tmp346347, i32 0, i32 2 + %tmp349 = getelementptr %struct.sigval_t, %struct.sigval_t* %tmp348, i32 0, i32 0 %tmp349350 = bitcast i8** %tmp349 to i32* - %tmp351 = load i32* %tmp349350, align 8 + %tmp351 = load i32, i32* %tmp349350, align 8 %tmp360 = call i32 asm sideeffect "...", "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"( i32 %tmp351, %struct.__large_struct* null, i32 -14, i32 0 ) @@ -450,17 +450,17 @@ entry: define i32 @test28() nounwind { entry: %orientations = alloca [1 x [1 x %struct.x]] - %tmp3 = call i32 @puts( i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0) ) nounwind - %tmp45 = getelementptr inbounds [1 x [1 x %struct.x]]* %orientations, i32 1, i32 0, i32 0 - %orientations62 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 0, i32 0, i32 0 + %tmp3 = call i32 @puts( i8* getelementptr ([6 x i8], [6 x i8]* @.str, i32 0, i32 0) ) nounwind + %tmp45 = getelementptr inbounds [1 x [1 x %struct.x]], [1 x [1 x %struct.x]]* %orientations, i32 1, i32 0, i32 0 + %orientations62 = getelementptr [1 x [1 x %struct.x]], [1 x [1 x %struct.x]]* %orientations, i32 0, i32 0, i32 0 br label %bb10 bb10: %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb10 ] %tmp.0.reg2mem.0.rec = mul i32 %indvar, -1 %tmp12.rec = add i32 %tmp.0.reg2mem.0.rec, -1 - %tmp12 = getelementptr inbounds %struct.x* %tmp45, i32 %tmp12.rec - %tmp16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind + %tmp12 = getelementptr inbounds %struct.x, %struct.x* %tmp45, i32 %tmp12.rec + %tmp16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([12 x i8], [12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind %tmp84 = icmp eq %struct.x* %tmp12, %orientations62 %indvar.next = add i32 %indvar, 1 br i1 %tmp84, label %bb17, label %bb10 @@ -482,12 +482,12 @@ declare i32 @printf(i8*, ...) %T = type <{ i64, i64, i64 }> define i32 @test29(i8* %start, i32 %X) nounwind { entry: - %tmp3 = load i64* null - %add.ptr = getelementptr i8* %start, i64 %tmp3 - %tmp158 = load i32* null - %add.ptr159 = getelementptr %T* null, i32 %tmp158 - %add.ptr209 = getelementptr i8* %start, i64 0 - %add.ptr212 = getelementptr i8* %add.ptr209, i32 %X + %tmp3 = load i64, i64* null + %add.ptr = getelementptr i8, i8* %start, i64 %tmp3 + %tmp158 = load i32, i32* null + %add.ptr159 = getelementptr %T, %T* null, i32 %tmp158 + %add.ptr209 = getelementptr i8, i8* %start, i64 0 + %add.ptr212 = getelementptr i8, i8* %add.ptr209, i32 %X %cmp214 = icmp ugt i8* %add.ptr212, %add.ptr br i1 %cmp214, label %if.then216, label %if.end363 @@ -506,8 +506,8 @@ entry: %0 = alloca i32, i32 %n, align 4 %1 = bitcast i32* %0 to [0 x i32]* call void @test30f(i32* %0) nounwind - %2 = getelementptr [0 x i32]* %1, i32 0, i32 %m - %3 = load i32* %2, align 4 + %2 = getelementptr [0 x i32], [0 x i32]* %1, i32 0, i32 %m + %3 = load i32, i32* %2, align 4 ret i32 %3 ; CHECK-LABEL: @test30( ; CHECK: getelementptr i32 @@ -518,8 +518,8 @@ declare void @test30f(i32*) define i1 @test31(i32* %A) { - %B = getelementptr i32* %A, i32 1 - %C = getelementptr i32* %A, i64 1 + %B = getelementptr i32, i32* %A, i32 1 + %C = getelementptr i32, i32* %A, i64 1 %V = icmp eq i32* %B, %C ret i1 %V ; CHECK-LABEL: @test31( @@ -530,18 +530,18 @@ define i1 @test31(i32* %A) { ; PR1345 define i8* @test32(i8* %v) { %A = alloca [4 x i8*], align 16 - %B = getelementptr [4 x i8*]* %A, i32 0, i32 0 + %B = getelementptr [4 x i8*], [4 x i8*]* %A, i32 0, i32 0 store i8* null, i8** %B %C = bitcast [4 x i8*]* %A to { [16 x i8] }* - %D = getelementptr { [16 x i8] }* %C, i32 0, i32 0, i32 8 + %D = getelementptr { [16 x i8] }, { [16 x i8] }* %C, i32 0, i32 0, i32 8 %E = bitcast i8* %D to i8** store i8* %v, i8** %E - %F = getelementptr [4 x i8*]* %A, i32 0, i32 2 - %G = load i8** %F + %F = getelementptr [4 x i8*], [4 x i8*]* %A, i32 0, i32 2 + %G = load i8*, i8** %F ret i8* %G ; CHECK-LABEL: @test32( -; CHECK: %D = getelementptr [4 x i8*]* %A, i64 0, i64 1 -; CHECK: %F = getelementptr [4 x i8*]* %A, i64 0, i64 2 +; CHECK: %D = getelementptr [4 x i8*], [4 x i8*]* %A, i64 0, i64 1 +; CHECK: %F = getelementptr [4 x i8*], [4 x i8*]* %A, i64 0, i64 2 } ; PR3290 @@ -550,44 +550,44 @@ define i8* @test32(i8* %v) { define i32* @test33(%struct.Key* %A) { ; CHECK-LABEL: @test33( -; CHECK: getelementptr %struct.Key* %A, i64 0, i32 0, i32 1 +; CHECK: getelementptr %struct.Key, %struct.Key* %A, i64 0, i32 0, i32 1 %B = bitcast %struct.Key* %A to %struct.anon* - %C = getelementptr %struct.anon* %B, i32 0, i32 2 + %C = getelementptr %struct.anon, %struct.anon* %B, i32 0, i32 2 ret i32* %C } define i32 addrspace(1)* @test33_as1(%struct.Key addrspace(1)* %A) { ; CHECK-LABEL: @test33_as1( -; CHECK: getelementptr %struct.Key addrspace(1)* %A, i16 0, i32 0, i32 1 +; CHECK: getelementptr %struct.Key, %struct.Key addrspace(1)* %A, i16 0, i32 0, i32 1 %B = bitcast %struct.Key addrspace(1)* %A to %struct.anon addrspace(1)* - %C = getelementptr %struct.anon addrspace(1)* %B, i32 0, i32 2 + %C = getelementptr %struct.anon, %struct.anon addrspace(1)* %B, i32 0, i32 2 ret i32 addrspace(1)* %C } define i32 addrspace(1)* @test33_array_as1([10 x i32] addrspace(1)* %A) { ; CHECK-LABEL: @test33_array_as1( -; CHECK: getelementptr [10 x i32] addrspace(1)* %A, i16 0, i16 2 +; CHECK: getelementptr [10 x i32], [10 x i32] addrspace(1)* %A, i16 0, i16 2 %B = bitcast [10 x i32] addrspace(1)* %A to [5 x i32] addrspace(1)* - %C = getelementptr [5 x i32] addrspace(1)* %B, i32 0, i32 2 + %C = getelementptr [5 x i32], [5 x i32] addrspace(1)* %B, i32 0, i32 2 ret i32 addrspace(1)* %C } ; Make sure the GEP indices use the right pointer sized integer define i32 addrspace(1)* @test33_array_struct_as1([10 x %struct.Key] addrspace(1)* %A) { ; CHECK-LABEL: @test33_array_struct_as1( -; CHECK: getelementptr [10 x %struct.Key] addrspace(1)* %A, i16 0, i16 1, i32 0, i32 0 +; CHECK: getelementptr [10 x %struct.Key], [10 x %struct.Key] addrspace(1)* %A, i16 0, i16 1, i32 0, i32 0 %B = bitcast [10 x %struct.Key] addrspace(1)* %A to [20 x i32] addrspace(1)* - %C = getelementptr [20 x i32] addrspace(1)* %B, i32 0, i32 2 + %C = getelementptr [20 x i32], [20 x i32] addrspace(1)* %B, i32 0, i32 2 ret i32 addrspace(1)* %C } define i32 addrspace(1)* @test33_addrspacecast(%struct.Key* %A) { ; CHECK-LABEL: @test33_addrspacecast( -; CHECK: %C = getelementptr %struct.Key* %A, i64 0, i32 0, i32 1 +; CHECK: %C = getelementptr %struct.Key, %struct.Key* %A, i64 0, i32 0, i32 1 ; CHECK-NEXT: addrspacecast i32* %C to i32 addrspace(1)* ; CHECK-NEXT: ret %B = addrspacecast %struct.Key* %A to %struct.anon addrspace(1)* - %C = getelementptr %struct.anon addrspace(1)* %B, i32 0, i32 2 + %C = getelementptr %struct.anon, %struct.anon addrspace(1)* %B, i32 0, i32 2 ret i32 addrspace(1)* %C } @@ -596,10 +596,10 @@ define i8* @test34(i8* %Val, i64 %V) nounwind { entry: %A = alloca %T2, align 8 %mrv_gep = bitcast %T2* %A to i64* - %B = getelementptr %T2* %A, i64 0, i32 0 + %B = getelementptr %T2, %T2* %A, i64 0, i32 0 store i64 %V, i64* %mrv_gep - %C = load i8** %B, align 8 + %C = load i8*, i8** %B, align 8 ret i8* %C ; CHECK-LABEL: @test34( ; CHECK: %[[C:.*]] = inttoptr i64 %V to i8* @@ -617,11 +617,11 @@ entry: ; Instcombine should be able to fold this getelementptr. define i32 @test35() nounwind { - call i32 (i8*, ...)* @printf(i8* getelementptr ([17 x i8]* @"\01LC8", i32 0, i32 0), - i8* getelementptr (%t1* bitcast (%t0* @s to %t1*), i32 0, i32 1, i32 0)) nounwind + call i32 (i8*, ...)* @printf(i8* getelementptr ([17 x i8], [17 x i8]* @"\01LC8", i32 0, i32 0), + i8* getelementptr (%t1, %t1* bitcast (%t0* @s to %t1*), i32 0, i32 1, i32 0)) nounwind ret i32 0 ; CHECK-LABEL: @test35( -; CHECK: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @"\01LC8", i64 0, i64 0), i8* getelementptr inbounds (%t0* @s, i64 0, i32 1, i64 0)) [[NUW:#[0-9]+]] +; CHECK: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @"\01LC8", i64 0, i64 0), i8* getelementptr inbounds (%t0, %t0* @s, i64 0, i32 1, i64 0)) [[NUW:#[0-9]+]] } ; Instcombine should constant-fold the GEP so that indices that have @@ -630,9 +630,9 @@ define i32 @test35() nounwind { ; the same address is computed, but 3 is in the range of [0,11). define i8* @test36() nounwind { - ret i8* getelementptr ([11 x i8]* @array, i32 0, i64 -1) + ret i8* getelementptr ([11 x i8], [11 x i8]* @array, i32 0, i64 -1) ; CHECK-LABEL: @test36( -; CHECK: ret i8* getelementptr ([11 x i8]* @array, i64 1676976733973595601, i64 4) +; CHECK: ret i8* getelementptr ([11 x i8], [11 x i8]* @array, i64 1676976733973595601, i64 4) } ; Instcombine shouldn't assume that gep(A,0,1) != gep(A,1,0). @@ -640,18 +640,18 @@ define i8* @test36() nounwind { define i1 @test37() nounwind { ; CHECK-LABEL: @test37( ; CHECK: ret i1 true - %t = icmp eq i8* getelementptr ([1 x i8]* @A37, i64 0, i64 1), - getelementptr ([1 x i8]* @A37, i64 1, i64 0) + %t = icmp eq i8* getelementptr ([1 x i8], [1 x i8]* @A37, i64 0, i64 1), + getelementptr ([1 x i8], [1 x i8]* @A37, i64 1, i64 0) ret i1 %t } ; Test index promotion define i32* @test38(i32* %I, i32 %n) { - %A = getelementptr i32* %I, i32 %n + %A = getelementptr i32, i32* %I, i32 %n ret i32* %A ; CHECK-LABEL: @test38( ; CHECK: = sext i32 %n to i64 -; CHECK: %A = getelementptr i32* %I, i64 % +; CHECK: %A = getelementptr i32, i32* %I, i64 % } ; Test that we don't duplicate work when the second gep is a "bitcast". @@ -660,14 +660,14 @@ declare void @pr10322_f2(%pr10322_t*) declare void @pr10322_f3(i8**) define void @pr10322_f1(%pr10322_t* %foo) { entry: - %arrayidx8 = getelementptr inbounds %pr10322_t* %foo, i64 2 + %arrayidx8 = getelementptr inbounds %pr10322_t, %pr10322_t* %foo, i64 2 call void @pr10322_f2(%pr10322_t* %arrayidx8) nounwind - %tmp2 = getelementptr inbounds %pr10322_t* %arrayidx8, i64 0, i32 0 + %tmp2 = getelementptr inbounds %pr10322_t, %pr10322_t* %arrayidx8, i64 0, i32 0 call void @pr10322_f3(i8** %tmp2) nounwind ret void ; CHECK-LABEL: @pr10322_f1( -; CHECK: %tmp2 = getelementptr inbounds %pr10322_t* %arrayidx8, i64 0, i32 0 +; CHECK: %tmp2 = getelementptr inbounds %pr10322_t, %pr10322_t* %arrayidx8, i64 0, i32 0 } ; Test that we combine the last two geps in this sequence, before we @@ -676,14 +676,14 @@ entry: %three_gep_t2 = type {%three_gep_t} define void @three_gep_f(%three_gep_t2* %x) { - %gep1 = getelementptr %three_gep_t2* %x, i64 2 + %gep1 = getelementptr %three_gep_t2, %three_gep_t2* %x, i64 2 call void @three_gep_h(%three_gep_t2* %gep1) - %gep2 = getelementptr %three_gep_t2* %gep1, i64 0, i32 0 - %gep3 = getelementptr %three_gep_t* %gep2, i64 0, i32 0 + %gep2 = getelementptr %three_gep_t2, %three_gep_t2* %gep1, i64 0, i32 0 + %gep3 = getelementptr %three_gep_t, %three_gep_t* %gep2, i64 0, i32 0 call void @three_gep_g(i32* %gep3) ; CHECK-LABEL: @three_gep_f( -; CHECK: %gep3 = getelementptr %three_gep_t2* %gep1, i64 0, i32 0, i32 0 +; CHECK: %gep3 = getelementptr %three_gep_t2, %three_gep_t2* %gep1, i64 0, i32 0, i32 0 ret void } @@ -694,21 +694,21 @@ declare void @three_gep_h(%three_gep_t2*) %struct.zot = type { i64, i8 } define void @test39(%struct.ham* %arg, i8 %arg1) nounwind { - %tmp = getelementptr inbounds %struct.ham* %arg, i64 0, i32 2 - %tmp2 = load %struct.zot** %tmp, align 8 + %tmp = getelementptr inbounds %struct.ham, %struct.ham* %arg, i64 0, i32 2 + %tmp2 = load %struct.zot*, %struct.zot** %tmp, align 8 %tmp3 = bitcast %struct.zot* %tmp2 to i8* - %tmp4 = getelementptr inbounds i8* %tmp3, i64 -8 + %tmp4 = getelementptr inbounds i8, i8* %tmp3, i64 -8 store i8 %arg1, i8* %tmp4, align 8 ret void ; CHECK-LABEL: @test39( -; CHECK: getelementptr inbounds %struct.ham* %arg, i64 0, i32 2 -; CHECK: getelementptr inbounds i8* %{{.+}}, i64 -8 +; CHECK: getelementptr inbounds %struct.ham, %struct.ham* %arg, i64 0, i32 2 +; CHECK: getelementptr inbounds i8, i8* %{{.+}}, i64 -8 } define i1 @pr16483([1 x i8]* %a, [1 x i8]* %b) { - %c = getelementptr [1 x i8]* %a, i32 0, i32 0 - %d = getelementptr [1 x i8]* %b, i32 0, i32 0 + %c = getelementptr [1 x i8], [1 x i8]* %a, i32 0, i32 0 + %d = getelementptr [1 x i8], [1 x i8]* %b, i32 0, i32 0 %cmp = icmp ult i8* %c, %d ret i1 %cmp @@ -718,82 +718,82 @@ define i1 @pr16483([1 x i8]* %a, [1 x i8]* %b) { define i8 @test_gep_bitcast_as1(i32 addrspace(1)* %arr, i16 %N) { ; CHECK-LABEL: @test_gep_bitcast_as1( -; CHECK: getelementptr i32 addrspace(1)* %arr, i16 %N +; CHECK: getelementptr i32, i32 addrspace(1)* %arr, i16 %N ; CHECK: bitcast %cast = bitcast i32 addrspace(1)* %arr to i8 addrspace(1)* %V = mul i16 %N, 4 - %t = getelementptr i8 addrspace(1)* %cast, i16 %V - %x = load i8 addrspace(1)* %t + %t = getelementptr i8, i8 addrspace(1)* %cast, i16 %V + %x = load i8, i8 addrspace(1)* %t ret i8 %x } ; The element size of the array matches the element size of the pointer define i64 @test_gep_bitcast_array_same_size_element([100 x double]* %arr, i64 %N) { ; CHECK-LABEL: @test_gep_bitcast_array_same_size_element( -; CHECK: getelementptr [100 x double]* %arr, i64 0, i64 %V +; CHECK: getelementptr [100 x double], [100 x double]* %arr, i64 0, i64 %V ; CHECK: bitcast %cast = bitcast [100 x double]* %arr to i64* %V = mul i64 %N, 8 - %t = getelementptr i64* %cast, i64 %V - %x = load i64* %t + %t = getelementptr i64, i64* %cast, i64 %V + %x = load i64, i64* %t ret i64 %x } ; gep should be done in the original address space. define i64 @test_gep_bitcast_array_same_size_element_addrspacecast([100 x double]* %arr, i64 %N) { ; CHECK-LABEL: @test_gep_bitcast_array_same_size_element_addrspacecast( -; CHECK: getelementptr [100 x double]* %arr, i64 0, i64 %V +; CHECK: getelementptr [100 x double], [100 x double]* %arr, i64 0, i64 %V ; CHECK-NEXT: bitcast double* ; CHECK-NEXT: %t = addrspacecast i64* -; CHECK: load i64 addrspace(3)* %t +; CHECK: load i64, i64 addrspace(3)* %t %cast = addrspacecast [100 x double]* %arr to i64 addrspace(3)* %V = mul i64 %N, 8 - %t = getelementptr i64 addrspace(3)* %cast, i64 %V - %x = load i64 addrspace(3)* %t + %t = getelementptr i64, i64 addrspace(3)* %cast, i64 %V + %x = load i64, i64 addrspace(3)* %t ret i64 %x } ; The element size of the array is different the element size of the pointer define i8 @test_gep_bitcast_array_different_size_element([100 x double]* %arr, i64 %N) { ; CHECK-LABEL: @test_gep_bitcast_array_different_size_element( -; CHECK: getelementptr [100 x double]* %arr, i64 0, i64 %N +; CHECK: getelementptr [100 x double], [100 x double]* %arr, i64 0, i64 %N ; CHECK: bitcast %cast = bitcast [100 x double]* %arr to i8* %V = mul i64 %N, 8 - %t = getelementptr i8* %cast, i64 %V - %x = load i8* %t + %t = getelementptr i8, i8* %cast, i64 %V + %x = load i8, i8* %t ret i8 %x } define i64 @test_gep_bitcast_array_same_size_element_as1([100 x double] addrspace(1)* %arr, i16 %N) { ; CHECK-LABEL: @test_gep_bitcast_array_same_size_element_as1( -; CHECK: getelementptr [100 x double] addrspace(1)* %arr, i16 0, i16 %V +; CHECK: getelementptr [100 x double], [100 x double] addrspace(1)* %arr, i16 0, i16 %V ; CHECK: bitcast %cast = bitcast [100 x double] addrspace(1)* %arr to i64 addrspace(1)* %V = mul i16 %N, 8 - %t = getelementptr i64 addrspace(1)* %cast, i16 %V - %x = load i64 addrspace(1)* %t + %t = getelementptr i64, i64 addrspace(1)* %cast, i16 %V + %x = load i64, i64 addrspace(1)* %t ret i64 %x } define i8 @test_gep_bitcast_array_different_size_element_as1([100 x double] addrspace(1)* %arr, i16 %N) { ; CHECK-LABEL: @test_gep_bitcast_array_different_size_element_as1( -; CHECK: getelementptr [100 x double] addrspace(1)* %arr, i16 0, i16 %N +; CHECK: getelementptr [100 x double], [100 x double] addrspace(1)* %arr, i16 0, i16 %N ; CHECK: bitcast %cast = bitcast [100 x double] addrspace(1)* %arr to i8 addrspace(1)* %V = mul i16 %N, 8 - %t = getelementptr i8 addrspace(1)* %cast, i16 %V - %x = load i8 addrspace(1)* %t + %t = getelementptr i8, i8 addrspace(1)* %cast, i16 %V + %x = load i8, i8 addrspace(1)* %t ret i8 %x } define i64 @test40() { %array = alloca [3 x i32], align 4 - %gep = getelementptr inbounds [3 x i32]* %array, i64 0, i64 2 + %gep = getelementptr inbounds [3 x i32], [3 x i32]* %array, i64 0, i64 2 %gepi8 = bitcast i32* %gep to i8* %p = ptrtoint [3 x i32]* %array to i64 %np = sub i64 0, %p - %gep2 = getelementptr i8* %gepi8, i64 %np + %gep2 = getelementptr i8, i8* %gepi8, i64 %np %ret = ptrtoint i8* %gep2 to i64 ret i64 %ret @@ -802,11 +802,11 @@ define i64 @test40() { } define i16 @test41([3 x i32] addrspace(1)* %array) { - %gep = getelementptr inbounds [3 x i32] addrspace(1)* %array, i16 0, i16 2 + %gep = getelementptr inbounds [3 x i32], [3 x i32] addrspace(1)* %array, i16 0, i16 2 %gepi8 = bitcast i32 addrspace(1)* %gep to i8 addrspace(1)* %p = ptrtoint [3 x i32] addrspace(1)* %array to i16 %np = sub i16 0, %p - %gep2 = getelementptr i8 addrspace(1)* %gepi8, i16 %np + %gep2 = getelementptr i8, i8 addrspace(1)* %gepi8, i16 %np %ret = ptrtoint i8 addrspace(1)* %gep2 to i16 ret i16 %ret @@ -817,7 +817,7 @@ define i16 @test41([3 x i32] addrspace(1)* %array) { define i8* @test42(i8* %c1, i8* %c2) { %ptrtoint = ptrtoint i8* %c1 to i64 %sub = sub i64 0, %ptrtoint - %gep = getelementptr inbounds i8* %c2, i64 %sub + %gep = getelementptr inbounds i8, i8* %c2, i64 %sub ret i8* %gep ; CHECK-LABEL: @test42( @@ -832,7 +832,7 @@ define i16* @test43(i16* %c1, i16* %c2) { %ptrtoint = ptrtoint i16* %c1 to i64 %sub = sub i64 0, %ptrtoint %shr = ashr i64 %sub, 1 - %gep = getelementptr inbounds i16* %c2, i64 %shr + %gep = getelementptr inbounds i16, i16* %c2, i64 %shr ret i16* %gep ; CHECK-LABEL: @test43( @@ -847,7 +847,7 @@ define %struct.C* @test44(%struct.C* %c1, %struct.C* %c2) { %ptrtoint = ptrtoint %struct.C* %c1 to i64 %sub = sub i64 0, %ptrtoint %shr = sdiv i64 %sub, 7 - %gep = getelementptr inbounds %struct.C* %c2, i64 %shr + %gep = getelementptr inbounds %struct.C, %struct.C* %c2, i64 %shr ret %struct.C* %gep ; CHECK-LABEL: @test44( @@ -863,7 +863,7 @@ define %struct.C* @test45(%struct.C* %c1, %struct.C** %c2) { %ptrtoint2 = ptrtoint %struct.C** %c2 to i64 %sub = sub i64 %ptrtoint2, %ptrtoint1 ; C2 - C1 %shr = sdiv i64 %sub, 7 - %gep = getelementptr inbounds %struct.C* %c1, i64 %shr ; C1 + (C2 - C1) + %gep = getelementptr inbounds %struct.C, %struct.C* %c1, i64 %shr ; C1 + (C2 - C1) ret %struct.C* %gep ; CHECK-LABEL: @test45( @@ -875,14 +875,14 @@ define %struct.C* @test46(%struct.C* %c1, %struct.C* %c2, i64 %N) { %ptrtoint = ptrtoint %struct.C* %c1 to i64 %sub = sub i64 0, %ptrtoint %sdiv = sdiv i64 %sub, %N - %gep = getelementptr inbounds %struct.C* %c2, i64 %sdiv + %gep = getelementptr inbounds %struct.C, %struct.C* %c2, i64 %sdiv ret %struct.C* %gep ; CHECK-LABEL: @test46( ; CHECK-NEXT: [[PTRTOINT:%.*]] = ptrtoint %struct.C* %c1 to i64 ; CHECK-NEXT: [[SUB:%.*]] = sub i64 0, [[PTRTOINT]] ; CHECK-NEXT: [[SDIV:%.*]] = sdiv i64 [[SUB]], %N -; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds %struct.C* %c2, i64 %sdiv +; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds %struct.C, %struct.C* %c2, i64 %sdiv ; CHECK-NEXT: ret %struct.C* [[GEP]] } @@ -890,7 +890,7 @@ define i32 addrspace(1)* @ascast_0_gep(i32* %p) nounwind { ; CHECK-LABEL: @ascast_0_gep( ; CHECK-NOT: getelementptr ; CHECK: ret - %gep = getelementptr i32* %p, i32 0 + %gep = getelementptr i32, i32* %p, i32 0 %x = addrspacecast i32* %gep to i32 addrspace(1)* ret i32 addrspace(1)* %x } @@ -902,7 +902,7 @@ define i32 addrspace(1)* @ascast_0_0_gep([128 x i32]* %p) nounwind { ; CHECK-NEXT: getelementptr [128 x i32] ; CHECK-NEXT: addrspacecast i32* ; CHECK-NEXT: ret i32 addrspace(1)* - %gep = getelementptr [128 x i32]* %p, i32 0, i32 0 + %gep = getelementptr [128 x i32], [128 x i32]* %p, i32 0, i32 0 %x = addrspacecast i32* %gep to i32 addrspace(1)* ret i32 addrspace(1)* %x } diff --git a/test/Transforms/InstCombine/icmp-range.ll b/test/Transforms/InstCombine/icmp-range.ll index 0911ab0..041adf7 100644 --- a/test/Transforms/InstCombine/icmp-range.ll +++ b/test/Transforms/InstCombine/icmp-range.ll @@ -6,14 +6,14 @@ define i1 @test_nonzero(i32* nocapture readonly %arg) { ; CHECK-LABEL:test_nonzero ; CHECK: ret i1 true - %val = load i32* %arg, !range !0 + %val = load i32, i32* %arg, !range !0 %rval = icmp ne i32 %val, 0 ret i1 %rval } define i1 @test_nonzero2(i32* nocapture readonly %arg) { ; CHECK-LABEL:test_nonzero2 ; CHECK: ret i1 false - %val = load i32* %arg, !range !0 + %val = load i32, i32* %arg, !range !0 %rval = icmp eq i32 %val, 0 ret i1 %rval } @@ -23,7 +23,7 @@ define i1 @test_nonzero3(i32* nocapture readonly %arg) { ; CHECK-LABEL: test_nonzero3 ; Check that this does not trigger - it wouldn't be legal ; CHECK: icmp - %val = load i32* %arg, !range !1 + %val = load i32, i32* %arg, !range !1 %rval = icmp ne i32 %val, 0 ret i1 %rval } @@ -32,7 +32,7 @@ define i1 @test_nonzero3(i32* nocapture readonly %arg) { define i1 @test_nonzero4(i8* nocapture readonly %arg) { ; CHECK-LABEL: test_nonzero4 ; CHECK: ret i1 false - %val = load i8* %arg, !range !2 + %val = load i8, i8* %arg, !range !2 %rval = icmp ne i8 %val, 0 ret i1 %rval } @@ -40,7 +40,7 @@ define i1 @test_nonzero4(i8* nocapture readonly %arg) { define i1 @test_nonzero5(i8* nocapture readonly %arg) { ; CHECK-LABEL: test_nonzero5 ; CHECK: ret i1 false - %val = load i8* %arg, !range !2 + %val = load i8, i8* %arg, !range !2 %rval = icmp ugt i8 %val, 0 ret i1 %rval } @@ -49,7 +49,7 @@ define i1 @test_nonzero5(i8* nocapture readonly %arg) { define i1 @test_nonzero6(i8* %argw) { ; CHECK-LABEL: test_nonzero6 ; CHECK: icmp ne i8 %val, 0 - %val = load i8* %argw, !range !3 + %val = load i8, i8* %argw, !range !3 %rval = icmp sgt i8 %val, 0 ret i1 %rval } diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index 64741c5..edcf76d 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -244,8 +244,8 @@ define i1 @test23(i32 %x) nounwind { ; CHECK: %cmp = icmp eq i64 %i, 1000 ; CHECK: ret i1 %cmp define i1 @test24(i64 %i) { - %p1 = getelementptr inbounds i32* getelementptr inbounds ([1000 x i32]* @X, i64 0, i64 0), i64 %i - %cmp = icmp eq i32* %p1, getelementptr inbounds ([1000 x i32]* @X, i64 1, i64 0) + %p1 = getelementptr inbounds i32, i32* getelementptr inbounds ([1000 x i32], [1000 x i32]* @X, i64 0, i64 0), i64 %i + %cmp = icmp eq i32* %p1, getelementptr inbounds ([1000 x i32], [1000 x i32]* @X, i64 1, i64 0) ret i1 %cmp } @@ -256,8 +256,8 @@ define i1 @test24(i64 %i) { ; CHECK: %cmp = icmp eq i16 %1, 1000 ; CHECK: ret i1 %cmp define i1 @test24_as1(i64 %i) { - %p1 = getelementptr inbounds i32 addrspace(1)* getelementptr inbounds ([1000 x i32] addrspace(1)* @X_as1, i64 0, i64 0), i64 %i - %cmp = icmp eq i32 addrspace(1)* %p1, getelementptr inbounds ([1000 x i32] addrspace(1)* @X_as1, i64 1, i64 0) + %p1 = getelementptr inbounds i32, i32 addrspace(1)* getelementptr inbounds ([1000 x i32], [1000 x i32] addrspace(1)* @X_as1, i64 0, i64 0), i64 %i + %cmp = icmp eq i32 addrspace(1)* %p1, getelementptr inbounds ([1000 x i32], [1000 x i32] addrspace(1)* @X_as1, i64 1, i64 0) ret i1 %cmp } @@ -619,8 +619,8 @@ declare i32 @test58_d(i64) define i1 @test59(i8* %foo) { %bit = bitcast i8* %foo to i32* - %gep1 = getelementptr inbounds i32* %bit, i64 2 - %gep2 = getelementptr inbounds i8* %foo, i64 10 + %gep1 = getelementptr inbounds i32, i32* %bit, i64 2 + %gep2 = getelementptr inbounds i8, i8* %foo, i64 10 %cast1 = bitcast i32* %gep1 to i8* %cmp = icmp ult i8* %cast1, %gep2 %use = ptrtoint i8* %cast1 to i64 @@ -632,23 +632,23 @@ define i1 @test59(i8* %foo) { define i1 @test59_as1(i8 addrspace(1)* %foo) { %bit = bitcast i8 addrspace(1)* %foo to i32 addrspace(1)* - %gep1 = getelementptr inbounds i32 addrspace(1)* %bit, i64 2 - %gep2 = getelementptr inbounds i8 addrspace(1)* %foo, i64 10 + %gep1 = getelementptr inbounds i32, i32 addrspace(1)* %bit, i64 2 + %gep2 = getelementptr inbounds i8, i8 addrspace(1)* %foo, i64 10 %cast1 = bitcast i32 addrspace(1)* %gep1 to i8 addrspace(1)* %cmp = icmp ult i8 addrspace(1)* %cast1, %gep2 %use = ptrtoint i8 addrspace(1)* %cast1 to i64 %call = call i32 @test58_d(i64 %use) nounwind ret i1 %cmp ; CHECK: @test59_as1 -; CHECK: %[[GEP:.+]] = getelementptr inbounds i8 addrspace(1)* %foo, i16 8 +; CHECK: %[[GEP:.+]] = getelementptr inbounds i8, i8 addrspace(1)* %foo, i16 8 ; CHECK: ptrtoint i8 addrspace(1)* %[[GEP]] to i16 ; CHECK: ret i1 true } define i1 @test60(i8* %foo, i64 %i, i64 %j) { %bit = bitcast i8* %foo to i32* - %gep1 = getelementptr inbounds i32* %bit, i64 %i - %gep2 = getelementptr inbounds i8* %foo, i64 %j + %gep1 = getelementptr inbounds i32, i32* %bit, i64 %i + %gep2 = getelementptr inbounds i8, i8* %foo, i64 %j %cast1 = bitcast i32* %gep1 to i8* %cmp = icmp ult i8* %cast1, %gep2 ret i1 %cmp @@ -660,8 +660,8 @@ define i1 @test60(i8* %foo, i64 %i, i64 %j) { define i1 @test60_as1(i8 addrspace(1)* %foo, i64 %i, i64 %j) { %bit = bitcast i8 addrspace(1)* %foo to i32 addrspace(1)* - %gep1 = getelementptr inbounds i32 addrspace(1)* %bit, i64 %i - %gep2 = getelementptr inbounds i8 addrspace(1)* %foo, i64 %j + %gep1 = getelementptr inbounds i32, i32 addrspace(1)* %bit, i64 %i + %gep2 = getelementptr inbounds i8, i8 addrspace(1)* %foo, i64 %j %cast1 = bitcast i32 addrspace(1)* %gep1 to i8 addrspace(1)* %cmp = icmp ult i8 addrspace(1)* %cast1, %gep2 ret i1 %cmp @@ -677,8 +677,8 @@ define i1 @test60_as1(i8 addrspace(1)* %foo, i64 %i, i64 %j) { ; bitcast. This uses the same sized addrspace. define i1 @test60_addrspacecast(i8* %foo, i64 %i, i64 %j) { %bit = addrspacecast i8* %foo to i32 addrspace(3)* - %gep1 = getelementptr inbounds i32 addrspace(3)* %bit, i64 %i - %gep2 = getelementptr inbounds i8* %foo, i64 %j + %gep1 = getelementptr inbounds i32, i32 addrspace(3)* %bit, i64 %i + %gep2 = getelementptr inbounds i8, i8* %foo, i64 %j %cast1 = addrspacecast i32 addrspace(3)* %gep1 to i8* %cmp = icmp ult i8* %cast1, %gep2 ret i1 %cmp @@ -690,8 +690,8 @@ define i1 @test60_addrspacecast(i8* %foo, i64 %i, i64 %j) { define i1 @test60_addrspacecast_smaller(i8* %foo, i16 %i, i64 %j) { %bit = addrspacecast i8* %foo to i32 addrspace(1)* - %gep1 = getelementptr inbounds i32 addrspace(1)* %bit, i16 %i - %gep2 = getelementptr inbounds i8* %foo, i64 %j + %gep1 = getelementptr inbounds i32, i32 addrspace(1)* %bit, i16 %i + %gep2 = getelementptr inbounds i8, i8* %foo, i64 %j %cast1 = addrspacecast i32 addrspace(1)* %gep1 to i8* %cmp = icmp ult i8* %cast1, %gep2 ret i1 %cmp @@ -704,8 +704,8 @@ define i1 @test60_addrspacecast_smaller(i8* %foo, i16 %i, i64 %j) { define i1 @test60_addrspacecast_larger(i8 addrspace(1)* %foo, i32 %i, i16 %j) { %bit = addrspacecast i8 addrspace(1)* %foo to i32 addrspace(2)* - %gep1 = getelementptr inbounds i32 addrspace(2)* %bit, i32 %i - %gep2 = getelementptr inbounds i8 addrspace(1)* %foo, i16 %j + %gep1 = getelementptr inbounds i32, i32 addrspace(2)* %bit, i32 %i + %gep2 = getelementptr inbounds i8, i8 addrspace(1)* %foo, i16 %j %cast1 = addrspacecast i32 addrspace(2)* %gep1 to i8 addrspace(1)* %cmp = icmp ult i8 addrspace(1)* %cast1, %gep2 ret i1 %cmp @@ -718,8 +718,8 @@ define i1 @test60_addrspacecast_larger(i8 addrspace(1)* %foo, i32 %i, i16 %j) { define i1 @test61(i8* %foo, i64 %i, i64 %j) { %bit = bitcast i8* %foo to i32* - %gep1 = getelementptr i32* %bit, i64 %i - %gep2 = getelementptr i8* %foo, i64 %j + %gep1 = getelementptr i32, i32* %bit, i64 %i + %gep2 = getelementptr i8, i8* %foo, i64 %j %cast1 = bitcast i32* %gep1 to i8* %cmp = icmp ult i8* %cast1, %gep2 ret i1 %cmp @@ -731,8 +731,8 @@ define i1 @test61(i8* %foo, i64 %i, i64 %j) { define i1 @test61_as1(i8 addrspace(1)* %foo, i16 %i, i16 %j) { %bit = bitcast i8 addrspace(1)* %foo to i32 addrspace(1)* - %gep1 = getelementptr i32 addrspace(1)* %bit, i16 %i - %gep2 = getelementptr i8 addrspace(1)* %foo, i16 %j + %gep1 = getelementptr i32, i32 addrspace(1)* %bit, i16 %i + %gep2 = getelementptr i8, i8 addrspace(1)* %foo, i16 %j %cast1 = bitcast i32 addrspace(1)* %gep1 to i8 addrspace(1)* %cmp = icmp ult i8 addrspace(1)* %cast1, %gep2 ret i1 %cmp @@ -743,8 +743,8 @@ define i1 @test61_as1(i8 addrspace(1)* %foo, i16 %i, i16 %j) { } define i1 @test62(i8* %a) { - %arrayidx1 = getelementptr inbounds i8* %a, i64 1 - %arrayidx2 = getelementptr inbounds i8* %a, i64 10 + %arrayidx1 = getelementptr inbounds i8, i8* %a, i64 1 + %arrayidx2 = getelementptr inbounds i8, i8* %a, i64 10 %cmp = icmp slt i8* %arrayidx1, %arrayidx2 ret i1 %cmp ; CHECK-LABEL: @test62( @@ -754,8 +754,8 @@ define i1 @test62(i8* %a) { define i1 @test62_as1(i8 addrspace(1)* %a) { ; CHECK-LABEL: @test62_as1( ; CHECK-NEXT: ret i1 true - %arrayidx1 = getelementptr inbounds i8 addrspace(1)* %a, i64 1 - %arrayidx2 = getelementptr inbounds i8 addrspace(1)* %a, i64 10 + %arrayidx1 = getelementptr inbounds i8, i8 addrspace(1)* %a, i64 1 + %arrayidx2 = getelementptr inbounds i8, i8 addrspace(1)* %a, i64 10 %cmp = icmp slt i8 addrspace(1)* %arrayidx1, %arrayidx2 ret i1 %cmp } @@ -1115,8 +1115,8 @@ define i1 @icmp_add_and_shr_ne_0(i32 %X) { ; CHECK-LABEL: define i1 @test71( ; CHECK-NEXT: ret i1 false define i1 @test71(i8* %x) { - %a = getelementptr i8* %x, i64 8 - %b = getelementptr inbounds i8* %x, i64 8 + %a = getelementptr i8, i8* %x, i64 8 + %b = getelementptr inbounds i8, i8* %x, i64 8 %c = icmp ugt i8* %a, %b ret i1 %c } @@ -1124,8 +1124,8 @@ define i1 @test71(i8* %x) { define i1 @test71_as1(i8 addrspace(1)* %x) { ; CHECK-LABEL: @test71_as1( ; CHECK-NEXT: ret i1 false - %a = getelementptr i8 addrspace(1)* %x, i64 8 - %b = getelementptr inbounds i8 addrspace(1)* %x, i64 8 + %a = getelementptr i8, i8 addrspace(1)* %x, i64 8 + %b = getelementptr inbounds i8, i8 addrspace(1)* %x, i64 8 %c = icmp ugt i8 addrspace(1)* %a, %b ret i1 %c } @@ -1573,3 +1573,33 @@ define i32 @f5(i8 %a, i8 %b) { %sub7.sub = select i1 %cmp4, i32 %sub7, i32 %sub ret i32 %sub7.sub } + +; CHECK-LABEL: @f6 +; CHECK: %cmp.unshifted = xor i32 %a, %b +; CHECK-NEXT: %cmp.mask = and i32 %cmp.unshifted, 255 +; CHECK-NEXT: %cmp = icmp eq i32 %cmp.mask, 0 +; CHECK-NEXT: %s = select i1 %cmp, i32 10000, i32 0 +; CHECK-NEXT: ret i32 %s +define i32 @f6(i32 %a, i32 %b) { + %sext = shl i32 %a, 24 + %conv = ashr i32 %sext, 24 + %sext6 = shl i32 %b, 24 + %conv4 = ashr i32 %sext6, 24 + %cmp = icmp eq i32 %conv, %conv4 + %s = select i1 %cmp, i32 10000, i32 0 + ret i32 %s +} + +; CHECK-LABEL: @f7 +; CHECK: %cmp.unshifted = xor i32 %a, %b +; CHECK-NEXT: %cmp.mask = and i32 %cmp.unshifted, 511 +; CHECK-NEXT: %cmp = icmp ne i32 %cmp.mask, 0 +; CHECK-NEXT: %s = select i1 %cmp, i32 10000, i32 0 +; CHECK-NEXT: ret i32 %s +define i32 @f7(i32 %a, i32 %b) { + %sext = shl i32 %a, 23 + %sext6 = shl i32 %b, 23 + %cmp = icmp ne i32 %sext, %sext6 + %s = select i1 %cmp, i32 10000, i32 0 + ret i32 %s +} diff --git a/test/Transforms/InstCombine/inline-intrinsic-assert.ll b/test/Transforms/InstCombine/inline-intrinsic-assert.ll new file mode 100644 index 0000000..af34277 --- /dev/null +++ b/test/Transforms/InstCombine/inline-intrinsic-assert.ll @@ -0,0 +1,30 @@ +; RUN: opt < %s -inline -instcombine -S | FileCheck %s + +; PR22857: http://llvm.org/bugs/show_bug.cgi?id=22857 +; The inliner should not add an edge to an intrinsic and +; then assert that it did not add an edge to an intrinsic! + +define float @foo(float %f1) #0 { + %call = call float @bar(float %f1) + ret float %call + +; CHECK-LABEL: @foo( +; CHECK-NEXT: call float @llvm.fabs.f32 +; CHECK-NEXT: ret float +} + +define float @bar(float %f1) #0 { + %call = call float @sqr(float %f1) + %call1 = call float @sqrtf(float %call) #0 + ret float %call1 +} + +define float @sqr(float %f) #0 { + %mul = fmul fast float %f, %f + ret float %mul +} + +declare float @sqrtf(float) #0 + +attributes #0 = { "unsafe-fp-math"="true" } + diff --git a/test/Transforms/InstCombine/intrinsics.ll b/test/Transforms/InstCombine/intrinsics.ll index 2791adf..539628a 100644 --- a/test/Transforms/InstCombine/intrinsics.ll +++ b/test/Transforms/InstCombine/intrinsics.ll @@ -363,3 +363,47 @@ define i32 @cttz_select(i32 %Value) nounwind { ; CHECK-NEXT: call i32 @llvm.cttz.i32(i32 %Value, i1 false) ; CHECK-NEXT: ret i32 } + +; CHECK-LABEL: @overflow_div_add( +; CHECK: ret i1 false +define i1 @overflow_div_add(i32 %v1, i32 %v2) nounwind { +entry: + %div = sdiv i32 %v1, 2 + %t = call %ov.result.32 @llvm.sadd.with.overflow.i32(i32 %div, i32 1) + %obit = extractvalue %ov.result.32 %t, 1 + ret i1 %obit +} + +; CHECK-LABEL: @overflow_div_sub( +; CHECK: ret i1 false +define i1 @overflow_div_sub(i32 %v1, i32 %v2) nounwind { +entry: + ; Check cases where the known sign bits are larger than the word size. + %a = ashr i32 %v1, 18 + %div = sdiv i32 %a, 65536 + %t = call %ov.result.32 @llvm.ssub.with.overflow.i32(i32 %div, i32 1) + %obit = extractvalue %ov.result.32 %t, 1 + ret i1 %obit +} + +; CHECK-LABEL: @overflow_mod_mul( +; CHECK: ret i1 false +define i1 @overflow_mod_mul(i32 %v1, i32 %v2) nounwind { +entry: + %rem = srem i32 %v1, 1000 + %t = call %ov.result.32 @llvm.smul.with.overflow.i32(i32 %rem, i32 %rem) + %obit = extractvalue %ov.result.32 %t, 1 + ret i1 %obit +} + +; CHECK-LABEL: @overflow_mod_overflow_mul( +; CHECK-NOT: ret i1 false +define i1 @overflow_mod_overflow_mul(i32 %v1, i32 %v2) nounwind { +entry: + %rem = srem i32 %v1, 65537 + ; This may overflow because the result of the mul operands may be greater than 16bits + ; and the result greater than 32. + %t = call %ov.result.32 @llvm.smul.with.overflow.i32(i32 %rem, i32 %rem) + %obit = extractvalue %ov.result.32 %t, 1 + ret i1 %obit +} diff --git a/test/Transforms/InstCombine/invariant.ll b/test/Transforms/InstCombine/invariant.ll index 3832380..246f9e6 100644 --- a/test/Transforms/InstCombine/invariant.ll +++ b/test/Transforms/InstCombine/invariant.ll @@ -11,6 +11,6 @@ define i8 @f() { %i = call {}* @llvm.invariant.start(i64 1, i8* %a) ; <{}*> [#uses=0] ; CHECK: call {}* @llvm.invariant.start call void @g(i8* %a) - %r = load i8* %a ; <i8> [#uses=1] + %r = load i8, i8* %a ; <i8> [#uses=1] ret i8 %r } diff --git a/test/Transforms/InstCombine/known_align.ll b/test/Transforms/InstCombine/known_align.ll index 0249951..653c4c5 100644 --- a/test/Transforms/InstCombine/known_align.ll +++ b/test/Transforms/InstCombine/known_align.ll @@ -11,17 +11,17 @@ entry: %tmp = alloca i32, align 4 ; <i32*> [#uses=2] %tmp1 = alloca i32, align 4 ; <i32*> [#uses=3] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - %tmp3 = load i32* getelementptr (%struct.p* @t, i32 0, i32 1), align 1 ; <i32> [#uses=1] + %tmp3 = load i32, i32* getelementptr (%struct.p, %struct.p* @t, i32 0, i32 1), align 1 ; <i32> [#uses=1] store i32 %tmp3, i32* %tmp1, align 4 - %tmp5 = load i32* %tmp1, align 4 ; <i32> [#uses=1] - store i32 %tmp5, i32* getelementptr (%struct.p* @u, i32 0, i32 1), align 1 - %tmp6 = load i32* %tmp1, align 4 ; <i32> [#uses=1] + %tmp5 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1] + store i32 %tmp5, i32* getelementptr (%struct.p, %struct.p* @u, i32 0, i32 1), align 1 + %tmp6 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1] store i32 %tmp6, i32* %tmp, align 4 - %tmp7 = load i32* %tmp, align 4 ; <i32> [#uses=1] + %tmp7 = load i32, i32* %tmp, align 4 ; <i32> [#uses=1] store i32 %tmp7, i32* %retval, align 4 br label %return return: ; preds = %entry - %retval8 = load i32* %retval ; <i32> [#uses=1] + %retval8 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval8 } diff --git a/test/Transforms/InstCombine/load-cmp.ll b/test/Transforms/InstCombine/load-cmp.ll index 40673a7..b0bfdc4 100644 --- a/test/Transforms/InstCombine/load-cmp.ll +++ b/test/Transforms/InstCombine/load-cmp.ll @@ -1,5 +1,4 @@ -; RUN: opt -instcombine -S < %s | FileCheck -check-prefix=NODL %s -; RUN: opt -instcombine -S -default-data-layout="p:32:32:32-p1:16:16:16-n8:16:32:64" < %s | FileCheck -check-prefix=P32 %s +; RUN: opt -instcombine -S -default-data-layout="p:32:32:32-p1:16:16:16-n8:16:32:64" < %s | FileCheck %s @G16 = internal constant [10 x i16] [i16 35, i16 82, i16 69, i16 81, i16 85, i16 73, i16 82, i16 69, i16 68, i16 0] @@ -21,185 +20,137 @@ define i1 @test1(i32 %X) { - %P = getelementptr inbounds [10 x i16]* @G16, i32 0, i32 %X - %Q = load i16* %P + %P = getelementptr inbounds [10 x i16], [10 x i16]* @G16, i32 0, i32 %X + %Q = load i16, i16* %P %R = icmp eq i16 %Q, 0 ret i1 %R -; NODL-LABEL: @test1( -; NODL-NEXT: %R = icmp eq i32 %X, 9 -; NODL-NEXT: ret i1 %R - -; P32-LABEL: @test1( -; P32-NEXT: %R = icmp eq i32 %X, 9 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test1( +; CHECK-NEXT: %R = icmp eq i32 %X, 9 +; CHECK-NEXT: ret i1 %R } define i1 @test1_noinbounds(i32 %X) { - %P = getelementptr [10 x i16]* @G16, i32 0, i32 %X - %Q = load i16* %P + %P = getelementptr [10 x i16], [10 x i16]* @G16, i32 0, i32 %X + %Q = load i16, i16* %P %R = icmp eq i16 %Q, 0 ret i1 %R -; NODL-LABEL: @test1_noinbounds( -; NODL-NEXT: %P = getelementptr [10 x i16]* @G16, i32 0, i32 %X - -; P32-LABEL: @test1_noinbounds( -; P32-NEXT: %R = icmp eq i32 %X, 9 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test1_noinbounds( +; CHECK-NEXT: %R = icmp eq i32 %X, 9 +; CHECK-NEXT: ret i1 %R } define i1 @test1_noinbounds_i64(i64 %X) { - %P = getelementptr [10 x i16]* @G16, i64 0, i64 %X - %Q = load i16* %P + %P = getelementptr [10 x i16], [10 x i16]* @G16, i64 0, i64 %X + %Q = load i16, i16* %P %R = icmp eq i16 %Q, 0 ret i1 %R -; NODL-LABEL: @test1_noinbounds_i64( -; NODL-NEXT: %P = getelementptr [10 x i16]* @G16, i64 0, i64 %X - -; P32-LABEL: @test1_noinbounds_i64( -; P32: %R = icmp eq i32 %1, 9 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test1_noinbounds_i64( +; CHECK: %R = icmp eq i32 %1, 9 +; CHECK-NEXT: ret i1 %R } define i1 @test1_noinbounds_as1(i32 %x) { - %p = getelementptr [10 x i16] addrspace(1)* @G16_as1, i16 0, i32 %x - %q = load i16 addrspace(1)* %p + %p = getelementptr [10 x i16], [10 x i16] addrspace(1)* @G16_as1, i16 0, i32 %x + %q = load i16, i16 addrspace(1)* %p %r = icmp eq i16 %q, 0 ret i1 %r -; P32-LABEL: @test1_noinbounds_as1( -; P32-NEXT: trunc i32 %x to i16 -; P32-NEXT: %r = icmp eq i16 %1, 9 -; P32-NEXT: ret i1 %r +; CHECK-LABEL: @test1_noinbounds_as1( +; CHECK-NEXT: trunc i32 %x to i16 +; CHECK-NEXT: %r = icmp eq i16 %1, 9 +; CHECK-NEXT: ret i1 %r } define i1 @test2(i32 %X) { - %P = getelementptr inbounds [10 x i16]* @G16, i32 0, i32 %X - %Q = load i16* %P + %P = getelementptr inbounds [10 x i16], [10 x i16]* @G16, i32 0, i32 %X + %Q = load i16, i16* %P %R = icmp slt i16 %Q, 85 ret i1 %R -; NODL-LABEL: @test2( -; NODL-NEXT: %R = icmp ne i32 %X, 4 -; NODL-NEXT: ret i1 %R +; CHECK-LABEL: @test2( +; CHECK-NEXT: %R = icmp ne i32 %X, 4 +; CHECK-NEXT: ret i1 %R } define i1 @test3(i32 %X) { - %P = getelementptr inbounds [6 x double]* @GD, i32 0, i32 %X - %Q = load double* %P + %P = getelementptr inbounds [6 x double], [6 x double]* @GD, i32 0, i32 %X + %Q = load double, double* %P %R = fcmp oeq double %Q, 1.0 ret i1 %R -; NODL-LABEL: @test3( -; NODL-NEXT: %R = icmp eq i32 %X, 1 -; NODL-NEXT: ret i1 %R - -; P32-LABEL: @test3( -; P32-NEXT: %R = icmp eq i32 %X, 1 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test3( +; CHECK-NEXT: %R = icmp eq i32 %X, 1 +; CHECK-NEXT: ret i1 %R } define i1 @test4(i32 %X) { - %P = getelementptr inbounds [10 x i16]* @G16, i32 0, i32 %X - %Q = load i16* %P + %P = getelementptr inbounds [10 x i16], [10 x i16]* @G16, i32 0, i32 %X + %Q = load i16, i16* %P %R = icmp sle i16 %Q, 73 ret i1 %R -; NODL-LABEL: @test4( -; NODL-NEXT: lshr i32 933, %X -; NODL-NEXT: and i32 {{.*}}, 1 -; NODL-NEXT: %R = icmp ne i32 {{.*}}, 0 -; NODL-NEXT: ret i1 %R - -; P32-LABEL: @test4( -; P32-NEXT: lshr i32 933, %X -; P32-NEXT: and i32 {{.*}}, 1 -; P32-NEXT: %R = icmp ne i32 {{.*}}, 0 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test4( +; CHECK-NEXT: lshr i32 933, %X +; CHECK-NEXT: and i32 {{.*}}, 1 +; CHECK-NEXT: %R = icmp ne i32 {{.*}}, 0 +; CHECK-NEXT: ret i1 %R } define i1 @test4_i16(i16 %X) { - %P = getelementptr inbounds [10 x i16]* @G16, i32 0, i16 %X - %Q = load i16* %P + %P = getelementptr inbounds [10 x i16], [10 x i16]* @G16, i32 0, i16 %X + %Q = load i16, i16* %P %R = icmp sle i16 %Q, 73 ret i1 %R - -; NODL-LABEL: @test4_i16( -; NODL-NEXT: lshr i16 933, %X -; NODL-NEXT: and i16 {{.*}}, 1 -; NODL-NEXT: %R = icmp ne i16 {{.*}}, 0 -; NODL-NEXT: ret i1 %R - -; P32-LABEL: @test4_i16( -; P32-NEXT: sext i16 %X to i32 -; P32-NEXT: lshr i32 933, %1 -; P32-NEXT: and i32 {{.*}}, 1 -; P32-NEXT: %R = icmp ne i32 {{.*}}, 0 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test4_i16( +; CHECK-NEXT: sext i16 %X to i32 +; CHECK-NEXT: lshr i32 933, %1 +; CHECK-NEXT: and i32 {{.*}}, 1 +; CHECK-NEXT: %R = icmp ne i32 {{.*}}, 0 +; CHECK-NEXT: ret i1 %R } define i1 @test5(i32 %X) { - %P = getelementptr inbounds [10 x i16]* @G16, i32 0, i32 %X - %Q = load i16* %P + %P = getelementptr inbounds [10 x i16], [10 x i16]* @G16, i32 0, i32 %X + %Q = load i16, i16* %P %R = icmp eq i16 %Q, 69 ret i1 %R -; NODL-LABEL: @test5( -; NODL-NEXT: icmp eq i32 %X, 2 -; NODL-NEXT: icmp eq i32 %X, 7 -; NODL-NEXT: %R = or i1 -; NODL-NEXT: ret i1 %R - -; P32-LABEL: @test5( -; P32-NEXT: icmp eq i32 %X, 2 -; P32-NEXT: icmp eq i32 %X, 7 -; P32-NEXT: %R = or i1 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test5( +; CHECK-NEXT: icmp eq i32 %X, 2 +; CHECK-NEXT: icmp eq i32 %X, 7 +; CHECK-NEXT: %R = or i1 +; CHECK-NEXT: ret i1 %R } define i1 @test6(i32 %X) { - %P = getelementptr inbounds [6 x double]* @GD, i32 0, i32 %X - %Q = load double* %P + %P = getelementptr inbounds [6 x double], [6 x double]* @GD, i32 0, i32 %X + %Q = load double, double* %P %R = fcmp ogt double %Q, 0.0 ret i1 %R -; NODL-LABEL: @test6( -; NODL-NEXT: add i32 %X, -1 -; NODL-NEXT: %R = icmp ult i32 {{.*}}, 3 -; NODL-NEXT: ret i1 %R - -; P32-LABEL: @test6( -; P32-NEXT: add i32 %X, -1 -; P32-NEXT: %R = icmp ult i32 {{.*}}, 3 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test6( +; CHECK-NEXT: add i32 %X, -1 +; CHECK-NEXT: %R = icmp ult i32 {{.*}}, 3 +; CHECK-NEXT: ret i1 %R } define i1 @test7(i32 %X) { - %P = getelementptr inbounds [6 x double]* @GD, i32 0, i32 %X - %Q = load double* %P + %P = getelementptr inbounds [6 x double], [6 x double]* @GD, i32 0, i32 %X + %Q = load double, double* %P %R = fcmp olt double %Q, 0.0 ret i1 %R -; NODL-LABEL: @test7( -; NODL-NEXT: add i32 %X, -1 -; NODL-NEXT: %R = icmp ugt i32 {{.*}}, 2 -; NODL-NEXT: ret i1 %R - -; P32-LABEL: @test7( -; P32-NEXT: add i32 %X, -1 -; P32-NEXT: %R = icmp ugt i32 {{.*}}, 2 -; P32-NEXT: ret i1 %R +; CHECK-LABEL: @test7( +; CHECK-NEXT: add i32 %X, -1 +; CHECK-NEXT: %R = icmp ugt i32 {{.*}}, 2 +; CHECK-NEXT: ret i1 %R } define i1 @test8(i32 %X) { - %P = getelementptr inbounds [10 x i16]* @G16, i32 0, i32 %X - %Q = load i16* %P + %P = getelementptr inbounds [10 x i16], [10 x i16]* @G16, i32 0, i32 %X + %Q = load i16, i16* %P %R = and i16 %Q, 3 %S = icmp eq i16 %R, 0 ret i1 %S -; NODL-LABEL: @test8( -; NODL-NEXT: and i32 %X, -2 -; NODL-NEXT: icmp eq i32 {{.*}}, 8 -; NODL-NEXT: ret i1 - -; P32-LABEL: @test8( -; P32-NEXT: and i32 %X, -2 -; P32-NEXT: icmp eq i32 {{.*}}, 8 -; P32-NEXT: ret i1 +; CHECK-LABEL: @test8( +; CHECK-NEXT: and i32 %X, -2 +; CHECK-NEXT: icmp eq i32 {{.*}}, 8 +; CHECK-NEXT: ret i1 } @GA = internal constant [4 x { i32, i32 } ] [ @@ -210,41 +161,30 @@ define i1 @test8(i32 %X) { ] define i1 @test9(i32 %X) { - %P = getelementptr inbounds [4 x { i32, i32 } ]* @GA, i32 0, i32 %X, i32 1 - %Q = load i32* %P + %P = getelementptr inbounds [4 x { i32, i32 } ], [4 x { i32, i32 } ]* @GA, i32 0, i32 %X, i32 1 + %Q = load i32, i32* %P %R = icmp eq i32 %Q, 1 ret i1 %R -; NODL-LABEL: @test9( -; NODL-NEXT: add i32 %X, -1 -; NODL-NEXT: icmp ult i32 {{.*}}, 2 -; NODL-NEXT: ret i1 - -; P32-LABEL: @test9( -; P32-NEXT: add i32 %X, -1 -; P32-NEXT: icmp ult i32 {{.*}}, 2 -; P32-NEXT: ret i1 +; CHECK-LABEL: @test9( +; CHECK-NEXT: add i32 %X, -1 +; CHECK-NEXT: icmp ult i32 {{.*}}, 2 +; CHECK-NEXT: ret i1 } define i1 @test10_struct(i32 %x) { -; NODL-LABEL: @test10_struct( -; NODL: getelementptr inbounds %Foo* @GS, i32 %x, i32 0 - -; P32-LABEL: @test10_struct( -; P32: ret i1 false - %p = getelementptr inbounds %Foo* @GS, i32 %x, i32 0 - %q = load i32* %p +; CHECK-LABEL: @test10_struct( +; CHECK: ret i1 false + %p = getelementptr inbounds %Foo, %Foo* @GS, i32 %x, i32 0 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } define i1 @test10_struct_noinbounds(i32 %x) { -; NODL-LABEL: @test10_struct_noinbounds( -; NODL: getelementptr %Foo* @GS, i32 %x, i32 0 - -; P32-LABEL: @test10_struct_noinbounds( -; P32: getelementptr %Foo* @GS, i32 %x, i32 0 - %p = getelementptr %Foo* @GS, i32 %x, i32 0 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_noinbounds( +; CHECK: getelementptr %Foo, %Foo* @GS, i32 %x, i32 0 + %p = getelementptr %Foo, %Foo* @GS, i32 %x, i32 0 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } @@ -252,13 +192,10 @@ define i1 @test10_struct_noinbounds(i32 %x) { ; Test that the GEP indices are converted before we ever get here ; Index < ptr size define i1 @test10_struct_i16(i16 %x){ -; NODL-LABEL: @test10_struct_i16( -; NODL: getelementptr inbounds %Foo* @GS, i16 %x, i32 0 - -; P32-LABEL: @test10_struct_i16( -; P32: ret i1 false - %p = getelementptr inbounds %Foo* @GS, i16 %x, i32 0 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_i16( +; CHECK: ret i1 false + %p = getelementptr inbounds %Foo, %Foo* @GS, i16 %x, i32 0 + %q = load i32, i32* %p %r = icmp eq i32 %q, 0 ret i1 %r } @@ -266,107 +203,79 @@ define i1 @test10_struct_i16(i16 %x){ ; Test that the GEP indices are converted before we ever get here ; Index > ptr size define i1 @test10_struct_i64(i64 %x){ -; NODL-LABEL: @test10_struct_i64( -; NODL: getelementptr inbounds %Foo* @GS, i64 %x, i32 0 - -; P32-LABEL: @test10_struct_i64( -; P32: ret i1 false - %p = getelementptr inbounds %Foo* @GS, i64 %x, i32 0 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_i64( +; CHECK: ret i1 false + %p = getelementptr inbounds %Foo, %Foo* @GS, i64 %x, i32 0 + %q = load i32, i32* %p %r = icmp eq i32 %q, 0 ret i1 %r } define i1 @test10_struct_noinbounds_i16(i16 %x) { -; NODL-LABEL: @test10_struct_noinbounds_i16( -; NODL: getelementptr %Foo* @GS, i16 %x, i32 0 - -; P32-LABEL: @test10_struct_noinbounds_i16( -; P32: %1 = sext i16 %x to i32 -; P32: getelementptr %Foo* @GS, i32 %1, i32 0 - %p = getelementptr %Foo* @GS, i16 %x, i32 0 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_noinbounds_i16( +; CHECK: %1 = sext i16 %x to i32 +; CHECK: getelementptr %Foo, %Foo* @GS, i32 %1, i32 0 + %p = getelementptr %Foo, %Foo* @GS, i16 %x, i32 0 + %q = load i32, i32* %p %r = icmp eq i32 %q, 0 ret i1 %r } define i1 @test10_struct_arr(i32 %x) { -; NODL-LABEL: @test10_struct_arr( -; NODL-NEXT: %r = icmp ne i32 %x, 1 -; NODL-NEXT: ret i1 %r - -; P32-LABEL: @test10_struct_arr( -; P32-NEXT: %r = icmp ne i32 %x, 1 -; P32-NEXT: ret i1 %r - %p = getelementptr inbounds [4 x %Foo]* @GStructArr, i32 0, i32 %x, i32 2 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_arr( +; CHECK-NEXT: %r = icmp ne i32 %x, 1 +; CHECK-NEXT: ret i1 %r + %p = getelementptr inbounds [4 x %Foo], [4 x %Foo]* @GStructArr, i32 0, i32 %x, i32 2 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } define i1 @test10_struct_arr_noinbounds(i32 %x) { -; NODL-LABEL: @test10_struct_arr_noinbounds( -; NODL-NEXT %p = getelementptr [4 x %Foo]* @GStructArr, i32 0, i32 %x, i32 2 - -; P32-LABEL: @test10_struct_arr_noinbounds( -; P32-NEXT %p = getelementptr [4 x %Foo]* @GStructArr, i32 0, i32 %x, i32 2 - %p = getelementptr [4 x %Foo]* @GStructArr, i32 0, i32 %x, i32 2 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_arr_noinbounds( +; CHECK-NEXT %p = getelementptr [4 x %Foo], [4 x %Foo]* @GStructArr, i32 0, i32 %x, i32 2 + %p = getelementptr [4 x %Foo], [4 x %Foo]* @GStructArr, i32 0, i32 %x, i32 2 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } define i1 @test10_struct_arr_i16(i16 %x) { -; NODL-LABEL: @test10_struct_arr_i16( -; NODL-NEXT: %r = icmp ne i16 %x, 1 -; NODL-NEXT: ret i1 %r - -; P32-LABEL: @test10_struct_arr_i16( -; P32-NEXT: %r = icmp ne i16 %x, 1 -; P32-NEXT: ret i1 %r - %p = getelementptr inbounds [4 x %Foo]* @GStructArr, i16 0, i16 %x, i32 2 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_arr_i16( +; CHECK-NEXT: %r = icmp ne i16 %x, 1 +; CHECK-NEXT: ret i1 %r + %p = getelementptr inbounds [4 x %Foo], [4 x %Foo]* @GStructArr, i16 0, i16 %x, i32 2 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } define i1 @test10_struct_arr_i64(i64 %x) { -; NODL-LABEL: @test10_struct_arr_i64( -; NODL-NEXT: %r = icmp ne i64 %x, 1 -; NODL-NEXT: ret i1 %r - -; P32-LABEL: @test10_struct_arr_i64( -; P32-NEXT: trunc i64 %x to i32 -; P32-NEXT: %r = icmp ne i32 %1, 1 -; P32-NEXT: ret i1 %r - %p = getelementptr inbounds [4 x %Foo]* @GStructArr, i64 0, i64 %x, i32 2 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_arr_i64( +; CHECK-NEXT: trunc i64 %x to i32 +; CHECK-NEXT: %r = icmp ne i32 %1, 1 +; CHECK-NEXT: ret i1 %r + %p = getelementptr inbounds [4 x %Foo], [4 x %Foo]* @GStructArr, i64 0, i64 %x, i32 2 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } define i1 @test10_struct_arr_noinbounds_i16(i16 %x) { -; NODL-LABEL: @test10_struct_arr_noinbounds_i16( -; NODL-NEXT: %p = getelementptr [4 x %Foo]* @GStructArr, i32 0, i16 %x, i32 2 - -; P32-LABEL: @test10_struct_arr_noinbounds_i16( -; P32-NEXT: %r = icmp ne i16 %x, 1 - %p = getelementptr [4 x %Foo]* @GStructArr, i32 0, i16 %x, i32 2 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_arr_noinbounds_i16( +; CHECK-NEXT: %r = icmp ne i16 %x, 1 + %p = getelementptr [4 x %Foo], [4 x %Foo]* @GStructArr, i32 0, i16 %x, i32 2 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } define i1 @test10_struct_arr_noinbounds_i64(i64 %x) { -; FIXME: Should be no trunc? -; NODL-LABEL: @test10_struct_arr_noinbounds_i64( -; NODL-NEXT: %p = getelementptr [4 x %Foo]* @GStructArr, i32 0, i64 %x, i32 2 - -; P32-LABEL: @test10_struct_arr_noinbounds_i64( -; P32: %r = icmp ne i32 %1, 1 -; P32-NEXT: ret i1 %r - %p = getelementptr [4 x %Foo]* @GStructArr, i32 0, i64 %x, i32 2 - %q = load i32* %p +; CHECK-LABEL: @test10_struct_arr_noinbounds_i64( +; CHECK: %r = icmp ne i32 %1, 1 +; CHECK-NEXT: ret i1 %r + %p = getelementptr [4 x %Foo], [4 x %Foo]* @GStructArr, i32 0, i64 %x, i32 2 + %q = load i32, i32* %p %r = icmp eq i32 %q, 9 ret i1 %r } diff --git a/test/Transforms/InstCombine/load-select.ll b/test/Transforms/InstCombine/load-select.ll index e8cbad3..dfc0798 100644 --- a/test/Transforms/InstCombine/load-select.ll +++ b/test/Transforms/InstCombine/load-select.ll @@ -10,7 +10,7 @@ define i32 @b(i32 %y) nounwind readonly { ; CHECK: ret i32 entry: %0 = icmp eq i32 %y, 0 ; <i1> [#uses=1] - %storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1] - %1 = load i32* %storemerge, align 4 ; <i32> [#uses=1] + %storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32], [2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32], [2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1] + %1 = load i32, i32* %storemerge, align 4 ; <i32> [#uses=1] ret i32 %1 } diff --git a/test/Transforms/InstCombine/load.ll b/test/Transforms/InstCombine/load.ll index 624083b..2cc55e9 100644 --- a/test/Transforms/InstCombine/load.ll +++ b/test/Transforms/InstCombine/load.ll @@ -16,31 +16,31 @@ target datalayout = "e-m:e-p:64:64:64-i64:64-f80:128-n8:16:32:64-S128" ; CHECK-LABEL: @test1( ; CHECK-NOT: load define i32 @test1() { - %B = load i32* @X ; <i32> [#uses=1] + %B = load i32, i32* @X ; <i32> [#uses=1] ret i32 %B } ; CHECK-LABEL: @test2( ; CHECK-NOT: load define float @test2() { - %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; <float*> [#uses=1] - %B = load float* %A ; <float> [#uses=1] + %A = getelementptr [2 x { i32, float }], [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; <float*> [#uses=1] + %B = load float, float* %A ; <float> [#uses=1] ret float %B } ; CHECK-LABEL: @test3( ; CHECK-NOT: load define i32 @test3() { - %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1] - %B = load i32* %A ; <i32> [#uses=1] + %A = getelementptr [2 x { i32, float }], [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1] + %B = load i32, i32* %A ; <i32> [#uses=1] ret i32 %B } ; CHECK-LABEL: @test4( ; CHECK-NOT: load define i32 @test4() { - %A = getelementptr [2 x { i32, float }]* @Z, i64 0, i64 1, i32 0 ; <i32*> [#uses=1] - %B = load i32* %A ; <i32> [#uses=1] + %A = getelementptr [2 x { i32, float }], [2 x { i32, float }]* @Z, i64 0, i64 1, i32 0 ; <i32*> [#uses=1] + %B = load i32, i32* %A ; <i32> [#uses=1] ret i32 %B } @@ -48,15 +48,15 @@ define i32 @test4() { ; CHECK-NOT: load define i32 @test5(i1 %C) { %Y = select i1 %C, i32* @X, i32* @X2 ; <i32*> [#uses=1] - %Z = load i32* %Y ; <i32> [#uses=1] + %Z = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %Z } ; CHECK-LABEL: @test7( ; CHECK-NOT: load define i32 @test7(i32 %X) { - %V = getelementptr i32* null, i32 %X ; <i32*> [#uses=1] - %R = load i32* %V ; <i32> [#uses=1] + %V = getelementptr i32, i32* null, i32 %X ; <i32*> [#uses=1] + %R = load i32, i32* %V ; <i32> [#uses=1] ret i32 %R } @@ -64,15 +64,15 @@ define i32 @test7(i32 %X) { ; CHECK-NOT: load define i32 @test8(i32* %P) { store i32 1, i32* %P - %X = load i32* %P ; <i32> [#uses=1] + %X = load i32, i32* %P ; <i32> [#uses=1] ret i32 %X } ; CHECK-LABEL: @test9( ; CHECK-NOT: load define i32 @test9(i32* %P) { - %X = load i32* %P ; <i32> [#uses=1] - %Y = load i32* %P ; <i32> [#uses=1] + %X = load i32, i32* %P ; <i32> [#uses=1] + %Y = load i32, i32* %P ; <i32> [#uses=1] %Z = sub i32 %X, %Y ; <i32> [#uses=1] ret i32 %Z } @@ -89,17 +89,17 @@ F: ; preds = %0 store i32 0, i32* %P br label %C C: ; preds = %F, %T - %V = load i32* %P ; <i32> [#uses=1] + %V = load i32, i32* %P ; <i32> [#uses=1] ret i32 %V } ; CHECK-LABEL: @test11( ; CHECK-NOT: load define double @test11(double* %p) { - %t0 = getelementptr double* %p, i32 1 + %t0 = getelementptr double, double* %p, i32 1 store double 2.0, double* %t0 - %t1 = getelementptr double* %p, i32 1 - %x = load double* %t1 + %t1 = getelementptr double, double* %p, i32 1 + %x = load double, double* %t1 ret double %x } @@ -110,14 +110,14 @@ define i32 @test12(i32* %P) { store i32 123, i32* %A ; Cast the result of the load not the source %Q = bitcast i32* %A to i32* - %V = load i32* %Q + %V = load i32, i32* %Q ret i32 %V } ; CHECK-LABEL: @test13( ; CHECK-NOT: load define <16 x i8> @test13(<2 x i64> %x) { - %tmp = load <16 x i8>* bitcast ([4 x i32]* @GLOBAL to <16 x i8>*) + %tmp = load <16 x i8>, <16 x i8>* bitcast ([4 x i32]* @GLOBAL to <16 x i8>*) ret <16 x i8> %tmp } @@ -128,13 +128,13 @@ define i8 @test14(i8 %x, i32 %y) { ; those confuse the analysis into thinking that the second store does not alias ; the first. ; CHECK-LABEL: @test14( -; CHECK: %[[R:.*]] = load i8* +; CHECK: %[[R:.*]] = load i8, i8* ; CHECK-NEXT: ret i8 %[[R]] %a = alloca i32 %a.i8 = bitcast i32* %a to i8* store i8 %x, i8* %a.i8 store i32 %y, i32* %a - %r = load i8* %a.i8 + %r = load i8, i8* %a.i8 ret i8 %r } @@ -143,12 +143,12 @@ define i8 @test14(i8 %x, i32 %y) { define i8 @test15(i8 %x, i32 %y) { ; Same test as @test14 essentially, but using a global instead of an alloca. ; CHECK-LABEL: @test15( -; CHECK: %[[R:.*]] = load i8* +; CHECK: %[[R:.*]] = load i8, i8* ; CHECK-NEXT: ret i8 %[[R]] %g.i8 = bitcast i32* @test15_global to i8* store i8 %x, i8* %g.i8 store i32 %y, i32* @test15_global - %r = load i8* %g.i8 + %r = load i8, i8* %g.i8 ret i8 %r } @@ -156,12 +156,12 @@ define void @test16(i8* %x, i8* %a, i8* %b, i8* %c) { ; Check that we canonicalize loads which are only stored to use integer types ; when there is a valid integer type. ; CHECK-LABEL: @test16( -; CHECK: %[[L1:.*]] = load i32* +; CHECK: %[[L1:.*]] = load i32, i32* ; CHECK-NOT: load ; CHECK: store i32 %[[L1]], i32* ; CHECK: store i32 %[[L1]], i32* ; CHECK-NOT: store -; CHECK: %[[L1:.*]] = load i32* +; CHECK: %[[L1:.*]] = load i32, i32* ; CHECK-NOT: load ; CHECK: store i32 %[[L1]], i32* ; CHECK: store i32 %[[L1]], i32* @@ -174,11 +174,11 @@ entry: %b.cast = bitcast i8* %b to float* %c.cast = bitcast i8* %c to i32* - %x1 = load float* %x.cast + %x1 = load float, float* %x.cast store float %x1, float* %a.cast store float %x1, float* %b.cast - %x2 = load float* %x.cast + %x2 = load float, float* %x.cast store float %x2, float* %b.cast %x2.cast = bitcast float %x2 to i32 store i32 %x2.cast, i32* %c.cast @@ -192,11 +192,11 @@ define void @test17(i8** %x, i8 %y) { ; than the value. ; ; CHECK-LABEL: @test17( -; CHECK: %[[L:.*]] = load i8** +; CHECK: %[[L:.*]] = load i8*, i8** ; CHECK: store i8 %y, i8* %[[L]] entry: - %x.load = load i8** %x + %x.load = load i8*, i8** %x store i8 %y, i8* %x.load ret void diff --git a/test/Transforms/InstCombine/load3.ll b/test/Transforms/InstCombine/load3.ll index f79ef9a..6db8dd3 100644 --- a/test/Transforms/InstCombine/load3.ll +++ b/test/Transforms/InstCombine/load3.ll @@ -5,10 +5,10 @@ target triple = "i386-apple-macosx10.0.0" ; Instcombine should be able to do trivial CSE of loads. define i32 @test1(i32* %p) { - %t0 = getelementptr i32* %p, i32 1 - %y = load i32* %t0 - %t1 = getelementptr i32* %p, i32 1 - %x = load i32* %t1 + %t0 = getelementptr i32, i32* %p, i32 1 + %y = load i32, i32* %t0 + %t1 = getelementptr i32, i32* %p, i32 1 + %x = load i32, i32* %t1 %a = sub i32 %y, %x ret i32 %a ; CHECK-LABEL: @test1( @@ -19,7 +19,7 @@ define i32 @test1(i32* %p) { ; PR7429 @.str = private constant [4 x i8] c"XYZ\00" define float @test2() { - %tmp = load float* bitcast ([4 x i8]* @.str to float*), align 1 + %tmp = load float, float* bitcast ([4 x i8]* @.str to float*), align 1 ret float %tmp ; CHECK-LABEL: @test2( @@ -37,10 +37,10 @@ align 4 ; PR14986 define void @test3() nounwind { ; This is a weird way of computing zero. - %l = load i32* getelementptr ([36 x i32]* @expect32, i32 29826161, i32 28), align 4 - store i32 %l, i32* getelementptr ([36 x i32]* @rslts32, i32 29826161, i32 28), align 4 + %l = load i32, i32* getelementptr ([36 x i32], [36 x i32]* @expect32, i32 29826161, i32 28), align 4 + store i32 %l, i32* getelementptr ([36 x i32], [36 x i32]* @rslts32, i32 29826161, i32 28), align 4 ret void ; CHECK-LABEL: @test3( -; CHECK: store i32 1, i32* getelementptr inbounds ([36 x i32]* @rslts32, i32 0, i32 0) +; CHECK: store i32 1, i32* getelementptr inbounds ([36 x i32], [36 x i32]* @rslts32, i32 0, i32 0) } diff --git a/test/Transforms/InstCombine/loadstore-alignment.ll b/test/Transforms/InstCombine/loadstore-alignment.ll index e90bdb7..4afa82d 100644 --- a/test/Transforms/InstCombine/loadstore-alignment.ll +++ b/test/Transforms/InstCombine/loadstore-alignment.ll @@ -9,58 +9,58 @@ target datalayout = "E-p:64:64:64-p1:64:64:64-p2:32:32:32-a0:0:8-f32:32:32-f64:6 ; CHECK-LABEL: @static_hem( ; CHECK: , align 16 define <2 x i64> @static_hem() { - %t = getelementptr <2 x i64>* @x, i32 7 - %tmp1 = load <2 x i64>* %t, align 1 + %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 7 + %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1 ret <2 x i64> %tmp1 } ; CHECK-LABEL: @static_hem_addrspacecast( ; CHECK: , align 16 define <2 x i64> @static_hem_addrspacecast() { - %t = getelementptr <2 x i64>* @x, i32 7 + %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 7 %t.asc = addrspacecast <2 x i64>* %t to <2 x i64> addrspace(1)* - %tmp1 = load <2 x i64> addrspace(1)* %t.asc, align 1 + %tmp1 = load <2 x i64>, <2 x i64> addrspace(1)* %t.asc, align 1 ret <2 x i64> %tmp1 } ; CHECK-LABEL: @static_hem_addrspacecast_smaller_ptr( ; CHECK: , align 16 define <2 x i64> @static_hem_addrspacecast_smaller_ptr() { - %t = getelementptr <2 x i64>* @x, i32 7 + %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 7 %t.asc = addrspacecast <2 x i64>* %t to <2 x i64> addrspace(2)* - %tmp1 = load <2 x i64> addrspace(2)* %t.asc, align 1 + %tmp1 = load <2 x i64>, <2 x i64> addrspace(2)* %t.asc, align 1 ret <2 x i64> %tmp1 } ; CHECK-LABEL: @static_hem_addrspacecast_larger_ptr( ; CHECK: , align 16 define <2 x i64> @static_hem_addrspacecast_larger_ptr() { - %t = getelementptr <2 x i64> addrspace(2)* @x.as2, i32 7 + %t = getelementptr <2 x i64>, <2 x i64> addrspace(2)* @x.as2, i32 7 %t.asc = addrspacecast <2 x i64> addrspace(2)* %t to <2 x i64> addrspace(1)* - %tmp1 = load <2 x i64> addrspace(1)* %t.asc, align 1 + %tmp1 = load <2 x i64>, <2 x i64> addrspace(1)* %t.asc, align 1 ret <2 x i64> %tmp1 } ; CHECK-LABEL: @hem( ; CHECK: , align 16 define <2 x i64> @hem(i32 %i) { - %t = getelementptr <2 x i64>* @x, i32 %i - %tmp1 = load <2 x i64>* %t, align 1 + %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 %i + %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1 ret <2 x i64> %tmp1 } ; CHECK-LABEL: @hem_2d( ; CHECK: , align 16 define <2 x i64> @hem_2d(i32 %i, i32 %j) { - %t = getelementptr [13 x <2 x i64>]* @xx, i32 %i, i32 %j - %tmp1 = load <2 x i64>* %t, align 1 + %t = getelementptr [13 x <2 x i64>], [13 x <2 x i64>]* @xx, i32 %i, i32 %j + %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1 ret <2 x i64> %tmp1 } ; CHECK-LABEL: @foo( ; CHECK: , align 16 define <2 x i64> @foo() { - %tmp1 = load <2 x i64>* @x, align 1 + %tmp1 = load <2 x i64>, <2 x i64>* @x, align 1 ret <2 x i64> %tmp1 } @@ -70,14 +70,14 @@ define <2 x i64> @foo() { define <2 x i64> @bar() { %t = alloca <2 x i64> call void @kip(<2 x i64>* %t) - %tmp1 = load <2 x i64>* %t, align 1 + %tmp1 = load <2 x i64>, <2 x i64>* %t, align 1 ret <2 x i64> %tmp1 } ; CHECK-LABEL: @static_hem_store( ; CHECK: , align 16 define void @static_hem_store(<2 x i64> %y) { - %t = getelementptr <2 x i64>* @x, i32 7 + %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 7 store <2 x i64> %y, <2 x i64>* %t, align 1 ret void } @@ -85,7 +85,7 @@ define void @static_hem_store(<2 x i64> %y) { ; CHECK-LABEL: @hem_store( ; CHECK: , align 16 define void @hem_store(i32 %i, <2 x i64> %y) { - %t = getelementptr <2 x i64>* @x, i32 %i + %t = getelementptr <2 x i64>, <2 x i64>* @x, i32 %i store <2 x i64> %y, <2 x i64>* %t, align 1 ret void } @@ -93,7 +93,7 @@ define void @hem_store(i32 %i, <2 x i64> %y) { ; CHECK-LABEL: @hem_2d_store( ; CHECK: , align 16 define void @hem_2d_store(i32 %i, i32 %j, <2 x i64> %y) { - %t = getelementptr [13 x <2 x i64>]* @xx, i32 %i, i32 %j + %t = getelementptr [13 x <2 x i64>], [13 x <2 x i64>]* @xx, i32 %i, i32 %j store <2 x i64> %y, <2 x i64>* %t, align 1 ret void } diff --git a/test/Transforms/InstCombine/loadstore-metadata.ll b/test/Transforms/InstCombine/loadstore-metadata.ll index be55fa6..a30c0bc 100644 --- a/test/Transforms/InstCombine/loadstore-metadata.ll +++ b/test/Transforms/InstCombine/loadstore-metadata.ll @@ -5,9 +5,9 @@ target datalayout = "e-m:e-p:64:64:64-i64:64-f80:128-n8:16:32:64-S128" define i32 @test_load_cast_combine_tbaa(float* %ptr) { ; Ensure (cast (load (...))) -> (load (cast (...))) preserves TBAA. ; CHECK-LABEL: @test_load_cast_combine_tbaa( -; CHECK: load i32* %{{.*}}, !tbaa !0 +; CHECK: load i32, i32* %{{.*}}, !tbaa !0 entry: - %l = load float* %ptr, !tbaa !0 + %l = load float, float* %ptr, !tbaa !0 %c = bitcast float %l to i32 ret i32 %c } @@ -15,9 +15,9 @@ entry: define i32 @test_load_cast_combine_noalias(float* %ptr) { ; Ensure (cast (load (...))) -> (load (cast (...))) preserves no-alias metadata. ; CHECK-LABEL: @test_load_cast_combine_noalias( -; CHECK: load i32* %{{.*}}, !alias.scope !2, !noalias !1 +; CHECK: load i32, i32* %{{.*}}, !alias.scope !2, !noalias !1 entry: - %l = load float* %ptr, !alias.scope !2, !noalias !1 + %l = load float, float* %ptr, !alias.scope !2, !noalias !1 %c = bitcast float %l to i32 ret i32 %c } @@ -27,11 +27,11 @@ define float @test_load_cast_combine_range(i32* %ptr) { ; would be nice to preserve or update it somehow but this is hard when moving ; between types. ; CHECK-LABEL: @test_load_cast_combine_range( -; CHECK: load float* %{{.*}} +; CHECK: load float, float* %{{.*}} ; CHECK-NOT: !range ; CHECK: ret float entry: - %l = load i32* %ptr, !range !5 + %l = load i32, i32* %ptr, !range !5 %c = bitcast i32 %l to float ret float %c } @@ -39,9 +39,9 @@ entry: define i32 @test_load_cast_combine_invariant(float* %ptr) { ; Ensure (cast (load (...))) -> (load (cast (...))) preserves invariant metadata. ; CHECK-LABEL: @test_load_cast_combine_invariant( -; CHECK: load i32* %{{.*}}, !invariant.load !3 +; CHECK: load i32, i32* %{{.*}}, !invariant.load !3 entry: - %l = load float* %ptr, !invariant.load !3 + %l = load float, float* %ptr, !invariant.load !3 %c = bitcast float %l to i32 ret i32 %c } @@ -50,9 +50,9 @@ define i32 @test_load_cast_combine_nontemporal(float* %ptr) { ; Ensure (cast (load (...))) -> (load (cast (...))) preserves nontemporal ; metadata. ; CHECK-LABEL: @test_load_cast_combine_nontemporal( -; CHECK: load i32* %{{.*}}, !nontemporal !4 +; CHECK: load i32, i32* %{{.*}}, !nontemporal !4 entry: - %l = load float* %ptr, !nontemporal !4 + %l = load float, float* %ptr, !nontemporal !4 %c = bitcast float %l to i32 ret i32 %c } @@ -61,15 +61,15 @@ define void @test_load_cast_combine_loop(float* %src, i32* %dst, i32 %n) { ; Ensure (cast (load (...))) -> (load (cast (...))) preserves loop access ; metadata. ; CHECK-LABEL: @test_load_cast_combine_loop( -; CHECK: load i32* %{{.*}}, !llvm.mem.parallel_loop_access !1 +; CHECK: load i32, i32* %{{.*}}, !llvm.mem.parallel_loop_access !1 entry: br label %loop loop: %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] - %src.gep = getelementptr inbounds float* %src, i32 %i - %dst.gep = getelementptr inbounds i32* %dst, i32 %i - %l = load float* %src.gep, !llvm.mem.parallel_loop_access !1 + %src.gep = getelementptr inbounds float, float* %src, i32 %i + %dst.gep = getelementptr inbounds i32, i32* %dst, i32 %i + %l = load float, float* %src.gep, !llvm.mem.parallel_loop_access !1 %c = bitcast float %l to i32 store i32 %c, i32* %dst.gep %i.next = add i32 %i, 1 @@ -93,12 +93,12 @@ define void @test_load_cast_combine_nonnull(float** %ptr) { ; file, and no LABEL lines are to be added after this point. ; ; CHECK-LABEL: @test_load_cast_combine_nonnull( -; CHECK: %[[V:.*]] = load i64* %{{.*}}, !range ![[MD:[0-9]+]] +; CHECK: %[[V:.*]] = load i64, i64* %{{.*}}, !range ![[MD:[0-9]+]] ; CHECK-NOT: !nonnull ; CHECK: store i64 %[[V]], i64* entry: - %p = load float** %ptr, !nonnull !3 - %gep = getelementptr float** %ptr, i32 42 + %p = load float*, float** %ptr, !nonnull !3 + %gep = getelementptr float*, float** %ptr, i32 42 store float* %p, float** %gep ret void } diff --git a/test/Transforms/InstCombine/lshr-phi.ll b/test/Transforms/InstCombine/lshr-phi.ll index 76a113f..79dc8b3 100644 --- a/test/Transforms/InstCombine/lshr-phi.ll +++ b/test/Transforms/InstCombine/lshr-phi.ll @@ -8,24 +8,24 @@ define i32 @hash_string(i8* nocapture %key) nounwind readonly { entry: - %t0 = load i8* %key, align 1 ; <i8> [#uses=1] + %t0 = load i8, i8* %key, align 1 ; <i8> [#uses=1] %t1 = icmp eq i8 %t0, 0 ; <i1> [#uses=1] br i1 %t1, label %bb2, label %bb bb: ; preds = %bb, %entry %indvar = phi i64 [ 0, %entry ], [ %tmp, %bb ] ; <i64> [#uses=2] %k.04 = phi i32 [ 0, %entry ], [ %t8, %bb ] ; <i32> [#uses=2] - %cp.05 = getelementptr i8* %key, i64 %indvar ; <i8*> [#uses=1] + %cp.05 = getelementptr i8, i8* %key, i64 %indvar ; <i8*> [#uses=1] %t2 = shl i32 %k.04, 1 ; <i32> [#uses=1] %t3 = lshr i32 %k.04, 14 ; <i32> [#uses=1] %t4 = add i32 %t2, %t3 ; <i32> [#uses=1] - %t5 = load i8* %cp.05, align 1 ; <i8> [#uses=1] + %t5 = load i8, i8* %cp.05, align 1 ; <i8> [#uses=1] %t6 = sext i8 %t5 to i32 ; <i32> [#uses=1] %t7 = xor i32 %t6, %t4 ; <i32> [#uses=1] %t8 = and i32 %t7, 16383 ; <i32> [#uses=2] %tmp = add i64 %indvar, 1 ; <i64> [#uses=2] - %scevgep = getelementptr i8* %key, i64 %tmp ; <i8*> [#uses=1] - %t9 = load i8* %scevgep, align 1 ; <i8> [#uses=1] + %scevgep = getelementptr i8, i8* %key, i64 %tmp ; <i8*> [#uses=1] + %t9 = load i8, i8* %scevgep, align 1 ; <i8> [#uses=1] %t10 = icmp eq i8 %t9, 0 ; <i1> [#uses=1] br i1 %t10, label %bb2, label %bb diff --git a/test/Transforms/InstCombine/malloc-free-delete.ll b/test/Transforms/InstCombine/malloc-free-delete.ll index 765c8c3..dc04adb 100644 --- a/test/Transforms/InstCombine/malloc-free-delete.ll +++ b/test/Transforms/InstCombine/malloc-free-delete.ll @@ -3,9 +3,9 @@ define i32 @main(i32 %argc, i8** %argv) { ; CHECK-LABEL: @main( %c_19 = alloca i8* - %malloc_206 = tail call i8* @malloc(i32 mul (i32 ptrtoint (i8* getelementptr (i8* null, i32 1) to i32), i32 10)) + %malloc_206 = tail call i8* @malloc(i32 mul (i32 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i32), i32 10)) store i8* %malloc_206, i8** %c_19 - %tmp_207 = load i8** %c_19 + %tmp_207 = load i8*, i8** %c_19 tail call void @free(i8* %tmp_207) ret i32 0 ; CHECK-NEXT: ret i32 0 diff --git a/test/Transforms/InstCombine/mem-gep-zidx.ll b/test/Transforms/InstCombine/mem-gep-zidx.ll index 9141d99..cf021b1 100644 --- a/test/Transforms/InstCombine/mem-gep-zidx.ll +++ b/test/Transforms/InstCombine/mem-gep-zidx.ll @@ -8,8 +8,8 @@ target triple = "powerpc64-unknown-linux-gnu" define signext i32 @test1(i32 signext %x) #0 { entry: %idxprom = sext i32 %x to i64 - %arrayidx = getelementptr inbounds [1 x i32]* @f.a, i64 0, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1 x i32], [1 x i32]* @f.a, i64 0, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 ret i32 %0 ; CHECK-LABEL: @test1 @@ -21,7 +21,7 @@ define void @test2(i32 signext %x, i64 %v) #0 { entry: %p = alloca i64 %idxprom = sext i32 %x to i64 - %arrayidx = getelementptr inbounds i64* %p, i64 %idxprom + %arrayidx = getelementptr inbounds i64, i64* %p, i64 %idxprom store i64 %v, i64* %arrayidx call void @foo(i64* %p) ret void @@ -36,12 +36,12 @@ define signext i32 @test3(i32 signext %x, i1 %y) #0 { entry: %idxprom = sext i32 %x to i64 %p = select i1 %y, [1 x i32]* @f.a, [1 x i32]* @f.b - %arrayidx = getelementptr inbounds [1 x i32]* %p, i64 0, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1 x i32], [1 x i32]* %p, i64 0, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 ret i32 %0 ; CHECK-LABEL: @test3 -; CHECK: getelementptr inbounds [1 x i32]* %p, i64 0, i64 0 +; CHECK: getelementptr inbounds [1 x i32], [1 x i32]* %p, i64 0, i64 0 } attributes #0 = { nounwind readnone } diff --git a/test/Transforms/InstCombine/memchr.ll b/test/Transforms/InstCombine/memchr.ll new file mode 100644 index 0000000..216dba8 --- /dev/null +++ b/test/Transforms/InstCombine/memchr.ll @@ -0,0 +1,200 @@ +; Test that the memchr library call simplifier works correctly. +; RUN: opt < %s -instcombine -S | FileCheck %s + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" + +@hello = constant [14 x i8] c"hello world\5Cn\00" +@hellonull = constant [14 x i8] c"hello\00world\5Cn\00" +@null = constant [1 x i8] zeroinitializer +@newlines = constant [3 x i8] c"\0D\0A\00" +@single = constant [2 x i8] c"\1F\00" +@spaces = constant [4 x i8] c" \0D\0A\00" +@negative = constant [3 x i8] c"\FF\FE\00" +@chp = global i8* zeroinitializer + +declare i8* @memchr(i8*, i32, i32) + +define void @test1() { +; CHECK-LABEL: @test1 +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 6) +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %str = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 + %dst = call i8* @memchr(i8* %str, i32 119, i32 14) + store i8* %dst, i8** @chp + ret void +} + +define void @test2() { +; CHECK-LABEL: @test2 +; CHECK: store i8* null, i8** @chp, align 4 +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %str = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 + %dst = call i8* @memchr(i8* %str, i32 119, i32 1) + store i8* %dst, i8** @chp + ret void +} + +define void @test3() { +; CHECK-LABEL: @test3 +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 13) +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 + %dst = call i8* @memchr(i8* %src, i32 0, i32 14) + store i8* %dst, i8** @chp + ret void +} + +define void @test4(i32 %chr) { +; CHECK-LABEL: @test4 +; CHECK: call i8* @memchr +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 + %dst = call i8* @memchr(i8* %src, i32 %chr, i32 14) + store i8* %dst, i8** @chp + ret void +} + +define void @test5() { +; CHECK-LABEL: @test5 +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 13) +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 + %dst = call i8* @memchr(i8* %src, i32 65280, i32 14) + store i8* %dst, i8** @chp + ret void +} + +define void @test6() { +; CHECK-LABEL: @test6 +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 6) +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 +; Overflow, but we still find the right thing. + %dst = call i8* @memchr(i8* %src, i32 119, i32 100) + store i8* %dst, i8** @chp + ret void +} + +define void @test7() { +; CHECK-LABEL: @test7 +; CHECK: store i8* null, i8** @chp, align 4 +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 +; Overflow + %dst = call i8* @memchr(i8* %src, i32 120, i32 100) + store i8* %dst, i8** @chp + ret void +} + +define void @test8() { +; CHECK-LABEL: @test8 +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hellonull, i32 0, i32 6) +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %str = getelementptr [14 x i8], [14 x i8]* @hellonull, i32 0, i32 0 + %dst = call i8* @memchr(i8* %str, i32 119, i32 14) + store i8* %dst, i8** @chp + ret void +} + +define void @test9() { +; CHECK-LABEL: @test9 +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hellonull, i32 0, i32 6) +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %str = getelementptr [14 x i8], [14 x i8]* @hellonull, i32 0, i32 2 + %dst = call i8* @memchr(i8* %str, i32 119, i32 12) + store i8* %dst, i8** @chp + ret void +} + +define void @test10() { +; CHECK-LABEL: @test10 +; CHECK: store i8* null, i8** @chp, align 4 +; CHECK-NOT: call i8* @memchr +; CHECK: ret void + + %str = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 + %dst = call i8* @memchr(i8* %str, i32 119, i32 6) + store i8* %dst, i8** @chp + ret void +} + +; Check transformation memchr("\r\n", C, 2) != nullptr -> (C & 9216) != 0 +define i1 @test11(i32 %C) { +; CHECK-LABEL: @test11 +; CHECK-NEXT: [[TRUNC:%.*]] = trunc i32 %C to i16 +; CHECK-NEXT: %memchr.bounds = icmp ult i16 [[TRUNC]], 16 +; CHECK-NEXT: [[SHL:%.*]] = shl i16 1, [[TRUNC]] +; CHECK-NEXT: [[AND:%.*]] = and i16 [[SHL]], 9216 +; CHECK-NEXT: %memchr.bits = icmp ne i16 [[AND]], 0 +; CHECK-NEXT: %memchr = and i1 %memchr.bounds, %memchr.bits +; CHECK-NEXT: ret i1 %memchr + + %dst = call i8* @memchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @newlines, i64 0, i64 0), i32 %C, i32 2) + %cmp = icmp ne i8* %dst, null + ret i1 %cmp +} + +; No 64 bits here +define i1 @test12(i32 %C) { +; CHECK-LABEL: @test12 +; CHECK-NEXT: %dst = call i8* @memchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @spaces, i32 0, i32 0), i32 %C, i32 3) +; CHECK-NEXT: %cmp = icmp ne i8* %dst, null +; CHECK-NEXT: ret i1 %cmp + + %dst = call i8* @memchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @spaces, i64 0, i64 0), i32 %C, i32 3) + %cmp = icmp ne i8* %dst, null + ret i1 %cmp +} + +define i1 @test13(i32 %C) { +; CHECK-LABEL: @test13 +; CHECK-NEXT: %memchr.bounds = icmp ult i32 %C, 32 +; CHECK-NEXT: [[SHL:%.*]] = shl i32 1, %C +; CHECK-NEXT: [[AND:%.*]] = and i32 [[SHL]], -2147483647 +; CHECK-NEXT: %memchr.bits = icmp ne i32 [[AND]], 0 +; CHECK-NEXT: %memchr = and i1 %memchr.bounds, %memchr.bits +; CHECK-NEXT: ret i1 %memchr + + %dst = call i8* @memchr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @single, i64 0, i64 0), i32 %C, i32 2) + %cmp = icmp ne i8* %dst, null + ret i1 %cmp +} + +define i1 @test14(i32 %C) { +; CHECK-LABEL: @test14 +; CHECK-NEXT: icmp eq i32 %C, 31 +; CHECK-NEXT: ret + + %dst = call i8* @memchr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @single, i64 0, i64 0), i32 %C, i32 1) + %cmp = icmp ne i8* %dst, null + ret i1 %cmp +} + +define i1 @test15(i32 %C) { +; CHECK-LABEL: @test15 +; CHECK-NEXT: %dst = call i8* @memchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @negative, i32 0, i32 0), i32 %C, i32 3) +; CHECK-NEXT: %cmp = icmp ne i8* %dst, null +; CHECK-NEXT: ret i1 %cmp + + %dst = call i8* @memchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @negative, i64 0, i64 0), i32 %C, i32 3) + %cmp = icmp ne i8* %dst, null + ret i1 %cmp +} diff --git a/test/Transforms/InstCombine/memcmp-1.ll b/test/Transforms/InstCombine/memcmp-1.ll index d960693..db15bd6 100644 --- a/test/Transforms/InstCombine/memcmp-1.ll +++ b/test/Transforms/InstCombine/memcmp-1.ll @@ -33,9 +33,9 @@ define i32 @test_simplify2(i8* %mem1, i8* %mem2) { define i32 @test_simplify3(i8* %mem1, i8* %mem2) { ; CHECK-LABEL: @test_simplify3( %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 1) -; CHECK: [[LOAD1:%[a-z]+]] = load i8* %mem1, align 1 +; CHECK: [[LOAD1:%[a-z]+]] = load i8, i8* %mem1, align 1 ; CHECK: [[ZEXT1:%[a-z]+]] = zext i8 [[LOAD1]] to i32 -; CHECK: [[LOAD2:%[a-z]+]] = load i8* %mem2, align 1 +; CHECK: [[LOAD2:%[a-z]+]] = load i8, i8* %mem2, align 1 ; CHECK: [[ZEXT2:%[a-z]+]] = zext i8 [[LOAD2]] to i32 ; CHECK: [[RET:%[a-z]+]] = sub nsw i32 [[ZEXT1]], [[ZEXT2]] ret i32 %ret @@ -46,8 +46,8 @@ define i32 @test_simplify3(i8* %mem1, i8* %mem2) { define i32 @test_simplify4() { ; CHECK-LABEL: @test_simplify4( - %mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0 - %mem2 = getelementptr [8 x i8]* @hello_u, i32 0, i32 0 + %mem1 = getelementptr [4 x i8], [4 x i8]* @hel, i32 0, i32 0 + %mem2 = getelementptr [8 x i8], [8 x i8]* @hello_u, i32 0, i32 0 %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3) ret i32 %ret ; CHECK: ret i32 0 @@ -55,8 +55,8 @@ define i32 @test_simplify4() { define i32 @test_simplify5() { ; CHECK-LABEL: @test_simplify5( - %mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0 - %mem2 = getelementptr [4 x i8]* @foo, i32 0, i32 0 + %mem1 = getelementptr [4 x i8], [4 x i8]* @hel, i32 0, i32 0 + %mem2 = getelementptr [4 x i8], [4 x i8]* @foo, i32 0, i32 0 %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3) ret i32 %ret ; CHECK: ret i32 1 @@ -64,8 +64,8 @@ define i32 @test_simplify5() { define i32 @test_simplify6() { ; CHECK-LABEL: @test_simplify6( - %mem1 = getelementptr [4 x i8]* @foo, i32 0, i32 0 - %mem2 = getelementptr [4 x i8]* @hel, i32 0, i32 0 + %mem1 = getelementptr [4 x i8], [4 x i8]* @foo, i32 0, i32 0 + %mem2 = getelementptr [4 x i8], [4 x i8]* @hel, i32 0, i32 0 %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3) ret i32 %ret ; CHECK: ret i32 -1 diff --git a/test/Transforms/InstCombine/memcpy-from-global.ll b/test/Transforms/InstCombine/memcpy-from-global.ll index 3bc1d36..da38087 100644 --- a/test/Transforms/InstCombine/memcpy-from-global.ll +++ b/test/Transforms/InstCombine/memcpy-from-global.ll @@ -14,23 +14,23 @@ entry: %tmp3 = shl i32 %hash, 2 ; <i32> [#uses=1] %tmp5 = and i32 %tmp3, 124 ; <i32> [#uses=4] - %tmp753 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp5 ; <float*> [#uses=1] - %tmp9 = load float* %tmp753 ; <float> [#uses=1] + %tmp753 = getelementptr [128 x float], [128 x float]* %lookupTable, i32 0, i32 %tmp5 ; <float*> [#uses=1] + %tmp9 = load float, float* %tmp753 ; <float> [#uses=1] %tmp11 = fmul float %tmp9, %x ; <float> [#uses=1] %tmp13 = fadd float %tmp11, 0.000000e+00 ; <float> [#uses=1] %tmp17.sum52 = or i32 %tmp5, 1 ; <i32> [#uses=1] - %tmp1851 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp17.sum52 ; <float*> [#uses=1] - %tmp19 = load float* %tmp1851 ; <float> [#uses=1] + %tmp1851 = getelementptr [128 x float], [128 x float]* %lookupTable, i32 0, i32 %tmp17.sum52 ; <float*> [#uses=1] + %tmp19 = load float, float* %tmp1851 ; <float> [#uses=1] %tmp21 = fmul float %tmp19, %y ; <float> [#uses=1] %tmp23 = fadd float %tmp21, %tmp13 ; <float> [#uses=1] %tmp27.sum50 = or i32 %tmp5, 2 ; <i32> [#uses=1] - %tmp2849 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp27.sum50 ; <float*> [#uses=1] - %tmp29 = load float* %tmp2849 ; <float> [#uses=1] + %tmp2849 = getelementptr [128 x float], [128 x float]* %lookupTable, i32 0, i32 %tmp27.sum50 ; <float*> [#uses=1] + %tmp29 = load float, float* %tmp2849 ; <float> [#uses=1] %tmp31 = fmul float %tmp29, %z ; <float> [#uses=1] %tmp33 = fadd float %tmp31, %tmp23 ; <float> [#uses=1] %tmp37.sum48 = or i32 %tmp5, 3 ; <i32> [#uses=1] - %tmp3847 = getelementptr [128 x float]* %lookupTable, i32 0, i32 %tmp37.sum48 ; <float*> [#uses=1] - %tmp39 = load float* %tmp3847 ; <float> [#uses=1] + %tmp3847 = getelementptr [128 x float], [128 x float]* %lookupTable, i32 0, i32 %tmp37.sum48 ; <float*> [#uses=1] + %tmp39 = load float, float* %tmp3847 ; <float> [#uses=1] %tmp41 = fmul float %tmp39, %w ; <float> [#uses=1] %tmp43 = fadd float %tmp41, %tmp33 ; <float> [#uses=1] ret float %tmp43 @@ -57,10 +57,10 @@ define void @test2() { ; %A alloca is deleted ; CHECK-NEXT: alloca [124 x i8] -; CHECK-NEXT: getelementptr inbounds [124 x i8]* +; CHECK-NEXT: getelementptr inbounds [124 x i8], [124 x i8]* ; use @G instead of %A -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* getelementptr inbounds (%T* @G, i64 0, i32 0) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* getelementptr inbounds (%T, %T* @G, i64 0, i32 0) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false) call void @bar(i8* %b) @@ -101,7 +101,7 @@ define void @test3() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK-LABEL: @test3( -; CHECK-NEXT: call void @bar(i8* getelementptr inbounds (%T* @G, i64 0, i32 0)) +; CHECK-NEXT: call void @bar(i8* getelementptr inbounds (%T, %T* @G, i64 0, i32 0)) ret void } @@ -111,7 +111,7 @@ define void @test3_addrspacecast() { call void @llvm.memcpy.p0i8.p1i8.i64(i8* %a, i8 addrspace(1)* addrspacecast (%T* @G to i8 addrspace(1)*), i64 124, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK-LABEL: @test3_addrspacecast( -; CHECK-NEXT: call void @bar(i8* getelementptr inbounds (%T* @G, i64 0, i32 0)) +; CHECK-NEXT: call void @bar(i8* getelementptr inbounds (%T, %T* @G, i64 0, i32 0)) ret void } @@ -122,7 +122,7 @@ define void @test4() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @baz(i8* byval %a) ; CHECK-LABEL: @test4( -; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T* @G, i64 0, i32 0)) +; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T, %T* @G, i64 0, i32 0)) ret void } @@ -134,7 +134,7 @@ define void @test5() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @baz(i8* byval %a) ; CHECK-LABEL: @test5( -; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T* @G, i64 0, i32 0)) +; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T, %T* @G, i64 0, i32 0)) ret void } @@ -155,7 +155,7 @@ define void @test6() { define void @test7() { %A = alloca %U, align 16 %a = bitcast %U* %A to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 0) to i8*), i64 20, i32 4, i1 false) + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U], [2 x %U]* @H, i64 0, i32 0) to i8*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK-LABEL: @test7( ; CHECK-NEXT: call void @bar(i8* bitcast ([2 x %U]* @H to i8*)) @@ -165,7 +165,7 @@ define void @test7() { define void @test8() { %A = alloca %U, align 16 %a = bitcast %U* %A to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 1) to i8*), i64 20, i32 4, i1 false) + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U], [2 x %U]* @H, i64 0, i32 1) to i8*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK-LABEL: @test8( ; CHECK: llvm.memcpy @@ -177,7 +177,7 @@ define void @test8() { define void @test8_addrspacecast() { %A = alloca %U, align 16 %a = bitcast %U* %A to i8* - call void @llvm.memcpy.p0i8.p1i8.i64(i8* %a, i8 addrspace(1)* addrspacecast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 1) to i8 addrspace(1)*), i64 20, i32 4, i1 false) + call void @llvm.memcpy.p0i8.p1i8.i64(i8* %a, i8 addrspace(1)* addrspacecast (%U* getelementptr ([2 x %U], [2 x %U]* @H, i64 0, i32 1) to i8 addrspace(1)*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK-LABEL: @test8_addrspacecast( ; CHECK: llvm.memcpy @@ -188,19 +188,19 @@ define void @test8_addrspacecast() { define void @test9() { %A = alloca %U, align 4 %a = bitcast %U* %A to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 1) to i8*), i64 20, i32 4, i1 false) + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U], [2 x %U]* @H, i64 0, i32 1) to i8*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK-LABEL: @test9( -; CHECK-NEXT: call void @bar(i8* bitcast (%U* getelementptr inbounds ([2 x %U]* @H, i64 0, i64 1) to i8*)) +; CHECK-NEXT: call void @bar(i8* bitcast (%U* getelementptr inbounds ([2 x %U], [2 x %U]* @H, i64 0, i64 1) to i8*)) ret void } define void @test9_addrspacecast() { %A = alloca %U, align 4 %a = bitcast %U* %A to i8* - call void @llvm.memcpy.p0i8.p1i8.i64(i8* %a, i8 addrspace(1)* addrspacecast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 1) to i8 addrspace(1)*), i64 20, i32 4, i1 false) + call void @llvm.memcpy.p0i8.p1i8.i64(i8* %a, i8 addrspace(1)* addrspacecast (%U* getelementptr ([2 x %U], [2 x %U]* @H, i64 0, i32 1) to i8 addrspace(1)*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK-LABEL: @test9_addrspacecast( -; CHECK-NEXT: call void @bar(i8* bitcast (%U* getelementptr inbounds ([2 x %U]* @H, i64 0, i64 1) to i8*)) +; CHECK-NEXT: call void @bar(i8* bitcast (%U* getelementptr inbounds ([2 x %U], [2 x %U]* @H, i64 0, i64 1) to i8*)) ret void } diff --git a/test/Transforms/InstCombine/memmove.ll b/test/Transforms/InstCombine/memmove.ll index 9d51ea0..96f230e 100644 --- a/test/Transforms/InstCombine/memmove.ll +++ b/test/Transforms/InstCombine/memmove.ll @@ -14,16 +14,16 @@ define void @test1(i8* %A, i8* %B, i32 %N) { define void @test2(i8* %A, i32 %N) { ;; dest can't alias source since we can't write to source! - call void @llvm.memmove.p0i8.p0i8.i32(i8* %A, i8* getelementptr inbounds ([33 x i8]* @S, i32 0, i32 0), i32 %N, i32 1, i1 false) + call void @llvm.memmove.p0i8.p0i8.i32(i8* %A, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @S, i32 0, i32 0), i32 %N, i32 1, i1 false) ret void } define i32 @test3() { - %h_p = getelementptr [2 x i8]* @h, i32 0, i32 0 ; <i8*> [#uses=1] - %hel_p = getelementptr [4 x i8]* @hel, i32 0, i32 0 ; <i8*> [#uses=1] - %hello_u_p = getelementptr [8 x i8]* @hello_u, i32 0, i32 0 ; <i8*> [#uses=1] + %h_p = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0 ; <i8*> [#uses=1] + %hel_p = getelementptr [4 x i8], [4 x i8]* @hel, i32 0, i32 0 ; <i8*> [#uses=1] + %hello_u_p = getelementptr [8 x i8], [8 x i8]* @hello_u, i32 0, i32 0 ; <i8*> [#uses=1] %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1] - %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=3] + %target_p = getelementptr [1024 x i8], [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=3] call void @llvm.memmove.p0i8.p0i8.i32(i8* %target_p, i8* %h_p, i32 2, i32 2, i1 false) call void @llvm.memmove.p0i8.p0i8.i32(i8* %target_p, i8* %hel_p, i32 4, i32 4, i1 false) call void @llvm.memmove.p0i8.p0i8.i32(i8* %target_p, i8* %hello_u_p, i32 8, i32 8, i1 false) diff --git a/test/Transforms/InstCombine/memset.ll b/test/Transforms/InstCombine/memset.ll index 7f02dad..dfafcf9 100644 --- a/test/Transforms/InstCombine/memset.ll +++ b/test/Transforms/InstCombine/memset.ll @@ -2,7 +2,7 @@ define i32 @main() { %target = alloca [1024 x i8] - %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 + %target_p = getelementptr [1024 x i8], [1024 x i8]* %target, i32 0, i32 0 call void @llvm.memset.p0i8.i32(i8* %target_p, i8 1, i32 0, i32 1, i1 false) call void @llvm.memset.p0i8.i32(i8* %target_p, i8 1, i32 1, i32 1, i1 false) call void @llvm.memset.p0i8.i32(i8* %target_p, i8 1, i32 2, i32 2, i1 false) diff --git a/test/Transforms/InstCombine/memset2.ll b/test/Transforms/InstCombine/memset2.ll index 87639f0..ad4c225 100644 --- a/test/Transforms/InstCombine/memset2.ll +++ b/test/Transforms/InstCombine/memset2.ll @@ -7,7 +7,7 @@ define i32 @test(%struct.Moves addrspace(1)* nocapture %moves) { entry: ; CHECK: bitcast i8 addrspace(1)* %gep to i64 addrspace(1)* - %gep = getelementptr inbounds %struct.Moves addrspace(1)* %moves, i32 1, i32 0, i32 9 + %gep = getelementptr inbounds %struct.Moves, %struct.Moves addrspace(1)* %moves, i32 1, i32 0, i32 9 call void @llvm.memset.p1i8.i64(i8 addrspace(1)* %gep, i8 0, i64 8, i32 1, i1 false) ret i32 0 } diff --git a/test/Transforms/InstCombine/merge-icmp.ll b/test/Transforms/InstCombine/merge-icmp.ll index b021fe04..6a65b5b 100644 --- a/test/Transforms/InstCombine/merge-icmp.ll +++ b/test/Transforms/InstCombine/merge-icmp.ll @@ -1,7 +1,7 @@ ; RUN: opt -S -instcombine < %s | FileCheck %s define i1 @test1(i16* %x) { - %load = load i16* %x, align 4 + %load = load i16, i16* %x, align 4 %trunc = trunc i16 %load to i8 %cmp1 = icmp eq i8 %trunc, 127 %and = and i16 %load, -256 @@ -15,7 +15,7 @@ define i1 @test1(i16* %x) { } define i1 @test2(i16* %x) { - %load = load i16* %x, align 4 + %load = load i16, i16* %x, align 4 %and = and i16 %load, -256 %cmp1 = icmp eq i16 %and, 32512 %trunc = trunc i16 %load to i8 diff --git a/test/Transforms/InstCombine/mul.ll b/test/Transforms/InstCombine/mul.ll index 4d1e6c7..de09f12 100644 --- a/test/Transforms/InstCombine/mul.ll +++ b/test/Transforms/InstCombine/mul.ll @@ -107,7 +107,7 @@ define i32 @test12(i32 %a, i32 %b) { ; PR2642 define internal void @test13(<4 x float>*) { ; CHECK-LABEL: @test13( - load <4 x float>* %0, align 1 + load <4 x float>, <4 x float>* %0, align 1 fmul <4 x float> %2, < float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 > store <4 x float> %3, <4 x float>* %0, align 1 ret void diff --git a/test/Transforms/InstCombine/multi-size-address-space-pointer.ll b/test/Transforms/InstCombine/multi-size-address-space-pointer.ll index 2d88bed..4e5b210 100644 --- a/test/Transforms/InstCombine/multi-size-address-space-pointer.ll +++ b/test/Transforms/InstCombine/multi-size-address-space-pointer.ll @@ -4,43 +4,43 @@ target datalayout = "e-p:32:32:32-p1:64:64:64-p2:8:8:8-p3:16:16:16-p4:16:16:16-i define i32 @test_as0(i32 addrspace(0)* %a) { ; CHECK-LABEL: @test_as0( -; CHECK: %arrayidx = getelementptr i32* %a, i32 1 - %arrayidx = getelementptr i32 addrspace(0)* %a, i64 1 - %y = load i32 addrspace(0)* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr i32, i32* %a, i32 1 + %arrayidx = getelementptr i32, i32 addrspace(0)* %a, i64 1 + %y = load i32, i32 addrspace(0)* %arrayidx, align 4 ret i32 %y } define i32 @test_as1(i32 addrspace(1)* %a) { ; CHECK-LABEL: @test_as1( -; CHECK: %arrayidx = getelementptr i32 addrspace(1)* %a, i64 1 - %arrayidx = getelementptr i32 addrspace(1)* %a, i32 1 - %y = load i32 addrspace(1)* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr i32, i32 addrspace(1)* %a, i64 1 + %arrayidx = getelementptr i32, i32 addrspace(1)* %a, i32 1 + %y = load i32, i32 addrspace(1)* %arrayidx, align 4 ret i32 %y } define i32 @test_as2(i32 addrspace(2)* %a) { ; CHECK-LABEL: @test_as2( -; CHECK: %arrayidx = getelementptr i32 addrspace(2)* %a, i8 1 - %arrayidx = getelementptr i32 addrspace(2)* %a, i32 1 - %y = load i32 addrspace(2)* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr i32, i32 addrspace(2)* %a, i8 1 + %arrayidx = getelementptr i32, i32 addrspace(2)* %a, i32 1 + %y = load i32, i32 addrspace(2)* %arrayidx, align 4 ret i32 %y } define i32 @test_as3(i32 addrspace(3)* %a) { ; CHECK-LABEL: @test_as3( -; CHECK: %arrayidx = getelementptr i32 addrspace(3)* %a, i16 1 - %arrayidx = getelementptr i32 addrspace(3)* %a, i32 1 - %y = load i32 addrspace(3)* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr i32, i32 addrspace(3)* %a, i16 1 + %arrayidx = getelementptr i32, i32 addrspace(3)* %a, i32 1 + %y = load i32, i32 addrspace(3)* %arrayidx, align 4 ret i32 %y } define i32 @test_combine_ptrtoint(i32 addrspace(2)* %a) { ; CHECK-LABEL: @test_combine_ptrtoint( -; CHECK-NEXT: %y = load i32 addrspace(2)* %a +; CHECK-NEXT: %y = load i32, i32 addrspace(2)* %a ; CHECK-NEXT: ret i32 %y %cast = ptrtoint i32 addrspace(2)* %a to i8 %castback = inttoptr i8 %cast to i32 addrspace(2)* - %y = load i32 addrspace(2)* %castback, align 4 + %y = load i32, i32 addrspace(2)* %castback, align 4 ret i32 %y } @@ -55,12 +55,12 @@ define i8 @test_combine_inttoptr(i8 %a) { define i32 @test_combine_vector_ptrtoint(<2 x i32 addrspace(2)*> %a) { ; CHECK-LABEL: @test_combine_vector_ptrtoint( ; CHECK-NEXT: %p = extractelement <2 x i32 addrspace(2)*> %a, i32 0 -; CHECK-NEXT: %y = load i32 addrspace(2)* %p, align 4 +; CHECK-NEXT: %y = load i32, i32 addrspace(2)* %p, align 4 ; CHECK-NEXT: ret i32 %y %cast = ptrtoint <2 x i32 addrspace(2)*> %a to <2 x i8> %castback = inttoptr <2 x i8> %cast to <2 x i32 addrspace(2)*> %p = extractelement <2 x i32 addrspace(2)*> %castback, i32 0 - %y = load i32 addrspace(2)* %p, align 4 + %y = load i32, i32 addrspace(2)* %p, align 4 ret i32 %y } @@ -75,38 +75,38 @@ define <2 x i8> @test_combine_vector_inttoptr(<2 x i8> %a) { ; Check that the GEP index is changed to the address space integer type (i64 -> i8) define i32 addrspace(2)* @shrink_gep_constant_index_64_as2(i32 addrspace(2)* %p) { ; CHECK-LABEL: @shrink_gep_constant_index_64_as2( -; CHECK-NEXT: getelementptr i32 addrspace(2)* %p, i8 1 - %ret = getelementptr i32 addrspace(2)* %p, i64 1 +; CHECK-NEXT: getelementptr i32, i32 addrspace(2)* %p, i8 1 + %ret = getelementptr i32, i32 addrspace(2)* %p, i64 1 ret i32 addrspace(2)* %ret } define i32 addrspace(2)* @shrink_gep_constant_index_32_as2(i32 addrspace(2)* %p) { ; CHECK-LABEL: @shrink_gep_constant_index_32_as2( -; CHECK-NEXT: getelementptr i32 addrspace(2)* %p, i8 1 - %ret = getelementptr i32 addrspace(2)* %p, i32 1 +; CHECK-NEXT: getelementptr i32, i32 addrspace(2)* %p, i8 1 + %ret = getelementptr i32, i32 addrspace(2)* %p, i32 1 ret i32 addrspace(2)* %ret } define i32 addrspace(3)* @shrink_gep_constant_index_64_as3(i32 addrspace(3)* %p) { ; CHECK-LABEL: @shrink_gep_constant_index_64_as3( -; CHECK-NEXT: getelementptr i32 addrspace(3)* %p, i16 1 - %ret = getelementptr i32 addrspace(3)* %p, i64 1 +; CHECK-NEXT: getelementptr i32, i32 addrspace(3)* %p, i16 1 + %ret = getelementptr i32, i32 addrspace(3)* %p, i64 1 ret i32 addrspace(3)* %ret } define i32 addrspace(2)* @shrink_gep_variable_index_64_as2(i32 addrspace(2)* %p, i64 %idx) { ; CHECK-LABEL: @shrink_gep_variable_index_64_as2( ; CHECK-NEXT: %1 = trunc i64 %idx to i8 -; CHECK-NEXT: getelementptr i32 addrspace(2)* %p, i8 %1 - %ret = getelementptr i32 addrspace(2)* %p, i64 %idx +; CHECK-NEXT: getelementptr i32, i32 addrspace(2)* %p, i8 %1 + %ret = getelementptr i32, i32 addrspace(2)* %p, i64 %idx ret i32 addrspace(2)* %ret } define i32 addrspace(1)* @grow_gep_variable_index_8_as1(i32 addrspace(1)* %p, i8 %idx) { ; CHECK-LABEL: @grow_gep_variable_index_8_as1( ; CHECK-NEXT: %1 = sext i8 %idx to i64 -; CHECK-NEXT: getelementptr i32 addrspace(1)* %p, i64 %1 - %ret = getelementptr i32 addrspace(1)* %p, i8 %idx +; CHECK-NEXT: getelementptr i32, i32 addrspace(1)* %p, i64 %1 + %ret = getelementptr i32, i32 addrspace(1)* %p, i8 %idx ret i32 addrspace(1)* %ret } diff --git a/test/Transforms/InstCombine/no-negzero.ll b/test/Transforms/InstCombine/no-negzero.ll index 4ed2836..07e6825 100644 --- a/test/Transforms/InstCombine/no-negzero.ll +++ b/test/Transforms/InstCombine/no-negzero.ll @@ -14,17 +14,17 @@ entry: %0 = alloca double, align 8 ; <double*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store double %x, double* %x_addr - %1 = load double* %x_addr, align 8 ; <double> [#uses=1] + %1 = load double, double* %x_addr, align 8 ; <double> [#uses=1] %2 = call double @fabs(double %1) nounwind readnone ; <double> [#uses=1] %3 = call double @sqrt(double %2) nounwind readonly ; <double> [#uses=1] %4 = fadd double %3, 0.000000e+00 ; <double> [#uses=1] store double %4, double* %0, align 8 - %5 = load double* %0, align 8 ; <double> [#uses=1] + %5 = load double, double* %0, align 8 ; <double> [#uses=1] store double %5, double* %retval, align 8 br label %return return: ; preds = %entry - %retval1 = load double* %retval ; <double> [#uses=1] + %retval1 = load double, double* %retval ; <double> [#uses=1] ret double %retval1 } diff --git a/test/Transforms/InstCombine/obfuscated_splat.ll b/test/Transforms/InstCombine/obfuscated_splat.ll index fa9cb42..c37456c 100644 --- a/test/Transforms/InstCombine/obfuscated_splat.ll +++ b/test/Transforms/InstCombine/obfuscated_splat.ll @@ -1,7 +1,7 @@ ; RUN: opt -instcombine -S < %s | FileCheck %s define void @test(<4 x float> *%in_ptr, <4 x float> *%out_ptr) { - %A = load <4 x float>* %in_ptr, align 16 + %A = load <4 x float>, <4 x float>* %in_ptr, align 16 %B = shufflevector <4 x float> %A, <4 x float> undef, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef> %C = shufflevector <4 x float> %B, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 4, i32 undef> %D = shufflevector <4 x float> %C, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 2, i32 4> diff --git a/test/Transforms/InstCombine/objsize-address-space.ll b/test/Transforms/InstCombine/objsize-address-space.ll index a971c91..6046dad 100644 --- a/test/Transforms/InstCombine/objsize-address-space.ll +++ b/test/Transforms/InstCombine/objsize-address-space.ll @@ -21,20 +21,20 @@ declare i16 @llvm.objectsize.i16.p3i8(i8 addrspace(3)*, i1) nounwind readonly define i32 @foo_as3() nounwind { ; CHECK-LABEL: @foo_as3( ; CHECK-NEXT: ret i32 60 - %1 = call i32 @llvm.objectsize.i32.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8] addrspace(3)* @a_as3, i32 0, i32 0), i1 false) + %1 = call i32 @llvm.objectsize.i32.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8], [60 x i8] addrspace(3)* @a_as3, i32 0, i32 0), i1 false) ret i32 %1 } define i16 @foo_as3_i16() nounwind { ; CHECK-LABEL: @foo_as3_i16( ; CHECK-NEXT: ret i16 60 - %1 = call i16 @llvm.objectsize.i16.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8] addrspace(3)* @a_as3, i32 0, i32 0), i1 false) + %1 = call i16 @llvm.objectsize.i16.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8], [60 x i8] addrspace(3)* @a_as3, i32 0, i32 0), i1 false) ret i16 %1 } @a_alias = weak alias [60 x i8] addrspace(3)* @a_as3 define i32 @foo_alias() nounwind { - %1 = call i32 @llvm.objectsize.i32.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8] addrspace(3)* @a_alias, i32 0, i32 0), i1 false) + %1 = call i32 @llvm.objectsize.i32.p3i8(i8 addrspace(3)* getelementptr inbounds ([60 x i8], [60 x i8] addrspace(3)* @a_alias, i32 0, i32 0), i1 false) ret i32 %1 } diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index 1285b1c..3125458 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/test/Transforms/InstCombine/objsize.ll @@ -8,7 +8,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i32 @foo() nounwind { ; CHECK-LABEL: @foo( ; CHECK-NEXT: ret i32 60 - %1 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) + %1 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false) ret i32 %1 } @@ -16,24 +16,24 @@ define i8* @bar() nounwind { ; CHECK-LABEL: @bar( entry: %retval = alloca i8* - %0 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) + %0 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false) %cmp = icmp ne i32 %0, -1 ; CHECK: br i1 true br i1 %cmp, label %cond.true, label %cond.false cond.true: - %1 = load i8** %retval + %1 = load i8*, i8** %retval ret i8* %1 cond.false: - %2 = load i8** %retval + %2 = load i8*, i8** %retval ret i8* %2 } define i32 @f() nounwind { ; CHECK-LABEL: @f( ; CHECK-NEXT: ret i32 0 - %1 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr ([60 x i8]* @a, i32 1, i32 0), i1 false) + %1 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr ([60 x i8], [60 x i8]* @a, i32 1, i32 0), i1 false) ret i32 %1 } @@ -42,7 +42,7 @@ define i32 @f() nounwind { define i1 @baz() nounwind { ; CHECK-LABEL: @baz( ; CHECK-NEXT: objectsize - %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([0 x i8]* @window, i32 0, i32 0), i1 false) + %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @window, i32 0, i32 0), i1 false) %2 = icmp eq i32 %1, -1 ret i1 %2 } @@ -51,7 +51,7 @@ define void @test1(i8* %q, i32 %x) nounwind noinline { ; CHECK-LABEL: @test1( ; CHECK: objectsize.i32.p0i8 entry: - %0 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([0 x i8]* @window, i32 0, i32 10), i1 false) ; <i64> [#uses=1] + %0 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @window, i32 0, i32 10), i1 false) ; <i64> [#uses=1] %1 = icmp eq i32 %0, -1 ; <i1> [#uses=1] br i1 %1, label %"47", label %"46" @@ -67,7 +67,7 @@ entry: define i32 @test2() nounwind { ; CHECK-LABEL: @test2( ; CHECK-NEXT: ret i32 34 - %1 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr (i8* bitcast ([9 x i32]* @.str5 to i8*), i32 2), i1 false) + %1 = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr (i8, i8* bitcast ([9 x i32]* @.str5 to i8*), i32 2), i1 false) ret i32 %1 } @@ -86,7 +86,7 @@ entry: br i1 undef, label %bb11, label %bb12 bb11: - %0 = getelementptr inbounds float* getelementptr inbounds ([480 x float]* @array, i32 0, i32 128), i32 -127 ; <float*> [#uses=1] + %0 = getelementptr inbounds float, float* getelementptr inbounds ([480 x float], [480 x float]* @array, i32 0, i32 128), i32 -127 ; <float*> [#uses=1] %1 = bitcast float* %0 to i8* ; <i8*> [#uses=1] %2 = call i32 @llvm.objectsize.i32.p0i8(i8* %1, i1 false) ; <i32> [#uses=1] %3 = call i8* @__memcpy_chk(i8* undef, i8* undef, i32 512, i32 %2) nounwind ; <i8*> [#uses=0] @@ -94,7 +94,7 @@ bb11: unreachable bb12: - %4 = getelementptr inbounds float* getelementptr inbounds ([480 x float]* @array, i32 0, i32 128), i32 -127 ; <float*> [#uses=1] + %4 = getelementptr inbounds float, float* getelementptr inbounds ([480 x float], [480 x float]* @array, i32 0, i32 128), i32 -127 ; <float*> [#uses=1] %5 = bitcast float* %4 to i8* ; <i8*> [#uses=1] %6 = call i8* @__inline_memcpy_chk(i8* %5, i8* undef, i32 512) nounwind inlinehint ; <i8*> [#uses=0] ; CHECK: @__inline_memcpy_chk @@ -126,7 +126,7 @@ define i8* @test5(i32 %n) nounwind ssp { entry: %0 = tail call noalias i8* @malloc(i32 20) nounwind %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %0, i1 false) - %2 = load i8** @s, align 8 + %2 = load i8*, i8** @s, align 8 ; CHECK-NOT: @llvm.objectsize ; CHECK: @llvm.memcpy.p0i8.p0i8.i32(i8* %0, i8* %1, i32 10, i32 1, i1 false) %3 = tail call i8* @__memcpy_chk(i8* %0, i8* %2, i32 10, i32 %1) nounwind @@ -138,7 +138,7 @@ define void @test6(i32 %n) nounwind ssp { entry: %0 = tail call noalias i8* @malloc(i32 20) nounwind %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %0, i1 false) - %2 = load i8** @s, align 8 + %2 = load i8*, i8** @s, align 8 ; CHECK-NOT: @llvm.objectsize ; CHECK: @__memcpy_chk(i8* %0, i8* %1, i32 30, i32 20) %3 = tail call i8* @__memcpy_chk(i8* %0, i8* %2, i32 30, i32 %1) nounwind @@ -153,7 +153,7 @@ define i32 @test7(i8** %esc) { ; CHECK-LABEL: @test7( %alloc = call noalias i8* @malloc(i32 48) nounwind store i8* %alloc, i8** %esc - %gep = getelementptr inbounds i8* %alloc, i32 16 + %gep = getelementptr inbounds i8, i8* %alloc, i32 16 %objsize = call i32 @llvm.objectsize.i32.p0i8(i8* %gep, i1 false) nounwind readonly ; CHECK: ret i32 32 ret i32 %objsize @@ -165,7 +165,7 @@ define i32 @test8(i8** %esc) { ; CHECK-LABEL: @test8( %alloc = call noalias i8* @calloc(i32 5, i32 7) nounwind store i8* %alloc, i8** %esc - %gep = getelementptr inbounds i8* %alloc, i32 5 + %gep = getelementptr inbounds i8, i8* %alloc, i32 5 %objsize = call i32 @llvm.objectsize.i32.p0i8(i8* %gep, i1 false) nounwind readonly ; CHECK: ret i32 30 ret i32 %objsize @@ -176,7 +176,7 @@ declare noalias i8* @strndup(i8* nocapture, i32) nounwind ; CHECK-LABEL: @test9( define i32 @test9(i8** %esc) { - %call = tail call i8* @strdup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0)) nounwind + %call = tail call i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)) nounwind store i8* %call, i8** %esc, align 8 %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %call, i1 true) ; CHECK: ret i32 8 @@ -185,7 +185,7 @@ define i32 @test9(i8** %esc) { ; CHECK-LABEL: @test10( define i32 @test10(i8** %esc) { - %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 3) nounwind + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 3) nounwind store i8* %call, i8** %esc, align 8 %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %call, i1 true) ; CHECK: ret i32 4 @@ -194,7 +194,7 @@ define i32 @test10(i8** %esc) { ; CHECK-LABEL: @test11( define i32 @test11(i8** %esc) { - %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 7) nounwind + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7) nounwind store i8* %call, i8** %esc, align 8 %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %call, i1 true) ; CHECK: ret i32 8 @@ -203,7 +203,7 @@ define i32 @test11(i8** %esc) { ; CHECK-LABEL: @test12( define i32 @test12(i8** %esc) { - %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 8) nounwind + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 8) nounwind store i8* %call, i8** %esc, align 8 %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %call, i1 true) ; CHECK: ret i32 8 @@ -212,7 +212,7 @@ define i32 @test12(i8** %esc) { ; CHECK-LABEL: @test13( define i32 @test13(i8** %esc) { - %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 57) nounwind + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 57) nounwind store i8* %call, i8** %esc, align 8 %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %call, i1 true) ; CHECK: ret i32 8 @@ -246,8 +246,8 @@ entry: ; technically reachable, but this malformed IR may appear as a result of constant propagation xpto: - %gep2 = getelementptr i8* %gep, i32 1 - %gep = getelementptr i8* %gep2, i32 1 + %gep2 = getelementptr i8, i8* %gep, i32 1 + %gep = getelementptr i8, i8* %gep2, i32 1 %o = call i32 @llvm.objectsize.i32.p0i8(i8* %gep, i1 true) ; CHECK: ret i32 undef ret i32 %o diff --git a/test/Transforms/InstCombine/odr-linkage.ll b/test/Transforms/InstCombine/odr-linkage.ll index 2ce6246..73675ef 100644 --- a/test/Transforms/InstCombine/odr-linkage.ll +++ b/test/Transforms/InstCombine/odr-linkage.ll @@ -6,10 +6,10 @@ @g4 = internal constant i32 4 define i32 @test() { - %A = load i32* @g1 - %B = load i32* @g2 - %C = load i32* @g3 - %D = load i32* @g4 + %A = load i32, i32* @g1 + %B = load i32, i32* @g2 + %C = load i32, i32* @g3 + %D = load i32, i32* @g4 %a = add i32 %A, %B %b = add i32 %a, %C diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index f604baf..b91a595 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -394,7 +394,7 @@ define i32 @test37(i32* %xp, i32 %y) { ; CHECK: select i1 %tobool, i32 -1, i32 %x %tobool = icmp ne i32 %y, 0 %sext = sext i1 %tobool to i32 - %x = load i32* %xp + %x = load i32, i32* %xp %or = or i32 %sext, %x ret i32 %or } @@ -404,7 +404,7 @@ define i32 @test38(i32* %xp, i32 %y) { ; CHECK: select i1 %tobool, i32 -1, i32 %x %tobool = icmp ne i32 %y, 0 %sext = sext i1 %tobool to i32 - %x = load i32* %xp + %x = load i32, i32* %xp %or = or i32 %x, %sext ret i32 %or } diff --git a/test/Transforms/InstCombine/osx-names.ll b/test/Transforms/InstCombine/osx-names.ll index 926caad..ed379c5 100644 --- a/test/Transforms/InstCombine/osx-names.ll +++ b/test/Transforms/InstCombine/osx-names.ll @@ -16,14 +16,14 @@ target triple = "i386-apple-macosx10.7.2" define void @test1(%struct.__sFILE* %stream) nounwind { ; CHECK-LABEL: define void @test1( ; CHECK: call i32 @"fwrite$UNIX2003" - %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0)) nounwind + %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0)) nounwind ret void } define void @test2(%struct.__sFILE* %stream, i8* %str) nounwind ssp { ; CHECK-LABEL: define void @test2( ; CHECK: call i32 @"fputs$UNIX2003" - %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([3 x i8]* @.str2, i32 0, i32 0), i8* %str) nounwind + %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str2, i32 0, i32 0), i8* %str) nounwind ret void } diff --git a/test/Transforms/InstCombine/overflow-mul.ll b/test/Transforms/InstCombine/overflow-mul.ll index 6d8d40b..bc0504b 100644 --- a/test/Transforms/InstCombine/overflow-mul.ll +++ b/test/Transforms/InstCombine/overflow-mul.ll @@ -174,6 +174,17 @@ define <4 x i32> @pr20113(<4 x i16> %a, <4 x i16> %b) { ret <4 x i32> %vcgez.i } + +; The last test needs this weird datalayout. +target datalayout = "i32:8:8" +; Without it, InstCombine will align the pointed on 4 Bytes +; The KnownBitsZero that result from the alignment allows to +; turn: +; and i32 %mul, 255 +; to: +; and i32 %mul, 252 +; The mask is no longer in the form 2^n-1 and this prevents the transformation. + @pr21445_data = external global i32 define i1 @pr21445(i8 %a) { ; CHECK-LABEL: @pr21445( diff --git a/test/Transforms/InstCombine/phi-merge-gep.ll b/test/Transforms/InstCombine/phi-merge-gep.ll index 25c9cea..b548e51 100644 --- a/test/Transforms/InstCombine/phi-merge-gep.ll +++ b/test/Transforms/InstCombine/phi-merge-gep.ll @@ -7,39 +7,39 @@ define void @foo(float* %Ar, float* %Ai, i64 %As, float* %Cr, float* %Ci, i64 %Cs, i64 %n) nounwind { entry: - %0 = getelementptr inbounds float* %Ar, i64 0 ; <float*> [#uses=1] - %1 = getelementptr inbounds float* %Ai, i64 0 ; <float*> [#uses=1] + %0 = getelementptr inbounds float, float* %Ar, i64 0 ; <float*> [#uses=1] + %1 = getelementptr inbounds float, float* %Ai, i64 0 ; <float*> [#uses=1] %2 = mul i64 %n, %As ; <i64> [#uses=1] - %3 = getelementptr inbounds float* %Ar, i64 %2 ; <float*> [#uses=1] + %3 = getelementptr inbounds float, float* %Ar, i64 %2 ; <float*> [#uses=1] %4 = mul i64 %n, %As ; <i64> [#uses=1] - %5 = getelementptr inbounds float* %Ai, i64 %4 ; <float*> [#uses=1] + %5 = getelementptr inbounds float, float* %Ai, i64 %4 ; <float*> [#uses=1] %6 = mul i64 %n, 2 ; <i64> [#uses=1] %7 = mul i64 %6, %As ; <i64> [#uses=1] - %8 = getelementptr inbounds float* %Ar, i64 %7 ; <float*> [#uses=1] + %8 = getelementptr inbounds float, float* %Ar, i64 %7 ; <float*> [#uses=1] %9 = mul i64 %n, 2 ; <i64> [#uses=1] %10 = mul i64 %9, %As ; <i64> [#uses=1] - %11 = getelementptr inbounds float* %Ai, i64 %10 ; <float*> [#uses=1] - %12 = getelementptr inbounds float* %Cr, i64 0 ; <float*> [#uses=1] - %13 = getelementptr inbounds float* %Ci, i64 0 ; <float*> [#uses=1] + %11 = getelementptr inbounds float, float* %Ai, i64 %10 ; <float*> [#uses=1] + %12 = getelementptr inbounds float, float* %Cr, i64 0 ; <float*> [#uses=1] + %13 = getelementptr inbounds float, float* %Ci, i64 0 ; <float*> [#uses=1] %14 = mul i64 %n, %Cs ; <i64> [#uses=1] - %15 = getelementptr inbounds float* %Cr, i64 %14 ; <float*> [#uses=1] + %15 = getelementptr inbounds float, float* %Cr, i64 %14 ; <float*> [#uses=1] %16 = mul i64 %n, %Cs ; <i64> [#uses=1] - %17 = getelementptr inbounds float* %Ci, i64 %16 ; <float*> [#uses=1] + %17 = getelementptr inbounds float, float* %Ci, i64 %16 ; <float*> [#uses=1] %18 = mul i64 %n, 2 ; <i64> [#uses=1] %19 = mul i64 %18, %Cs ; <i64> [#uses=1] - %20 = getelementptr inbounds float* %Cr, i64 %19 ; <float*> [#uses=1] + %20 = getelementptr inbounds float, float* %Cr, i64 %19 ; <float*> [#uses=1] %21 = mul i64 %n, 2 ; <i64> [#uses=1] %22 = mul i64 %21, %Cs ; <i64> [#uses=1] - %23 = getelementptr inbounds float* %Ci, i64 %22 ; <float*> [#uses=1] + %23 = getelementptr inbounds float, float* %Ci, i64 %22 ; <float*> [#uses=1] br label %bb13 bb: ; preds = %bb13 - %24 = load float* %A0r.0, align 4 ; <float> [#uses=1] - %25 = load float* %A0i.0, align 4 ; <float> [#uses=1] - %26 = load float* %A1r.0, align 4 ; <float> [#uses=2] - %27 = load float* %A1i.0, align 4 ; <float> [#uses=2] - %28 = load float* %A2r.0, align 4 ; <float> [#uses=2] - %29 = load float* %A2i.0, align 4 ; <float> [#uses=2] + %24 = load float, float* %A0r.0, align 4 ; <float> [#uses=1] + %25 = load float, float* %A0i.0, align 4 ; <float> [#uses=1] + %26 = load float, float* %A1r.0, align 4 ; <float> [#uses=2] + %27 = load float, float* %A1i.0, align 4 ; <float> [#uses=2] + %28 = load float, float* %A2r.0, align 4 ; <float> [#uses=2] + %29 = load float, float* %A2i.0, align 4 ; <float> [#uses=2] %30 = fadd float %26, %28 ; <float> [#uses=2] %31 = fadd float %27, %29 ; <float> [#uses=2] %32 = fsub float %26, %28 ; <float> [#uses=1] @@ -62,18 +62,18 @@ bb: ; preds = %bb13 store float %43, float* %C1i.0, align 4 store float %44, float* %C2r.0, align 4 store float %45, float* %C2i.0, align 4 - %46 = getelementptr inbounds float* %A0r.0, i64 %As ; <float*> [#uses=1] - %47 = getelementptr inbounds float* %A0i.0, i64 %As ; <float*> [#uses=1] - %48 = getelementptr inbounds float* %A1r.0, i64 %As ; <float*> [#uses=1] - %49 = getelementptr inbounds float* %A1i.0, i64 %As ; <float*> [#uses=1] - %50 = getelementptr inbounds float* %A2r.0, i64 %As ; <float*> [#uses=1] - %51 = getelementptr inbounds float* %A2i.0, i64 %As ; <float*> [#uses=1] - %52 = getelementptr inbounds float* %C0r.0, i64 %Cs ; <float*> [#uses=1] - %53 = getelementptr inbounds float* %C0i.0, i64 %Cs ; <float*> [#uses=1] - %54 = getelementptr inbounds float* %C1r.0, i64 %Cs ; <float*> [#uses=1] - %55 = getelementptr inbounds float* %C1i.0, i64 %Cs ; <float*> [#uses=1] - %56 = getelementptr inbounds float* %C2r.0, i64 %Cs ; <float*> [#uses=1] - %57 = getelementptr inbounds float* %C2i.0, i64 %Cs ; <float*> [#uses=1] + %46 = getelementptr inbounds float, float* %A0r.0, i64 %As ; <float*> [#uses=1] + %47 = getelementptr inbounds float, float* %A0i.0, i64 %As ; <float*> [#uses=1] + %48 = getelementptr inbounds float, float* %A1r.0, i64 %As ; <float*> [#uses=1] + %49 = getelementptr inbounds float, float* %A1i.0, i64 %As ; <float*> [#uses=1] + %50 = getelementptr inbounds float, float* %A2r.0, i64 %As ; <float*> [#uses=1] + %51 = getelementptr inbounds float, float* %A2i.0, i64 %As ; <float*> [#uses=1] + %52 = getelementptr inbounds float, float* %C0r.0, i64 %Cs ; <float*> [#uses=1] + %53 = getelementptr inbounds float, float* %C0i.0, i64 %Cs ; <float*> [#uses=1] + %54 = getelementptr inbounds float, float* %C1r.0, i64 %Cs ; <float*> [#uses=1] + %55 = getelementptr inbounds float, float* %C1i.0, i64 %Cs ; <float*> [#uses=1] + %56 = getelementptr inbounds float, float* %C2r.0, i64 %Cs ; <float*> [#uses=1] + %57 = getelementptr inbounds float, float* %C2i.0, i64 %Cs ; <float*> [#uses=1] %58 = add nsw i64 %i.0, 1 ; <i64> [#uses=1] br label %bb13 diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll index 6e31465..54cc4cf 100644 --- a/test/Transforms/InstCombine/phi.ll +++ b/test/Transforms/InstCombine/phi.ll @@ -125,11 +125,11 @@ Exit: ; preds = %Loop define i32* @test8({ i32, i32 } *%A, i1 %b) { BB0: - %X = getelementptr inbounds { i32, i32 } *%A, i32 0, i32 1 + %X = getelementptr inbounds { i32, i32 }, { i32, i32 } *%A, i32 0, i32 1 br i1 %b, label %BB1, label %BB2 BB1: - %Y = getelementptr { i32, i32 } *%A, i32 0, i32 1 + %Y = getelementptr { i32, i32 }, { i32, i32 } *%A, i32 0, i32 1 br label %BB2 BB2: @@ -139,7 +139,7 @@ BB2: ; CHECK-LABEL: @test8( ; CHECK-NOT: phi ; CHECK: BB2: -; CHECK-NEXT: %B = getelementptr { i32, i32 }* %A +; CHECK-NEXT: %B = getelementptr { i32, i32 }, { i32, i32 }* %A ; CHECK-NEXT: ret i32* %B } @@ -149,11 +149,11 @@ entry: br i1 %c, label %bb1, label %bb bb: - %C = load i32* %B, align 1 + %C = load i32, i32* %B, align 1 br label %bb2 bb1: - %D = load i32* %A, align 1 + %D = load i32, i32* %A, align 1 br label %bb2 bb2: @@ -162,7 +162,7 @@ bb2: ; CHECK-LABEL: @test9( ; CHECK: bb2: ; CHECK-NEXT: phi i32* [ %B, %bb ], [ %A, %bb1 ] -; CHECK-NEXT: %E = load i32* %{{[^,]*}}, align 1 +; CHECK-NEXT: %E = load i32, i32* %{{[^,]*}}, align 1 ; CHECK-NEXT: ret i32 %E } @@ -173,11 +173,11 @@ entry: br i1 %c, label %bb1, label %bb bb: - %C = load i32* %B, align 16 + %C = load i32, i32* %B, align 16 br label %bb2 bb1: - %D = load i32* %A, align 32 + %D = load i32, i32* %A, align 32 br label %bb2 bb2: @@ -186,7 +186,7 @@ bb2: ; CHECK-LABEL: @test10( ; CHECK: bb2: ; CHECK-NEXT: phi i32* [ %B, %bb ], [ %A, %bb1 ] -; CHECK-NEXT: %E = load i32* %{{[^,]*}}, align 16 +; CHECK-NEXT: %E = load i32, i32* %{{[^,]*}}, align 16 ; CHECK-NEXT: ret i32 %E } @@ -375,30 +375,30 @@ entry: store i32 %flag, i32* %flag.addr store i32* %pointer2, i32** %pointer2.addr store i32 10, i32* %res - %tmp = load i32* %flag.addr ; <i32> [#uses=1] + %tmp = load i32, i32* %flag.addr ; <i32> [#uses=1] %tobool = icmp ne i32 %tmp, 0 ; <i1> [#uses=1] br i1 %tobool, label %if.then, label %if.else return: ; preds = %if.end - %tmp7 = load i32* %retval ; <i32> [#uses=1] + %tmp7 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %tmp7 if.end: ; preds = %if.else, %if.then - %tmp6 = load i32* %res ; <i32> [#uses=1] + %tmp6 = load i32, i32* %res ; <i32> [#uses=1] store i32 %tmp6, i32* %retval br label %return if.then: ; preds = %entry - %tmp1 = load i32 addrspace(1)** %pointer1.addr ; <i32 addrspace(1)*> - %arrayidx = getelementptr i32 addrspace(1)* %tmp1, i32 0 ; <i32 addrspace(1)*> [#uses=1] - %tmp2 = load i32 addrspace(1)* %arrayidx ; <i32> [#uses=1] + %tmp1 = load i32 addrspace(1)*, i32 addrspace(1)** %pointer1.addr ; <i32 addrspace(1)*> + %arrayidx = getelementptr i32, i32 addrspace(1)* %tmp1, i32 0 ; <i32 addrspace(1)*> [#uses=1] + %tmp2 = load i32, i32 addrspace(1)* %arrayidx ; <i32> [#uses=1] store i32 %tmp2, i32* %res br label %if.end if.else: ; preds = %entry - %tmp3 = load i32** %pointer2.addr ; <i32*> [#uses=1] - %arrayidx4 = getelementptr i32* %tmp3, i32 0 ; <i32*> [#uses=1] - %tmp5 = load i32* %arrayidx4 ; <i32> [#uses=1] + %tmp3 = load i32*, i32** %pointer2.addr ; <i32*> [#uses=1] + %arrayidx4 = getelementptr i32, i32* %tmp3, i32 0 ; <i32*> [#uses=1] + %tmp5 = load i32, i32* %arrayidx4 ; <i32> [#uses=1] store i32 %tmp5, i32* %res br label %if.end } diff --git a/test/Transforms/InstCombine/pr12251.ll b/test/Transforms/InstCombine/pr12251.ll index 8c382bb..7197bda 100644 --- a/test/Transforms/InstCombine/pr12251.ll +++ b/test/Transforms/InstCombine/pr12251.ll @@ -2,13 +2,13 @@ define zeroext i1 @_Z3fooPb(i8* nocapture %x) { entry: - %a = load i8* %x, align 1, !range !0 + %a = load i8, i8* %x, align 1, !range !0 %b = and i8 %a, 1 %tobool = icmp ne i8 %b, 0 ret i1 %tobool } -; CHECK: %a = load i8* %x, align 1, !range !0 +; CHECK: %a = load i8, i8* %x, align 1, !range !0 ; CHECK-NEXT: %tobool = icmp ne i8 %a, 0 ; CHECK-NEXT: ret i1 %tobool diff --git a/test/Transforms/InstCombine/pr21651.ll b/test/Transforms/InstCombine/pr21651.ll index 914785f..d2b8d31 100644 --- a/test/Transforms/InstCombine/pr21651.ll +++ b/test/Transforms/InstCombine/pr21651.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @PR21651() { switch i2 0, label %out [ i2 0, label %out diff --git a/test/Transforms/InstCombine/pr2645-0.ll b/test/Transforms/InstCombine/pr2645-0.ll index e8aeb2a..21bfa64 100644 --- a/test/Transforms/InstCombine/pr2645-0.ll +++ b/test/Transforms/InstCombine/pr2645-0.ll @@ -6,10 +6,10 @@ define internal void @""(i8*) { ; <label>:1 bitcast i8* %0 to i32* ; <i32*>:2 [#uses=1] - load i32* %2, align 1 ; <i32>:3 [#uses=1] - getelementptr i8* %0, i32 4 ; <i8*>:4 [#uses=1] + load i32, i32* %2, align 1 ; <i32>:3 [#uses=1] + getelementptr i8, i8* %0, i32 4 ; <i8*>:4 [#uses=1] bitcast i8* %4 to i32* ; <i32*>:5 [#uses=1] - load i32* %5, align 1 ; <i32>:6 [#uses=1] + load i32, i32* %5, align 1 ; <i32>:6 [#uses=1] br label %7 ; <label>:7 ; preds = %9, %1 @@ -22,7 +22,7 @@ define internal void @""(i8*) { sitofp i32 %.0 to float ; <float>:10 [#uses=1] insertelement <4 x float> %.01, float %10, i32 0 ; <<4 x float>>:11 [#uses=1] shufflevector <4 x float> %11, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>>:12 [#uses=2] - getelementptr i8* %0, i32 48 ; <i8*>:13 [#uses=1] + getelementptr i8, i8* %0, i32 48 ; <i8*>:13 [#uses=1] bitcast i8* %13 to <4 x float>* ; <<4 x float>*>:14 [#uses=1] store <4 x float> %12, <4 x float>* %14, align 16 add i32 %.0, 2 ; <i32>:15 [#uses=1] diff --git a/test/Transforms/InstCombine/pr2645-1.ll b/test/Transforms/InstCombine/pr2645-1.ll index d320daf..2986d21 100644 --- a/test/Transforms/InstCombine/pr2645-1.ll +++ b/test/Transforms/InstCombine/pr2645-1.ll @@ -13,9 +13,9 @@ define internal void @""(i8*, i32, i8*) { br i1 %5, label %6, label %20 ; <label>:6 ; preds = %4 - %7 = getelementptr i8* %2, i32 %.0 ; <i8*> [#uses=1] + %7 = getelementptr i8, i8* %2, i32 %.0 ; <i8*> [#uses=1] %8 = bitcast i8* %7 to <4 x i16>* ; <<4 x i16>*> [#uses=1] - %9 = load <4 x i16>* %8, align 1 ; <<4 x i16>> [#uses=1] + %9 = load <4 x i16>, <4 x i16>* %8, align 1 ; <<4 x i16>> [#uses=1] %10 = bitcast <4 x i16> %9 to <1 x i64> ; <<1 x i64>> [#uses=1] %11 = call <2 x i64> @foo(<1 x i64> %10) ; <<2 x i64>> [#uses=1] @@ -24,7 +24,7 @@ define internal void @""(i8*, i32, i8*) { %14 = shufflevector <8 x i16> %13, <8 x i16> %13, <8 x i32> < i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3 > ; <<8 x i16>> [#uses=1] %15 = bitcast <8 x i16> %14 to <4 x i32> ; <<4 x i32>> [#uses=1] %16 = sitofp <4 x i32> %15 to <4 x float> ; <<4 x float>> [#uses=1] - %17 = getelementptr i8* %0, i32 %.0 ; <i8*> [#uses=1] + %17 = getelementptr i8, i8* %0, i32 %.0 ; <i8*> [#uses=1] %18 = bitcast i8* %17 to <4 x float>* ; <<4 x float>*> [#uses=1] store <4 x float> %16, <4 x float>* %18, align 1 %19 = add i32 %.0, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/InstCombine/pr8547.ll b/test/Transforms/InstCombine/pr8547.ll index 7e9cbe1..f6b3374 100644 --- a/test/Transforms/InstCombine/pr8547.ll +++ b/test/Transforms/InstCombine/pr8547.ll @@ -21,6 +21,6 @@ for.cond: ; preds = %for.cond, %codeRepl br i1 %tobool, label %for.cond, label %codeRepl2 codeRepl2: ; preds = %for.cond - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str, i64 0, i64 0), i32 %conv2) nounwind + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %conv2) nounwind ret i32 0 } diff --git a/test/Transforms/InstCombine/printf-1.ll b/test/Transforms/InstCombine/printf-1.ll index 483bc7a..3fe79ac 100644 --- a/test/Transforms/InstCombine/printf-1.ll +++ b/test/Transforms/InstCombine/printf-1.ll @@ -21,7 +21,7 @@ declare i32 @printf(i8*, ...) define void @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %fmt = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %fmt = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) ret void ; CHECK-NEXT: ret void @@ -31,7 +31,7 @@ define void @test_simplify1() { define void @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %fmt = getelementptr [2 x i8]* @h, i32 0, i32 0 + %fmt = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @putchar(i32 104) ret void @@ -40,7 +40,7 @@ define void @test_simplify2() { define void @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %fmt = getelementptr [2 x i8]* @percent, i32 0, i32 0 + %fmt = getelementptr [2 x i8], [2 x i8]* @percent, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @putchar(i32 37) ret void @@ -51,9 +51,9 @@ define void @test_simplify3() { define void @test_simplify4() { ; CHECK-LABEL: @test_simplify4( - %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt) -; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8]* [[STR]], i32 0, i32 0)) +; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* [[STR]], i32 0, i32 0)) ret void ; CHECK-NEXT: ret void } @@ -62,7 +62,7 @@ define void @test_simplify4() { define void @test_simplify5() { ; CHECK-LABEL: @test_simplify5( - %fmt = getelementptr [3 x i8]* @percent_c, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_c, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, i8 104) ; CHECK-NEXT: call i32 @putchar(i32 104) ret void @@ -73,10 +73,10 @@ define void @test_simplify5() { define void @test_simplify6() { ; CHECK-LABEL: @test_simplify6( - %fmt = getelementptr [4 x i8]* @percent_s, i32 0, i32 0 - %str = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [4 x i8], [4 x i8]* @percent_s, i32 0, i32 0 + %str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, i8* %str) -; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0)) +; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0)) ret void ; CHECK-NEXT: ret void } @@ -85,18 +85,18 @@ define void @test_simplify6() { define void @test_simplify7() { ; CHECK-IPRINTF-LABEL: @test_simplify7( - %fmt = getelementptr [3 x i8]* @percent_d, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_d, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, i32 187) -; CHECK-IPRINTF-NEXT: call i32 (i8*, ...)* @iprintf(i8* getelementptr inbounds ([3 x i8]* @percent_d, i32 0, i32 0), i32 187) +; CHECK-IPRINTF-NEXT: call i32 (i8*, ...)* @iprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187) ret void ; CHECK-IPRINTF-NEXT: ret void } define void @test_no_simplify1() { ; CHECK-IPRINTF-LABEL: @test_no_simplify1( - %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0 call i32 (i8*, ...)* @printf(i8* %fmt, double 1.87) -; CHECK-IPRINTF-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) +; CHECK-IPRINTF-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) ret void ; CHECK-IPRINTF-NEXT: ret void } @@ -111,9 +111,9 @@ define void @test_no_simplify2(i8* %fmt, double %d) { define i32 @test_no_simplify3() { ; CHECK-LABEL: @test_no_simplify3( - %fmt = getelementptr [2 x i8]* @h, i32 0, i32 0 + %fmt = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0 %ret = call i32 (i8*, ...)* @printf(i8* %fmt) -; CHECK-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([2 x i8]* @h, i32 0, i32 0)) +; CHECK-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @h, i32 0, i32 0)) ret i32 %ret ; CHECK-NEXT: ret i32 %ret } diff --git a/test/Transforms/InstCombine/printf-2.ll b/test/Transforms/InstCombine/printf-2.ll index 7e018eb..d685824 100644 --- a/test/Transforms/InstCombine/printf-2.ll +++ b/test/Transforms/InstCombine/printf-2.ll @@ -14,7 +14,7 @@ declare void @printf(i8*, ...) define void @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %fmt = getelementptr [2 x i8]* @h, i32 0, i32 0 + %fmt = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0 call void (i8*, ...)* @printf(i8* %fmt) ; CHECK-NEXT: call i32 @putchar(i32 104) ret void @@ -23,19 +23,19 @@ define void @test_simplify1() { define void @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 call void (i8*, ...)* @printf(i8* %fmt) -; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @str, i32 0, i32 0)) +; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i32 0, i32 0)) ret void ; CHECK-NEXT: ret void } define void @test_simplify6() { ; CHECK-LABEL: @test_simplify6( - %fmt = getelementptr [4 x i8]* @percent_s, i32 0, i32 0 - %str = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [4 x i8], [4 x i8]* @percent_s, i32 0, i32 0 + %str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 call void (i8*, ...)* @printf(i8* %fmt, i8* %str) -; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0)) +; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0)) ret void ; CHECK-NEXT: ret void } diff --git a/test/Transforms/InstCombine/puts-1.ll b/test/Transforms/InstCombine/puts-1.ll index bd7557e..2102868 100644 --- a/test/Transforms/InstCombine/puts-1.ll +++ b/test/Transforms/InstCombine/puts-1.ll @@ -12,7 +12,7 @@ declare i32 @puts(i8*) define void @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %str = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 call i32 @puts(i8* %str) ; CHECK-NEXT: call i32 @putchar(i32 10) ret void @@ -23,9 +23,9 @@ define void @test_simplify1() { define i32 @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %str = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 %ret = call i32 @puts(i8* %str) -; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([1 x i8]* @empty, i32 0, i32 0)) +; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @empty, i32 0, i32 0)) ret i32 %ret ; CHECK-NEXT: ret i32 %ret } diff --git a/test/Transforms/InstCombine/select-cmp-br.ll b/test/Transforms/InstCombine/select-cmp-br.ll index f10d587..1dc7e15 100644 --- a/test/Transforms/InstCombine/select-cmp-br.ll +++ b/test/Transforms/InstCombine/select-cmp-br.ll @@ -9,13 +9,13 @@ declare void @foobar() define void @test1(%C*) { entry: - %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0 - %m = load i64** %1, align 8 - %2 = getelementptr inbounds %C* %0, i64 1, i32 0, i32 0 - %n = load i64** %2, align 8 - %3 = getelementptr inbounds i64* %m, i64 9 + %1 = getelementptr inbounds %C, %C* %0, i64 0, i32 0, i32 0 + %m = load i64*, i64** %1, align 8 + %2 = getelementptr inbounds %C, %C* %0, i64 1, i32 0, i32 0 + %n = load i64*, i64** %2, align 8 + %3 = getelementptr inbounds i64, i64* %m, i64 9 %4 = bitcast i64* %3 to i64 (%C*)** - %5 = load i64 (%C*)** %4, align 8 + %5 = load i64 (%C*)*, i64 (%C*)** %4, align 8 %6 = icmp eq i64* %m, %n %7 = select i1 %6, %C* %0, %C* null %8 = icmp eq %C* %7, null @@ -25,7 +25,7 @@ entry: ret void ; <label>:10 ; preds = %entry - %11 = getelementptr inbounds %C* %7, i64 0, i32 0 + %11 = getelementptr inbounds %C, %C* %7, i64 0, i32 0 tail call void @bar(%struct.S* %11) br label %9 @@ -40,13 +40,13 @@ entry: define void @test2(%C*) { entry: - %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0 - %m = load i64** %1, align 8 - %2 = getelementptr inbounds %C* %0, i64 1, i32 0, i32 0 - %n = load i64** %2, align 8 - %3 = getelementptr inbounds i64* %m, i64 9 + %1 = getelementptr inbounds %C, %C* %0, i64 0, i32 0, i32 0 + %m = load i64*, i64** %1, align 8 + %2 = getelementptr inbounds %C, %C* %0, i64 1, i32 0, i32 0 + %n = load i64*, i64** %2, align 8 + %3 = getelementptr inbounds i64, i64* %m, i64 9 %4 = bitcast i64* %3 to i64 (%C*)** - %5 = load i64 (%C*)** %4, align 8 + %5 = load i64 (%C*)*, i64 (%C*)** %4, align 8 %6 = icmp eq i64* %m, %n %7 = select i1 %6, %C* null, %C* %0 %8 = icmp eq %C* %7, null @@ -56,7 +56,7 @@ entry: ret void ; <label>:10 ; preds = %entry - %11 = getelementptr inbounds %C* %7, i64 0, i32 0 + %11 = getelementptr inbounds %C, %C* %7, i64 0, i32 0 tail call void @bar(%struct.S* %11) br label %9 @@ -71,13 +71,13 @@ entry: define void @test3(%C*) { entry: - %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0 - %m = load i64** %1, align 8 - %2 = getelementptr inbounds %C* %0, i64 1, i32 0, i32 0 - %n = load i64** %2, align 8 - %3 = getelementptr inbounds i64* %m, i64 9 + %1 = getelementptr inbounds %C, %C* %0, i64 0, i32 0, i32 0 + %m = load i64*, i64** %1, align 8 + %2 = getelementptr inbounds %C, %C* %0, i64 1, i32 0, i32 0 + %n = load i64*, i64** %2, align 8 + %3 = getelementptr inbounds i64, i64* %m, i64 9 %4 = bitcast i64* %3 to i64 (%C*)** - %5 = load i64 (%C*)** %4, align 8 + %5 = load i64 (%C*)*, i64 (%C*)** %4, align 8 %6 = icmp eq i64* %m, %n %7 = select i1 %6, %C* %0, %C* null %8 = icmp ne %C* %7, null @@ -87,7 +87,7 @@ entry: ret void ; <label>:10 ; preds = %entry - %11 = getelementptr inbounds %C* %7, i64 0, i32 0 + %11 = getelementptr inbounds %C, %C* %7, i64 0, i32 0 tail call void @bar(%struct.S* %11) br label %9 @@ -102,13 +102,13 @@ entry: define void @test4(%C*) { entry: - %1 = getelementptr inbounds %C* %0, i64 0, i32 0, i32 0 - %m = load i64** %1, align 8 - %2 = getelementptr inbounds %C* %0, i64 1, i32 0, i32 0 - %n = load i64** %2, align 8 - %3 = getelementptr inbounds i64* %m, i64 9 + %1 = getelementptr inbounds %C, %C* %0, i64 0, i32 0, i32 0 + %m = load i64*, i64** %1, align 8 + %2 = getelementptr inbounds %C, %C* %0, i64 1, i32 0, i32 0 + %n = load i64*, i64** %2, align 8 + %3 = getelementptr inbounds i64, i64* %m, i64 9 %4 = bitcast i64* %3 to i64 (%C*)** - %5 = load i64 (%C*)** %4, align 8 + %5 = load i64 (%C*)*, i64 (%C*)** %4, align 8 %6 = icmp eq i64* %m, %n %7 = select i1 %6, %C* null, %C* %0 %8 = icmp ne %C* %7, null @@ -118,7 +118,7 @@ entry: ret void ; <label>:10 ; preds = %entry - %11 = getelementptr inbounds %C* %7, i64 0, i32 0 + %11 = getelementptr inbounds %C, %C* %7, i64 0, i32 0 tail call void @bar(%struct.S* %11) br label %9 @@ -141,7 +141,7 @@ entry: ret void ; <label>:5 ; preds = %entry - %6 = getelementptr inbounds %C* %2, i64 0, i32 0 + %6 = getelementptr inbounds %C, %C* %2, i64 0, i32 0 tail call void @bar(%struct.S* %6) br label %4 diff --git a/test/Transforms/InstCombine/select-load-call.ll b/test/Transforms/InstCombine/select-load-call.ll index b63468d..ad0ef4f 100644 --- a/test/Transforms/InstCombine/select-load-call.ll +++ b/test/Transforms/InstCombine/select-load-call.ll @@ -10,6 +10,6 @@ define i32 @test(i1 %cond, i32 *%P) { call void @test2() readonly %P2 = select i1 %cond, i32 *%P, i32* %A - %V = load i32* %P2 + %V = load i32, i32* %P2 ret i32 %V } diff --git a/test/Transforms/InstCombine/select-select.ll b/test/Transforms/InstCombine/select-select.ll index 65820ac..768d1c4 100644 --- a/test/Transforms/InstCombine/select-select.ll +++ b/test/Transforms/InstCombine/select-select.ll @@ -21,4 +21,14 @@ define float @foo2(float %a) #0 { ret float %f } +; CHECK-LABEL: @foo3 +define <2 x i32> @foo3(<2 x i1> %vec_bool, i1 %bool, <2 x i32> %V) { +; CHECK: %[[sel0:.*]] = select <2 x i1> %vec_bool, <2 x i32> zeroinitializer, <2 x i32> %V +; CHECK: %[[sel1:.*]] = select i1 %bool, <2 x i32> %[[sel0]], <2 x i32> %V +; CHECK: ret <2 x i32> %[[sel1]] + %sel0 = select <2 x i1> %vec_bool, <2 x i32> zeroinitializer, <2 x i32> %V + %sel1 = select i1 %bool, <2 x i32> %sel0, <2 x i32> %V + ret <2 x i32> %sel1 +} + attributes #0 = { nounwind readnone ssp uwtable } diff --git a/test/Transforms/InstCombine/select.ll b/test/Transforms/InstCombine/select.ll index a6a7aa9..e4cc6f5 100644 --- a/test/Transforms/InstCombine/select.ll +++ b/test/Transforms/InstCombine/select.ll @@ -301,30 +301,30 @@ define i32 @test15j(i32 %X) { define i32 @test16(i1 %C, i32* %P) { %P2 = select i1 %C, i32* %P, i32* null - %V = load i32* %P2 + %V = load i32, i32* %P2 ret i32 %V ; CHECK-LABEL: @test16( -; CHECK-NEXT: %V = load i32* %P +; CHECK-NEXT: %V = load i32, i32* %P ; CHECK: ret i32 %V } ;; It may be legal to load from a null address in a non-zero address space define i32 @test16_neg(i1 %C, i32 addrspace(1)* %P) { %P2 = select i1 %C, i32 addrspace(1)* %P, i32 addrspace(1)* null - %V = load i32 addrspace(1)* %P2 + %V = load i32, i32 addrspace(1)* %P2 ret i32 %V ; CHECK-LABEL: @test16_neg ; CHECK-NEXT: %P2 = select i1 %C, i32 addrspace(1)* %P, i32 addrspace(1)* null -; CHECK-NEXT: %V = load i32 addrspace(1)* %P2 +; CHECK-NEXT: %V = load i32, i32 addrspace(1)* %P2 ; CHECK: ret i32 %V } define i32 @test16_neg2(i1 %C, i32 addrspace(1)* %P) { %P2 = select i1 %C, i32 addrspace(1)* null, i32 addrspace(1)* %P - %V = load i32 addrspace(1)* %P2 + %V = load i32, i32 addrspace(1)* %P2 ret i32 %V ; CHECK-LABEL: @test16_neg2 ; CHECK-NEXT: %P2 = select i1 %C, i32 addrspace(1)* null, i32 addrspace(1)* %P -; CHECK-NEXT: %V = load i32 addrspace(1)* %P2 +; CHECK-NEXT: %V = load i32, i32 addrspace(1)* %P2 ; CHECK: ret i32 %V } @@ -813,7 +813,7 @@ define i32 @test59(i32 %x, i32 %y) nounwind { define i1 @test60(i32 %x, i1* %y) nounwind { %cmp = icmp eq i32 %x, 0 - %load = load i1* %y, align 1 + %load = load i1, i1* %y, align 1 %cmp1 = icmp slt i32 %x, 1 %sel = select i1 %cmp, i1 %load, i1 %cmp1 ret i1 %sel @@ -823,7 +823,7 @@ define i1 @test60(i32 %x, i1* %y) nounwind { @glbl = constant i32 10 define i32 @test61(i32* %ptr) { - %A = load i32* %ptr + %A = load i32, i32* %ptr %B = icmp eq i32* %ptr, @glbl %C = select i1 %B, i32 %A, i32 10 ret i32 %C @@ -1249,11 +1249,11 @@ define i32 @test76(i1 %flag, i32* %x) { ; CHECK-LABEL: @test76( ; CHECK: store i32 0, i32* %x ; CHECK: %[[P:.*]] = select i1 %flag, i32* @under_aligned, i32* %x -; CHECK: load i32* %[[P]] +; CHECK: load i32, i32* %[[P]] store i32 0, i32* %x %p = select i1 %flag, i32* @under_aligned, i32* %x - %v = load i32* %p + %v = load i32, i32* %p ret i32 %v } @@ -1268,13 +1268,13 @@ define i32 @test77(i1 %flag, i32* %x) { ; CHECK: call void @scribble_on_i32(i32* %[[A]]) ; CHECK: store i32 0, i32* %x ; CHECK: %[[P:.*]] = select i1 %flag, i32* %[[A]], i32* %x -; CHECK: load i32* %[[P]] +; CHECK: load i32, i32* %[[P]] %under_aligned = alloca i32, align 1 call void @scribble_on_i32(i32* %under_aligned) store i32 0, i32* %x %p = select i1 %flag, i32* %under_aligned, i32* %x - %v = load i32* %p + %v = load i32, i32* %p ret i32 %v } @@ -1282,8 +1282,8 @@ define i32 @test78(i1 %flag, i32* %x, i32* %y, i32* %z) { ; Test that we can speculate the loads around the select even when we can't ; fold the load completely away. ; CHECK-LABEL: @test78( -; CHECK: %[[V1:.*]] = load i32* %x -; CHECK-NEXT: %[[V2:.*]] = load i32* %y +; CHECK: %[[V1:.*]] = load i32, i32* %x +; CHECK-NEXT: %[[V2:.*]] = load i32, i32* %y ; CHECK-NEXT: %[[S:.*]] = select i1 %flag, i32 %[[V1]], i32 %[[V2]] ; CHECK-NEXT: ret i32 %[[S]] entry: @@ -1292,7 +1292,7 @@ entry: ; Block forwarding by storing to %z which could alias either %x or %y. store i32 42, i32* %z %p = select i1 %flag, i32* %x, i32* %y - %v = load i32* %p + %v = load i32, i32* %p ret i32 %v } @@ -1300,8 +1300,8 @@ define float @test79(i1 %flag, float* %x, i32* %y, i32* %z) { ; Test that we can speculate the loads around the select even when we can't ; fold the load completely away. ; CHECK-LABEL: @test79( -; CHECK: %[[V1:.*]] = load float* %x -; CHECK-NEXT: %[[V2:.*]] = load float* %y +; CHECK: %[[V1:.*]] = load float, float* %x +; CHECK-NEXT: %[[V2:.*]] = load float, float* %y ; CHECK-NEXT: %[[S:.*]] = select i1 %flag, float %[[V1]], float %[[V2]] ; CHECK-NEXT: ret float %[[S]] entry: @@ -1312,7 +1312,7 @@ entry: ; Block forwarding by storing to %z which could alias either %x or %y. store i32 42, i32* %z %p = select i1 %flag, float* %x, float* %y1 - %v = load float* %p + %v = load float, float* %p ret float %v } @@ -1322,7 +1322,7 @@ define i32 @test80(i1 %flag) { ; CHECK-LABEL: @test80( ; CHECK: %[[X:.*]] = alloca i32 ; CHECK-NEXT: %[[Y:.*]] = alloca i32 -; CHECK: %[[V:.*]] = load i32* %[[X]] +; CHECK: %[[V:.*]] = load i32, i32* %[[X]] ; CHECK-NEXT: store i32 %[[V]], i32* %[[Y]] ; CHECK-NEXT: ret i32 %[[V]] entry: @@ -1330,10 +1330,10 @@ entry: %y = alloca i32 call void @scribble_on_i32(i32* %x) call void @scribble_on_i32(i32* %y) - %tmp = load i32* %x + %tmp = load i32, i32* %x store i32 %tmp, i32* %y %p = select i1 %flag, i32* %x, i32* %y - %v = load i32* %p + %v = load i32, i32* %p ret i32 %v } @@ -1343,7 +1343,7 @@ define float @test81(i1 %flag) { ; CHECK-LABEL: @test81( ; CHECK: %[[X:.*]] = alloca i32 ; CHECK-NEXT: %[[Y:.*]] = alloca i32 -; CHECK: %[[V:.*]] = load i32* %[[X]] +; CHECK: %[[V:.*]] = load i32, i32* %[[X]] ; CHECK-NEXT: store i32 %[[V]], i32* %[[Y]] ; CHECK-NEXT: %[[C:.*]] = bitcast i32 %[[V]] to float ; CHECK-NEXT: ret float %[[C]] @@ -1354,10 +1354,10 @@ entry: %y1 = bitcast i32* %y to float* call void @scribble_on_i32(i32* %x1) call void @scribble_on_i32(i32* %y) - %tmp = load i32* %x1 + %tmp = load i32, i32* %x1 store i32 %tmp, i32* %y %p = select i1 %flag, float* %x, float* %y1 - %v = load float* %p + %v = load float, float* %p ret float %v } @@ -1369,7 +1369,7 @@ define i32 @test82(i1 %flag) { ; CHECK-NEXT: %[[Y:.*]] = alloca i32 ; CHECK-NEXT: %[[X1:.*]] = bitcast float* %[[X]] to i32* ; CHECK-NEXT: %[[Y1:.*]] = bitcast i32* %[[Y]] to float* -; CHECK: %[[V:.*]] = load float* %[[X]] +; CHECK: %[[V:.*]] = load float, float* %[[X]] ; CHECK-NEXT: store float %[[V]], float* %[[Y1]] ; CHECK-NEXT: %[[C:.*]] = bitcast float %[[V]] to i32 ; CHECK-NEXT: ret i32 %[[C]] @@ -1380,10 +1380,10 @@ entry: %y1 = bitcast i32* %y to float* call void @scribble_on_i32(i32* %x1) call void @scribble_on_i32(i32* %y) - %tmp = load float* %x + %tmp = load float, float* %x store float %tmp, float* %y1 %p = select i1 %flag, i32* %x1, i32* %y - %v = load i32* %p + %v = load i32, i32* %p ret i32 %v } @@ -1398,7 +1398,7 @@ define i8* @test83(i1 %flag) { ; CHECK-NEXT: %[[Y:.*]] = alloca i8* ; CHECK-DAG: %[[X2:.*]] = bitcast i8** %[[X]] to i64* ; CHECK-DAG: %[[Y2:.*]] = bitcast i8** %[[Y]] to i64* -; CHECK: %[[V:.*]] = load i64* %[[X2]] +; CHECK: %[[V:.*]] = load i64, i64* %[[X2]] ; CHECK-NEXT: store i64 %[[V]], i64* %[[Y2]] ; CHECK-NEXT: %[[C:.*]] = inttoptr i64 %[[V]] to i8* ; CHECK-NEXT: ret i8* %[[S]] @@ -1409,10 +1409,10 @@ entry: %y1 = bitcast i64* %y to i8** call void @scribble_on_i64(i64* %x1) call void @scribble_on_i64(i64* %y) - %tmp = load i64* %x1 + %tmp = load i64, i64* %x1 store i64 %tmp, i64* %y %p = select i1 %flag, i8** %x, i8** %y1 - %v = load i8** %p + %v = load i8*, i8** %p ret i8* %v } @@ -1422,7 +1422,7 @@ define i64 @test84(i1 %flag) { ; CHECK-LABEL: @test84( ; CHECK: %[[X:.*]] = alloca i8* ; CHECK-NEXT: %[[Y:.*]] = alloca i8* -; CHECK: %[[V:.*]] = load i8** %[[X]] +; CHECK: %[[V:.*]] = load i8*, i8** %[[X]] ; CHECK-NEXT: store i8* %[[V]], i8** %[[Y]] ; CHECK-NEXT: %[[C:.*]] = ptrtoint i8* %[[V]] to i64 ; CHECK-NEXT: ret i64 %[[C]] @@ -1433,10 +1433,10 @@ entry: %y1 = bitcast i64* %y to i8** call void @scribble_on_i64(i64* %x1) call void @scribble_on_i64(i64* %y) - %tmp = load i8** %x + %tmp = load i8*, i8** %x store i8* %tmp, i8** %y1 %p = select i1 %flag, i64* %x1, i64* %y - %v = load i64* %p + %v = load i64, i64* %p ret i64 %v } @@ -1445,10 +1445,10 @@ define i8* @test85(i1 %flag) { ; pointer doesn't load all of the stored integer bits. We could fix this, but it ; would require endianness checks and other nastiness. ; CHECK-LABEL: @test85( -; CHECK: %[[T:.*]] = load i128* +; CHECK: %[[T:.*]] = load i128, i128* ; CHECK-NEXT: store i128 %[[T]], i128* -; CHECK-NEXT: %[[X:.*]] = load i8** -; CHECK-NEXT: %[[Y:.*]] = load i8** +; CHECK-NEXT: %[[X:.*]] = load i8*, i8** +; CHECK-NEXT: %[[Y:.*]] = load i8*, i8** ; CHECK-NEXT: %[[V:.*]] = select i1 %flag, i8* %[[X]], i8* %[[Y]] ; CHECK-NEXT: ret i8* %[[V]] entry: @@ -1459,10 +1459,10 @@ entry: %y1 = bitcast i128* %y to i8** call void @scribble_on_i128(i128* %x2) call void @scribble_on_i128(i128* %y) - %tmp = load i128* %x2 + %tmp = load i128, i128* %x2 store i128 %tmp, i128* %y %p = select i1 %flag, i8** %x1, i8** %y1 - %v = load i8** %p + %v = load i8*, i8** %p ret i8* %v } @@ -1472,10 +1472,10 @@ define i128 @test86(i1 %flag) { ; the bits of the integer. ; ; CHECK-LABEL: @test86( -; CHECK: %[[T:.*]] = load i8** +; CHECK: %[[T:.*]] = load i8*, i8** ; CHECK-NEXT: store i8* %[[T]], i8** -; CHECK-NEXT: %[[X:.*]] = load i128* -; CHECK-NEXT: %[[Y:.*]] = load i128* +; CHECK-NEXT: %[[X:.*]] = load i128, i128* +; CHECK-NEXT: %[[Y:.*]] = load i128, i128* ; CHECK-NEXT: %[[V:.*]] = select i1 %flag, i128 %[[X]], i128 %[[Y]] ; CHECK-NEXT: ret i128 %[[V]] entry: @@ -1486,10 +1486,10 @@ entry: %y1 = bitcast i128* %y to i8** call void @scribble_on_i128(i128* %x2) call void @scribble_on_i128(i128* %y) - %tmp = load i8** %x1 + %tmp = load i8*, i8** %x1 store i8* %tmp, i8** %y1 %p = select i1 %flag, i128* %x2, i128* %y - %v = load i128* %p + %v = load i128, i128* %p ret i128 %v } diff --git a/test/Transforms/InstCombine/shufflemask-undef.ll b/test/Transforms/InstCombine/shufflemask-undef.ll index aa6baa9..10509a9 100644 --- a/test/Transforms/InstCombine/shufflemask-undef.ll +++ b/test/Transforms/InstCombine/shufflemask-undef.ll @@ -69,8 +69,8 @@ target triple = "i386-apple-darwin9" define i32 @foo(%struct.State* %dst, <4 x float>* %prgrm, <4 x float>** %buffs, %struct._VMConstants* %cnstn, %struct.PPStreamToken* %pstrm, %struct.PluginBufferData* %gpctx, %struct.VMTextures* %txtrs, %struct.VMGPStack* %gpstk) nounwind { bb266.i: - getelementptr <4 x float>* null, i32 11 ; <<4 x float>*>:0 [#uses=1] - load <4 x float>* %0, align 16 ; <<4 x float>>:1 [#uses=1] + getelementptr <4 x float>, <4 x float>* null, i32 11 ; <<4 x float>*>:0 [#uses=1] + load <4 x float>, <4 x float>* %0, align 16 ; <<4 x float>>:1 [#uses=1] shufflevector <4 x float> %1, <4 x float> undef, <4 x i32> < i32 0, i32 1, i32 1, i32 1 > ; <<4 x float>>:2 [#uses=1] shufflevector <4 x float> %2, <4 x float> undef, <4 x i32> < i32 0, i32 4, i32 1, i32 5 > ; <<4 x float>>:3 [#uses=1] shufflevector <4 x float> undef, <4 x float> undef, <4 x i32> < i32 0, i32 4, i32 1, i32 5 > ; <<4 x float>>:4 [#uses=1] diff --git a/test/Transforms/InstCombine/signed-comparison.ll b/test/Transforms/InstCombine/signed-comparison.ll index ab0e7e7..922f4dc 100644 --- a/test/Transforms/InstCombine/signed-comparison.ll +++ b/test/Transforms/InstCombine/signed-comparison.ll @@ -12,8 +12,8 @@ entry: bb: %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %bb ] %t0 = and i64 %indvar, 65535 - %t1 = getelementptr double* %p, i64 %t0 - %t2 = load double* %t1, align 8 + %t1 = getelementptr double, double* %p, i64 %t0 + %t2 = load double, double* %t1, align 8 %t3 = fmul double %t2, 2.2 store double %t3, double* %t1, align 8 %i.04 = trunc i64 %indvar to i16 diff --git a/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll b/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll index 6d2193f..db8f179 100644 --- a/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll +++ b/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll @@ -29,7 +29,7 @@ bb95: ; preds = %bb88 unreachable bb107: ; preds = %bb88 - %0 = load i16* undef, align 8 ; <i16> [#uses=1] + %0 = load i16, i16* undef, align 8 ; <i16> [#uses=1] %1 = icmp eq i16 %0, 38 ; <i1> [#uses=1] %src_eqv_here.0 = select i1 %1, %struct.rtx_def* null, %struct.rtx_def* null ; <%struct.rtx_def*> [#uses=1] br i1 undef, label %bb127, label %bb125 diff --git a/test/Transforms/InstCombine/simplify-libcalls.ll b/test/Transforms/InstCombine/simplify-libcalls.ll index fae3e6e..c569cdd 100644 --- a/test/Transforms/InstCombine/simplify-libcalls.ll +++ b/test/Transforms/InstCombine/simplify-libcalls.ll @@ -1,11 +1,12 @@ ; RUN: opt -S < %s -instcombine | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32" @G = constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=1] declare i32 @sprintf(i8*, i8*, ...) define void @foo(i8* %P, i32* %X) { - call i32 (i8*, i8*, ...)* @sprintf( i8* %P, i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i32* %X ) ; <i32>:1 [#uses=0] + call i32 (i8*, i8*, ...)* @sprintf( i8* %P, i8* getelementptr ([3 x i8], [3 x i8]* @G, i32 0, i32 0), i32* %X ) ; <i32>:1 [#uses=0] ret void } @@ -15,26 +16,26 @@ define void @foo(i8* %P, i32* %X) { @str2 = internal constant [5 x i8] c"Ponk\00" define i8* @test1() { - %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str, i32 0, i32 2), i32 103 ) ; <i8*> [#uses=1] + %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8], [5 x i8]* @str, i32 0, i32 2), i32 103 ) ; <i8*> [#uses=1] ret i8* %tmp3 ; CHECK-LABEL: @test1( -; CHECK: ret i8* getelementptr inbounds ([5 x i8]* @str, i32 0, i64 3) +; CHECK: ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i32 0, i32 3) } declare i8* @strchr(i8*, i32) define i8* @test2() { - %tmp3 = tail call i8* @strchr( i8* getelementptr ([8 x i8]* @str1, i32 0, i32 2), i32 0 ) ; <i8*> [#uses=1] + %tmp3 = tail call i8* @strchr( i8* getelementptr ([8 x i8], [8 x i8]* @str1, i32 0, i32 2), i32 0 ) ; <i8*> [#uses=1] ret i8* %tmp3 ; CHECK-LABEL: @test2( -; CHECK: ret i8* getelementptr inbounds ([8 x i8]* @str1, i32 0, i64 7) +; CHECK: ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str1, i32 0, i32 7) } define i8* @test3() { entry: - %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str2, i32 0, i32 1), i32 80 ) ; <i8*> [#uses=1] + %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8], [5 x i8]* @str2, i32 0, i32 1), i32 80 ) ; <i8*> [#uses=1] ret i8* %tmp3 ; CHECK-LABEL: @test3( @@ -47,8 +48,8 @@ declare i32 @memcmp(i8*, i8*, i32) nounwind readonly define i1 @PR2341(i8** %start_addr) { entry: - %tmp4 = load i8** %start_addr, align 4 ; <i8*> [#uses=1] - %tmp5 = call i32 @memcmp( i8* %tmp4, i8* getelementptr ([5 x i8]* @_2E_str, i32 0, i32 0), i32 4 ) nounwind readonly ; <i32> [#uses=1] + %tmp4 = load i8*, i8** %start_addr, align 4 ; <i8*> [#uses=1] + %tmp5 = call i32 @memcmp( i8* %tmp4, i8* getelementptr ([5 x i8], [5 x i8]* @_2E_str, i32 0, i32 0), i32 4 ) nounwind readonly ; <i32> [#uses=1] %tmp6 = icmp eq i32 %tmp5, 0 ; <i1> [#uses=1] ret i1 %tmp6 @@ -80,7 +81,7 @@ entry: define i32 @PR4641(i32 %argc, i8** %argv) nounwind { entry: call void @exit(i32 0) nounwind - %cond392 = select i1 undef, i8* getelementptr ([2 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str14, i32 0, i32 0) ; <i8*> [#uses=1] + %cond392 = select i1 undef, i8* getelementptr ([2 x i8], [2 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([2 x i8], [2 x i8]* @.str14, i32 0, i32 0) ; <i8*> [#uses=1] %call393 = call %struct.__sFILE* @fopen(i8* undef, i8* %cond392) nounwind ; <%struct.__sFILE*> [#uses=0] unreachable } @@ -114,11 +115,11 @@ for.end: ; preds = %for.cond20 @hello_u = constant [8 x i8] c"hello_u\00" ; <[8 x i8]*> [#uses=1] define i32 @MemCpy() { - %h_p = getelementptr [2 x i8]* @h, i32 0, i32 0 - %hel_p = getelementptr [4 x i8]* @hel, i32 0, i32 0 - %hello_u_p = getelementptr [8 x i8]* @hello_u, i32 0, i32 0 + %h_p = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0 + %hel_p = getelementptr [4 x i8], [4 x i8]* @hel, i32 0, i32 0 + %hello_u_p = getelementptr [8 x i8], [8 x i8]* @hello_u, i32 0, i32 0 %target = alloca [1024 x i8] - %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 + %target_p = getelementptr [1024 x i8], [1024 x i8]* %target, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %h_p, i32 2, i32 2, i1 false) call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %hel_p, i32 4, i32 4, i1 false) call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %hello_u_p, i32 8, i32 8, i1 false) diff --git a/test/Transforms/InstCombine/sincospi.ll b/test/Transforms/InstCombine/sincospi.ll index 739827f..f49fb35 100644 --- a/test/Transforms/InstCombine/sincospi.ll +++ b/test/Transforms/InstCombine/sincospi.ll @@ -18,17 +18,17 @@ declare double @__cospi(double %x) #0 @var64 = global double 0.0 define float @test_instbased_f32() { - %val = load float* @var32 + %val = load float, float* @var32 %sin = call float @__sinpif(float %val) #0 %cos = call float @__cospif(float %val) #0 %res = fadd float %sin, %cos ret float %res -; CHECK-FLOAT-IN-VEC: [[VAL:%[a-z0-9]+]] = load float* @var32 +; CHECK-FLOAT-IN-VEC: [[VAL:%[a-z0-9]+]] = load float, float* @var32 ; CHECK-FLOAT-IN-VEC: [[SINCOS:%[a-z0-9]+]] = call <2 x float> @__sincospif_stret(float [[VAL]]) ; CHECK-FLOAT-IN-VEC: extractelement <2 x float> [[SINCOS]], i32 0 ; CHECK-FLOAT-IN-VEC: extractelement <2 x float> [[SINCOS]], i32 1 -; CHECK: [[VAL:%[a-z0-9]+]] = load float* @var32 +; CHECK: [[VAL:%[a-z0-9]+]] = load float, float* @var32 ; CHECK: [[SINCOS:%[a-z0-9]+]] = call { float, float } @__sincospif_stret(float [[VAL]]) ; CHECK: extractvalue { float, float } [[SINCOS]], 0 ; CHECK: extractvalue { float, float } [[SINCOS]], 1 @@ -55,17 +55,17 @@ define float @test_constant_f32() { } define double @test_instbased_f64() { - %val = load double* @var64 + %val = load double, double* @var64 %sin = call double @__sinpi(double %val) #0 %cos = call double @__cospi(double %val) #0 %res = fadd double %sin, %cos ret double %res -; CHECK-FLOAT-IN-VEC: [[VAL:%[a-z0-9]+]] = load double* @var64 +; CHECK-FLOAT-IN-VEC: [[VAL:%[a-z0-9]+]] = load double, double* @var64 ; CHECK-FLOAT-IN-VEC: [[SINCOS:%[a-z0-9]+]] = call { double, double } @__sincospi_stret(double [[VAL]]) ; CHECK-FLOAT-IN-VEC: extractvalue { double, double } [[SINCOS]], 0 ; CHECK-FLOAT-IN-VEC: extractvalue { double, double } [[SINCOS]], 1 -; CHECK: [[VAL:%[a-z0-9]+]] = load double* @var64 +; CHECK: [[VAL:%[a-z0-9]+]] = load double, double* @var64 ; CHECK: [[SINCOS:%[a-z0-9]+]] = call { double, double } @__sincospi_stret(double [[VAL]]) ; CHECK: extractvalue { double, double } [[SINCOS]], 0 ; CHECK: extractvalue { double, double } [[SINCOS]], 1 diff --git a/test/Transforms/InstCombine/sprintf-1.ll b/test/Transforms/InstCombine/sprintf-1.ll index afa38f3..ec188c6 100644 --- a/test/Transforms/InstCombine/sprintf-1.ll +++ b/test/Transforms/InstCombine/sprintf-1.ll @@ -20,16 +20,16 @@ declare i32 @sprintf(i8*, i8*, ...) define void @test_simplify1(i8* %dst) { ; CHECK-LABEL: @test_simplify1( - %fmt = getelementptr [13 x i8]* @hello_world, i32 0, i32 0 + %fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt) -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* getelementptr inbounds ([13 x i8]* @hello_world, i32 0, i32 0), i32 13, i32 1, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 13, i32 1, i1 false) ret void ; CHECK-NEXT: ret void } define void @test_simplify2(i8* %dst) { ; CHECK-LABEL: @test_simplify2( - %fmt = getelementptr [1 x i8]* @null, i32 0, i32 0 + %fmt = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt) ; CHECK-NEXT: store i8 0, i8* %dst, align 1 ret void @@ -38,7 +38,7 @@ define void @test_simplify2(i8* %dst) { define void @test_simplify3(i8* %dst) { ; CHECK-LABEL: @test_simplify3( - %fmt = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 + %fmt = getelementptr [7 x i8], [7 x i8]* @null_hello, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt) ; CHECK-NEXT: store i8 0, i8* %dst, align 1 ret void @@ -49,10 +49,10 @@ define void @test_simplify3(i8* %dst) { define void @test_simplify4(i8* %dst) { ; CHECK-LABEL: @test_simplify4( - %fmt = getelementptr [3 x i8]* @percent_c, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_c, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i8 104) ; CHECK-NEXT: store i8 104, i8* %dst, align 1 -; CHECK-NEXT: [[NUL:%[a-z0-9]+]] = getelementptr i8* %dst, i32 1 +; CHECK-NEXT: [[NUL:%[a-z0-9]+]] = getelementptr i8, i8* %dst, i32 1 ; CHECK-NEXT: store i8 0, i8* [[NUL]], align 1 ret void ; CHECK-NEXT: ret void @@ -62,7 +62,7 @@ define void @test_simplify4(i8* %dst) { define void @test_simplify5(i8* %dst, i8* %str) { ; CHECK-LABEL: @test_simplify5( - %fmt = getelementptr [3 x i8]* @percent_s, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i8* %str) ; CHECK-NEXT: [[STRLEN:%[a-z0-9]+]] = call i32 @strlen(i8* %str) ; CHECK-NEXT: [[LENINC:%[a-z0-9]+]] = add i32 [[STRLEN]], 1 @@ -75,18 +75,18 @@ define void @test_simplify5(i8* %dst, i8* %str) { define void @test_simplify6(i8* %dst) { ; CHECK-IPRINTF-LABEL: @test_simplify6( - %fmt = getelementptr [3 x i8]* @percent_d, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_d, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i32 187) -; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...)* @siprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8]* @percent_d, i32 0, i32 0), i32 187) +; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...)* @siprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187) ret void ; CHECK-IPRINTF-NEXT: ret void } define void @test_no_simplify1(i8* %dst) { ; CHECK-IPRINTF-LABEL: @test_no_simplify1( - %fmt = getelementptr [3 x i8]* @percent_f, i32 0, i32 0 + %fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0 call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, double 1.87) -; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) +; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) ret void ; CHECK-IPRINTF-NEXT: ret void } diff --git a/test/Transforms/InstCombine/sqrt.ll b/test/Transforms/InstCombine/sqrt.ll index 650b10c..24c2e00 100644 --- a/test/Transforms/InstCombine/sqrt.ll +++ b/test/Transforms/InstCombine/sqrt.ll @@ -38,8 +38,8 @@ entry: ; CHECK: sqrt( ; CHECK-NOT: sqrtf( ; CHECK: fptrunc - %arrayidx13 = getelementptr inbounds float* %v, i64 2 - %tmp14 = load float* %arrayidx13 + %arrayidx13 = getelementptr inbounds float, float* %v, i64 2 + %tmp14 = load float, float* %arrayidx13 %mul18 = fmul float %tmp14, %tmp14 %add19 = fadd float undef, %mul18 %conv = fpext float %add19 to double diff --git a/test/Transforms/InstCombine/stack-overalign.ll b/test/Transforms/InstCombine/stack-overalign.ll index 80c2ee8..a8f086e 100644 --- a/test/Transforms/InstCombine/stack-overalign.ll +++ b/test/Transforms/InstCombine/stack-overalign.ll @@ -18,8 +18,8 @@ define void @foo() nounwind { entry: %src = alloca [1024 x i8], align 1 - %src1 = getelementptr [1024 x i8]* %src, i32 0, i32 0 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([1024 x i8]* @dst, i32 0, i32 0), i8* %src1, i32 1024, i32 1, i1 false) + %src1 = getelementptr [1024 x i8], [1024 x i8]* %src, i32 0, i32 0 + call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @dst, i32 0, i32 0), i8* %src1, i32 1024, i32 1, i1 false) call void @frob(i8* %src1) nounwind ret void } diff --git a/test/Transforms/InstCombine/stacksaverestore.ll b/test/Transforms/InstCombine/stacksaverestore.ll index f5c7a6f..de400e9 100644 --- a/test/Transforms/InstCombine/stacksaverestore.ll +++ b/test/Transforms/InstCombine/stacksaverestore.ll @@ -31,7 +31,7 @@ bb: ; preds = %bb, %bb.preheader %i.0.reg2mem.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; <i32> [#uses=2] %tmp = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1] %tmp23 = alloca i8, i32 %size ; <i8*> [#uses=2] - %tmp27 = getelementptr i8* %tmp23, i32 %tmp25 ; <i8*> [#uses=1] + %tmp27 = getelementptr i8, i8* %tmp23, i32 %tmp25 ; <i8*> [#uses=1] store i8 0, i8* %tmp27, align 1 %tmp28 = call i8* @llvm.stacksave( ) ; <i8*> [#uses=1] %tmp52 = alloca i8, i32 %size ; <i8*> [#uses=1] diff --git a/test/Transforms/InstCombine/store.ll b/test/Transforms/InstCombine/store.ll index 0bb1759..5dfbd71 100644 --- a/test/Transforms/InstCombine/store.ll +++ b/test/Transforms/InstCombine/store.ll @@ -12,7 +12,7 @@ define void @test1(i32* %P) { } define void @test2(i32* %P) { - %X = load i32* %P ; <i32> [#uses=1] + %X = load i32, i32* %P ; <i32> [#uses=1] %Y = add i32 %X, 0 ; <i32> [#uses=1] store i32 %Y, i32* %P ret void @@ -36,12 +36,12 @@ Cond2: br label %Cont Cont: - %V = load i32* %A + %V = load i32, i32* %A ret i32 %V ; CHECK-LABEL: @test3( ; CHECK-NOT: alloca ; CHECK: Cont: -; CHECK-NEXT: %storemerge = phi i32 [ 47, %Cond2 ], [ -987654321, %Cond ] +; CHECK-NEXT: %storemerge = phi i32 [ -987654321, %Cond ], [ 47, %Cond2 ] ; CHECK-NEXT: ret i32 %storemerge } @@ -56,7 +56,7 @@ Cond: br label %Cont Cont: - %V = load i32* %A + %V = load i32, i32* %A ret i32 %V ; CHECK-LABEL: @test4( ; CHECK-NOT: alloca @@ -92,15 +92,15 @@ entry: for.cond: ; preds = %for.body, %entry %storemerge = phi i32 [ 0, %entry ], [ %inc, %for.body ] - %0 = load i32* %gi, align 4, !tbaa !0 + %0 = load i32, i32* %gi, align 4, !tbaa !0 %cmp = icmp slt i32 %0, %n br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond %idxprom = sext i32 %0 to i64 - %arrayidx = getelementptr inbounds float* %a, i64 %idxprom + %arrayidx = getelementptr inbounds float, float* %a, i64 %idxprom store float 0.000000e+00, float* %arrayidx, align 4, !tbaa !3 - %1 = load i32* %gi, align 4, !tbaa !0 + %1 = load i32, i32* %gi, align 4, !tbaa !0 %inc = add nsw i32 %1, 1 store i32 %inc, i32* %gi, align 4, !tbaa !0 br label %for.cond diff --git a/test/Transforms/InstCombine/stpcpy-1.ll b/test/Transforms/InstCombine/stpcpy-1.ll index b918c9e..cc82899 100644 --- a/test/Transforms/InstCombine/stpcpy-1.ll +++ b/test/Transforms/InstCombine/stpcpy-1.ll @@ -14,31 +14,31 @@ declare i8* @stpcpy(i8*, i8*) define i8* @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %ret = call i8* @stpcpy(i8* %dst, i8* %src) ; CHECK: @llvm.memcpy.p0i8.p0i8.i32 -; CHECK-NEXT: getelementptr inbounds ([32 x i8]* @a, i32 0, i32 5) +; CHECK-NEXT: getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 5) ret i8* %ret } define i8* @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 %ret = call i8* @stpcpy(i8* %dst, i8* %dst) ; CHECK: [[LEN:%[a-z]+]] = call i32 @strlen -; CHECK-NEXT: getelementptr inbounds [32 x i8]* @a, i32 0, i32 [[LEN]] +; CHECK-NEXT: getelementptr inbounds [32 x i8], [32 x i8]* @a, i32 0, i32 [[LEN]] ret i8* %ret } define i8* @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [32 x i8]* @b, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [32 x i8], [32 x i8]* @b, i32 0, i32 0 %ret = call i8* @stpcpy(i8* %dst, i8* %src) ; CHECK: call i8* @stpcpy diff --git a/test/Transforms/InstCombine/stpcpy-2.ll b/test/Transforms/InstCombine/stpcpy-2.ll index 6a0f753..07e13a6 100644 --- a/test/Transforms/InstCombine/stpcpy-2.ll +++ b/test/Transforms/InstCombine/stpcpy-2.ll @@ -13,8 +13,8 @@ declare i16* @stpcpy(i8*, i8*) define void @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i16* @stpcpy(i8* %dst, i8* %src) ; CHECK: call i16* @stpcpy diff --git a/test/Transforms/InstCombine/stpcpy_chk-1.ll b/test/Transforms/InstCombine/stpcpy_chk-1.ll index 393c5d9..2fcc34b 100644 --- a/test/Transforms/InstCombine/stpcpy_chk-1.ll +++ b/test/Transforms/InstCombine/stpcpy_chk-1.ll @@ -13,33 +13,33 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i8* @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 11) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 11) %ret = call i8* @__stpcpy_chk(i8* %dst, i8* %src, i32 60) ret i8* %ret } define i8* @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 11) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 11) %ret = call i8* @__stpcpy_chk(i8* %dst, i8* %src, i32 12) ret i8* %ret } define i8* @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 11) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 11) %ret = call i8* @__stpcpy_chk(i8* %dst, i8* %src, i32 -1) ret i8* %ret } @@ -48,10 +48,10 @@ define i8* @test_simplify3() { define i8* @test_simplify4() { ; CHECK-LABEL: @test_simplify4( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [60 x i8], [60 x i8]* @b, i32 0, i32 0 -; CHECK-NEXT: %stpcpy = call i8* @stpcpy(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8]* @b, i32 0, i32 0)) +; CHECK-NEXT: %stpcpy = call i8* @stpcpy(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @b, i32 0, i32 0)) ; CHECK-NEXT: ret i8* %stpcpy %ret = call i8* @__stpcpy_chk(i8* %dst, i8* %src, i32 -1) ret i8* %ret @@ -61,12 +61,12 @@ define i8* @test_simplify4() { define i8* @test_simplify5() { ; CHECK-LABEL: @test_simplify5( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: %len = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) -; CHECK-NEXT: %1 = call i8* @__memcpy_chk(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 %len) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 11) +; CHECK-NEXT: %len = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false) +; CHECK-NEXT: %1 = call i8* @__memcpy_chk(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 %len) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 11) %len = call i32 @llvm.objectsize.i32.p0i8(i8* %dst, i1 false) %ret = call i8* @__stpcpy_chk(i8* %dst, i8* %src, i32 %len) ret i8* %ret @@ -76,10 +76,10 @@ define i8* @test_simplify5() { define i8* @test_simplify6() { ; CHECK-LABEL: @test_simplify6( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 -; CHECK-NEXT: %strlen = call i32 @strlen(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0)) -; CHECK-NEXT: %1 = getelementptr inbounds [60 x i8]* @a, i32 0, i32 %strlen +; CHECK-NEXT: %strlen = call i32 @strlen(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0)) +; CHECK-NEXT: %1 = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 %strlen ; CHECK-NEXT: ret i8* %1 %len = call i32 @llvm.objectsize.i32.p0i8(i8* %dst, i1 false) %ret = call i8* @__stpcpy_chk(i8* %dst, i8* %dst, i32 %len) @@ -90,10 +90,10 @@ define i8* @test_simplify6() { define i8* @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [60 x i8], [60 x i8]* @b, i32 0, i32 0 -; CHECK-NEXT: %ret = call i8* @__stpcpy_chk(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8]* @b, i32 0, i32 0), i32 8) +; CHECK-NEXT: %ret = call i8* @__stpcpy_chk(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @b, i32 0, i32 0), i32 8) ; CHECK-NEXT: ret i8* %ret %ret = call i8* @__stpcpy_chk(i8* %dst, i8* %src, i32 8) ret i8* %ret diff --git a/test/Transforms/InstCombine/stpcpy_chk-2.ll b/test/Transforms/InstCombine/stpcpy_chk-2.ll index b503da9..b4803f9 100644 --- a/test/Transforms/InstCombine/stpcpy_chk-2.ll +++ b/test/Transforms/InstCombine/stpcpy_chk-2.ll @@ -10,8 +10,8 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define void @test_no_simplify() { ; CHECK-LABEL: @test_no_simplify( - %dst = getelementptr inbounds [60 x i16]* @a, i32 0, i32 0 - %src = getelementptr inbounds [8 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i16], [60 x i16]* @a, i32 0, i32 0 + %src = getelementptr inbounds [8 x i8], [8 x i8]* @.str, i32 0, i32 0 ; CHECK-NEXT: call i16* @__strcpy_chk call i16* @__strcpy_chk(i16* %dst, i8* %src, i32 8) diff --git a/test/Transforms/InstCombine/strcat-1.ll b/test/Transforms/InstCombine/strcat-1.ll index 131ad48..446a26e 100644 --- a/test/Transforms/InstCombine/strcat-1.ll +++ b/test/Transforms/InstCombine/strcat-1.ll @@ -18,19 +18,19 @@ define i32 @main() { ; CHECK: call i32 @puts %target = alloca [1024 x i8] - %arg1 = getelementptr [1024 x i8]* %target, i32 0, i32 0 + %arg1 = getelementptr [1024 x i8], [1024 x i8]* %target, i32 0, i32 0 store i8 0, i8* %arg1 ; rslt1 = strcat(target, "hello\00") - %arg2 = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %arg2 = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %rslt1 = call i8* @strcat(i8* %arg1, i8* %arg2) ; rslt2 = strcat(rslt1, "\00") - %arg3 = getelementptr [1 x i8]* @null, i32 0, i32 0 + %arg3 = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %rslt2 = call i8* @strcat(i8* %rslt1, i8* %arg3) ; rslt3 = strcat(rslt2, "\00hello\00") - %arg4 = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 + %arg4 = getelementptr [7 x i8], [7 x i8]* @null_hello, i32 0, i32 0 %rslt3 = call i8* @strcat(i8* %rslt2, i8* %arg4) call i32 @puts( i8* %rslt3 ) diff --git a/test/Transforms/InstCombine/strcat-2.ll b/test/Transforms/InstCombine/strcat-2.ll index 48f8267..2870197 100644 --- a/test/Transforms/InstCombine/strcat-2.ll +++ b/test/Transforms/InstCombine/strcat-2.ll @@ -15,8 +15,8 @@ define void @test_simplify1() { ; CHECK-NOT: call i8* @strcat ; CHECK: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i8* @strcat(i8* %dst, i8* %src) ret void } @@ -25,8 +25,8 @@ define void @test_simplify2() { ; CHECK-LABEL: @test_simplify2( ; CHECK-NEXT: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 call i8* @strcat(i8* %dst, i8* %src) ret void } diff --git a/test/Transforms/InstCombine/strcat-3.ll b/test/Transforms/InstCombine/strcat-3.ll index e3396df..88cd162 100644 --- a/test/Transforms/InstCombine/strcat-3.ll +++ b/test/Transforms/InstCombine/strcat-3.ll @@ -15,8 +15,8 @@ define void @test_nosimplify1() { ; CHECK: call i16* @strcat ; CHECK: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i16* @strcat(i8* %dst, i8* %src) ret void } diff --git a/test/Transforms/InstCombine/strchr-1.ll b/test/Transforms/InstCombine/strchr-1.ll index 66b3e2e..6c10ebd 100644 --- a/test/Transforms/InstCombine/strchr-1.ll +++ b/test/Transforms/InstCombine/strchr-1.ll @@ -1,20 +1,21 @@ ; Test that the strchr library call simplifier works correctly. ; RUN: opt < %s -instcombine -S | FileCheck %s -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" @hello = constant [14 x i8] c"hello world\5Cn\00" @null = constant [1 x i8] zeroinitializer +@newlines = constant [3 x i8] c"\0D\0A\00" @chp = global i8* zeroinitializer declare i8* @strchr(i8*, i32) define void @test_simplify1() { -; CHECK: store i8* getelementptr inbounds ([14 x i8]* @hello, i32 0, i32 6) +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 6) ; CHECK-NOT: call i8* @strchr ; CHECK: ret void - %str = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %str = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strchr(i8* %str, i32 119) store i8* %dst, i8** @chp ret void @@ -25,18 +26,18 @@ define void @test_simplify2() { ; CHECK-NOT: call i8* @strchr ; CHECK: ret void - %str = getelementptr [1 x i8]* @null, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %dst = call i8* @strchr(i8* %str, i32 119) store i8* %dst, i8** @chp ret void } define void @test_simplify3() { -; CHECK: store i8* getelementptr inbounds ([14 x i8]* @hello, i32 0, i32 13) +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 13) ; CHECK-NOT: call i8* @strchr ; CHECK: ret void - %src = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strchr(i8* %src, i32 0) store i8* %dst, i8** @chp ret void @@ -47,18 +48,18 @@ define void @test_simplify4(i32 %chr) { ; CHECK-NOT: call i8* @strchr ; CHECK: ret void - %src = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strchr(i8* %src, i32 %chr) store i8* %dst, i8** @chp ret void } define void @test_simplify5() { -; CHECK: store i8* getelementptr inbounds ([14 x i8]* @hello, i32 0, i32 13) +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 13) ; CHECK-NOT: call i8* @strchr ; CHECK: ret void - %src = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strchr(i8* %src, i32 65280) store i8* %dst, i8** @chp ret void @@ -68,7 +69,7 @@ define void @test_simplify5() { define void @test_simplify6(i8* %str) { ; CHECK: %strlen = call i32 @strlen(i8* %str) ; CHECK-NOT: call i8* @strchr -; CHECK: %strchr = getelementptr i8* %str, i32 %strlen +; CHECK: %strchr = getelementptr i8, i8* %str, i32 %strlen ; CHECK: store i8* %strchr, i8** @chp, align 4 ; CHECK: ret void @@ -76,3 +77,19 @@ define void @test_simplify6(i8* %str) { store i8* %dst, i8** @chp ret void } + +; Check transformation strchr("\r\n", C) != nullptr -> (C & 9217) != 0 +define i1 @test_simplify7(i32 %C) { +; CHECK-LABEL: @test_simplify7 +; CHECK-NEXT: [[TRUNC:%.*]] = trunc i32 %C to i16 +; CHECK-NEXT: %memchr.bounds = icmp ult i16 [[TRUNC]], 16 +; CHECK-NEXT: [[SHL:%.*]] = shl i16 1, [[TRUNC]] +; CHECK-NEXT: [[AND:%.*]] = and i16 [[SHL]], 9217 +; CHECK-NEXT: %memchr.bits = icmp ne i16 [[AND]], 0 +; CHECK-NEXT: %memchr1 = and i1 %memchr.bounds, %memchr.bits +; CHECK-NEXT: ret i1 %memchr1 + + %dst = call i8* @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @newlines, i64 0, i64 0), i32 %C) + %cmp = icmp ne i8* %dst, null + ret i1 %cmp +} diff --git a/test/Transforms/InstCombine/strchr-2.ll b/test/Transforms/InstCombine/strchr-2.ll index 35bbd23..dd86a16 100644 --- a/test/Transforms/InstCombine/strchr-2.ll +++ b/test/Transforms/InstCombine/strchr-2.ll @@ -14,7 +14,7 @@ define void @test_nosimplify1() { ; CHECK: call i8 @strchr ; CHECK: ret void - %str = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %str = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8 @strchr(i8* %str, i32 119) store i8 %dst, i8* @chr ret void diff --git a/test/Transforms/InstCombine/strcmp-1.ll b/test/Transforms/InstCombine/strcmp-1.ll index 9bbd7db..9bc1fc6 100644 --- a/test/Transforms/InstCombine/strcmp-1.ll +++ b/test/Transforms/InstCombine/strcmp-1.ll @@ -13,12 +13,12 @@ declare i32 @strcmp(i8*, i8*) ; strcmp("", x) -> -*x define i32 @test1(i8* %str2) { ; CHECK-LABEL: @test1( -; CHECK: %strcmpload = load i8* %str +; CHECK: %strcmpload = load i8, i8* %str ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: %2 = sub nsw i32 0, %1 ; CHECK: ret i32 %2 - %str1 = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 + %str1 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) ret i32 %temp1 @@ -27,11 +27,11 @@ define i32 @test1(i8* %str2) { ; strcmp(x, "") -> *x define i32 @test2(i8* %str1) { ; CHECK-LABEL: @test2( -; CHECK: %strcmpload = load i8* %str +; CHECK: %strcmpload = load i8, i8* %str ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: ret i32 %1 - %str2 = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 + %str2 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) ret i32 %temp1 } @@ -41,8 +41,8 @@ define i32 @test3() { ; CHECK-LABEL: @test3( ; CHECK: ret i32 -1 - %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %str2 = getelementptr inbounds [6 x i8]* @hello, i32 0, i32 0 + %str1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %str2 = getelementptr inbounds [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) ret i32 %temp1 } @@ -51,8 +51,8 @@ define i32 @test4() { ; CHECK-LABEL: @test4( ; CHECK: ret i32 1 - %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %str2 = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 + %str1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %str2 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) ret i32 %temp1 } @@ -61,12 +61,12 @@ define i32 @test4() { ; (This transform is rather difficult to trigger in a useful manner) define i32 @test5(i1 %b) { ; CHECK-LABEL: @test5( -; CHECK: %memcmp = call i32 @memcmp(i8* getelementptr inbounds ([6 x i8]* @hello, i32 0, i32 0), i8* %str2, i32 5) +; CHECK: %memcmp = call i32 @memcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i8* %str2, i32 5) ; CHECK: ret i32 %memcmp - %str1 = getelementptr inbounds [6 x i8]* @hello, i32 0, i32 0 - %temp1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %temp2 = getelementptr inbounds [5 x i8]* @bell, i32 0, i32 0 + %str1 = getelementptr inbounds [6 x i8], [6 x i8]* @hello, i32 0, i32 0 + %temp1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %temp2 = getelementptr inbounds [5 x i8], [5 x i8]* @bell, i32 0, i32 0 %str2 = select i1 %b, i8* %temp1, i8* %temp2 %temp3 = call i32 @strcmp(i8* %str1, i8* %str2) ret i32 %temp3 diff --git a/test/Transforms/InstCombine/strcmp-2.ll b/test/Transforms/InstCombine/strcmp-2.ll index f0ef516..a537b10 100644 --- a/test/Transforms/InstCombine/strcmp-2.ll +++ b/test/Transforms/InstCombine/strcmp-2.ll @@ -13,8 +13,8 @@ define i16 @test_nosimplify() { ; CHECK: call i16 @strcmp ; CHECK: ret i16 %temp1 - %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %str2 = getelementptr inbounds [6 x i8]* @hello, i32 0, i32 0 + %str1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %str2 = getelementptr inbounds [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %temp1 = call i16 @strcmp(i8* %str1, i8* %str2) ret i16 %temp1 } diff --git a/test/Transforms/InstCombine/strcpy-1.ll b/test/Transforms/InstCombine/strcpy-1.ll index 7c253f6..24c70c1 100644 --- a/test/Transforms/InstCombine/strcpy-1.ll +++ b/test/Transforms/InstCombine/strcpy-1.ll @@ -15,8 +15,8 @@ declare i8* @strcpy(i8*, i8*) define void @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i8* @strcpy(i8* %dst, i8* %src) ; CHECK: @llvm.memcpy.p0i8.p0i8.i32 @@ -26,18 +26,18 @@ define void @test_simplify1() { define i8* @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 %ret = call i8* @strcpy(i8* %dst, i8* %dst) -; CHECK: ret i8* getelementptr inbounds ([32 x i8]* @a, i32 0, i32 0) +; CHECK: ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0) ret i8* %ret } define i8* @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [32 x i8]* @b, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [32 x i8], [32 x i8]* @b, i32 0, i32 0 %ret = call i8* @strcpy(i8* %dst, i8* %src) ; CHECK: call i8* @strcpy diff --git a/test/Transforms/InstCombine/strcpy-2.ll b/test/Transforms/InstCombine/strcpy-2.ll index bad392d..cfc8a41 100644 --- a/test/Transforms/InstCombine/strcpy-2.ll +++ b/test/Transforms/InstCombine/strcpy-2.ll @@ -13,8 +13,8 @@ declare i16* @strcpy(i8*, i8*) define void @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i16* @strcpy(i8* %dst, i8* %src) ; CHECK: call i16* @strcpy diff --git a/test/Transforms/InstCombine/strcpy_chk-1.ll b/test/Transforms/InstCombine/strcpy_chk-1.ll index e3f163f..7a21a49 100644 --- a/test/Transforms/InstCombine/strcpy_chk-1.ll +++ b/test/Transforms/InstCombine/strcpy_chk-1.ll @@ -13,33 +13,33 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i8* @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0) %ret = call i8* @__strcpy_chk(i8* %dst, i8* %src, i32 60) ret i8* %ret } define i8* @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0) %ret = call i8* @__strcpy_chk(i8* %dst, i8* %src, i32 12) ret i8* %ret } define i8* @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0) %ret = call i8* @__strcpy_chk(i8* %dst, i8* %src, i32 -1) ret i8* %ret } @@ -48,10 +48,10 @@ define i8* @test_simplify3() { define i8* @test_simplify4() { ; CHECK-LABEL: @test_simplify4( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [60 x i8], [60 x i8]* @b, i32 0, i32 0 -; CHECK-NEXT: %strcpy = call i8* @strcpy(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8]* @b, i32 0, i32 0)) +; CHECK-NEXT: %strcpy = call i8* @strcpy(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @b, i32 0, i32 0)) ; CHECK-NEXT: ret i8* %strcpy %ret = call i8* @__strcpy_chk(i8* %dst, i8* %src, i32 -1) ret i8* %ret @@ -61,11 +61,11 @@ define i8* @test_simplify4() { define i8* @test_simplify5() { ; CHECK-LABEL: @test_simplify5( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: %len = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) -; CHECK-NEXT: %1 = call i8* @__memcpy_chk(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 %len) +; CHECK-NEXT: %len = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false) +; CHECK-NEXT: %1 = call i8* @__memcpy_chk(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 %len) ; CHECK-NEXT: ret i8* %1 %len = call i32 @llvm.objectsize.i32.p0i8(i8* %dst, i1 false) %ret = call i8* @__strcpy_chk(i8* %dst, i8* %src, i32 %len) @@ -76,10 +76,10 @@ define i8* @test_simplify5() { define i8* @test_simplify6() { ; CHECK-LABEL: @test_simplify6( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 -; CHECK-NEXT: %len = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i1 false) -; CHECK-NEXT: %ret = call i8* @__strcpy_chk(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i32 %len) +; CHECK-NEXT: %len = call i32 @llvm.objectsize.i32.p0i8(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i1 false) +; CHECK-NEXT: %ret = call i8* @__strcpy_chk(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i32 %len) ; CHECK-NEXT: ret i8* %ret %len = call i32 @llvm.objectsize.i32.p0i8(i8* %dst, i1 false) %ret = call i8* @__strcpy_chk(i8* %dst, i8* %dst, i32 %len) @@ -90,10 +90,10 @@ define i8* @test_simplify6() { define i8* @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [60 x i8], [60 x i8]* @b, i32 0, i32 0 -; CHECK-NEXT: %ret = call i8* @__strcpy_chk(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8]* @b, i32 0, i32 0), i32 8) +; CHECK-NEXT: %ret = call i8* @__strcpy_chk(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @b, i32 0, i32 0), i32 8) ; CHECK-NEXT: ret i8* %ret %ret = call i8* @__strcpy_chk(i8* %dst, i8* %src, i32 8) ret i8* %ret diff --git a/test/Transforms/InstCombine/strcpy_chk-2.ll b/test/Transforms/InstCombine/strcpy_chk-2.ll index 1eff5a8..c2204a8 100644 --- a/test/Transforms/InstCombine/strcpy_chk-2.ll +++ b/test/Transforms/InstCombine/strcpy_chk-2.ll @@ -10,8 +10,8 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define void @test_no_simplify() { ; CHECK-LABEL: @test_no_simplify( - %dst = getelementptr inbounds [60 x i16]* @a, i32 0, i32 0 - %src = getelementptr inbounds [8 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i16], [60 x i16]* @a, i32 0, i32 0 + %src = getelementptr inbounds [8 x i8], [8 x i8]* @.str, i32 0, i32 0 ; CHECK-NEXT: call i16* @__strcpy_chk call i16* @__strcpy_chk(i16* %dst, i8* %src, i32 8) diff --git a/test/Transforms/InstCombine/strcpy_chk-64.ll b/test/Transforms/InstCombine/strcpy_chk-64.ll index 31447d9..8a2cdc2 100644 --- a/test/Transforms/InstCombine/strcpy_chk-64.ll +++ b/test/Transforms/InstCombine/strcpy_chk-64.ll @@ -7,7 +7,7 @@ define void @func(i8* %i) nounwind ssp { ; CHECK: @__strcpy_chk(i8* %arraydecay, i8* %i, i64 32) entry: %s = alloca [32 x i8], align 16 - %arraydecay = getelementptr inbounds [32 x i8]* %s, i32 0, i32 0 + %arraydecay = getelementptr inbounds [32 x i8], [32 x i8]* %s, i32 0, i32 0 %call = call i8* @__strcpy_chk(i8* %arraydecay, i8* %i, i64 32) call void @func2(i8* %arraydecay) ret void diff --git a/test/Transforms/InstCombine/strcspn-1.ll b/test/Transforms/InstCombine/strcspn-1.ll index b3b52b5..8d441a9 100644 --- a/test/Transforms/InstCombine/strcspn-1.ll +++ b/test/Transforms/InstCombine/strcspn-1.ll @@ -14,7 +14,7 @@ declare i64 @strcspn(i8*, i8*) define i64 @test_simplify1(i8* %str) { ; CHECK-LABEL: @test_simplify1( - %pat = getelementptr [1 x i8]* @null, i32 0, i32 0 + %pat = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strcspn(i8* %str, i8* %pat) ; CHECK-NEXT: [[VAR:%[a-z]+]] = call i64 @strlen(i8* %str) @@ -26,7 +26,7 @@ define i64 @test_simplify1(i8* %str) { define i64 @test_simplify2(i8* %pat) { ; CHECK-LABEL: @test_simplify2( - %str = getelementptr [1 x i8]* @null, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strcspn(i8* %str, i8* %pat) ret i64 %ret @@ -37,8 +37,8 @@ define i64 @test_simplify2(i8* %pat) { define i64 @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %str = getelementptr [6 x i8]* @abcba, i32 0, i32 0 - %pat = getelementptr [4 x i8]* @abc, i32 0, i32 0 + %str = getelementptr [6 x i8], [6 x i8]* @abcba, i32 0, i32 0 + %pat = getelementptr [4 x i8], [4 x i8]* @abc, i32 0, i32 0 %ret = call i64 @strcspn(i8* %str, i8* %pat) ret i64 %ret diff --git a/test/Transforms/InstCombine/strcspn-2.ll b/test/Transforms/InstCombine/strcspn-2.ll index ecfa27d..749860a 100644 --- a/test/Transforms/InstCombine/strcspn-2.ll +++ b/test/Transforms/InstCombine/strcspn-2.ll @@ -12,7 +12,7 @@ declare double @strcspn(i8*, i8*) define double @test_no_simplify1(i8* %pat) { ; CHECK-LABEL: @test_no_simplify1( - %str = getelementptr [1 x i8]* @null, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call double @strcspn(i8* %str, i8* %pat) ; CHECK-NEXT: call double @strcspn diff --git a/test/Transforms/InstCombine/strlen-1.ll b/test/Transforms/InstCombine/strlen-1.ll index 4a3caf2..fe45369 100644 --- a/test/Transforms/InstCombine/strlen-1.ll +++ b/test/Transforms/InstCombine/strlen-1.ll @@ -17,7 +17,7 @@ declare i32 @strlen(i8*) define i32 @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %hello_p = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p) ret i32 %hello_l ; CHECK-NEXT: ret i32 5 @@ -25,7 +25,7 @@ define i32 @test_simplify1() { define i32 @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 + %null_p = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %null_l = call i32 @strlen(i8* %null_p) ret i32 %null_l ; CHECK-NEXT: ret i32 0 @@ -33,7 +33,7 @@ define i32 @test_simplify2() { define i32 @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %null_hello_p = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 + %null_hello_p = getelementptr [7 x i8], [7 x i8]* @null_hello, i32 0, i32 0 %null_hello_l = call i32 @strlen(i8* %null_hello_p) ret i32 %null_hello_l ; CHECK-NEXT: ret i32 0 @@ -50,7 +50,7 @@ define i32 @test_simplify4() { define i1 @test_simplify5() { ; CHECK-LABEL: @test_simplify5( - %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %hello_p = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p) %eq_hello = icmp eq i32 %hello_l, 0 ret i1 %eq_hello @@ -59,7 +59,7 @@ define i1 @test_simplify5() { define i1 @test_simplify6() { ; CHECK-LABEL: @test_simplify6( - %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 + %null_p = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %null_l = call i32 @strlen(i8* %null_p) %eq_null = icmp eq i32 %null_l, 0 ret i1 %eq_null @@ -70,7 +70,7 @@ define i1 @test_simplify6() { define i1 @test_simplify7() { ; CHECK-LABEL: @test_simplify7( - %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %hello_p = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p) %ne_hello = icmp ne i32 %hello_l, 0 ret i1 %ne_hello @@ -79,7 +79,7 @@ define i1 @test_simplify7() { define i1 @test_simplify8() { ; CHECK-LABEL: @test_simplify8( - %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 + %null_p = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %null_l = call i32 @strlen(i8* %null_p) %ne_null = icmp ne i32 %null_l, 0 ret i1 %ne_null @@ -88,8 +88,8 @@ define i1 @test_simplify8() { define i32 @test_simplify9(i1 %x) { ; CHECK-LABEL: @test_simplify9 - %hello = getelementptr [6 x i8]* @hello, i32 0, i32 0 - %longer = getelementptr [7 x i8]* @longer, i32 0, i32 0 + %hello = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 + %longer = getelementptr [7 x i8], [7 x i8]* @longer, i32 0, i32 0 %s = select i1 %x, i8* %hello, i8* %longer %l = call i32 @strlen(i8* %s) ; CHECK-NEXT: select i1 %x, i32 5, i32 6 @@ -101,7 +101,7 @@ define i32 @test_simplify9(i1 %x) { define i32 @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %a_p = getelementptr [32 x i8]* @a, i32 0, i32 0 + %a_p = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 %a_l = call i32 @strlen(i8* %a_p) ; CHECK-NEXT: %a_l = call i32 @strlen ret i32 %a_l diff --git a/test/Transforms/InstCombine/strlen-2.ll b/test/Transforms/InstCombine/strlen-2.ll index 6652a31..df5eee0 100644 --- a/test/Transforms/InstCombine/strlen-2.ll +++ b/test/Transforms/InstCombine/strlen-2.ll @@ -10,7 +10,7 @@ declare i32 @strlen(i8*, i32) define i32 @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %hello_p = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p, i32 187) ; CHECK-NEXT: %hello_l = call i32 @strlen ret i32 %hello_l diff --git a/test/Transforms/InstCombine/strncat-1.ll b/test/Transforms/InstCombine/strncat-1.ll index 8eae3da..4b8da81 100644 --- a/test/Transforms/InstCombine/strncat-1.ll +++ b/test/Transforms/InstCombine/strncat-1.ll @@ -17,19 +17,19 @@ define i32 @main() { ; CHECK: call i32 @puts %target = alloca [1024 x i8] - %arg1 = getelementptr [1024 x i8]* %target, i32 0, i32 0 + %arg1 = getelementptr [1024 x i8], [1024 x i8]* %target, i32 0, i32 0 store i8 0, i8* %arg1 ; rslt1 = strncat(target, "hello\00") - %arg2 = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %arg2 = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %rslt1 = call i8* @strncat(i8* %arg1, i8* %arg2, i32 6) ; rslt2 = strncat(rslt1, "\00") - %arg3 = getelementptr [1 x i8]* @null, i32 0, i32 0 + %arg3 = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %rslt2 = call i8* @strncat(i8* %rslt1, i8* %arg3, i32 42) ; rslt3 = strncat(rslt2, "\00hello\00") - %arg4 = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 + %arg4 = getelementptr [7 x i8], [7 x i8]* @null_hello, i32 0, i32 0 %rslt3 = call i8* @strncat(i8* %rslt2, i8* %arg4, i32 42) call i32 @puts(i8* %rslt3) diff --git a/test/Transforms/InstCombine/strncat-2.ll b/test/Transforms/InstCombine/strncat-2.ll index b09fa12..3533e1e 100644 --- a/test/Transforms/InstCombine/strncat-2.ll +++ b/test/Transforms/InstCombine/strncat-2.ll @@ -15,8 +15,8 @@ define void @test_simplify1() { ; CHECK-NOT: call i8* @strncat ; CHECK: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i8* @strncat(i8* %dst, i8* %src, i32 13) ret void } @@ -25,8 +25,8 @@ define void @test_simplify2() { ; CHECK-LABEL: @test_simplify2( ; CHECK-NEXT: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [1 x i8]* @empty, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0 call i8* @strncat(i8* %dst, i8* %src, i32 13) ret void } @@ -35,8 +35,8 @@ define void @test_simplify3() { ; CHECK-LABEL: @test_simplify3( ; CHECK-NEXT: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i8* @strncat(i8* %dst, i8* %src, i32 0) ret void } @@ -46,8 +46,8 @@ define void @test_nosimplify1() { ; CHECK: call i8* @strncat ; CHECK: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i8* @strncat(i8* %dst, i8* %src, i32 1) ret void } diff --git a/test/Transforms/InstCombine/strncat-3.ll b/test/Transforms/InstCombine/strncat-3.ll index 1b25b4a..0f6964d 100644 --- a/test/Transforms/InstCombine/strncat-3.ll +++ b/test/Transforms/InstCombine/strncat-3.ll @@ -15,8 +15,8 @@ define void @test_nosimplify1() { ; CHECK: call i16* @strncat ; CHECK: ret void - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i16* @strncat(i8* %dst, i8* %src, i32 13) ret void } diff --git a/test/Transforms/InstCombine/strncmp-1.ll b/test/Transforms/InstCombine/strncmp-1.ll index 49b0955..a112182 100644 --- a/test/Transforms/InstCombine/strncmp-1.ll +++ b/test/Transforms/InstCombine/strncmp-1.ll @@ -13,12 +13,12 @@ declare i32 @strncmp(i8*, i8*, i32) ; strncmp("", x, n) -> -*x define i32 @test1(i8* %str2) { ; CHECK-LABEL: @test1( -; CHECK: %strcmpload = load i8* %str +; CHECK: %strcmpload = load i8, i8* %str ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: %2 = sub nsw i32 0, %1 ; CHECK: ret i32 %2 - %str1 = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 + %str1 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 10) ret i32 %temp1 } @@ -26,11 +26,11 @@ define i32 @test1(i8* %str2) { ; strncmp(x, "", n) -> *x define i32 @test2(i8* %str1) { ; CHECK-LABEL: @test2( -; CHECK: %strcmpload = load i8* %str1 +; CHECK: %strcmpload = load i8, i8* %str1 ; CHECK: %1 = zext i8 %strcmpload to i32 ; CHECK: ret i32 %1 - %str2 = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 + %str2 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 10) ret i32 %temp1 } @@ -40,8 +40,8 @@ define i32 @test3() { ; CHECK-LABEL: @test3( ; CHECK: ret i32 -1 - %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %str2 = getelementptr inbounds [6 x i8]* @hello, i32 0, i32 0 + %str1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %str2 = getelementptr inbounds [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 10) ret i32 %temp1 } @@ -50,8 +50,8 @@ define i32 @test4() { ; CHECK-LABEL: @test4( ; CHECK: ret i32 1 - %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %str2 = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 + %str1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %str2 = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 10) ret i32 %temp1 } @@ -60,8 +60,8 @@ define i32 @test5() { ; CHECK-LABEL: @test5( ; CHECK: ret i32 0 - %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %str2 = getelementptr inbounds [6 x i8]* @hello, i32 0, i32 0 + %str1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %str2 = getelementptr inbounds [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %temp1 = call i32 @strncmp(i8* %str1, i8* %str2, i32 4) ret i32 %temp1 } @@ -69,9 +69,9 @@ define i32 @test5() { ; strncmp(x,y,1) -> memcmp(x,y,1) define i32 @test6(i8* %str1, i8* %str2) { ; CHECK-LABEL: @test6( -; CHECK: [[LOAD1:%[a-z]+]] = load i8* %str1, align 1 +; CHECK: [[LOAD1:%[a-z]+]] = load i8, i8* %str1, align 1 ; CHECK: [[ZEXT1:%[a-z]+]] = zext i8 [[LOAD1]] to i32 -; CHECK: [[LOAD2:%[a-z]+]] = load i8* %str2, align 1 +; CHECK: [[LOAD2:%[a-z]+]] = load i8, i8* %str2, align 1 ; CHECK: [[ZEXT2:%[a-z]+]] = zext i8 [[LOAD2]] to i32 ; CHECK: [[RET:%[a-z]+]] = sub nsw i32 [[ZEXT1]], [[ZEXT2]] ; CHECK: ret i32 [[RET]] diff --git a/test/Transforms/InstCombine/strncmp-2.ll b/test/Transforms/InstCombine/strncmp-2.ll index 16ad8a4..9e19781 100644 --- a/test/Transforms/InstCombine/strncmp-2.ll +++ b/test/Transforms/InstCombine/strncmp-2.ll @@ -13,8 +13,8 @@ define i16 @test_nosimplify() { ; CHECK: call i16 @strncmp ; CHECK: ret i16 %temp1 - %str1 = getelementptr inbounds [5 x i8]* @hell, i32 0, i32 0 - %str2 = getelementptr inbounds [6 x i8]* @hello, i32 0, i32 0 + %str1 = getelementptr inbounds [5 x i8], [5 x i8]* @hell, i32 0, i32 0 + %str2 = getelementptr inbounds [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %temp1 = call i16 @strncmp(i8* %str1, i8* %str2, i32 10) ret i16 %temp1 } diff --git a/test/Transforms/InstCombine/strncpy-1.ll b/test/Transforms/InstCombine/strncpy-1.ll index c70197f..28cb26b 100644 --- a/test/Transforms/InstCombine/strncpy-1.ll +++ b/test/Transforms/InstCombine/strncpy-1.ll @@ -20,16 +20,16 @@ define i32 @test_simplify1() { ; CHECK-NOT: call i8* @strncpy ; CHECK: call i32 @puts %target = alloca [1024 x i8] - %arg1 = getelementptr [1024 x i8]* %target, i32 0, i32 0 + %arg1 = getelementptr [1024 x i8], [1024 x i8]* %target, i32 0, i32 0 store i8 0, i8* %arg1 - %arg2 = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %arg2 = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %rslt1 = call i8* @strncpy(i8* %arg1, i8* %arg2, i32 6) - %arg3 = getelementptr [1 x i8]* @null, i32 0, i32 0 + %arg3 = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %rslt2 = call i8* @strncpy(i8* %rslt1, i8* %arg3, i32 42) - %arg4 = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 + %arg4 = getelementptr [7 x i8], [7 x i8]* @null_hello, i32 0, i32 0 %rslt3 = call i8* @strncpy(i8* %rslt2, i8* %arg4, i32 42) call i32 @puts( i8* %rslt3 ) @@ -40,8 +40,8 @@ define i32 @test_simplify1() { define void @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [1 x i8]* @null, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 call i8* @strncpy(i8* %dst, i8* %src, i32 32) ; CHECK: call void @llvm.memset.p0i8.i32 @@ -52,20 +52,20 @@ define void @test_simplify2() { define i8* @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %ret = call i8* @strncpy(i8* %dst, i8* %src, i32 0) ret i8* %ret -; CHECK: ret i8* getelementptr inbounds ([32 x i8]* @a, i32 0, i32 0) +; CHECK: ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0) } ; Check strncpy(x, s, c) -> memcpy(x, s, c, 1) [s and c are constant]. define void @test_simplify4() { ; CHECK-LABEL: @test_simplify4( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i8* @strncpy(i8* %dst, i8* %src, i32 6) ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32 @@ -76,8 +76,8 @@ define void @test_simplify4() { define void @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [32 x i8]* @b, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [32 x i8], [32 x i8]* @b, i32 0, i32 0 call i8* @strncpy(i8* %dst, i8* %src, i32 32) ; CHECK: call i8* @strncpy @@ -86,8 +86,8 @@ define void @test_no_simplify1() { define void @test_no_simplify2() { ; CHECK-LABEL: @test_no_simplify2( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i8* @strncpy(i8* %dst, i8* %src, i32 8) ; CHECK: call i8* @strncpy diff --git a/test/Transforms/InstCombine/strncpy-2.ll b/test/Transforms/InstCombine/strncpy-2.ll index acc2878..5c45f9f 100644 --- a/test/Transforms/InstCombine/strncpy-2.ll +++ b/test/Transforms/InstCombine/strncpy-2.ll @@ -13,8 +13,8 @@ declare i16* @strncpy(i8*, i8*, i32) define void @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr [32 x i8]* @a, i32 0, i32 0 - %src = getelementptr [6 x i8]* @hello, i32 0, i32 0 + %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 + %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 call i16* @strncpy(i8* %dst, i8* %src, i32 6) ; CHECK: call i16* @strncpy diff --git a/test/Transforms/InstCombine/strncpy_chk-1.ll b/test/Transforms/InstCombine/strncpy_chk-1.ll index 9242a8a..03690b9 100644 --- a/test/Transforms/InstCombine/strncpy_chk-1.ll +++ b/test/Transforms/InstCombine/strncpy_chk-1.ll @@ -13,32 +13,32 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i8* @test_simplify1() { ; CHECK-LABEL: @test_simplify1( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0) %ret = call i8* @__strncpy_chk(i8* %dst, i8* %src, i32 12, i32 60) ret i8* %ret } define i8* @test_simplify2() { ; CHECK-LABEL: @test_simplify2( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) -; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 12, i32 1, i1 false) +; CHECK-NEXT: ret i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0) %ret = call i8* @__strncpy_chk(i8* %dst, i8* %src, i32 12, i32 12) ret i8* %ret } define i8* @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [60 x i8], [60 x i8]* @b, i32 0, i32 0 -; CHECK-NEXT: %strncpy = call i8* @strncpy(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8]* @b, i32 0, i32 0), i32 12) +; CHECK-NEXT: %strncpy = call i8* @strncpy(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @b, i32 0, i32 0), i32 12) ; CHECK-NEXT: ret i8* %strncpy %ret = call i8* @__strncpy_chk(i8* %dst, i8* %src, i32 12, i32 60) ret i8* %ret @@ -48,10 +48,10 @@ define i8* @test_simplify3() { define i8* @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [12 x i8]* @.str, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [12 x i8], [12 x i8]* @.str, i32 0, i32 0 -; CHECK-NEXT: %ret = call i8* @__strncpy_chk(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 8, i32 4) +; CHECK-NEXT: %ret = call i8* @__strncpy_chk(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 8, i32 4) ; CHECK-NEXT: ret i8* %ret %ret = call i8* @__strncpy_chk(i8* %dst, i8* %src, i32 8, i32 4) ret i8* %ret @@ -59,10 +59,10 @@ define i8* @test_no_simplify1() { define i8* @test_no_simplify2() { ; CHECK-LABEL: @test_no_simplify2( - %dst = getelementptr inbounds [60 x i8]* @a, i32 0, i32 0 - %src = getelementptr inbounds [60 x i8]* @b, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i8], [60 x i8]* @a, i32 0, i32 0 + %src = getelementptr inbounds [60 x i8], [60 x i8]* @b, i32 0, i32 0 -; CHECK-NEXT: %ret = call i8* @__strncpy_chk(i8* getelementptr inbounds ([60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8]* @b, i32 0, i32 0), i32 8, i32 0) +; CHECK-NEXT: %ret = call i8* @__strncpy_chk(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @a, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @b, i32 0, i32 0), i32 8, i32 0) ; CHECK-NEXT: ret i8* %ret %ret = call i8* @__strncpy_chk(i8* %dst, i8* %src, i32 8, i32 0) ret i8* %ret diff --git a/test/Transforms/InstCombine/strncpy_chk-2.ll b/test/Transforms/InstCombine/strncpy_chk-2.ll index 829a479..89ecd46 100644 --- a/test/Transforms/InstCombine/strncpy_chk-2.ll +++ b/test/Transforms/InstCombine/strncpy_chk-2.ll @@ -10,8 +10,8 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define void @test_no_simplify() { ; CHECK-LABEL: @test_no_simplify( - %dst = getelementptr inbounds [60 x i16]* @a, i32 0, i32 0 - %src = getelementptr inbounds [60 x i16]* @b, i32 0, i32 0 + %dst = getelementptr inbounds [60 x i16], [60 x i16]* @a, i32 0, i32 0 + %src = getelementptr inbounds [60 x i16], [60 x i16]* @b, i32 0, i32 0 ; CHECK-NEXT: call i16* @__strncpy_chk call i16* @__strncpy_chk(i16* %dst, i16* %src, i32 60, i32 60) diff --git a/test/Transforms/InstCombine/strpbrk-1.ll b/test/Transforms/InstCombine/strpbrk-1.ll index 58b2d9e..a61100d 100644 --- a/test/Transforms/InstCombine/strpbrk-1.ll +++ b/test/Transforms/InstCombine/strpbrk-1.ll @@ -14,7 +14,7 @@ declare i8* @strpbrk(i8*, i8*) define i8* @test_simplify1(i8* %str) { ; CHECK-LABEL: @test_simplify1( - %pat = getelementptr [1 x i8]* @null, i32 0, i32 0 + %pat = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %str, i8* %pat) ret i8* %ret @@ -25,7 +25,7 @@ define i8* @test_simplify1(i8* %str) { define i8* @test_simplify2(i8* %pat) { ; CHECK-LABEL: @test_simplify2( - %str = getelementptr [1 x i8]* @null, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %str, i8* %pat) ret i8* %ret @@ -36,19 +36,19 @@ define i8* @test_simplify2(i8* %pat) { define i8* @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %str = getelementptr [12 x i8]* @hello, i32 0, i32 0 - %pat = getelementptr [2 x i8]* @w, i32 0, i32 0 + %str = getelementptr [12 x i8], [12 x i8]* @hello, i32 0, i32 0 + %pat = getelementptr [2 x i8], [2 x i8]* @w, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %str, i8* %pat) ret i8* %ret -; CHECK-NEXT: ret i8* getelementptr inbounds ([12 x i8]* @hello, i32 0, i32 6) +; CHECK-NEXT: ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @hello, i32 0, i32 6) } ; Check strpbrk(s, "a") -> strchr(s, 'a'). define i8* @test_simplify4(i8* %str) { ; CHECK-LABEL: @test_simplify4( - %pat = getelementptr [2 x i8]* @w, i32 0, i32 0 + %pat = getelementptr [2 x i8], [2 x i8]* @w, i32 0, i32 0 %ret = call i8* @strpbrk(i8* %str, i8* %pat) ; CHECK-NEXT: [[VAR:%[a-z]+]] = call i8* @strchr(i8* %str, i32 119) diff --git a/test/Transforms/InstCombine/strpbrk-2.ll b/test/Transforms/InstCombine/strpbrk-2.ll index b797d7a..0af6faf 100644 --- a/test/Transforms/InstCombine/strpbrk-2.ll +++ b/test/Transforms/InstCombine/strpbrk-2.ll @@ -13,8 +13,8 @@ declare i16* @strpbrk(i8*, i8*) define i16* @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( - %str = getelementptr [12 x i8]* @hello, i32 0, i32 0 - %pat = getelementptr [2 x i8]* @w, i32 0, i32 0 + %str = getelementptr [12 x i8], [12 x i8]* @hello, i32 0, i32 0 + %pat = getelementptr [2 x i8], [2 x i8]* @w, i32 0, i32 0 %ret = call i16* @strpbrk(i8* %str, i8* %pat) ; CHECK-NEXT: %ret = call i16* @strpbrk diff --git a/test/Transforms/InstCombine/strrchr-1.ll b/test/Transforms/InstCombine/strrchr-1.ll index 4615f5f..3ae68fb 100644 --- a/test/Transforms/InstCombine/strrchr-1.ll +++ b/test/Transforms/InstCombine/strrchr-1.ll @@ -10,11 +10,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i8* @strrchr(i8*, i32) define void @test_simplify1() { -; CHECK: store i8* getelementptr inbounds ([14 x i8]* @hello, i32 0, i32 6) +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 6) ; CHECK-NOT: call i8* @strrchr ; CHECK: ret void - %str = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %str = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strrchr(i8* %str, i32 119) store i8* %dst, i8** @chp ret void @@ -25,29 +25,29 @@ define void @test_simplify2() { ; CHECK-NOT: call i8* @strrchr ; CHECK: ret void - %str = getelementptr [1 x i8]* @null, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %dst = call i8* @strrchr(i8* %str, i32 119) store i8* %dst, i8** @chp ret void } define void @test_simplify3() { -; CHECK: store i8* getelementptr inbounds ([14 x i8]* @hello, i32 0, i32 13) +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 13) ; CHECK-NOT: call i8* @strrchr ; CHECK: ret void - %src = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strrchr(i8* %src, i32 0) store i8* %dst, i8** @chp ret void } define void @test_simplify4() { -; CHECK: store i8* getelementptr inbounds ([14 x i8]* @hello, i32 0, i32 13) +; CHECK: store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @hello, i32 0, i32 13) ; CHECK-NOT: call i8* @strrchr ; CHECK: ret void - %src = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strrchr(i8* %src, i32 65280) store i8* %dst, i8** @chp ret void @@ -58,7 +58,7 @@ define void @test_nosimplify1(i32 %chr) { ; CHECK: call i8* @strrchr ; CHECK: ret void - %src = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %src = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8* @strrchr(i8* %src, i32 %chr) store i8* %dst, i8** @chp ret void diff --git a/test/Transforms/InstCombine/strrchr-2.ll b/test/Transforms/InstCombine/strrchr-2.ll index 1974f6c..4c203d0 100644 --- a/test/Transforms/InstCombine/strrchr-2.ll +++ b/test/Transforms/InstCombine/strrchr-2.ll @@ -14,7 +14,7 @@ define void @test_nosimplify1() { ; CHECK: call i8 @strrchr ; CHECK: ret void - %str = getelementptr [14 x i8]* @hello, i32 0, i32 0 + %str = getelementptr [14 x i8], [14 x i8]* @hello, i32 0, i32 0 %dst = call i8 @strrchr(i8* %str, i32 119) store i8 %dst, i8* @chr ret void diff --git a/test/Transforms/InstCombine/strspn-1.ll b/test/Transforms/InstCombine/strspn-1.ll index ac940cc..3d9c573 100644 --- a/test/Transforms/InstCombine/strspn-1.ll +++ b/test/Transforms/InstCombine/strspn-1.ll @@ -14,7 +14,7 @@ declare i64 @strspn(i8*, i8*) define i64 @test_simplify1(i8* %str) { ; CHECK-LABEL: @test_simplify1( - %pat = getelementptr [1 x i8]* @null, i32 0, i32 0 + %pat = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strspn(i8* %str, i8* %pat) ret i64 %ret @@ -25,7 +25,7 @@ define i64 @test_simplify1(i8* %str) { define i64 @test_simplify2(i8* %pat) { ; CHECK-LABEL: @test_simplify2( - %str = getelementptr [1 x i8]* @null, i32 0, i32 0 + %str = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call i64 @strspn(i8* %str, i8* %pat) ret i64 %ret @@ -36,8 +36,8 @@ define i64 @test_simplify2(i8* %pat) { define i64 @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %str = getelementptr [6 x i8]* @abcba, i32 0, i32 0 - %pat = getelementptr [4 x i8]* @abc, i32 0, i32 0 + %str = getelementptr [6 x i8], [6 x i8]* @abcba, i32 0, i32 0 + %pat = getelementptr [4 x i8], [4 x i8]* @abc, i32 0, i32 0 %ret = call i64 @strspn(i8* %str, i8* %pat) ret i64 %ret diff --git a/test/Transforms/InstCombine/strstr-1.ll b/test/Transforms/InstCombine/strstr-1.ll index a946dd3..d57e56c 100644 --- a/test/Transforms/InstCombine/strstr-1.ll +++ b/test/Transforms/InstCombine/strstr-1.ll @@ -15,7 +15,7 @@ declare i8* @strstr(i8*, i8*) define i8* @test_simplify1(i8* %str) { ; CHECK-LABEL: @test_simplify1( - %pat = getelementptr inbounds [1 x i8]* @.str, i32 0, i32 0 + %pat = getelementptr inbounds [1 x i8], [1 x i8]* @.str, i32 0, i32 0 %ret = call i8* @strstr(i8* %str, i8* %pat) ret i8* %ret ; CHECK-NEXT: ret i8* %str @@ -25,7 +25,7 @@ define i8* @test_simplify1(i8* %str) { define i8* @test_simplify2(i8* %str) { ; CHECK-LABEL: @test_simplify2( - %pat = getelementptr inbounds [2 x i8]* @.str1, i32 0, i32 0 + %pat = getelementptr inbounds [2 x i8], [2 x i8]* @.str1, i32 0, i32 0 %ret = call i8* @strstr(i8* %str, i8* %pat) ret i8* %ret ; CHECK-NEXT: @strchr(i8* %str, i32 97) @@ -35,11 +35,11 @@ define i8* @test_simplify2(i8* %str) { define i8* @test_simplify3() { ; CHECK-LABEL: @test_simplify3( - %str = getelementptr inbounds [6 x i8]* @.str2, i32 0, i32 0 - %pat = getelementptr inbounds [4 x i8]* @.str3, i32 0, i32 0 + %str = getelementptr inbounds [6 x i8], [6 x i8]* @.str2, i32 0, i32 0 + %pat = getelementptr inbounds [4 x i8], [4 x i8]* @.str3, i32 0, i32 0 %ret = call i8* @strstr(i8* %str, i8* %pat) ret i8* %ret -; CHECK-NEXT: getelementptr inbounds ([6 x i8]* @.str2, i64 0, i64 1) +; CHECK-NEXT: getelementptr inbounds ([6 x i8], [6 x i8]* @.str2, i64 0, i64 1) } ; Check strstr(str, str) -> str. diff --git a/test/Transforms/InstCombine/strstr-2.ll b/test/Transforms/InstCombine/strstr-2.ll index 7b28ed0..9cb3311 100644 --- a/test/Transforms/InstCombine/strstr-2.ll +++ b/test/Transforms/InstCombine/strstr-2.ll @@ -10,7 +10,7 @@ declare i8 @strstr(i8*, i8*) define i8 @test_no_simplify1(i8* %str) { ; CHECK-LABEL: @test_no_simplify1( - %pat = getelementptr inbounds [1 x i8]* @null, i32 0, i32 0 + %pat = getelementptr inbounds [1 x i8], [1 x i8]* @null, i32 0, i32 0 %ret = call i8 @strstr(i8* %str, i8* %pat) ; CHECK-NEXT: call i8 @strstr ret i8 %ret diff --git a/test/Transforms/InstCombine/struct-assign-tbaa.ll b/test/Transforms/InstCombine/struct-assign-tbaa.ll index e949640..c75a839 100644 --- a/test/Transforms/InstCombine/struct-assign-tbaa.ll +++ b/test/Transforms/InstCombine/struct-assign-tbaa.ll @@ -10,7 +10,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, %struct.test1 = type { float } ; CHECK: @test -; CHECK: %[[LOAD:.*]] = load i32* %{{.*}}, align 4, !tbaa !0 +; CHECK: %[[LOAD:.*]] = load i32, i32* %{{.*}}, align 4, !tbaa !0 ; CHECK: store i32 %[[LOAD:.*]], i32* %{{.*}}, align 4, !tbaa !0 ; CHECK: ret define void @test1(%struct.test1* nocapture %a, %struct.test1* nocapture %b) { @@ -30,8 +30,8 @@ define i32 (i8*, i32*, double*)*** @test2() { %tmp = alloca %struct.test2, align 8 %tmp1 = bitcast %struct.test2* %tmp to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* undef, i64 8, i32 8, i1 false), !tbaa.struct !4 - %tmp2 = getelementptr %struct.test2* %tmp, i32 0, i32 0 - %tmp3 = load i32 (i8*, i32*, double*)*** %tmp2 + %tmp2 = getelementptr %struct.test2, %struct.test2* %tmp, i32 0, i32 0 + %tmp3 = load i32 (i8*, i32*, double*)**, i32 (i8*, i32*, double*)*** %tmp2 ret i32 (i8*, i32*, double*)*** %tmp2 } diff --git a/test/Transforms/InstCombine/sub.ll b/test/Transforms/InstCombine/sub.ll index 0e421f7..c76d8d0 100644 --- a/test/Transforms/InstCombine/sub.ll +++ b/test/Transforms/InstCombine/sub.ll @@ -216,7 +216,7 @@ define zeroext i1 @test22(i32 %a, i32 %b) nounwind { ; rdar://7362831 define i32 @test23(i8* %P, i64 %A){ - %B = getelementptr inbounds i8* %P, i64 %A + %B = getelementptr inbounds i8, i8* %P, i64 %A %C = ptrtoint i8* %B to i64 %D = trunc i64 %C to i32 %E = ptrtoint i8* %P to i64 @@ -232,7 +232,7 @@ define i8 @test23_as1(i8 addrspace(1)* %P, i16 %A) { ; CHECK: @test23_as1 ; CHECK-NEXT: = trunc i16 %A to i8 ; CHECK-NEXT: ret i8 - %B = getelementptr inbounds i8 addrspace(1)* %P, i16 %A + %B = getelementptr inbounds i8, i8 addrspace(1)* %P, i16 %A %C = ptrtoint i8 addrspace(1)* %B to i16 %D = trunc i16 %C to i8 %E = ptrtoint i8 addrspace(1)* %P to i16 @@ -242,7 +242,7 @@ define i8 @test23_as1(i8 addrspace(1)* %P, i16 %A) { } define i64 @test24(i8* %P, i64 %A){ - %B = getelementptr inbounds i8* %P, i64 %A + %B = getelementptr inbounds i8, i8* %P, i64 %A %C = ptrtoint i8* %B to i64 %E = ptrtoint i8* %P to i64 %G = sub i64 %C, %E @@ -254,7 +254,7 @@ define i64 @test24(i8* %P, i64 %A){ define i16 @test24_as1(i8 addrspace(1)* %P, i16 %A) { ; CHECK: @test24_as1 ; CHECK-NEXT: ret i16 %A - %B = getelementptr inbounds i8 addrspace(1)* %P, i16 %A + %B = getelementptr inbounds i8, i8 addrspace(1)* %P, i16 %A %C = ptrtoint i8 addrspace(1)* %B to i16 %E = ptrtoint i8 addrspace(1)* %P to i16 %G = sub i16 %C, %E @@ -262,7 +262,7 @@ define i16 @test24_as1(i8 addrspace(1)* %P, i16 %A) { } define i64 @test24a(i8* %P, i64 %A){ - %B = getelementptr inbounds i8* %P, i64 %A + %B = getelementptr inbounds i8, i8* %P, i64 %A %C = ptrtoint i8* %B to i64 %E = ptrtoint i8* %P to i64 %G = sub i64 %E, %C @@ -276,7 +276,7 @@ define i16 @test24a_as1(i8 addrspace(1)* %P, i16 %A) { ; CHECK: @test24a_as1 ; CHECK-NEXT: sub i16 0, %A ; CHECK-NEXT: ret i16 - %B = getelementptr inbounds i8 addrspace(1)* %P, i16 %A + %B = getelementptr inbounds i8, i8 addrspace(1)* %P, i16 %A %C = ptrtoint i8 addrspace(1)* %B to i16 %E = ptrtoint i8 addrspace(1)* %P to i16 %G = sub i16 %E, %C @@ -287,7 +287,7 @@ define i16 @test24a_as1(i8 addrspace(1)* %P, i16 %A) { @Arr = external global [42 x i16] define i64 @test24b(i8* %P, i64 %A){ - %B = getelementptr inbounds [42 x i16]* @Arr, i64 0, i64 %A + %B = getelementptr inbounds [42 x i16], [42 x i16]* @Arr, i64 0, i64 %A %C = ptrtoint i16* %B to i64 %G = sub i64 %C, ptrtoint ([42 x i16]* @Arr to i64) ret i64 %G @@ -298,9 +298,9 @@ define i64 @test24b(i8* %P, i64 %A){ define i64 @test25(i8* %P, i64 %A){ - %B = getelementptr inbounds [42 x i16]* @Arr, i64 0, i64 %A + %B = getelementptr inbounds [42 x i16], [42 x i16]* @Arr, i64 0, i64 %A %C = ptrtoint i16* %B to i64 - %G = sub i64 %C, ptrtoint (i16* getelementptr ([42 x i16]* @Arr, i64 1, i64 0) to i64) + %G = sub i64 %C, ptrtoint (i16* getelementptr ([42 x i16], [42 x i16]* @Arr, i64 1, i64 0) to i64) ret i64 %G ; CHECK-LABEL: @test25( ; CHECK-NEXT: shl nuw i64 %A, 1 @@ -316,9 +316,9 @@ define i16 @test25_as1(i8 addrspace(1)* %P, i64 %A) { ; CHECK-NEXT: shl nuw i16 %1, 1 ; CHECK-NEXT: add i16 {{.*}}, -84 ; CHECK-NEXT: ret i16 - %B = getelementptr inbounds [42 x i16] addrspace(1)* @Arr_as1, i64 0, i64 %A + %B = getelementptr inbounds [42 x i16], [42 x i16] addrspace(1)* @Arr_as1, i64 0, i64 %A %C = ptrtoint i16 addrspace(1)* %B to i16 - %G = sub i16 %C, ptrtoint (i16 addrspace(1)* getelementptr ([42 x i16] addrspace(1)* @Arr_as1, i64 1, i64 0) to i16) + %G = sub i16 %C, ptrtoint (i16 addrspace(1)* getelementptr ([42 x i16], [42 x i16] addrspace(1)* @Arr_as1, i64 1, i64 0) to i16) ret i16 %G } @@ -353,8 +353,8 @@ define i32 @test28(i32 %x, i32 %y, i32 %z) { } define i64 @test29(i8* %foo, i64 %i, i64 %j) { - %gep1 = getelementptr inbounds i8* %foo, i64 %i - %gep2 = getelementptr inbounds i8* %foo, i64 %j + %gep1 = getelementptr inbounds i8, i8* %foo, i64 %i + %gep2 = getelementptr inbounds i8, i8* %foo, i64 %j %cast1 = ptrtoint i8* %gep1 to i64 %cast2 = ptrtoint i8* %gep2 to i64 %sub = sub i64 %cast1, %cast2 @@ -366,8 +366,8 @@ define i64 @test29(i8* %foo, i64 %i, i64 %j) { define i64 @test30(i8* %foo, i64 %i, i64 %j) { %bit = bitcast i8* %foo to i32* - %gep1 = getelementptr inbounds i32* %bit, i64 %i - %gep2 = getelementptr inbounds i8* %foo, i64 %j + %gep1 = getelementptr inbounds i32, i32* %bit, i64 %i + %gep2 = getelementptr inbounds i8, i8* %foo, i64 %j %cast1 = ptrtoint i32* %gep1 to i64 %cast2 = ptrtoint i8* %gep2 to i64 %sub = sub i64 %cast1, %cast2 @@ -384,8 +384,8 @@ define i16 @test30_as1(i8 addrspace(1)* %foo, i16 %i, i16 %j) { ; CHECK-NEXT: sub i16 %gep1.idx, %j ; CHECK-NEXT: ret i16 %bit = bitcast i8 addrspace(1)* %foo to i32 addrspace(1)* - %gep1 = getelementptr inbounds i32 addrspace(1)* %bit, i16 %i - %gep2 = getelementptr inbounds i8 addrspace(1)* %foo, i16 %j + %gep1 = getelementptr inbounds i32, i32 addrspace(1)* %bit, i16 %i + %gep2 = getelementptr inbounds i8, i8 addrspace(1)* %foo, i16 %j %cast1 = ptrtoint i32 addrspace(1)* %gep1 to i16 %cast2 = ptrtoint i8 addrspace(1)* %gep2 to i16 %sub = sub i16 %cast1, %cast2 diff --git a/test/Transforms/InstCombine/switch-truncate-crash.ll b/test/Transforms/InstCombine/switch-truncate-crash.ll new file mode 100644 index 0000000..cc3c1ff --- /dev/null +++ b/test/Transforms/InstCombine/switch-truncate-crash.ll @@ -0,0 +1,7 @@ +; RUN: opt -instcombine < %s + +define void @test() { + switch i32 0, label %out [i32 0, label %out] +out: + ret void +} diff --git a/test/Transforms/InstCombine/type_pun.ll b/test/Transforms/InstCombine/type_pun.ll index 33143ef..098164c 100644 --- a/test/Transforms/InstCombine/type_pun.ll +++ b/test/Transforms/InstCombine/type_pun.ll @@ -10,6 +10,10 @@ ; cleaning up the alloca/store/GEP/load. +; Provide legal integer types. +target datalayout = "p:32:32" + + ; Extracting the zeroth element in an i32 array. define i32 @type_pun_zeroth(<16 x i8> %in) { ; CHECK-LABEL: @type_pun_zeroth( diff --git a/test/Transforms/InstCombine/unpack-fca.ll b/test/Transforms/InstCombine/unpack-fca.ll new file mode 100644 index 0000000..5f63330 --- /dev/null +++ b/test/Transforms/InstCombine/unpack-fca.ll @@ -0,0 +1,31 @@ +; RUN: opt -instcombine -S < %s | FileCheck %s + +target datalayout = "e-i64:64-f80:128-n8:16:32:64" +target triple = "x86_64-unknown-linux-gnu" + +%A__vtbl = type { i8*, i32 (%A*)* } +%A = type { %A__vtbl* } + +@A__vtblZ = constant %A__vtbl { i8* null, i32 (%A*)* @A.foo } + +declare i32 @A.foo(%A* nocapture %this) + +declare i8* @allocmemory(i64) + +define void @structA() { +body: + %0 = tail call i8* @allocmemory(i64 32) + %1 = bitcast i8* %0 to %A* +; CHECK: store %A__vtbl* @A__vtblZ + store %A { %A__vtbl* @A__vtblZ }, %A* %1, align 8 + ret void +} + +define void @structOfA() { +body: + %0 = tail call i8* @allocmemory(i64 32) + %1 = bitcast i8* %0 to { %A }* +; CHECK: store %A__vtbl* @A__vtblZ + store { %A } { %A { %A__vtbl* @A__vtblZ } }, { %A }* %1, align 8 + ret void +} diff --git a/test/Transforms/InstCombine/urem-simplify-bug.ll b/test/Transforms/InstCombine/urem-simplify-bug.ll index 3e94ab5..6dd27e9 100644 --- a/test/Transforms/InstCombine/urem-simplify-bug.ll +++ b/test/Transforms/InstCombine/urem-simplify-bug.ll @@ -22,7 +22,7 @@ bb14: ; preds = %entry br label %bb15 bb15: ; preds = %bb14, %bb - %iftmp.0.0 = phi i8* [ getelementptr ([5 x i8]* @.str1, i32 0, i32 0), %bb14 ], [ getelementptr ([5 x i8]* @.str, i32 0, i32 0), %bb ] ; <i8*> [#uses=1] + %iftmp.0.0 = phi i8* [ getelementptr ([5 x i8], [5 x i8]* @.str1, i32 0, i32 0), %bb14 ], [ getelementptr ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), %bb ] ; <i8*> [#uses=1] %tmp17 = call i32 (i8*, ...)* @printf( i8* %iftmp.0.0 ) nounwind ; <i32> [#uses=0] ret i32 0 } diff --git a/test/Transforms/InstCombine/vec_demanded_elts.ll b/test/Transforms/InstCombine/vec_demanded_elts.ll index 00a029a..8a8b834 100644 --- a/test/Transforms/InstCombine/vec_demanded_elts.ll +++ b/test/Transforms/InstCombine/vec_demanded_elts.ll @@ -110,7 +110,7 @@ define void @vac(<4 x float>* nocapture %a) nounwind { ; CHECK-NOT: load ; CHECK: ret entry: - %tmp1 = load <4 x float>* %a ; <<4 x float>> [#uses=1] + %tmp1 = load <4 x float>, <4 x float>* %a ; <<4 x float>> [#uses=1] %vecins = insertelement <4 x float> %tmp1, float 0.000000e+00, i32 0 ; <<4 x float>> [#uses=1] %vecins4 = insertelement <4 x float> %vecins, float 0.000000e+00, i32 1; <<4 x float>> [#uses=1] %vecins6 = insertelement <4 x float> %vecins4, float 0.000000e+00, i32 2; <<4 x float>> [#uses=1] @@ -141,8 +141,8 @@ declare i64 @llvm.x86.sse2.cvttsd2si64(<2 x double>) ; <rdar://problem/6945110> define <4 x i32> @kernel3_vertical(<4 x i16> * %src, <8 x i16> * %foo) nounwind { entry: - %tmp = load <4 x i16>* %src - %tmp1 = load <8 x i16>* %foo + %tmp = load <4 x i16>, <4 x i16>* %src + %tmp1 = load <8 x i16>, <8 x i16>* %foo ; CHECK: %tmp2 = shufflevector %tmp2 = shufflevector <4 x i16> %tmp, <4 x i16> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef> ; pmovzxwd ignores the upper 64-bits of its input; -instcombine should remove this shuffle: diff --git a/test/Transforms/InstCombine/vec_extract_var_elt.ll b/test/Transforms/InstCombine/vec_extract_var_elt.ll index f6f9e01..5c0610f 100644 --- a/test/Transforms/InstCombine/vec_extract_var_elt.ll +++ b/test/Transforms/InstCombine/vec_extract_var_elt.ll @@ -3,7 +3,7 @@ define void @test (float %b, <8 x float> * %p) { ; CHECK: extractelement ; CHECK: fptosi - %1 = load <8 x float> * %p + %1 = load <8 x float> , <8 x float> * %p %2 = bitcast <8 x float> %1 to <8 x i32> %3 = bitcast <8 x i32> %2 to <8 x float> %a = fptosi <8 x float> %3 to <8 x i32> diff --git a/test/Transforms/InstCombine/vec_phi_extract.ll b/test/Transforms/InstCombine/vec_phi_extract.ll index 1d778a0..1079dc9 100644 --- a/test/Transforms/InstCombine/vec_phi_extract.ll +++ b/test/Transforms/InstCombine/vec_phi_extract.ll @@ -16,7 +16,7 @@ loop: %end = icmp ult i32 %elt, %limit %3 = add i32 10, %elt %4 = sext i32 %elt to i64 - %5 = getelementptr i32* %ptr, i64 %4 + %5 = getelementptr i32, i32* %ptr, i64 %4 store i32 %3, i32* %5 %inc = add <16 x i32> %2, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16> br i1 %end, label %loop, label %ret diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll index eb4e9d6..164e315 100644 --- a/test/Transforms/InstCombine/vec_shuffle.ll +++ b/test/Transforms/InstCombine/vec_shuffle.ll @@ -190,11 +190,11 @@ define void @test14(i16 %conv10) { %tmp = alloca <4 x i16>, align 8 %vecinit6 = insertelement <4 x i16> undef, i16 23, i32 3 store <4 x i16> %vecinit6, <4 x i16>* undef - %tmp1 = load <4 x i16>* undef + %tmp1 = load <4 x i16>, <4 x i16>* undef %vecinit11 = insertelement <4 x i16> undef, i16 %conv10, i32 3 %div = udiv <4 x i16> %tmp1, %vecinit11 store <4 x i16> %div, <4 x i16>* %tmp - %tmp4 = load <4 x i16>* %tmp + %tmp4 = load <4 x i16>, <4 x i16>* %tmp %tmp5 = shufflevector <4 x i16> %tmp4, <4 x i16> undef, <2 x i32> <i32 2, i32 0> %cmp = icmp ule <2 x i16> %tmp5, undef %sext = sext <2 x i1> %cmp to <2 x i16> diff --git a/test/Transforms/InstCombine/vector-casts.ll b/test/Transforms/InstCombine/vector-casts.ll index ca97b34..727eb4e 100644 --- a/test/Transforms/InstCombine/vector-casts.ll +++ b/test/Transforms/InstCombine/vector-casts.ll @@ -133,7 +133,7 @@ entry: %dim31 = insertelement <4 x i32> %dim30, i32 %a, i32 2 %dim32 = insertelement <4 x i32> %dim31, i32 %a, i32 3 - %offset_ptr = getelementptr <4 x float>* null, i32 1 + %offset_ptr = getelementptr <4 x float>, <4 x float>* null, i32 1 %offset_int = ptrtoint <4 x float>* %offset_ptr to i64 %sizeof32 = trunc i64 %offset_int to i32 diff --git a/test/Transforms/InstCombine/vector_gep1.ll b/test/Transforms/InstCombine/vector_gep1.ll index 90ca262..0f4e407 100644 --- a/test/Transforms/InstCombine/vector_gep1.ll +++ b/test/Transforms/InstCombine/vector_gep1.ll @@ -17,26 +17,26 @@ define <2 x i1> @test2(<2 x i8*> %a) { } define <2 x i1> @test3(<2 x i8*> %a) { - %g = getelementptr <2 x i8*> %a, <2 x i32> <i32 1, i32 0> + %g = getelementptr i8, <2 x i8*> %a, <2 x i32> <i32 1, i32 0> %B = icmp ult <2 x i8*> %g, zeroinitializer ret <2 x i1> %B } define <1 x i1> @test4(<1 x i8*> %a) { - %g = getelementptr <1 x i8*> %a, <1 x i32> <i32 1> + %g = getelementptr i8, <1 x i8*> %a, <1 x i32> <i32 1> %B = icmp ult <1 x i8*> %g, zeroinitializer ret <1 x i1> %B } define <2 x i1> @test5(<2 x i8*> %a) { - %w = getelementptr <2 x i8*> %a, <2 x i32> zeroinitializer - %e = getelementptr <2 x i8*> %w, <2 x i32> <i32 5, i32 9> - %g = getelementptr <2 x i8*> %e, <2 x i32> <i32 1, i32 0> + %w = getelementptr i8, <2 x i8*> %a, <2 x i32> zeroinitializer + %e = getelementptr i8, <2 x i8*> %w, <2 x i32> <i32 5, i32 9> + %g = getelementptr i8, <2 x i8*> %e, <2 x i32> <i32 1, i32 0> %B = icmp ult <2 x i8*> %g, zeroinitializer ret <2 x i1> %B } define <2 x i32*> @test7(<2 x {i32, i32}*> %a) { - %w = getelementptr <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> zeroinitializer + %w = getelementptr {i32, i32}, <2 x {i32, i32}*> %a, <2 x i32> <i32 5, i32 9>, <2 x i32> zeroinitializer ret <2 x i32*> %w } diff --git a/test/Transforms/InstCombine/vector_gep2.ll b/test/Transforms/InstCombine/vector_gep2.ll index 42057d6..d76a7d5 100644 --- a/test/Transforms/InstCombine/vector_gep2.ll +++ b/test/Transforms/InstCombine/vector_gep2.ll @@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu" define <2 x i8*> @testa(<2 x i8*> %a) { ; CHECK-LABEL: @testa( - %g = getelementptr <2 x i8*> %a, <2 x i32> <i32 0, i32 1> -; CHECK: getelementptr <2 x i8*> %a, <2 x i64> <i64 0, i64 1> + %g = getelementptr i8, <2 x i8*> %a, <2 x i32> <i32 0, i32 1> +; CHECK: getelementptr i8, <2 x i8*> %a, <2 x i64> <i64 0, i64 1> ret <2 x i8*> %g } diff --git a/test/Transforms/InstCombine/volatile_store.ll b/test/Transforms/InstCombine/volatile_store.ll index 7cab199..7377b68 100644 --- a/test/Transforms/InstCombine/volatile_store.ll +++ b/test/Transforms/InstCombine/volatile_store.ll @@ -5,7 +5,7 @@ define void @self_assign_1() { entry: - %tmp = load volatile i32* @x ; <i32> [#uses=1] + %tmp = load volatile i32, i32* @x ; <i32> [#uses=1] store volatile i32 %tmp, i32* @x br label %return diff --git a/test/Transforms/InstCombine/vsx-unaligned.ll b/test/Transforms/InstCombine/vsx-unaligned.ll index 26e0426..ad264fb 100644 --- a/test/Transforms/InstCombine/vsx-unaligned.ll +++ b/test/Transforms/InstCombine/vsx-unaligned.ll @@ -14,28 +14,28 @@ entry: %t1 = alloca <4 x float>*, align 8 %t2 = alloca <2 x double>*, align 8 store <4 x float>* @vf, <4 x float>** %t1, align 8 - %0 = load <4 x float>** %t1, align 8 + %0 = load <4 x float>*, <4 x float>** %t1, align 8 %1 = bitcast <4 x float>* %0 to i8* %2 = call <4 x i32> @llvm.ppc.vsx.lxvw4x(i8* %1) store <4 x float>* @res_vf, <4 x float>** %t1, align 8 - %3 = load <4 x float>** %t1, align 8 + %3 = load <4 x float>*, <4 x float>** %t1, align 8 %4 = bitcast <4 x float>* %3 to i8* call void @llvm.ppc.vsx.stxvw4x(<4 x i32> %2, i8* %4) store <2 x double>* @vd, <2 x double>** %t2, align 8 - %5 = load <2 x double>** %t2, align 8 + %5 = load <2 x double>*, <2 x double>** %t2, align 8 %6 = bitcast <2 x double>* %5 to i8* %7 = call <2 x double> @llvm.ppc.vsx.lxvd2x(i8* %6) store <2 x double>* @res_vd, <2 x double>** %t2, align 8 - %8 = load <2 x double>** %t2, align 8 + %8 = load <2 x double>*, <2 x double>** %t2, align 8 %9 = bitcast <2 x double>* %8 to i8* call void @llvm.ppc.vsx.stxvd2x(<2 x double> %7, i8* %9) ret void } ; CHECK-LABEL: @test1 -; CHECK: %0 = load <4 x i32>* bitcast (<4 x float>* @vf to <4 x i32>*), align 1 +; CHECK: %0 = load <4 x i32>, <4 x i32>* bitcast (<4 x float>* @vf to <4 x i32>*), align 1 ; CHECK: store <4 x i32> %0, <4 x i32>* bitcast (<4 x float>* @res_vf to <4 x i32>*), align 1 -; CHECK: %1 = load <2 x double>* @vd, align 1 +; CHECK: %1 = load <2 x double>, <2 x double>* @vd, align 1 ; CHECK: store <2 x double> %1, <2 x double>* @res_vd, align 1 declare <4 x i32> @llvm.ppc.vsx.lxvw4x(i8*) diff --git a/test/Transforms/InstCombine/weak-symbols.ll b/test/Transforms/InstCombine/weak-symbols.ll index ec946ea..3f92e64 100644 --- a/test/Transforms/InstCombine/weak-symbols.ll +++ b/test/Transforms/InstCombine/weak-symbols.ll @@ -13,8 +13,8 @@ define i32 @foo() nounwind { ; CHECK: ret i32 %temp1 entry: - %str1 = getelementptr inbounds [2 x i8]* @fake_init, i64 0, i64 0 - %str2 = getelementptr inbounds [2 x i8]* @.str, i64 0, i64 0 + %str1 = getelementptr inbounds [2 x i8], [2 x i8]* @fake_init, i64 0, i64 0 + %str2 = getelementptr inbounds [2 x i8], [2 x i8]* @.str, i64 0, i64 0 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) nounwind readonly ret i32 %temp1 } @@ -24,8 +24,8 @@ define i32 @bar() nounwind { ; CHECK: ret i32 0 entry: - %str1 = getelementptr inbounds [2 x i8]* @real_init, i64 0, i64 0 - %str2 = getelementptr inbounds [2 x i8]* @.str, i64 0, i64 0 + %str1 = getelementptr inbounds [2 x i8], [2 x i8]* @real_init, i64 0, i64 0 + %str2 = getelementptr inbounds [2 x i8], [2 x i8]* @.str, i64 0, i64 0 %temp1 = call i32 @strcmp(i8* %str1, i8* %str2) nounwind readonly ret i32 %temp1 } diff --git a/test/Transforms/InstCombine/x86-vperm2.ll b/test/Transforms/InstCombine/x86-vperm2.ll new file mode 100644 index 0000000..5c60852 --- /dev/null +++ b/test/Transforms/InstCombine/x86-vperm2.ll @@ -0,0 +1,283 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +; This should never happen, but make sure we don't crash handling a non-constant immediate byte. + +define <4 x double> @perm2pd_non_const_imm(<4 x double> %a0, <4 x double> %a1, i8 %b) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 %b) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_non_const_imm +; CHECK-NEXT: call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 %b) +; CHECK-NEXT: ret <4 x double> +} + + +; In the following 4 tests, both zero mask bits of the immediate are set. + +define <4 x double> @perm2pd_0x88(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 136) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x88 +; CHECK-NEXT: ret <4 x double> zeroinitializer +} + +define <8 x float> @perm2ps_0x88(<8 x float> %a0, <8 x float> %a1) { + %res = call <8 x float> @llvm.x86.avx.vperm2f128.ps.256(<8 x float> %a0, <8 x float> %a1, i8 136) + ret <8 x float> %res + +; CHECK-LABEL: @perm2ps_0x88 +; CHECK-NEXT: ret <8 x float> zeroinitializer +} + +define <8 x i32> @perm2si_0x88(<8 x i32> %a0, <8 x i32> %a1) { + %res = call <8 x i32> @llvm.x86.avx.vperm2f128.si.256(<8 x i32> %a0, <8 x i32> %a1, i8 136) + ret <8 x i32> %res + +; CHECK-LABEL: @perm2si_0x88 +; CHECK-NEXT: ret <8 x i32> zeroinitializer +} + +define <4 x i64> @perm2i_0x88(<4 x i64> %a0, <4 x i64> %a1) { + %res = call <4 x i64> @llvm.x86.avx2.vperm2i128(<4 x i64> %a0, <4 x i64> %a1, i8 136) + ret <4 x i64> %res + +; CHECK-LABEL: @perm2i_0x88 +; CHECK-NEXT: ret <4 x i64> zeroinitializer +} + + +; The other control bits are ignored when zero mask bits of the immediate are set. + +define <4 x double> @perm2pd_0xff(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 255) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0xff +; CHECK-NEXT: ret <4 x double> zeroinitializer +} + + +; The following 16 tests are simple shuffles, except for 2 cases where we can just return one of the +; source vectors. Verify that we generate the right shuffle masks and undef source operand where possible.. + +define <4 x double> @perm2pd_0x00(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 0) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x00 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a0, <4 x double> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x01(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 1) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x01 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a0, <4 x double> undef, <4 x i32> <i32 2, i32 3, i32 0, i32 1> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x02(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 2) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x02 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a1, <4 x double> %a0, <4 x i32> <i32 0, i32 1, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x03(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 3) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x03 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a1, <4 x double> %a0, <4 x i32> <i32 2, i32 3, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x10(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 16) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x10 +; CHECK-NEXT: ret <4 x double> %a0 +} + +define <4 x double> @perm2pd_0x11(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 17) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x11 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a0, <4 x double> undef, <4 x i32> <i32 2, i32 3, i32 2, i32 3> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x12(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 18) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x12 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a1, <4 x double> %a0, <4 x i32> <i32 0, i32 1, i32 6, i32 7> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x13(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 19) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x13 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a1, <4 x double> %a0, <4 x i32> <i32 2, i32 3, i32 6, i32 7> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x20(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 32) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x20 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a0, <4 x double> %a1, <4 x i32> <i32 0, i32 1, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x21(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 33) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x21 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a0, <4 x double> %a1, <4 x i32> <i32 2, i32 3, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x22(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 34) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x22 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a1, <4 x double> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x23(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 35) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x23 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a1, <4 x double> undef, <4 x i32> <i32 2, i32 3, i32 0, i32 1> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x30(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 48) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x30 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a0, <4 x double> %a1, <4 x i32> <i32 0, i32 1, i32 6, i32 7> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x31(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 49) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x31 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a0, <4 x double> %a1, <4 x i32> <i32 2, i32 3, i32 6, i32 7> +; CHECK-NEXT: ret <4 x double> %1 +} + +define <4 x double> @perm2pd_0x32(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 50) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x32 +; CHECK-NEXT: ret <4 x double> %a1 +} + +define <4 x double> @perm2pd_0x33(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 51) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x33 +; CHECK-NEXT: %1 = shufflevector <4 x double> %a1, <4 x double> undef, <4 x i32> <i32 2, i32 3, i32 2, i32 3> +; CHECK-NEXT: ret <4 x double> %1 +} + +; Confirm that a mask for 32-bit elements is also correct. + +define <8 x float> @perm2ps_0x31(<8 x float> %a0, <8 x float> %a1) { + %res = call <8 x float> @llvm.x86.avx.vperm2f128.ps.256(<8 x float> %a0, <8 x float> %a1, i8 49) + ret <8 x float> %res + +; CHECK-LABEL: @perm2ps_0x31 +; CHECK-NEXT: %1 = shufflevector <8 x float> %a0, <8 x float> %a1, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 12, i32 13, i32 14, i32 15> +; CHECK-NEXT: ret <8 x float> %1 +} + + +; Confirm that the AVX2 version works the same. + +define <4 x i64> @perm2i_0x33(<4 x i64> %a0, <4 x i64> %a1) { + %res = call <4 x i64> @llvm.x86.avx2.vperm2i128(<4 x i64> %a0, <4 x i64> %a1, i8 51) + ret <4 x i64> %res + +; CHECK-LABEL: @perm2i_0x33 +; CHECK-NEXT: %1 = shufflevector <4 x i64> %a1, <4 x i64> undef, <4 x i32> <i32 2, i32 3, i32 2, i32 3> +; CHECK-NEXT: ret <4 x i64> %1 +} + + +; Confirm that when a single zero mask bit is set, we replace a source vector with zeros. + +define <4 x double> @perm2pd_0x81(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 129) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x81 +; CHECK-NEXT: shufflevector <4 x double> %a0, <4 x double> <double 0.0{{.*}}<4 x i32> <i32 2, i32 3, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> +} + +define <4 x double> @perm2pd_0x83(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 131) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x83 +; CHECK-NEXT: shufflevector <4 x double> %a1, <4 x double> <double 0.0{{.*}}, <4 x i32> <i32 2, i32 3, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> +} + +define <4 x double> @perm2pd_0x28(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 40) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x28 +; CHECK-NEXT: shufflevector <4 x double> <double 0.0{{.*}}, <4 x double> %a1, <4 x i32> <i32 0, i32 1, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> +} + +define <4 x double> @perm2pd_0x08(<4 x double> %a0, <4 x double> %a1) { + %res = call <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double> %a0, <4 x double> %a1, i8 8) + ret <4 x double> %res + +; CHECK-LABEL: @perm2pd_0x08 +; CHECK-NEXT: shufflevector <4 x double> <double 0.0{{.*}}, <4 x double> %a0, <4 x i32> <i32 0, i32 1, i32 4, i32 5> +; CHECK-NEXT: ret <4 x double> +} + +; Check one more with the AVX2 version. + +define <4 x i64> @perm2i_0x28(<4 x i64> %a0, <4 x i64> %a1) { + %res = call <4 x i64> @llvm.x86.avx2.vperm2i128(<4 x i64> %a0, <4 x i64> %a1, i8 40) + ret <4 x i64> %res + +; CHECK-LABEL: @perm2i_0x28 +; CHECK-NEXT: shufflevector <4 x i64> <i64 0{{.*}}, <4 x i64> %a1, <4 x i32> <i32 0, i32 1, i32 4, i32 5> +; CHECK-NEXT: ret <4 x i64> +} + +declare <4 x double> @llvm.x86.avx.vperm2f128.pd.256(<4 x double>, <4 x double>, i8) nounwind readnone +declare <8 x float> @llvm.x86.avx.vperm2f128.ps.256(<8 x float>, <8 x float>, i8) nounwind readnone +declare <8 x i32> @llvm.x86.avx.vperm2f128.si.256(<8 x i32>, <8 x i32>, i8) nounwind readnone +declare <4 x i64> @llvm.x86.avx2.vperm2i128(<4 x i64>, <4 x i64>, i8) nounwind readnone + diff --git a/test/Transforms/InstCombine/zext-or-icmp.ll b/test/Transforms/InstCombine/zext-or-icmp.ll index ddc6083..3a27f9a 100644 --- a/test/Transforms/InstCombine/zext-or-icmp.ll +++ b/test/Transforms/InstCombine/zext-or-icmp.ll @@ -10,19 +10,19 @@ entry: %tmp3 = and i32 %tmp2, 2 ; <i32> [#uses=1] %tmp5 = and i32 %blk_i, 1 ; <i32> [#uses=1] %tmp6 = or i32 %tmp3, %tmp5 ; <i32> [#uses=1] - %tmp8 = getelementptr %struct.FooBar* %up, i32 0, i32 7 ; <i16*> [#uses=1] - %tmp9 = load i16* %tmp8, align 1 ; <i16> [#uses=1] + %tmp8 = getelementptr %struct.FooBar, %struct.FooBar* %up, i32 0, i32 7 ; <i16*> [#uses=1] + %tmp9 = load i16, i16* %tmp8, align 1 ; <i16> [#uses=1] %tmp910 = zext i16 %tmp9 to i32 ; <i32> [#uses=1] - %tmp12 = getelementptr [4 x i8]* @some_idx, i32 0, i32 %tmp6 ; <i8*> [#uses=1] - %tmp13 = load i8* %tmp12, align 1 ; <i8> [#uses=1] + %tmp12 = getelementptr [4 x i8], [4 x i8]* @some_idx, i32 0, i32 %tmp6 ; <i8*> [#uses=1] + %tmp13 = load i8, i8* %tmp12, align 1 ; <i8> [#uses=1] %tmp1314 = zext i8 %tmp13 to i32 ; <i32> [#uses=1] %tmp151 = lshr i32 %tmp910, %tmp1314 ; <i32> [#uses=1] %tmp1516 = trunc i32 %tmp151 to i8 ; <i8> [#uses=1] - %tmp18 = getelementptr %struct.FooBar* %up, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp19 = load i8* %tmp18, align 1 ; <i8> [#uses=1] + %tmp18 = getelementptr %struct.FooBar, %struct.FooBar* %up, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp19 = load i8, i8* %tmp18, align 1 ; <i8> [#uses=1] %tmp22 = and i8 %tmp1516, %tmp19 ; <i8> [#uses=1] - %tmp24 = getelementptr %struct.FooBar* %up, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp25 = load i8* %tmp24, align 1 ; <i8> [#uses=1] + %tmp24 = getelementptr %struct.FooBar, %struct.FooBar* %up, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp25 = load i8, i8* %tmp24, align 1 ; <i8> [#uses=1] %tmp26.mask = and i8 %tmp25, 1 ; <i8> [#uses=1] %toBool = icmp eq i8 %tmp26.mask, 0 ; <i1> [#uses=1] %toBool.not = xor i1 %toBool, true ; <i1> [#uses=1] diff --git a/test/Transforms/InstMerge/ld_hoist1.ll b/test/Transforms/InstMerge/ld_hoist1.ll index 715f1b8..74c8900 100644 --- a/test/Transforms/InstMerge/ld_hoist1.ll +++ b/test/Transforms/InstMerge/ld_hoist1.ll @@ -15,35 +15,35 @@ for.body.lr.ph: ; preds = %entry ; CHECK-LABEL: for.body ; CHECK: load -; CHECK: %2 = getelementptr inbounds i32* %in, i64 %indvars.iv -; CHECK: %3 = load i32* %2, align 4 +; CHECK: %2 = getelementptr inbounds i32, i32* %in, i64 %indvars.iv +; CHECK: %3 = load i32, i32* %2, align 4 for.body: ; preds = %for.body.lr.ph, %for.inc %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] - %arrayidx = getelementptr inbounds i32* %trigger, i64 %indvars.iv - %1 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %trigger, i64 %indvars.iv + %1 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %1, 0 br i1 %cmp1, label %if.then, label %if.else ; CHECK-LABEL: if.then if.then: ; preds = %for.body ; This load should be hoisted - %arrayidx3 = getelementptr inbounds i32* %in, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %in, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %conv = sitofp i32 %2 to float %add = fadd float %conv, 5.000000e-01 - %arrayidx5 = getelementptr inbounds float* %out, i64 %indvars.iv + %arrayidx5 = getelementptr inbounds float, float* %out, i64 %indvars.iv store float %add, float* %arrayidx5, align 4 br label %for.inc if.else: ; preds = %for.body - %arrayidx7 = getelementptr inbounds float* %out, i64 %indvars.iv - %3 = load float* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds float, float* %out, i64 %indvars.iv + %3 = load float, float* %arrayidx7, align 4 %div = fdiv float %3, 3.000000e+00 store float %div, float* %arrayidx7, align 4 ; This load should be hoisted in spite of store - %arrayidx9 = getelementptr inbounds i32* %in, i64 %indvars.iv - %4 = load i32* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds i32, i32* %in, i64 %indvars.iv + %4 = load i32, i32* %arrayidx9, align 4 %conv10 = sitofp i32 %4 to float %add13 = fadd float %div, %conv10 store float %add13, float* %arrayidx7, align 4 diff --git a/test/Transforms/InstMerge/ld_hoist_st_sink.ll b/test/Transforms/InstMerge/ld_hoist_st_sink.ll index 978160a..1d3f941 100644 --- a/test/Transforms/InstMerge/ld_hoist_st_sink.ll +++ b/test/Transforms/InstMerge/ld_hoist_st_sink.ll @@ -8,8 +8,8 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" define i64 @foo(%struct.node* nocapture readonly %r) nounwind { entry: - %node.0.in16 = getelementptr inbounds %struct.node* %r, i64 0, i32 2 - %node.017 = load %struct.node** %node.0.in16, align 8 + %node.0.in16 = getelementptr inbounds %struct.node, %struct.node* %r, i64 0, i32 2 + %node.017 = load %struct.node*, %struct.node** %node.0.in16, align 8 %tobool18 = icmp eq %struct.node* %node.017, null br i1 %tobool18, label %while.end, label %while.body.preheader @@ -21,46 +21,46 @@ while.body.preheader: ; preds = %entry while.body: ; preds = %while.body.preheader, %if.end %node.020 = phi %struct.node* [ %node.0, %if.end ], [ %node.017, %while.body.preheader ] %sum.019 = phi i64 [ %inc, %if.end ], [ 0, %while.body.preheader ] - %orientation = getelementptr inbounds %struct.node* %node.020, i64 0, i32 4 - %0 = load i64* %orientation, align 8 + %orientation = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 4 + %0 = load i64, i64* %orientation, align 8 %cmp = icmp eq i64 %0, 1 br i1 %cmp, label %if.then, label %if.else ; CHECK: if.then if.then: ; preds = %while.body - %a = getelementptr inbounds %struct.node* %node.020, i64 0, i32 5 + %a = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 5 ; CHECK-NOT: load %struct.arc - %1 = load %struct.arc** %a, align 8 - %cost = getelementptr inbounds %struct.arc* %1, i64 0, i32 0 -; CHECK-NOT: load i64* - %2 = load i64* %cost, align 8 - %pred = getelementptr inbounds %struct.node* %node.020, i64 0, i32 1 -; CHECK-NOT: load %struct.node** - %3 = load %struct.node** %pred, align 8 - %p = getelementptr inbounds %struct.node* %3, i64 0, i32 6 -; CHECK-NOT: load i64* - %4 = load i64* %p, align 8 + %1 = load %struct.arc*, %struct.arc** %a, align 8 + %cost = getelementptr inbounds %struct.arc, %struct.arc* %1, i64 0, i32 0 +; CHECK-NOT: load i64, i64* + %2 = load i64, i64* %cost, align 8 + %pred = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 1 +; CHECK-NOT: load %struct.node*, %struct.node** + %3 = load %struct.node*, %struct.node** %pred, align 8 + %p = getelementptr inbounds %struct.node, %struct.node* %3, i64 0, i32 6 +; CHECK-NOT: load i64, i64* + %4 = load i64, i64* %p, align 8 %add = add nsw i64 %4, %2 - %p1 = getelementptr inbounds %struct.node* %node.020, i64 0, i32 6 + %p1 = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 6 ; CHECK-NOT: store i64 store i64 %add, i64* %p1, align 8 br label %if.end ; CHECK: if.else if.else: ; preds = %while.body - %pred2 = getelementptr inbounds %struct.node* %node.020, i64 0, i32 1 -; CHECK-NOT: load %struct.node** - %5 = load %struct.node** %pred2, align 8 - %p3 = getelementptr inbounds %struct.node* %5, i64 0, i32 6 -; CHECK-NOT: load i64* - %6 = load i64* %p3, align 8 - %a4 = getelementptr inbounds %struct.node* %node.020, i64 0, i32 5 -; CHECK-NOT: load %struct.arc** - %7 = load %struct.arc** %a4, align 8 - %cost5 = getelementptr inbounds %struct.arc* %7, i64 0, i32 0 -; CHECK-NOT: load i64* - %8 = load i64* %cost5, align 8 + %pred2 = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 1 +; CHECK-NOT: load %struct.node*, %struct.node** + %5 = load %struct.node*, %struct.node** %pred2, align 8 + %p3 = getelementptr inbounds %struct.node, %struct.node* %5, i64 0, i32 6 +; CHECK-NOT: load i64, i64* + %6 = load i64, i64* %p3, align 8 + %a4 = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 5 +; CHECK-NOT: load %struct.arc*, %struct.arc** + %7 = load %struct.arc*, %struct.arc** %a4, align 8 + %cost5 = getelementptr inbounds %struct.arc, %struct.arc* %7, i64 0, i32 0 +; CHECK-NOT: load i64, i64* + %8 = load i64, i64* %cost5, align 8 %sub = sub nsw i64 %6, %8 - %p6 = getelementptr inbounds %struct.node* %node.020, i64 0, i32 6 + %p6 = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 6 ; CHECK-NOT: store i64 store i64 %sub, i64* %p6, align 8 br label %if.end @@ -69,8 +69,8 @@ if.else: ; preds = %while.body if.end: ; preds = %if.else, %if.then ; CHECK: store %inc = add nsw i64 %sum.019, 1 - %node.0.in = getelementptr inbounds %struct.node* %node.020, i64 0, i32 2 - %node.0 = load %struct.node** %node.0.in, align 8 + %node.0.in = getelementptr inbounds %struct.node, %struct.node* %node.020, i64 0, i32 2 + %node.0 = load %struct.node*, %struct.node** %node.0.in, align 8 %tobool = icmp eq %struct.node* %node.0, null br i1 %tobool, label %while.end.loopexit, label %while.body diff --git a/test/Transforms/InstMerge/st_sink_barrier_call.ll b/test/Transforms/InstMerge/st_sink_barrier_call.ll index c158b00..cdcc346 100644 --- a/test/Transforms/InstMerge/st_sink_barrier_call.ll +++ b/test/Transforms/InstMerge/st_sink_barrier_call.ll @@ -10,27 +10,27 @@ declare i32 @foo(i32 %x) ; Function Attrs: nounwind uwtable define void @sink_store(%struct.node* nocapture %r, i32 %index) { entry: - %node.0.in16 = getelementptr inbounds %struct.node* %r, i64 0, i32 2 - %node.017 = load %struct.node** %node.0.in16, align 8 + %node.0.in16 = getelementptr inbounds %struct.node, %struct.node* %r, i64 0, i32 2 + %node.017 = load %struct.node*, %struct.node** %node.0.in16, align 8 %index.addr = alloca i32, align 4 store i32 %index, i32* %index.addr, align 4 - %0 = load i32* %index.addr, align 4 + %0 = load i32, i32* %index.addr, align 4 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else ; CHECK: if.then if.then: ; preds = %entry - %1 = load i32* %index.addr, align 4 - %p1 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %1 = load i32, i32* %index.addr, align 4 + %p1 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK: store i32 store i32 %1, i32* %p1, align 4 br label %if.end ; CHECK: if.else if.else: ; preds = %entry - %2 = load i32* %index.addr, align 4 + %2 = load i32, i32* %index.addr, align 4 %add = add nsw i32 %2, 1 - %p3 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %p3 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK: store i32 store i32 %add, i32* %p3, align 4 call i32 @foo(i32 5) ;barrier diff --git a/test/Transforms/InstMerge/st_sink_bugfix_22613.ll b/test/Transforms/InstMerge/st_sink_bugfix_22613.ll index 34e3fdb..575f239 100644 --- a/test/Transforms/InstMerge/st_sink_bugfix_22613.ll +++ b/test/Transforms/InstMerge/st_sink_bugfix_22613.ll @@ -26,46 +26,46 @@ entry: br label %for.cond for.cond: ; preds = %for.inc8, %entry - %0 = load i32* @d, align 4 + %0 = load i32, i32* @d, align 4 %cmp = icmp slt i32 %0, 2 br i1 %cmp, label %for.body, label %for.end10 for.body: ; preds = %for.cond - %1 = load i32* @d, align 4 + %1 = load i32, i32* @d, align 4 %idxprom = sext i32 %1 to i64 - %2 = load i32* @b, align 4 + %2 = load i32, i32* @b, align 4 %idxprom1 = sext i32 %2 to i64 - %arrayidx = getelementptr inbounds [1 x [3 x i8]]* @f, i32 0, i64 %idxprom1 - %arrayidx2 = getelementptr inbounds [3 x i8]* %arrayidx, i32 0, i64 %idxprom + %arrayidx = getelementptr inbounds [1 x [3 x i8]], [1 x [3 x i8]]* @f, i32 0, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds [3 x i8], [3 x i8]* %arrayidx, i32 0, i64 %idxprom store i8 0, i8* %arrayidx2, align 1 store i32 0, i32* @e, align 4 br label %for.cond3 for.cond3: ; preds = %for.inc, %for.body - %3 = load i32* @e, align 4 + %3 = load i32, i32* @e, align 4 %cmp4 = icmp slt i32 %3, 3 br i1 %cmp4, label %for.body5, label %for.end for.body5: ; preds = %for.cond3 - %4 = load i32* @c, align 4 + %4 = load i32, i32* @c, align 4 %tobool = icmp ne i32 %4, 0 br i1 %tobool, label %if.then, label %if.end if.then: ; preds = %for.body5 - %5 = load i32* @a, align 4 + %5 = load i32, i32* @a, align 4 %dec = add nsw i32 %5, -1 store i32 %dec, i32* @a, align 4 br label %if.end if.end: ; preds = %if.then, %for.body5 - %6 = load i32* @e, align 4 + %6 = load i32, i32* @e, align 4 %idxprom6 = sext i32 %6 to i64 - %arrayidx7 = getelementptr inbounds [3 x i8]* getelementptr inbounds ([1 x [3 x i8]]* @f, i32 0, i64 0), i32 0, i64 %idxprom6 + %arrayidx7 = getelementptr inbounds [3 x i8], [3 x i8]* getelementptr inbounds ([1 x [3 x i8]], [1 x [3 x i8]]* @f, i32 0, i64 0), i32 0, i64 %idxprom6 store i8 1, i8* %arrayidx7, align 1 br label %for.inc for.inc: ; preds = %if.end - %7 = load i32* @e, align 4 + %7 = load i32, i32* @e, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* @e, align 4 br label %for.cond3 @@ -74,7 +74,7 @@ for.end: ; preds = %for.cond3 br label %for.inc8 for.inc8: ; preds = %for.end - %8 = load i32* @d, align 4 + %8 = load i32, i32* @d, align 4 %inc9 = add nsw i32 %8, 1 store i32 %inc9, i32* @d, align 4 br label %for.cond @@ -89,7 +89,7 @@ entry: %retval = alloca i32, align 4 store i32 0, i32* %retval call void @fn1() - %0 = load i8* getelementptr inbounds ([1 x [3 x i8]]* @f, i32 0, i64 0, i64 1), align 1 + %0 = load i8, i8* getelementptr inbounds ([1 x [3 x i8]], [1 x [3 x i8]]* @f, i32 0, i64 0, i64 1), align 1 %conv = sext i8 %0 to i32 %cmp = icmp ne i32 %conv, 1 br i1 %cmp, label %if.then, label %if.end diff --git a/test/Transforms/InstMerge/st_sink_no_barrier_call.ll b/test/Transforms/InstMerge/st_sink_no_barrier_call.ll index 72f1fdf..0ad90f8 100644 --- a/test/Transforms/InstMerge/st_sink_no_barrier_call.ll +++ b/test/Transforms/InstMerge/st_sink_no_barrier_call.ll @@ -10,27 +10,27 @@ declare i32 @foo(i32 %x) #0 ; Function Attrs: nounwind uwtable define void @sink_store(%struct.node* nocapture %r, i32 %index) { entry: - %node.0.in16 = getelementptr inbounds %struct.node* %r, i64 0, i32 2 - %node.017 = load %struct.node** %node.0.in16, align 8 + %node.0.in16 = getelementptr inbounds %struct.node, %struct.node* %r, i64 0, i32 2 + %node.017 = load %struct.node*, %struct.node** %node.0.in16, align 8 %index.addr = alloca i32, align 4 store i32 %index, i32* %index.addr, align 4 - %0 = load i32* %index.addr, align 4 + %0 = load i32, i32* %index.addr, align 4 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else ; CHECK: if.then if.then: ; preds = %entry - %1 = load i32* %index.addr, align 4 - %p1 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %1 = load i32, i32* %index.addr, align 4 + %p1 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK-NOT: store i32 store i32 %1, i32* %p1, align 4 br label %if.end ; CHECK: if.else if.else: ; preds = %entry - %2 = load i32* %index.addr, align 4 + %2 = load i32, i32* %index.addr, align 4 %add = add nsw i32 %2, 1 - %p3 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %p3 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK-NOT: store i32 store i32 %add, i32* %p3, align 4 call i32 @foo(i32 5) ;not a barrier diff --git a/test/Transforms/InstMerge/st_sink_no_barrier_load.ll b/test/Transforms/InstMerge/st_sink_no_barrier_load.ll index 5be0c25..b7236e4 100644 --- a/test/Transforms/InstMerge/st_sink_no_barrier_load.ll +++ b/test/Transforms/InstMerge/st_sink_no_barrier_load.ll @@ -8,30 +8,30 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" ; Function Attrs: nounwind uwtable define void @sink_store(%struct.node* nocapture %r, i32 %index) { entry: - %node.0.in16 = getelementptr inbounds %struct.node* %r, i64 0, i32 2 - %node.017 = load %struct.node** %node.0.in16, align 8 + %node.0.in16 = getelementptr inbounds %struct.node, %struct.node* %r, i64 0, i32 2 + %node.017 = load %struct.node*, %struct.node** %node.0.in16, align 8 %index.addr = alloca i32, align 4 store i32 %index, i32* %index.addr, align 4 - %0 = load i32* %index.addr, align 4 + %0 = load i32, i32* %index.addr, align 4 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else ; CHECK: if.then if.then: ; preds = %entry - %1 = load i32* %index.addr, align 4 - %p1 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %1 = load i32, i32* %index.addr, align 4 + %p1 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK-NOT: store i32 store i32 %1, i32* %p1, align 4 - %p2 = getelementptr inbounds %struct.node* %node.017, i32 5, i32 6 - ; CHECK: load i32* - %not_barrier = load i32 * %p2, align 4 + %p2 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 5, i32 6 + ; CHECK: load i32, i32* + %not_barrier = load i32 , i32 * %p2, align 4 br label %if.end ; CHECK: if.else if.else: ; preds = %entry - %2 = load i32* %index.addr, align 4 + %2 = load i32, i32* %index.addr, align 4 %add = add nsw i32 %2, 1 - %p3 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %p3 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK-NOT: store i32 store i32 %add, i32* %p3, align 4 br label %if.end diff --git a/test/Transforms/InstMerge/st_sink_no_barrier_store.ll b/test/Transforms/InstMerge/st_sink_no_barrier_store.ll index 06e2b63..e13f28a 100644 --- a/test/Transforms/InstMerge/st_sink_no_barrier_store.ll +++ b/test/Transforms/InstMerge/st_sink_no_barrier_store.ll @@ -8,29 +8,29 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" ; Function Attrs: nounwind uwtable define void @sink_store(%struct.node* nocapture %r, i32 %index) { entry: - %node.0.in16 = getelementptr inbounds %struct.node* %r, i64 0, i32 2 - %node.017 = load %struct.node** %node.0.in16, align 8 + %node.0.in16 = getelementptr inbounds %struct.node, %struct.node* %r, i64 0, i32 2 + %node.017 = load %struct.node*, %struct.node** %node.0.in16, align 8 %index.addr = alloca i32, align 4 store i32 %index, i32* %index.addr, align 4 - %0 = load i32* %index.addr, align 4 + %0 = load i32, i32* %index.addr, align 4 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else ; CHECK: if.then if.then: ; preds = %entry - %1 = load i32* %index.addr, align 4 - %p1 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %1 = load i32, i32* %index.addr, align 4 + %p1 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK-NOT: store i32 store i32 %1, i32* %p1, align 4 br label %if.end ; CHECK: if.else if.else: ; preds = %entry - %2 = load i32* %index.addr, align 4 + %2 = load i32, i32* %index.addr, align 4 %add = add nsw i32 %2, 1 - %p2 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %p2 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 store i32 %add, i32* %p2, align 4 - %p3 = getelementptr inbounds %struct.node* %node.017, i32 5, i32 6 + %p3 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 5, i32 6 ; CHECK: store i32 store i32 %add, i32* %p3, align 4 ; This is not a barrier br label %if.end diff --git a/test/Transforms/InstMerge/st_sink_two_stores.ll b/test/Transforms/InstMerge/st_sink_two_stores.ll index 1f7c6aa..5b5582f 100644 --- a/test/Transforms/InstMerge/st_sink_two_stores.ll +++ b/test/Transforms/InstMerge/st_sink_two_stores.ll @@ -8,33 +8,33 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" ; Function Attrs: nounwind uwtable define void @sink_store(%struct.node* nocapture %r, i32 %index) { entry: - %node.0.in16 = getelementptr inbounds %struct.node* %r, i64 0, i32 2 - %node.017 = load %struct.node** %node.0.in16, align 8 + %node.0.in16 = getelementptr inbounds %struct.node, %struct.node* %r, i64 0, i32 2 + %node.017 = load %struct.node*, %struct.node** %node.0.in16, align 8 %index.addr = alloca i32, align 4 store i32 %index, i32* %index.addr, align 4 - %0 = load i32* %index.addr, align 4 + %0 = load i32, i32* %index.addr, align 4 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else ; CHECK: if.then if.then: ; preds = %entry - %1 = load i32* %index.addr, align 4 - %p1 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %1 = load i32, i32* %index.addr, align 4 + %p1 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK-NOT: store i32 store i32 %1, i32* %p1, align 4 - %p2 = getelementptr inbounds %struct.node* %node.017, i32 4, i32 6 + %p2 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 4, i32 6 ; CHECK-NOT: store i32 store i32 %1, i32* %p2, align 4 br label %if.end ; CHECK: if.else if.else: ; preds = %entry - %2 = load i32* %index.addr, align 4 + %2 = load i32, i32* %index.addr, align 4 %add = add nsw i32 %2, 1 - %p3 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %p3 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK-NOT: store i32 store i32 %add, i32* %p3, align 4 - %p4 = getelementptr inbounds %struct.node* %node.017, i32 4, i32 6 + %p4 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 4, i32 6 ; CHECK-NOT: store i32 store i32 %2, i32* %p4, align 4 br label %if.end diff --git a/test/Transforms/InstMerge/st_sink_with_barrier.ll b/test/Transforms/InstMerge/st_sink_with_barrier.ll index d4efaa7..a05ae88 100644 --- a/test/Transforms/InstMerge/st_sink_with_barrier.ll +++ b/test/Transforms/InstMerge/st_sink_with_barrier.ll @@ -7,30 +7,30 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" ; Function Attrs: nounwind uwtable define void @sink_store(%struct.node* nocapture %r, i32 %index) { entry: - %node.0.in16 = getelementptr inbounds %struct.node* %r, i64 0, i32 2 - %node.017 = load %struct.node** %node.0.in16, align 8 + %node.0.in16 = getelementptr inbounds %struct.node, %struct.node* %r, i64 0, i32 2 + %node.017 = load %struct.node*, %struct.node** %node.0.in16, align 8 %index.addr = alloca i32, align 4 store i32 %index, i32* %index.addr, align 4 - %0 = load i32* %index.addr, align 4 + %0 = load i32, i32* %index.addr, align 4 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else ; CHECK: if.then if.then: ; preds = %entry - %1 = load i32* %index.addr, align 4 - %p1 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %1 = load i32, i32* %index.addr, align 4 + %p1 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK: store i32 store i32 %1, i32* %p1, align 4 - %p2 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 - ; CHECK: load i32* - %barrier = load i32 * %p2, align 4 + %p2 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 + ; CHECK: load i32, i32* + %barrier = load i32 , i32 * %p2, align 4 br label %if.end ; CHECK: if.else if.else: ; preds = %entry - %2 = load i32* %index.addr, align 4 + %2 = load i32, i32* %index.addr, align 4 %add = add nsw i32 %2, 1 - %p3 = getelementptr inbounds %struct.node* %node.017, i32 0, i32 6 + %p3 = getelementptr inbounds %struct.node, %struct.node* %node.017, i32 0, i32 6 ; CHECK: store i32 store i32 %add, i32* %p3, align 4 br label %if.end diff --git a/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll b/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll index a10081a..5380a7b 100644 --- a/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll +++ b/test/Transforms/InstSimplify/2011-10-27-BinOpCrash.ll @@ -6,7 +6,7 @@ @_ZN11xercesc_2_5L15gCombiningCharsE = external constant [163 x i16], align 2 define i32 @_ZN11xercesc_2_515XMLRangeFactory11buildRangesEv(i32 %x) { - %a = add i32 %x, add (i32 add (i32 ashr (i32 add (i32 mul (i32 ptrtoint ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE, i32 0, i32 30) to i32)), i32 1), i32 ashr (i32 add (i32 mul (i32 ptrtoint ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE, i32 0, i32 4) to i32)), i32 1)), i32 8) + %a = add i32 %x, add (i32 add (i32 ashr (i32 add (i32 mul (i32 ptrtoint ([32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([32 x i16], [32 x i16]* @_ZN11xercesc_2_5L11gDigitCharsE, i32 0, i32 30) to i32)), i32 1), i32 ashr (i32 add (i32 mul (i32 ptrtoint ([7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE to i32), i32 -1), i32 ptrtoint (i16* getelementptr inbounds ([7 x i16], [7 x i16]* @_ZN11xercesc_2_5L17gIdeographicCharsE, i32 0, i32 4) to i32)), i32 1)), i32 8) %b = add i32 %a, %x ret i32 %b } diff --git a/test/Transforms/InstSimplify/call-callconv.ll b/test/Transforms/InstSimplify/call-callconv.ll index e475be7..56a8e44 100644 --- a/test/Transforms/InstSimplify/call-callconv.ll +++ b/test/Transforms/InstSimplify/call-callconv.ll @@ -29,7 +29,7 @@ declare arm_aapcscc i32 @labs(i32) nounwind readnone define arm_aapcscc i32 @_strlen1() { ; CHECK: _strlen1 - %call = tail call arm_aapcscc i32 @strlen(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0)) + %call = tail call arm_aapcscc i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)) ret i32 %call ; CHECK: ret i32 3 } @@ -42,7 +42,7 @@ define arm_aapcscc zeroext i1 @_strlen2(i8* %str) { %cmp = icmp ne i32 %call, 0 ret i1 %cmp -; CHECK: %[[STRLENFIRST:.*]] = load i8* %str +; CHECK: %[[STRLENFIRST:.*]] = load i8, i8* %str ; CHECK: %[[CMP:.*]] = icmp ne i8 %[[STRLENFIRST]], 0 ; CHECK: ret i1 %[[CMP]] } diff --git a/test/Transforms/InstSimplify/call.ll b/test/Transforms/InstSimplify/call.ll index fd854c5..ac94e75 100644 --- a/test/Transforms/InstSimplify/call.ll +++ b/test/Transforms/InstSimplify/call.ll @@ -109,7 +109,7 @@ entry: br i1 %cmp, label %cast.end, label %cast.notnull cast.notnull: ; preds = %entry - %add.ptr = getelementptr inbounds i8* %call, i64 4 + %add.ptr = getelementptr inbounds i8, i8* %call, i64 4 br label %cast.end cast.end: ; preds = %cast.notnull, %entry @@ -132,7 +132,7 @@ entry: br i1 %cmp, label %cast.end, label %cast.notnull cast.notnull: ; preds = %entry - %add.ptr = getelementptr inbounds i8* %call, i64 4 + %add.ptr = getelementptr inbounds i8, i8* %call, i64 4 br label %cast.end cast.end: ; preds = %cast.notnull, %entry @@ -152,7 +152,7 @@ entry: br i1 %cmp, label %cast.end, label %cast.notnull cast.notnull: ; preds = %entry - %add.ptr = getelementptr inbounds i8* %call, i64 4 + %add.ptr = getelementptr inbounds i8, i8* %call, i64 4 br label %cast.end cast.end: ; preds = %cast.notnull, %entry diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll index 10c7ca6..07c90d8 100644 --- a/test/Transforms/InstSimplify/compare.ll +++ b/test/Transforms/InstSimplify/compare.ll @@ -24,7 +24,7 @@ define i1 @bitcast() { define i1 @gep() { ; CHECK-LABEL: @gep( %a = alloca [3 x i8], align 8 - %x = getelementptr inbounds [3 x i8]* %a, i32 0, i32 0 + %x = getelementptr inbounds [3 x i8], [3 x i8]* %a, i32 0, i32 0 %cmp = icmp eq i8* %x, null ret i1 %cmp ; CHECK-NEXT: ret i1 false @@ -33,8 +33,8 @@ define i1 @gep() { define i1 @gep2() { ; CHECK-LABEL: @gep2( %a = alloca [3 x i8], align 8 - %x = getelementptr inbounds [3 x i8]* %a, i32 0, i32 0 - %y = getelementptr inbounds [3 x i8]* %a, i32 0, i32 0 + %x = getelementptr inbounds [3 x i8], [3 x i8]* %a, i32 0, i32 0 + %y = getelementptr inbounds [3 x i8], [3 x i8]* %a, i32 0, i32 0 %cmp = icmp eq i8* %x, %y ret i1 %cmp ; CHECK-NEXT: ret i1 true @@ -48,8 +48,8 @@ define i1 @gep2() { define i1 @gep3() { ; CHECK-LABEL: @gep3( %x = alloca %gept, align 8 - %a = getelementptr %gept* %x, i64 0, i32 0 - %b = getelementptr %gept* %x, i64 0, i32 1 + %a = getelementptr %gept, %gept* %x, i64 0, i32 0 + %b = getelementptr %gept, %gept* %x, i64 0, i32 1 %equal = icmp eq i32* %a, %b ret i1 %equal ; CHECK-NEXT: ret i1 false @@ -58,8 +58,8 @@ define i1 @gep3() { define i1 @gep4() { ; CHECK-LABEL: @gep4( %x = alloca %gept, align 8 - %a = getelementptr %gept* @gepy, i64 0, i32 0 - %b = getelementptr %gept* @gepy, i64 0, i32 1 + %a = getelementptr %gept, %gept* @gepy, i64 0, i32 0 + %b = getelementptr %gept, %gept* @gepy, i64 0, i32 1 %equal = icmp eq i32* %a, %b ret i1 %equal ; CHECK-NEXT: ret i1 false @@ -68,8 +68,8 @@ define i1 @gep4() { define i1 @gep5() { ; CHECK-LABEL: @gep5( %x = alloca %gept, align 8 - %a = getelementptr inbounds %gept* %x, i64 0, i32 1 - %b = getelementptr %gept* @gepy, i64 0, i32 0 + %a = getelementptr inbounds %gept, %gept* %x, i64 0, i32 1 + %b = getelementptr %gept, %gept* @gepy, i64 0, i32 0 %equal = icmp eq i32* %a, %b ret i1 %equal ; CHECK-NEXT: ret i1 false @@ -78,8 +78,8 @@ define i1 @gep5() { define i1 @gep6(%gept* %x) { ; Same as @gep3 but potentially null. ; CHECK-LABEL: @gep6( - %a = getelementptr %gept* %x, i64 0, i32 0 - %b = getelementptr %gept* %x, i64 0, i32 1 + %a = getelementptr %gept, %gept* %x, i64 0, i32 0 + %b = getelementptr %gept, %gept* %x, i64 0, i32 1 %equal = icmp eq i32* %a, %b ret i1 %equal ; CHECK-NEXT: ret i1 false @@ -87,8 +87,8 @@ define i1 @gep6(%gept* %x) { define i1 @gep7(%gept* %x) { ; CHECK-LABEL: @gep7( - %a = getelementptr %gept* %x, i64 0, i32 0 - %b = getelementptr %gept* @gepz, i64 0, i32 0 + %a = getelementptr %gept, %gept* %x, i64 0, i32 0 + %b = getelementptr %gept, %gept* @gepz, i64 0, i32 0 %equal = icmp eq i32* %a, %b ret i1 %equal ; CHECK: ret i1 %equal @@ -96,8 +96,8 @@ define i1 @gep7(%gept* %x) { define i1 @gep8(%gept* %x) { ; CHECK-LABEL: @gep8( - %a = getelementptr %gept* %x, i32 1 - %b = getelementptr %gept* %x, i32 -1 + %a = getelementptr %gept, %gept* %x, i32 1 + %b = getelementptr %gept, %gept* %x, i32 -1 %equal = icmp ugt %gept* %a, %b ret i1 %equal ; CHECK: ret i1 %equal @@ -109,14 +109,14 @@ define i1 @gep9(i8* %ptr) { ; CHECK: ret i1 true entry: - %first1 = getelementptr inbounds i8* %ptr, i32 0 - %first2 = getelementptr inbounds i8* %first1, i32 1 - %first3 = getelementptr inbounds i8* %first2, i32 2 - %first4 = getelementptr inbounds i8* %first3, i32 4 - %last1 = getelementptr inbounds i8* %first2, i32 48 - %last2 = getelementptr inbounds i8* %last1, i32 8 - %last3 = getelementptr inbounds i8* %last2, i32 -4 - %last4 = getelementptr inbounds i8* %last3, i32 -4 + %first1 = getelementptr inbounds i8, i8* %ptr, i32 0 + %first2 = getelementptr inbounds i8, i8* %first1, i32 1 + %first3 = getelementptr inbounds i8, i8* %first2, i32 2 + %first4 = getelementptr inbounds i8, i8* %first3, i32 4 + %last1 = getelementptr inbounds i8, i8* %first2, i32 48 + %last2 = getelementptr inbounds i8, i8* %last1, i32 8 + %last3 = getelementptr inbounds i8, i8* %last2, i32 -4 + %last4 = getelementptr inbounds i8, i8* %last3, i32 -4 %first.int = ptrtoint i8* %first4 to i32 %last.int = ptrtoint i8* %last4 to i32 %cmp = icmp ne i32 %last.int, %first.int @@ -129,10 +129,10 @@ define i1 @gep10(i8* %ptr) { ; CHECK: ret i1 true entry: - %first1 = getelementptr inbounds i8* %ptr, i32 -2 - %first2 = getelementptr inbounds i8* %first1, i32 44 - %last1 = getelementptr inbounds i8* %ptr, i32 48 - %last2 = getelementptr inbounds i8* %last1, i32 -6 + %first1 = getelementptr inbounds i8, i8* %ptr, i32 -2 + %first2 = getelementptr inbounds i8, i8* %first1, i32 44 + %last1 = getelementptr inbounds i8, i8* %ptr, i32 48 + %last2 = getelementptr inbounds i8, i8* %last1, i32 -6 %first.int = ptrtoint i8* %first2 to i32 %last.int = ptrtoint i8* %last2 to i32 %cmp = icmp eq i32 %last.int, %first.int @@ -145,9 +145,9 @@ define i1 @gep11(i8* %ptr) { ; CHECK: ret i1 true entry: - %first1 = getelementptr inbounds i8* %ptr, i32 -2 - %last1 = getelementptr inbounds i8* %ptr, i32 48 - %last2 = getelementptr inbounds i8* %last1, i32 -6 + %first1 = getelementptr inbounds i8, i8* %ptr, i32 -2 + %last1 = getelementptr inbounds i8, i8* %ptr, i32 48 + %last2 = getelementptr inbounds i8, i8* %last1, i32 -6 %cmp = icmp ult i8* %first1, %last2 ret i1 %cmp } @@ -158,9 +158,9 @@ define i1 @gep12(i8* %ptr) { ; CHECK: ret i1 %cmp entry: - %first1 = getelementptr inbounds i8* %ptr, i32 -2 - %last1 = getelementptr inbounds i8* %ptr, i32 48 - %last2 = getelementptr inbounds i8* %last1, i32 -6 + %first1 = getelementptr inbounds i8, i8* %ptr, i32 -2 + %last1 = getelementptr inbounds i8, i8* %ptr, i32 48 + %last2 = getelementptr inbounds i8, i8* %last1, i32 -6 %cmp = icmp slt i8* %first1, %last2 ret i1 %cmp } @@ -168,7 +168,7 @@ entry: define i1 @gep13(i8* %ptr) { ; CHECK-LABEL: @gep13( ; We can prove this GEP is non-null because it is inbounds. - %x = getelementptr inbounds i8* %ptr, i32 1 + %x = getelementptr inbounds i8, i8* %ptr, i32 1 %cmp = icmp eq i8* %x, null ret i1 %cmp ; CHECK-NEXT: ret i1 false @@ -178,7 +178,7 @@ define i1 @gep14({ {}, i8 }* %ptr) { ; CHECK-LABEL: @gep14( ; We can't simplify this because the offset of one in the GEP actually doesn't ; move the pointer. - %x = getelementptr inbounds { {}, i8 }* %ptr, i32 0, i32 1 + %x = getelementptr inbounds { {}, i8 }, { {}, i8 }* %ptr, i32 0, i32 1 %cmp = icmp eq i8* %x, null ret i1 %cmp ; CHECK-NOT: ret i1 false @@ -188,7 +188,7 @@ define i1 @gep15({ {}, [4 x {i8, i8}]}* %ptr, i32 %y) { ; CHECK-LABEL: @gep15( ; We can prove this GEP is non-null even though there is a user value, as we ; would necessarily violate inbounds on one side or the other. - %x = getelementptr inbounds { {}, [4 x {i8, i8}]}* %ptr, i32 0, i32 1, i32 %y, i32 1 + %x = getelementptr inbounds { {}, [4 x {i8, i8}]}, { {}, [4 x {i8, i8}]}* %ptr, i32 0, i32 1, i32 %y, i32 1 %cmp = icmp eq i8* %x, null ret i1 %cmp ; CHECK-NEXT: ret i1 false @@ -199,7 +199,7 @@ define i1 @gep16(i8* %ptr, i32 %a) { ; We can prove this GEP is non-null because it is inbounds and because we know ; %b is non-zero even though we don't know its value. %b = or i32 %a, 1 - %x = getelementptr inbounds i8* %ptr, i32 %b + %x = getelementptr inbounds i8, i8* %ptr, i32 %b %cmp = icmp eq i8* %x, null ret i1 %cmp ; CHECK-NEXT: ret i1 false @@ -687,7 +687,7 @@ define <2 x i1> @vectorselectcrash(i32 %arg1) { ; PR12013 define i1 @alloca_compare(i64 %idx) { %sv = alloca { i32, i32, [124 x i32] } - %1 = getelementptr inbounds { i32, i32, [124 x i32] }* %sv, i32 0, i32 2, i64 %idx + %1 = getelementptr inbounds { i32, i32, [124 x i32] }, { i32, i32, [124 x i32] }* %sv, i32 0, i32 2, i64 %idx %2 = icmp eq i32* %1, null ret i1 %2 ; CHECK: alloca_compare @@ -699,7 +699,7 @@ define i1 @infinite_gep() { ret i1 1 unreachableblock: - %X = getelementptr i32 *%X, i32 1 + %X = getelementptr i32, i32 *%X, i32 1 %Y = icmp eq i32* %X, null ret i1 %Y } @@ -744,7 +744,7 @@ define i1 @alloca_gep(i64 %a, i64 %b) { ; We can prove this GEP is non-null because it is inbounds and the pointer ; is non-null. %strs = alloca [1000 x [1001 x i8]], align 16 - %x = getelementptr inbounds [1000 x [1001 x i8]]* %strs, i64 0, i64 %a, i64 %b + %x = getelementptr inbounds [1000 x [1001 x i8]], [1000 x [1001 x i8]]* %strs, i64 0, i64 %a, i64 %b %cmp = icmp eq i8* %x, null ret i1 %cmp ; CHECK-NEXT: ret i1 false @@ -753,10 +753,10 @@ define i1 @alloca_gep(i64 %a, i64 %b) { define i1 @non_inbounds_gep_compare(i64* %a) { ; CHECK-LABEL: @non_inbounds_gep_compare( ; Equality compares with non-inbounds GEPs can be folded. - %x = getelementptr i64* %a, i64 42 - %y = getelementptr inbounds i64* %x, i64 -42 - %z = getelementptr i64* %a, i64 -42 - %w = getelementptr inbounds i64* %z, i64 42 + %x = getelementptr i64, i64* %a, i64 42 + %y = getelementptr inbounds i64, i64* %x, i64 -42 + %z = getelementptr i64, i64* %a, i64 -42 + %w = getelementptr inbounds i64, i64* %z, i64 42 %cmp = icmp eq i64* %y, %w ret i1 %cmp ; CHECK-NEXT: ret i1 true @@ -765,8 +765,8 @@ define i1 @non_inbounds_gep_compare(i64* %a) { define i1 @non_inbounds_gep_compare2(i64* %a) { ; CHECK-LABEL: @non_inbounds_gep_compare2( ; Equality compares with non-inbounds GEPs can be folded. - %x = getelementptr i64* %a, i64 4294967297 - %y = getelementptr i64* %a, i64 1 + %x = getelementptr i64, i64* %a, i64 4294967297 + %y = getelementptr i64, i64* %a, i64 1 %cmp = icmp eq i64* %y, %y ret i1 %cmp ; CHECK-NEXT: ret i1 true @@ -918,7 +918,7 @@ define i1 @nonnull_deref_as_arg(i32 addrspace(1)* dereferenceable(4) %i) { ret i1 %cmp ; CHECK-LABEL: @nonnull_deref_as_arg ; CHECK: icmp -; CHECK ret +; CHECK: ret } declare nonnull i32* @returns_nonnull_helper() @@ -950,7 +950,7 @@ define i1 @returns_nonnull_as_deref() { } define i1 @nonnull_load(i32** %addr) { - %ptr = load i32** %addr, !nonnull !{} + %ptr = load i32*, i32** %addr, !nonnull !{} %cmp = icmp eq i32* %ptr, null ret i1 %cmp ; CHECK-LABEL: @nonnull_load @@ -958,14 +958,14 @@ define i1 @nonnull_load(i32** %addr) { } define i1 @nonnull_load_as_outer(i32* addrspace(1)* %addr) { - %ptr = load i32* addrspace(1)* %addr, !nonnull !{} + %ptr = load i32*, i32* addrspace(1)* %addr, !nonnull !{} %cmp = icmp eq i32* %ptr, null ret i1 %cmp ; CHECK-LABEL: @nonnull_load_as_outer ; CHECK: ret i1 false } define i1 @nonnull_load_as_inner(i32 addrspace(1)** %addr) { - %ptr = load i32 addrspace(1)** %addr, !nonnull !{} + %ptr = load i32 addrspace(1)*, i32 addrspace(1)** %addr, !nonnull !{} %cmp = icmp eq i32 addrspace(1)* %ptr, null ret i1 %cmp ; CHECK-LABEL: @nonnull_load_as_inner diff --git a/test/Transforms/InstSimplify/gep.ll b/test/Transforms/InstSimplify/gep.ll index 49a97f1..13640e7 100644 --- a/test/Transforms/InstSimplify/gep.ll +++ b/test/Transforms/InstSimplify/gep.ll @@ -9,7 +9,7 @@ define %struct.A* @test1(%struct.A* %b, %struct.A* %e) { %b_ptr = ptrtoint %struct.A* %b to i64 %sub = sub i64 %e_ptr, %b_ptr %sdiv = sdiv exact i64 %sub, 7 - %gep = getelementptr inbounds %struct.A* %b, i64 %sdiv + %gep = getelementptr inbounds %struct.A, %struct.A* %b, i64 %sdiv ret %struct.A* %gep ; CHECK-LABEL: @test1 ; CHECK-NEXT: ret %struct.A* %e @@ -19,7 +19,7 @@ define i8* @test2(i8* %b, i8* %e) { %e_ptr = ptrtoint i8* %e to i64 %b_ptr = ptrtoint i8* %b to i64 %sub = sub i64 %e_ptr, %b_ptr - %gep = getelementptr inbounds i8* %b, i64 %sub + %gep = getelementptr inbounds i8, i8* %b, i64 %sub ret i8* %gep ; CHECK-LABEL: @test2 ; CHECK-NEXT: ret i8* %e @@ -30,7 +30,7 @@ define i64* @test3(i64* %b, i64* %e) { %b_ptr = ptrtoint i64* %b to i64 %sub = sub i64 %e_ptr, %b_ptr %ashr = ashr exact i64 %sub, 3 - %gep = getelementptr inbounds i64* %b, i64 %ashr + %gep = getelementptr inbounds i64, i64* %b, i64 %ashr ret i64* %gep ; CHECK-LABEL: @test3 ; CHECK-NEXT: ret i64* %e @@ -40,7 +40,7 @@ define %struct.A* @test4(%struct.A* %b) { %b_ptr = ptrtoint %struct.A* %b to i64 %sub = sub i64 0, %b_ptr %sdiv = sdiv exact i64 %sub, 7 - %gep = getelementptr inbounds %struct.A* %b, i64 %sdiv + %gep = getelementptr inbounds %struct.A, %struct.A* %b, i64 %sdiv ret %struct.A* %gep ; CHECK-LABEL: @test4 ; CHECK-NEXT: ret %struct.A* null @@ -49,7 +49,7 @@ define %struct.A* @test4(%struct.A* %b) { define i8* @test5(i8* %b) { %b_ptr = ptrtoint i8* %b to i64 %sub = sub i64 0, %b_ptr - %gep = getelementptr inbounds i8* %b, i64 %sub + %gep = getelementptr inbounds i8, i8* %b, i64 %sub ret i8* %gep ; CHECK-LABEL: @test5 ; CHECK-NEXT: ret i8* null @@ -59,7 +59,7 @@ define i64* @test6(i64* %b) { %b_ptr = ptrtoint i64* %b to i64 %sub = sub i64 0, %b_ptr %ashr = ashr exact i64 %sub, 3 - %gep = getelementptr inbounds i64* %b, i64 %ashr + %gep = getelementptr inbounds i64, i64* %b, i64 %ashr ret i64* %gep ; CHECK-LABEL: @test6 ; CHECK-NEXT: ret i64* null @@ -69,7 +69,7 @@ define i8* @test7(i8* %b, i8** %e) { %e_ptr = ptrtoint i8** %e to i64 %b_ptr = ptrtoint i8* %b to i64 %sub = sub i64 %e_ptr, %b_ptr - %gep = getelementptr inbounds i8* %b, i64 %sub + %gep = getelementptr inbounds i8, i8* %b, i64 %sub ret i8* %gep ; CHECK-LABEL: @test7 ; CHECK-NEXT: ptrtoint diff --git a/test/Transforms/InstSimplify/load.ll b/test/Transforms/InstSimplify/load.ll index 92953cd..ab87d4b 100644 --- a/test/Transforms/InstSimplify/load.ll +++ b/test/Transforms/InstSimplify/load.ll @@ -6,14 +6,14 @@ define i32 @crash_on_zeroinit() { ; CHECK-LABEL: @crash_on_zeroinit ; CHECK: ret i32 0 - %load = load i32* bitcast ({}* @zeroinit to i32*) + %load = load i32, i32* bitcast ({}* @zeroinit to i32*) ret i32 %load } define i32 @crash_on_undef() { ; CHECK-LABEL: @crash_on_undef ; CHECK: ret i32 undef - %load = load i32* bitcast ({}* @undef to i32*) + %load = load i32, i32* bitcast ({}* @undef to i32*) ret i32 %load } diff --git a/test/Transforms/InstSimplify/noalias-ptr.ll b/test/Transforms/InstSimplify/noalias-ptr.ll index 7693e55..59b1dfa 100644 --- a/test/Transforms/InstSimplify/noalias-ptr.ll +++ b/test/Transforms/InstSimplify/noalias-ptr.ll @@ -26,7 +26,7 @@ define void @_Z2p1v() #0 { %1 = bitcast [10 x i32]* %mStackData to i8* %2 = tail call noalias i8* @_Znam(i64 48) #4 %3 = bitcast i8* %2 to i32* - %4 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %4 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %5 = icmp eq i32* %3, %4 br i1 %5, label %7, label %6 @@ -47,7 +47,7 @@ define void @_Z2p1v() #0 { define void @_Z2p2bb(i1 zeroext %b1, i1 zeroext %b2) #0 { %mStackData = alloca [10 x i32], align 16 %1 = bitcast [10 x i32]* %mStackData to i8* - %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %3 = select i1 %b1, i32* %2, i32* @g2 %4 = tail call noalias i8* @_Znam(i64 48) #4 %5 = tail call noalias i8* @_Znam(i64 48) #4 @@ -72,7 +72,7 @@ define void @_Z2p2bb(i1 zeroext %b1, i1 zeroext %b2) #0 { define void @_Z2p4bb(i1 zeroext %b1, i1 zeroext %b2) #0 { %mStackData = alloca [10 x i32], align 16 %1 = bitcast [10 x i32]* %mStackData to i8* - %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %3 = select i1 %b1, i32* %2, i32* @g3 %4 = tail call noalias i8* @_Znam(i64 48) #4 %5 = tail call noalias i8* @_Znam(i64 48) #4 @@ -97,7 +97,7 @@ define void @_Z2p4bb(i1 zeroext %b1, i1 zeroext %b2) #0 { define void @_Z2p5bb(i1 zeroext %b1, i1 zeroext %b2) #0 { %mStackData = alloca [10 x i32], align 16 %1 = bitcast [10 x i32]* %mStackData to i8* - %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %3 = select i1 %b1, i32* %2, i32* @g4 %4 = tail call noalias i8* @_Znam(i64 48) #4 %5 = tail call noalias i8* @_Znam(i64 48) #4 @@ -122,7 +122,7 @@ define void @_Z2p5bb(i1 zeroext %b1, i1 zeroext %b2) #0 { define void @_Z2p6bb(i1 zeroext %b1, i1 zeroext %b2) #0 { %mStackData = alloca [10 x i32], align 16 %1 = bitcast [10 x i32]* %mStackData to i8* - %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %3 = select i1 %b1, i32* %2, i32* @g5 %4 = tail call noalias i8* @_Znam(i64 48) #4 %5 = tail call noalias i8* @_Znam(i64 48) #4 @@ -151,7 +151,7 @@ define void @_Z2p6bb(i1 zeroext %b1, i1 zeroext %b2) #0 { define void @_Z4nopebbPi(i1 zeroext %b1, i1 zeroext %b2, i32* readnone %q) #0 { %mStackData = alloca [10 x i32], align 16 %1 = bitcast [10 x i32]* %mStackData to i8* - %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %3 = select i1 %b1, i32* %2, i32* %q %4 = tail call noalias i8* @_Znam(i64 48) #4 %5 = tail call noalias i8* @_Znam(i64 48) #4 @@ -176,7 +176,7 @@ define void @_Z4nopebbPi(i1 zeroext %b1, i1 zeroext %b2, i32* readnone %q) #0 { define void @_Z2p3bb(i1 zeroext %b1, i1 zeroext %b2) #0 { %mStackData = alloca [10 x i32], align 16 %1 = bitcast [10 x i32]* %mStackData to i8* - %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %3 = select i1 %b1, i32* %2, i32* @g1 %4 = tail call noalias i8* @_Znam(i64 48) #4 %5 = tail call noalias i8* @_Znam(i64 48) #4 @@ -201,7 +201,7 @@ define void @_Z2p3bb(i1 zeroext %b1, i1 zeroext %b2) #0 { define void @_Z2p7bb(i1 zeroext %b1, i1 zeroext %b2) #0 { %mStackData = alloca [10 x i32], align 16 %1 = bitcast [10 x i32]* %mStackData to i8* - %2 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %2 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %3 = select i1 %b1, i32* %2, i32* @g6 %4 = tail call noalias i8* @_Znam(i64 48) #4 %5 = tail call noalias i8* @_Znam(i64 48) #4 @@ -228,7 +228,7 @@ define void @_Z2p2v(i32 %c) #0 { %1 = bitcast [10 x i32]* %mStackData to i8* %2 = tail call noalias i8* @_Znam(i64 48) #4 %3 = bitcast i8* %2 to i32* - %4 = getelementptr inbounds [10 x i32]* %mStackData, i64 0, i64 0 + %4 = getelementptr inbounds [10 x i32], [10 x i32]* %mStackData, i64 0, i64 0 %5 = icmp eq i32* %3, %4 br i1 %5, label %7, label %6 diff --git a/test/Transforms/InstSimplify/past-the-end.ll b/test/Transforms/InstSimplify/past-the-end.ll index 075da4a..b676e9d 100644 --- a/test/Transforms/InstSimplify/past-the-end.ll +++ b/test/Transforms/InstSimplify/past-the-end.ll @@ -18,8 +18,8 @@ define zeroext i1 @no_offsets() { ; Comparing past-the-end addresses of two distinct globals. Never equal. define zeroext i1 @both_past_the_end() { - %x = getelementptr i32* @opte_a, i32 1 - %y = getelementptr i32* @opte_b, i32 1 + %x = getelementptr i32, i32* @opte_a, i32 1 + %y = getelementptr i32, i32* @opte_b, i32 1 %t = icmp eq i32* %x, %y ret i1 %t ; CHECK: both_past_the_end( @@ -31,11 +31,11 @@ define zeroext i1 @both_past_the_end() { ; of another. Can't fold this. define zeroext i1 @just_one_past_the_end() { - %x = getelementptr i32* @opte_a, i32 1 + %x = getelementptr i32, i32* @opte_a, i32 1 %t = icmp eq i32* %x, @opte_b ret i1 %t ; CHECK: just_one_past_the_end( - ; CHECK: ret i1 icmp eq (i32* getelementptr inbounds (i32* @opte_a, i32 1), i32* @opte_b) + ; CHECK: ret i1 icmp eq (i32* getelementptr inbounds (i32, i32* @opte_a, i32 1), i32* @opte_b) } ; Comparing base addresses of two distinct allocas. Never equal. @@ -54,8 +54,8 @@ define zeroext i1 @no_alloca_offsets() { define zeroext i1 @both_past_the_end_alloca() { %m = alloca i32 %n = alloca i32 - %x = getelementptr i32* %m, i32 1 - %y = getelementptr i32* %n, i32 1 + %x = getelementptr i32, i32* %m, i32 1 + %y = getelementptr i32, i32* %n, i32 1 %t = icmp eq i32* %x, %y ret i1 %t ; CHECK: both_past_the_end_alloca( @@ -69,7 +69,7 @@ define zeroext i1 @both_past_the_end_alloca() { define zeroext i1 @just_one_past_the_end_alloca() { %m = alloca i32 %n = alloca i32 - %x = getelementptr i32* %m, i32 1 + %x = getelementptr i32, i32* %m, i32 1 %t = icmp eq i32* %x, %n ret i1 %t ; CHECK: just_one_past_the_end_alloca( diff --git a/test/Transforms/InstSimplify/ptr_diff.ll b/test/Transforms/InstSimplify/ptr_diff.ll index 6a3f652..6c27e6f 100644 --- a/test/Transforms/InstSimplify/ptr_diff.ll +++ b/test/Transforms/InstSimplify/ptr_diff.ll @@ -6,8 +6,8 @@ define i64 @ptrdiff1(i8* %ptr) { ; CHECK-LABEL: @ptrdiff1( ; CHECK-NEXT: ret i64 42 - %first = getelementptr inbounds i8* %ptr, i32 0 - %last = getelementptr inbounds i8* %ptr, i32 42 + %first = getelementptr inbounds i8, i8* %ptr, i32 0 + %last = getelementptr inbounds i8, i8* %ptr, i32 42 %first.int = ptrtoint i8* %first to i64 %last.int = ptrtoint i8* %last to i64 %diff = sub i64 %last.int, %first.int @@ -18,14 +18,14 @@ define i64 @ptrdiff2(i8* %ptr) { ; CHECK-LABEL: @ptrdiff2( ; CHECK-NEXT: ret i64 42 - %first1 = getelementptr inbounds i8* %ptr, i32 0 - %first2 = getelementptr inbounds i8* %first1, i32 1 - %first3 = getelementptr inbounds i8* %first2, i32 2 - %first4 = getelementptr inbounds i8* %first3, i32 4 - %last1 = getelementptr inbounds i8* %first2, i32 48 - %last2 = getelementptr inbounds i8* %last1, i32 8 - %last3 = getelementptr inbounds i8* %last2, i32 -4 - %last4 = getelementptr inbounds i8* %last3, i32 -4 + %first1 = getelementptr inbounds i8, i8* %ptr, i32 0 + %first2 = getelementptr inbounds i8, i8* %first1, i32 1 + %first3 = getelementptr inbounds i8, i8* %first2, i32 2 + %first4 = getelementptr inbounds i8, i8* %first3, i32 4 + %last1 = getelementptr inbounds i8, i8* %first2, i32 48 + %last2 = getelementptr inbounds i8, i8* %last1, i32 8 + %last3 = getelementptr inbounds i8, i8* %last2, i32 -4 + %last4 = getelementptr inbounds i8, i8* %last3, i32 -4 %first.int = ptrtoint i8* %first4 to i64 %last.int = ptrtoint i8* %last4 to i64 %diff = sub i64 %last.int, %first.int @@ -39,8 +39,8 @@ define i64 @ptrdiff3(i8* %ptr) { ; CHECK: sub ; CHECK: ret - %first = getelementptr i8* %ptr, i32 0 - %last = getelementptr i8* %ptr, i32 42 + %first = getelementptr i8, i8* %ptr, i32 0 + %last = getelementptr i8, i8* %ptr, i32 42 %first.int = ptrtoint i8* %first to i64 %last.int = ptrtoint i8* %last to i64 %diff = sub i64 %last.int, %first.int @@ -64,12 +64,12 @@ define <4 x i32> @ptrdiff4(<4 x i8*> %arg) nounwind { define i32 @ptrdiff5() nounwind { bb: - %tmp = getelementptr inbounds %struct.ham* @global, i32 0, i32 1 - %tmp1 = getelementptr inbounds [2 x [2 x i32]]* %tmp, i32 0, i32 0 + %tmp = getelementptr inbounds %struct.ham, %struct.ham* @global, i32 0, i32 1 + %tmp1 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %tmp, i32 0, i32 0 %tmp2 = bitcast [2 x i32]* %tmp1 to i32* %tmp3 = ptrtoint i32* %tmp2 to i32 - %tmp4 = getelementptr inbounds %struct.ham* @global, i32 0, i32 1 - %tmp5 = getelementptr inbounds [2 x [2 x i32]]* %tmp4, i32 0, i32 0 + %tmp4 = getelementptr inbounds %struct.ham, %struct.ham* @global, i32 0, i32 1 + %tmp5 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %tmp4, i32 0, i32 0 %tmp6 = ptrtoint [2 x i32]* %tmp5 to i32 %tmp7 = sub i32 %tmp3, %tmp6 ret i32 %tmp7 diff --git a/test/Transforms/InstSimplify/vector_gep.ll b/test/Transforms/InstSimplify/vector_gep.ll index 1781463..5c30620 100644 --- a/test/Transforms/InstSimplify/vector_gep.ll +++ b/test/Transforms/InstSimplify/vector_gep.ll @@ -4,13 +4,13 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" declare void @helper(<2 x i8*>) define void @test(<2 x i8*> %a) { - %A = getelementptr <2 x i8*> %a, <2 x i32> <i32 0, i32 0> + %A = getelementptr i8, <2 x i8*> %a, <2 x i32> <i32 0, i32 0> call void @helper(<2 x i8*> %A) ret void } define <4 x i8*> @test1(<4 x i8*> %a) { - %gep = getelementptr <4 x i8*> %a, <4 x i32> zeroinitializer + %gep = getelementptr i8, <4 x i8*> %a, <4 x i32> zeroinitializer ret <4 x i8*> %gep ; CHECK-LABEL: @test1 @@ -18,7 +18,7 @@ define <4 x i8*> @test1(<4 x i8*> %a) { } define <4 x i8*> @test2(<4 x i8*> %a) { - %gep = getelementptr <4 x i8*> %a + %gep = getelementptr i8, <4 x i8*> %a ret <4 x i8*> %gep ; CHECK-LABEL: @test2 @@ -28,7 +28,7 @@ define <4 x i8*> @test2(<4 x i8*> %a) { %struct = type { double, float } define <4 x float*> @test3() { - %gep = getelementptr <4 x %struct*> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1> + %gep = getelementptr %struct, <4 x %struct*> undef, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ret <4 x float*> %gep ; CHECK-LABEL: @test3 @@ -38,7 +38,7 @@ define <4 x float*> @test3() { %struct.empty = type { } define <4 x %struct.empty*> @test4(<4 x %struct.empty*> %a) { - %gep = getelementptr <4 x %struct.empty*> %a, <4 x i32> <i32 1, i32 1, i32 1, i32 1> + %gep = getelementptr %struct.empty, <4 x %struct.empty*> %a, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ret <4 x %struct.empty*> %gep ; CHECK-LABEL: @test4 @@ -47,9 +47,9 @@ define <4 x %struct.empty*> @test4(<4 x %struct.empty*> %a) { define <4 x i8*> @test5() { %c = inttoptr <4 x i64> <i64 1, i64 2, i64 3, i64 4> to <4 x i8*> - %gep = getelementptr <4 x i8*> %c, <4 x i32> <i32 1, i32 1, i32 1, i32 1> + %gep = getelementptr i8, <4 x i8*> %c, <4 x i32> <i32 1, i32 1, i32 1, i32 1> ret <4 x i8*> %gep ; CHECK-LABEL: @test5 -; CHECK-NEXT: ret <4 x i8*> getelementptr (<4 x i8*> <i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 2 to i8*), i8* inttoptr (i64 3 to i8*), i8* inttoptr (i64 4 to i8*)>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>) +; CHECK-NEXT: ret <4 x i8*> getelementptr (i8, <4 x i8*> <i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 2 to i8*), i8* inttoptr (i64 3 to i8*), i8* inttoptr (i64 4 to i8*)>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>) } diff --git a/test/Transforms/InstSimplify/vector_ptr_bitcast.ll b/test/Transforms/InstSimplify/vector_ptr_bitcast.ll index 607892a..97c8343 100644 --- a/test/Transforms/InstSimplify/vector_ptr_bitcast.ll +++ b/test/Transforms/InstSimplify/vector_ptr_bitcast.ll @@ -14,7 +14,7 @@ target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128" align 8 define i64 @fn() { - %x = load <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8 + %x = load <2 x i8*>, <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8 %b = extractelement <2 x i8*> %x, i32 0 %c = ptrtoint i8* %b to i64 ; CHECK-LABEL: @fn @@ -23,7 +23,7 @@ define i64 @fn() { } define i64 @fn2() { - %x = load <4 x i32*>* bitcast (%mst2* @b to <4 x i32*>*), align 8 + %x = load <4 x i32*>, <4 x i32*>* bitcast (%mst2* @b to <4 x i32*>*), align 8 %b = extractelement <4 x i32*> %x, i32 0 %c = extractelement <4 x i32*> %x, i32 3 %d = ptrtoint i32* %b to i64 diff --git a/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll b/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll index 1652388..c50b6fc 100644 --- a/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll +++ b/test/Transforms/Internalize/2009-01-05-InternalizeAliases.ll @@ -10,7 +10,7 @@ ; CHECK: @C = internal alias i32* @A define i32 @main() { - %tmp = load i32* @C + %tmp = load i32, i32* @C ret i32 %tmp } diff --git a/test/Transforms/JumpThreading/2010-08-26-and.ll b/test/Transforms/JumpThreading/2010-08-26-and.ll index 2d6caf7..c0a6b47 100644 --- a/test/Transforms/JumpThreading/2010-08-26-and.ll +++ b/test/Transforms/JumpThreading/2010-08-26-and.ll @@ -29,8 +29,8 @@ land.lhs.true.i: ; preds = %_ZN12StringSwitchI5 %retval.0.i.pre161 = phi i32 [ undef, %bb.nph ], [ %retval.0.i.pre, %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134 ] ; <i32> [#uses=3] %indvar = phi i64 [ 0, %bb.nph ], [ %tmp146, %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134 ] ; <i64> [#uses=1] %tmp146 = add i64 %indvar, 1 ; <i64> [#uses=3] - %arrayidx = getelementptr i8** %argv, i64 %tmp146 ; <i8**> [#uses=1] - %tmp6 = load i8** %arrayidx, align 8 ; <i8*> [#uses=8] + %arrayidx = getelementptr i8*, i8** %argv, i64 %tmp146 ; <i8**> [#uses=1] + %tmp6 = load i8*, i8** %arrayidx, align 8 ; <i8*> [#uses=8] %call.i.i = call i64 @strlen(i8* %tmp6) nounwind ; <i64> [#uses=1] %conv.i.i = trunc i64 %call.i.i to i32 ; <i32> [#uses=6]\ ; CHECK: switch i32 %conv.i.i @@ -42,7 +42,7 @@ land.lhs.true.i: ; preds = %_ZN12StringSwitchI5 ] land.lhs.true5.i: ; preds = %land.lhs.true.i - %call.i = call i32 @memcmp(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i8* %tmp6, i64 4) nounwind ; <i32> [#uses=1] + %call.i = call i32 @memcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %tmp6, i64 4) nounwind ; <i32> [#uses=1] %cmp9.i = icmp eq i32 %call.i, 0 ; <i1> [#uses=1] br i1 %cmp9.i, label %_ZN12StringSwitchI5ColorE4CaseILj4EEERS1_RAT__KcRKS0_.exit, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit @@ -50,7 +50,7 @@ _ZN12StringSwitchI5ColorE4CaseILj4EEERS1_RAT__KcRKS0_.exit: ; preds = %land.lhs. br label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit land.lhs.true5.i37: ; preds = %land.lhs.true.i - %call.i35 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8]* @.str1, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] + %call.i35 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str1, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] %cmp9.i36 = icmp eq i32 %call.i35, 0 ; <i1> [#uses=1] br i1 %cmp9.i36, label %if.then.i40, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit @@ -66,7 +66,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit: ; preds = %if.then.i br i1 %or.cond, label %land.lhs.true5.i55, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60 land.lhs.true5.i55: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit - %call.i53 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8]* @.str2, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] + %call.i53 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str2, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] %cmp9.i54 = icmp eq i32 %call.i53, 0 ; <i1> [#uses=1] br i1 %cmp9.i54, label %if.then.i58, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60 @@ -83,7 +83,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60: ; preds = %if.then br i1 %or.cond168, label %land.lhs.true5.i74, label %_ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit land.lhs.true5.i74: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit60 - %call.i72 = call i32 @memcmp(i8* getelementptr inbounds ([6 x i8]* @.str3, i64 0, i64 0), i8* %tmp6, i64 6) nounwind ; <i32> [#uses=1] + %call.i72 = call i32 @memcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i8* %tmp6, i64 6) nounwind ; <i32> [#uses=1] %cmp9.i73 = icmp eq i32 %call.i72, 0 ; <i1> [#uses=1] br i1 %cmp9.i73, label %if.then.i77, label %_ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit @@ -100,7 +100,7 @@ _ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit: ; preds = %if.then.i br i1 %or.cond169, label %land.lhs.true5.i92, label %_ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit land.lhs.true5.i92: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj6EEERS1_RAT__KcRKS0_.exit - %call.i90 = call i32 @memcmp(i8* getelementptr inbounds ([5 x i8]* @.str4, i64 0, i64 0), i8* %tmp6, i64 5) nounwind ; <i32> [#uses=1] + %call.i90 = call i32 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str4, i64 0, i64 0), i8* %tmp6, i64 5) nounwind ; <i32> [#uses=1] %cmp9.i91 = icmp eq i32 %call.i90, 0 ; <i1> [#uses=1] br i1 %cmp9.i91, label %if.then.i95, label %_ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit @@ -117,7 +117,7 @@ _ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit: ; preds = %if.then.i br i1 %or.cond170, label %land.lhs.true5.i110, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115 land.lhs.true5.i110: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj5EEERS1_RAT__KcRKS0_.exit - %call.i108 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8]* @.str5, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] + %call.i108 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str5, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] %cmp9.i109 = icmp eq i32 %call.i108, 0 ; <i1> [#uses=1] br i1 %cmp9.i109, label %if.then.i113, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115 @@ -134,7 +134,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115: ; preds = %if.the br i1 %or.cond171, label %land.lhs.true5.i129, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134 land.lhs.true5.i129: ; preds = %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit115 - %call.i127 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8]* @.str6, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] + %call.i127 = call i32 @memcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str6, i64 0, i64 0), i8* %tmp6, i64 7) nounwind ; <i32> [#uses=1] %cmp9.i128 = icmp eq i32 %call.i127, 0 ; <i1> [#uses=1] br i1 %cmp9.i128, label %if.then.i132, label %_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134 @@ -147,7 +147,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134: ; preds = %if.the %tmp7.i138 = and i8 %tmp2.i137, 1 ; <i8> [#uses=1] %tobool.i139 = icmp eq i8 %tmp7.i138, 0 ; <i1> [#uses=1] %retval.0.i = select i1 %tobool.i139, i32 0, i32 %retval.0.i.pre ; <i32> [#uses=1] - %call22 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str7, i64 0, i64 0), i32 %retval.0.i) ; <i32> [#uses=0] + %call22 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str7, i64 0, i64 0), i32 %retval.0.i) ; <i32> [#uses=0] %exitcond = icmp eq i64 %tmp146, %tmp145 ; <i1> [#uses=1] br i1 %exitcond, label %for.end, label %land.lhs.true.i diff --git a/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll b/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll index 86a1321..0323723 100644 --- a/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll +++ b/test/Transforms/JumpThreading/2011-04-14-InfLoop.ll @@ -15,7 +15,7 @@ for.cond1177: br i1 %cmp1179, label %for.cond1177, label %land.rhs1320 land.rhs1320: - %tmp1324 = load volatile i64* getelementptr inbounds (%0* @g_338, i64 0, i32 2), align 1 + %tmp1324 = load volatile i64, i64* getelementptr inbounds (%0, %0* @g_338, i64 0, i32 2), align 1 br label %if.end.i if.end.i: diff --git a/test/Transforms/JumpThreading/crash.ll b/test/Transforms/JumpThreading/crash.ll index 2fe8746..900a773 100644 --- a/test/Transforms/JumpThreading/crash.ll +++ b/test/Transforms/JumpThreading/crash.ll @@ -356,7 +356,7 @@ B2: br label %BrBlock BrBlock: - %L = load i32* %P + %L = load i32, i32* %P %C = icmp eq i32 %L, 42 br i1 %C, label %T, label %F diff --git a/test/Transforms/JumpThreading/indirectbr.ll b/test/Transforms/JumpThreading/indirectbr.ll index b87fb6c..59f393a 100644 --- a/test/Transforms/JumpThreading/indirectbr.ll +++ b/test/Transforms/JumpThreading/indirectbr.ll @@ -79,15 +79,15 @@ entry: br label %__here __here: ; preds = %entry - %call = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here) to i64)) nounwind noredzone + %call = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here) to i64)) nounwind noredzone br label %__here1 __here1: ; preds = %__here - %call2 = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here1) to i64)) nounwind noredzone + %call2 = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here1) to i64)) nounwind noredzone br label %__here3 __here3: ; preds = %__here1 - %call4 = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here3) to i64)) nounwind noredzone + %call4 = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here3) to i64)) nounwind noredzone ret void } diff --git a/test/Transforms/JumpThreading/landing-pad.ll b/test/Transforms/JumpThreading/landing-pad.ll index 9ee0526..4d49db0 100644 --- a/test/Transforms/JumpThreading/landing-pad.ll +++ b/test/Transforms/JumpThreading/landing-pad.ll @@ -13,8 +13,8 @@ define void @_ZN15EditCommandImpl5applyEv(%class.E* %this) uwtable align 2 { entry: %0 = bitcast %class.E* %this to void (%class.E*)*** - %vtable = load void (%class.E*)*** %0, align 8 - %1 = load void (%class.E*)** %vtable, align 8 + %vtable = load void (%class.E*)**, void (%class.E*)*** %0, align 8 + %1 = load void (%class.E*)*, void (%class.E*)** %vtable, align 8 call void %1(%class.E* %this) ret void } @@ -22,16 +22,16 @@ entry: define void @_ZN1DC1Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 { entry: call void @_ZN24CompositeEditCommandImplC2Ev() - %0 = getelementptr inbounds %class.D* %this, i64 0, i32 0, i32 0, i32 0 - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 + %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0 + store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 ret void } define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr uwtable align 2 { entry: call void @_ZN24CompositeEditCommandImplC2Ev() - %0 = getelementptr inbounds %class.D* %this, i64 0, i32 0, i32 0, i32 0 - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 + %0 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, i32 0, i32 0 + store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 ret void } @@ -50,10 +50,10 @@ entry: _ZN1DC1Ev.exit: ; preds = %entry %0 = bitcast i8* %call to i32 (...)*** - store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 - %_ref.i.i.i = getelementptr inbounds i8* %call, i64 8 + store i32 (...)** bitcast (i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @_ZTV1D, i64 0, i64 2) to i32 (...)**), i32 (...)*** %0, align 8 + %_ref.i.i.i = getelementptr inbounds i8, i8* %call, i64 8 %1 = bitcast i8* %_ref.i.i.i to i32* - %2 = load i32* %1, align 4 + %2 = load i32, i32* %1, align 4 %inc.i.i.i = add nsw i32 %2, 1 store i32 %inc.i.i.i, i32* %1, align 4 %3 = bitcast i8* %call to %class.D* @@ -76,7 +76,7 @@ lpad: ; preds = %entry lpad1: ; preds = %_ZN1DC1Ev.exit, %_ZN15EditCommandImpl5applyEv.exit %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup - %6 = load i32* %1, align 4 + %6 = load i32, i32* %1, align 4 %tobool.i.i.i = icmp eq i32 %6, 0 br i1 %tobool.i.i.i, label %_ZN1BI1DED1Ev.exit, label %if.then.i.i.i @@ -98,10 +98,10 @@ terminate.lpad: ; No predecessors! define void @_ZN1BI1DEC1EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 { entry: - %m_ptr.i = getelementptr inbounds %class.B* %this, i64 0, i32 0 + %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 store %class.D* %p1, %class.D** %m_ptr.i, align 8 - %_ref.i.i = getelementptr inbounds %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 - %0 = load i32* %_ref.i.i, align 4 + %_ref.i.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 + %0 = load i32, i32* %_ref.i.i, align 4 %inc.i.i = add nsw i32 %0, 1 store i32 %inc.i.i, i32* %_ref.i.i, align 4 ret void @@ -115,8 +115,8 @@ declare void @_ZdlPv() define %class.D* @_ZN1BI1DEptEv(%class.B* nocapture readonly %this) nounwind readonly uwtable align 2 { entry: - %m_ptr = getelementptr inbounds %class.B* %this, i64 0, i32 0 - %0 = load %class.D** %m_ptr, align 8 + %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 + %0 = load %class.D*, %class.D** %m_ptr, align 8 ret %class.D* %0 } @@ -124,10 +124,10 @@ declare void @_ZN1D16deleteKeyPressedEv() define void @_ZN1BI1DED1Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 { entry: - %m_ptr.i = getelementptr inbounds %class.B* %this, i64 0, i32 0 - %0 = load %class.D** %m_ptr.i, align 8 - %_ref.i.i = getelementptr inbounds %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 - %1 = load i32* %_ref.i.i, align 4 + %m_ptr.i = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 + %0 = load %class.D*, %class.D** %m_ptr.i, align 8 + %_ref.i.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 + %1 = load i32, i32* %_ref.i.i, align 4 %tobool.i.i = icmp eq i32 %1, 0 br i1 %tobool.i.i, label %_ZN1BI1DED2Ev.exit, label %if.then.i.i @@ -146,10 +146,10 @@ declare hidden void @__clang_call_terminate() define void @_ZN1BI1DED2Ev(%class.B* nocapture readonly %this) unnamed_addr uwtable align 2 { entry: - %m_ptr = getelementptr inbounds %class.B* %this, i64 0, i32 0 - %0 = load %class.D** %m_ptr, align 8 - %_ref.i = getelementptr inbounds %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 - %1 = load i32* %_ref.i, align 4 + %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 + %0 = load %class.D*, %class.D** %m_ptr, align 8 + %_ref.i = getelementptr inbounds %class.D, %class.D* %0, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 + %1 = load i32, i32* %_ref.i, align 4 %tobool.i = icmp eq i32 %1, 0 br i1 %tobool.i, label %_ZN1AI1CE5derefEv.exit, label %if.then.i @@ -166,8 +166,8 @@ _ZN1AI1CE5derefEv.exit: ; preds = %entry, %if.then.i define void @_ZN1AI1CE5derefEv(%class.A* nocapture readonly %this) nounwind uwtable align 2 { entry: - %_ref = getelementptr inbounds %class.A* %this, i64 0, i32 0 - %0 = load i32* %_ref, align 4 + %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0 + %0 = load i32, i32* %_ref, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %if.end, label %if.then @@ -184,10 +184,10 @@ if.end: ; preds = %entry, %if.then define void @_ZN1BI1DEC2EPS0_(%class.B* nocapture %this, %class.D* %p1) unnamed_addr uwtable align 2 { entry: - %m_ptr = getelementptr inbounds %class.B* %this, i64 0, i32 0 + %m_ptr = getelementptr inbounds %class.B, %class.B* %this, i64 0, i32 0 store %class.D* %p1, %class.D** %m_ptr, align 8 - %_ref.i = getelementptr inbounds %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 - %0 = load i32* %_ref.i, align 4 + %_ref.i = getelementptr inbounds %class.D, %class.D* %p1, i64 0, i32 0, i32 0, i32 1, i32 0, i32 0 + %0 = load i32, i32* %_ref.i, align 4 %inc.i = add nsw i32 %0, 1 store i32 %inc.i, i32* %_ref.i, align 4 ret void @@ -195,8 +195,8 @@ entry: define void @_ZN1AI1CE3refEv(%class.A* nocapture %this) nounwind uwtable align 2 { entry: - %_ref = getelementptr inbounds %class.A* %this, i64 0, i32 0 - %0 = load i32* %_ref, align 4 + %_ref = getelementptr inbounds %class.A, %class.A* %this, i64 0, i32 0 + %0 = load i32, i32* %_ref, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %_ref, align 4 ret void diff --git a/test/Transforms/JumpThreading/lvi-load.ll b/test/Transforms/JumpThreading/lvi-load.ll index 2a4cf92..a36e263 100644 --- a/test/Transforms/JumpThreading/lvi-load.ll +++ b/test/Transforms/JumpThreading/lvi-load.ll @@ -16,8 +16,8 @@ target triple = "x86_64-apple-darwin10.4" ; CHECK: Z3fooPN4llvm5ValueE define zeroext i8 @_Z3fooPN4llvm5ValueE(%"struct.llvm::Value"* %V) ssp { entry: - %0 = getelementptr inbounds %"struct.llvm::Value"* %V, i64 0, i32 1 ; <i8*> [#uses=1] - %1 = load i8* %0, align 8 ; <i8> [#uses=2] + %0 = getelementptr inbounds %"struct.llvm::Value", %"struct.llvm::Value"* %V, i64 0, i32 1 ; <i8*> [#uses=1] + %1 = load i8, i8* %0, align 8 ; <i8> [#uses=2] %2 = icmp ugt i8 %1, 20 ; <i1> [#uses=1] br i1 %2, label %bb.i, label %bb2 @@ -27,7 +27,7 @@ bb.i: ; preds = %entry ; CHECK-NOT: assert bb6.i.i: ; preds = %bb.i - tail call void @__assert_rtn(i8* getelementptr inbounds ([5 x i8]* @_ZZN4llvm4castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_E8__func__, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8]* @.str, i64 0, i64 0), i32 202, i8* getelementptr inbounds ([59 x i8]* @.str1, i64 0, i64 0)) noreturn + tail call void @__assert_rtn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_ZZN4llvm4castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_E8__func__, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 202, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str1, i64 0, i64 0)) noreturn unreachable _ZN4llvm8dyn_castINS_11InstructionEPNS_5ValueEEENS_10cast_rettyIT_T0_E8ret_typeERKS6_.exit: ; preds = %bb.i diff --git a/test/Transforms/JumpThreading/or-undef.ll b/test/Transforms/JumpThreading/or-undef.ll index 6311b6d..b55bddd 100644 --- a/test/Transforms/JumpThreading/or-undef.ll +++ b/test/Transforms/JumpThreading/or-undef.ll @@ -32,13 +32,13 @@ bb2: ; preds = %bb1, %bb, %entry br i1 %tmp7, label %bb7, label %bb5 bb5: ; preds = %bb2 - %tmp8 = load i8** %argv.0, align 8 ; <i8*> [#uses=1] + %tmp8 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1] %tmp9 = icmp eq i8* %tmp8, null ; <i1> [#uses=1] br i1 %tmp9, label %bb7, label %bb6 bb6: ; preds = %bb5 - %tmp10 = load i8** %argv.0, align 8 ; <i8*> [#uses=1] - %tmp11 = load i8* %tmp10, align 1 ; <i8> [#uses=1] + %tmp10 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1] + %tmp11 = load i8, i8* %tmp10, align 1 ; <i8> [#uses=1] %tmp12 = icmp eq i8 %tmp11, 0 ; <i1> [#uses=1] br i1 %tmp12, label %bb7, label %bb8 @@ -47,7 +47,7 @@ bb7: ; preds = %bb6, %bb5, %bb2 br label %bb9 bb8: ; preds = %bb6 - %tmp13 = load i8** %argv.0, align 8 ; <i8*> [#uses=1] + %tmp13 = load i8*, i8** %argv.0, align 8 ; <i8*> [#uses=1] %tmp14 = call i64 @f5(i8* %tmp13) nounwind ; <i64> [#uses=0] br label %bb9 diff --git a/test/Transforms/JumpThreading/phi-eq.ll b/test/Transforms/JumpThreading/phi-eq.ll index 3dd2c36..75e8cc8 100644 --- a/test/Transforms/JumpThreading/phi-eq.ll +++ b/test/Transforms/JumpThreading/phi-eq.ll @@ -39,7 +39,7 @@ if.then: ; preds = %do.body br label %if.end if.else: ; preds = %do.body - call void @g_assertion_message_expr(i8* null, i8* getelementptr inbounds ([10 x i8]* @.str2, i32 0, i32 0), i32 581, i8* getelementptr inbounds ([62 x i8]* @__PRETTY_FUNCTION__.copy_filter_list, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8]* @.str12, i32 0, i32 0)) noreturn + call void @g_assertion_message_expr(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 581, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @__PRETTY_FUNCTION__.copy_filter_list, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str12, i32 0, i32 0)) noreturn unreachable if.end: ; preds = %if.then @@ -66,7 +66,7 @@ sw.bb3.i: ; preds = %do.end br label %get_filter_list.exit sw.default.i: ; preds = %do.end - call void @g_assertion_message(i8* null, i8* getelementptr inbounds ([10 x i8]* @.str2, i32 0, i32 0), i32 408, i8* getelementptr inbounds ([44 x i8]* @__PRETTY_FUNCTION__.get_filter_list, i32 0, i32 0), i8* null) noreturn nounwind + call void @g_assertion_message(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 408, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @__PRETTY_FUNCTION__.get_filter_list, i32 0, i32 0), i8* null) noreturn nounwind unreachable get_filter_list.exit: ; preds = %sw.bb3.i, %sw.bb2.i, %sw.bb1.i, %sw.bb.i @@ -91,40 +91,40 @@ sw.bb3.i4: ; preds = %get_filter_list.exi br label %get_filter_list.exit6 sw.default.i5: ; preds = %get_filter_list.exit - call void @g_assertion_message(i8* null, i8* getelementptr inbounds ([10 x i8]* @.str2, i32 0, i32 0), i32 408, i8* getelementptr inbounds ([44 x i8]* @__PRETTY_FUNCTION__.get_filter_list, i32 0, i32 0), i8* null) noreturn nounwind + call void @g_assertion_message(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 408, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @__PRETTY_FUNCTION__.get_filter_list, i32 0, i32 0), i8* null) noreturn nounwind unreachable ; CHECK: get_filter_list.exit get_filter_list.exit6: ; preds = %sw.bb3.i4, %sw.bb2.i3, %sw.bb1.i2, %sw.bb.i1 %1 = phi %struct._GList** [ @display_edited_filters, %sw.bb3.i4 ], [ @capture_edited_filters, %sw.bb2.i3 ], [ @display_filters, %sw.bb1.i2 ], [ @capture_filters, %sw.bb.i1 ] ; CHECK: %2 = load - %2 = load %struct._GList** %1, align 8 + %2 = load %struct._GList*, %struct._GList** %1, align 8 ; We should have jump-threading insert an additional load here for the value ; coming out of the first switch, which is picked up by a subsequent phi -; CHECK: %.pr = load %struct._GList** %0 +; CHECK: %.pr = load %struct._GList*, %struct._GList** %0 ; CHECK-NEXT: br label %while.cond br label %while.cond ; CHECK: while.cond while.cond: ; preds = %while.body, %get_filter_list.exit6 ; CHECK: {{= phi .*%.pr}} - %3 = load %struct._GList** %0, align 8 + %3 = load %struct._GList*, %struct._GList** %0, align 8 ; CHECK: tobool %tobool = icmp ne %struct._GList* %3, null br i1 %tobool, label %while.body, label %while.end while.body: ; preds = %while.cond - %4 = load %struct._GList** %0, align 8 - %5 = load %struct._GList** %0, align 8 + %4 = load %struct._GList*, %struct._GList** %0, align 8 + %5 = load %struct._GList*, %struct._GList** %0, align 8 %call2 = call %struct._GList* @g_list_first(%struct._GList* %5) - %data.i = getelementptr inbounds %struct._GList* %call2, i32 0, i32 0 - %6 = load i8** %data.i, align 8 + %data.i = getelementptr inbounds %struct._GList, %struct._GList* %call2, i32 0, i32 0 + %6 = load i8*, i8** %data.i, align 8 %7 = bitcast i8* %6 to %struct.filter_def* - %name.i = getelementptr inbounds %struct.filter_def* %7, i32 0, i32 0 - %8 = load i8** %name.i, align 8 + %name.i = getelementptr inbounds %struct.filter_def, %struct.filter_def* %7, i32 0, i32 0 + %8 = load i8*, i8** %name.i, align 8 call void @g_free(i8* %8) nounwind - %strval.i = getelementptr inbounds %struct.filter_def* %7, i32 0, i32 1 - %9 = load i8** %strval.i, align 8 + %strval.i = getelementptr inbounds %struct.filter_def, %struct.filter_def* %7, i32 0, i32 1 + %9 = load i8*, i8** %strval.i, align 8 call void @g_free(i8* %9) nounwind %10 = bitcast %struct.filter_def* %7 to i8* call void @g_free(i8* %10) nounwind @@ -136,7 +136,7 @@ while.end: ; preds = %while.cond br label %do.body4 do.body4: ; preds = %while.end - %11 = load %struct._GList** %0, align 8 + %11 = load %struct._GList*, %struct._GList** %0, align 8 %call5 = call i32 @g_list_length(%struct._GList* %11) %cmp6 = icmp eq i32 %call5, 0 br i1 %cmp6, label %if.then7, label %if.else8 @@ -145,7 +145,7 @@ if.then7: ; preds = %do.body4 br label %if.end9 if.else8: ; preds = %do.body4 - call void @g_assertion_message_expr(i8* null, i8* getelementptr inbounds ([10 x i8]* @.str2, i32 0, i32 0), i32 600, i8* getelementptr inbounds ([62 x i8]* @__PRETTY_FUNCTION__.copy_filter_list, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8]* @.str13, i32 0, i32 0)) noreturn + call void @g_assertion_message_expr(i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str2, i32 0, i32 0), i32 600, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @__PRETTY_FUNCTION__.copy_filter_list, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str13, i32 0, i32 0)) noreturn unreachable if.end9: ; preds = %if.then7 @@ -160,21 +160,21 @@ while.cond11: ; preds = %cond.end, %do.end10 br i1 %tobool12, label %while.body13, label %while.end16 while.body13: ; preds = %while.cond11 - %data = getelementptr inbounds %struct._GList* %cond10, i32 0, i32 0 - %12 = load i8** %data, align 8 + %data = getelementptr inbounds %struct._GList, %struct._GList* %cond10, i32 0, i32 0 + %12 = load i8*, i8** %data, align 8 %13 = bitcast i8* %12 to %struct.filter_def* - %14 = load %struct._GList** %0, align 8 - %name = getelementptr inbounds %struct.filter_def* %13, i32 0, i32 0 - %15 = load i8** %name, align 8 - %strval = getelementptr inbounds %struct.filter_def* %13, i32 0, i32 1 - %16 = load i8** %strval, align 8 + %14 = load %struct._GList*, %struct._GList** %0, align 8 + %name = getelementptr inbounds %struct.filter_def, %struct.filter_def* %13, i32 0, i32 0 + %15 = load i8*, i8** %name, align 8 + %strval = getelementptr inbounds %struct.filter_def, %struct.filter_def* %13, i32 0, i32 1 + %16 = load i8*, i8** %strval, align 8 %call.i7 = call noalias i8* @g_malloc(i64 16) nounwind %17 = bitcast i8* %call.i7 to %struct.filter_def* %call1.i = call noalias i8* @g_strdup(i8* %15) nounwind - %name.i8 = getelementptr inbounds %struct.filter_def* %17, i32 0, i32 0 + %name.i8 = getelementptr inbounds %struct.filter_def, %struct.filter_def* %17, i32 0, i32 0 store i8* %call1.i, i8** %name.i8, align 8 %call2.i = call noalias i8* @g_strdup(i8* %16) nounwind - %strval.i9 = getelementptr inbounds %struct.filter_def* %17, i32 0, i32 1 + %strval.i9 = getelementptr inbounds %struct.filter_def, %struct.filter_def* %17, i32 0, i32 1 store i8* %call2.i, i8** %strval.i9, align 8 %18 = bitcast %struct.filter_def* %17 to i8* %call3.i = call %struct._GList* @g_list_append(%struct._GList* %14, i8* %18) nounwind @@ -183,8 +183,8 @@ while.body13: ; preds = %while.cond11 br i1 %tobool15, label %cond.true, label %cond.false cond.true: ; preds = %while.body13 - %next = getelementptr inbounds %struct._GList* %cond10, i32 0, i32 1 - %19 = load %struct._GList** %next, align 8 + %next = getelementptr inbounds %struct._GList, %struct._GList* %cond10, i32 0, i32 1 + %19 = load %struct._GList*, %struct._GList** %next, align 8 br label %cond.end cond.false: ; preds = %while.body13 diff --git a/test/Transforms/JumpThreading/select.ll b/test/Transforms/JumpThreading/select.ll index 545e86c..d0df772 100644 --- a/test/Transforms/JumpThreading/select.ll +++ b/test/Transforms/JumpThreading/select.ll @@ -135,7 +135,7 @@ L4: ; CHECK: icmp define void @test_switch_default(i32* nocapture %status) nounwind { entry: - %0 = load i32* %status, align 4 + %0 = load i32, i32* %status, align 4 switch i32 %0, label %L2 [ i32 5061, label %L1 i32 0, label %L2 @@ -146,7 +146,7 @@ L1: br label %L2 L2: - %1 = load i32* %status, align 4 + %1 = load i32, i32* %status, align 4 %cmp57.i = icmp eq i32 %1, 0 br i1 %cmp57.i, label %L3, label %L4 diff --git a/test/Transforms/JumpThreading/thread-loads.ll b/test/Transforms/JumpThreading/thread-loads.ll index 4351f99..008eac7 100644 --- a/test/Transforms/JumpThreading/thread-loads.ll +++ b/test/Transforms/JumpThreading/thread-loads.ll @@ -21,7 +21,7 @@ bb: ; preds = %entry bb1: ; preds = %entry, %bb %res.0 = phi i32 [ 1, %bb ], [ 0, %entry ] ; <i32> [#uses=2] - %2 = load i32* %P, align 4 ; <i32> [#uses=1] + %2 = load i32, i32* %P, align 4 ; <i32> [#uses=1] %3 = icmp sgt i32 %2, 36 ; <i1> [#uses=1] br i1 %3, label %bb3, label %bb2 @@ -60,7 +60,7 @@ bb: ; preds = %entry bb1: ; preds = %entry, %bb %res.0 = phi i32 [ 1, %bb ], [ 0, %entry ] - %2 = load i32* %P, align 4, !tbaa !0 + %2 = load i32, i32* %P, align 4, !tbaa !0 %3 = icmp sgt i32 %2, 36 br i1 %3, label %bb3, label %bb2 @@ -83,16 +83,16 @@ define i32 @test3(i8** %x, i1 %f) { ; CHECK-LABEL: @test3( entry: %0 = bitcast i8** %x to i32** - %1 = load i32** %0, align 8 + %1 = load i32*, i32** %0, align 8 br i1 %f, label %if.end57, label %if.then56 -; CHECK: %[[LOAD:.*]] = load i32** +; CHECK: %[[LOAD:.*]] = load i32*, i32** ; CHECK: %[[CAST:.*]] = bitcast i32* %[[LOAD]] to i8* if.then56: br label %if.end57 if.end57: - %2 = load i8** %x, align 8 + %2 = load i8*, i8** %x, align 8 %tobool59 = icmp eq i8* %2, null br i1 %tobool59, label %return, label %if.then60 ; CHECK: %[[PHI:.*]] = phi i8* [ %[[CAST]], %[[PRED:[^ ]+]] ], [ %[[CAST]], %[[PRED]] ] diff --git a/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll b/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll index dd43c88..a6abfa5 100644 --- a/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll +++ b/test/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll @@ -10,10 +10,10 @@ no_exit: ; preds = %endif, %entry %SJE.0.0 = phi %struct.SetJmpMapEntry* [ %tmp.24, %endif ], [ null, %entry ] ; <%struct.SetJmpMapEntry*> [#uses=1] br i1 false, label %then, label %endif then: ; preds = %no_exit - %tmp.20 = getelementptr %struct.SetJmpMapEntry* %SJE.0.0, i32 0, i32 1 ; <i32*> [#uses=0] + %tmp.20 = getelementptr %struct.SetJmpMapEntry, %struct.SetJmpMapEntry* %SJE.0.0, i32 0, i32 1 ; <i32*> [#uses=0] ret void endif: ; preds = %no_exit - %tmp.24 = load %struct.SetJmpMapEntry** null ; <%struct.SetJmpMapEntry*> [#uses=1] + %tmp.24 = load %struct.SetJmpMapEntry*, %struct.SetJmpMapEntry** null ; <%struct.SetJmpMapEntry*> [#uses=1] br i1 false, label %UnifiedReturnBlock, label %no_exit UnifiedReturnBlock: ; preds = %endif, %entry ret void diff --git a/test/Transforms/LCSSA/2006-07-09-NoDominator.ll b/test/Transforms/LCSSA/2006-07-09-NoDominator.ll index b03f09a..bc3d150 100644 --- a/test/Transforms/LCSSA/2006-07-09-NoDominator.ll +++ b/test/Transforms/LCSSA/2006-07-09-NoDominator.ll @@ -11,10 +11,10 @@ loopentry: ; preds = %endif, %entry no_exit: ; preds = %loopentry br i1 false, label %then, label %endif then: ; preds = %no_exit - %tmp.21 = getelementptr %struct.SetJmpMapEntry* %SJE.0, i32 0, i32 1 ; <i32*> [#uses=0] + %tmp.21 = getelementptr %struct.SetJmpMapEntry, %struct.SetJmpMapEntry* %SJE.0, i32 0, i32 1 ; <i32*> [#uses=0] br label %return endif: ; preds = %no_exit - %tmp.25 = load %struct.SetJmpMapEntry** null ; <%struct.SetJmpMapEntry*> [#uses=1] + %tmp.25 = load %struct.SetJmpMapEntry*, %struct.SetJmpMapEntry** null ; <%struct.SetJmpMapEntry*> [#uses=1] br label %loopentry loopexit: ; preds = %loopentry br label %return diff --git a/test/Transforms/LCSSA/2007-07-12-LICM-2.ll b/test/Transforms/LCSSA/2007-07-12-LICM-2.ll index 2c5815c..f5d3f7e 100644 --- a/test/Transforms/LCSSA/2007-07-12-LICM-2.ll +++ b/test/Transforms/LCSSA/2007-07-12-LICM-2.ll @@ -4,7 +4,7 @@ entry: br label %bb7 bb7: ; preds = %bb7, %entry - %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1] + %tmp39 = load <4 x float>, <4 x float>* null ; <<4 x float>> [#uses=1] %tmp40 = fadd <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=1] %tmp43 = fadd <4 x float> %tmp40, < float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00 > ; <<4 x float>> [#uses=1] %tmp46 = fadd <4 x float> %tmp43, < float 3.000000e+00, float 0.000000e+00, float 2.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1] diff --git a/test/Transforms/LCSSA/2007-07-12-LICM-3.ll b/test/Transforms/LCSSA/2007-07-12-LICM-3.ll index 7e0d3c6..689b6ea 100644 --- a/test/Transforms/LCSSA/2007-07-12-LICM-3.ll +++ b/test/Transforms/LCSSA/2007-07-12-LICM-3.ll @@ -8,7 +8,7 @@ bb: ; preds = %bb56, %entry br label %bb7 bb7: ; preds = %bb7, %bb - %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1] + %tmp39 = load <4 x float>, <4 x float>* null ; <<4 x float>> [#uses=1] %tmp40 = fadd <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=1] %tmp43 = fadd <4 x float> %tmp40, < float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00 > ; <<4 x float>> [#uses=1] %tmp46 = fadd <4 x float> %tmp43, < float 3.000000e+00, float 0.000000e+00, float 2.000000e+00, float 4.000000e+00 > ; <<4 x float>> [#uses=1] diff --git a/test/Transforms/LCSSA/2007-07-12-LICM.ll b/test/Transforms/LCSSA/2007-07-12-LICM.ll index 8c07aa2..f1785ed 100644 --- a/test/Transforms/LCSSA/2007-07-12-LICM.ll +++ b/test/Transforms/LCSSA/2007-07-12-LICM.ll @@ -4,7 +4,7 @@ entry: br label %bb7 bb7: ; preds = %bb7, %entry - %tmp39 = load <4 x float>* null ; <<4 x float>> [#uses=1] + %tmp39 = load <4 x float>, <4 x float>* null ; <<4 x float>> [#uses=1] %tmp40 = fadd <4 x float> %tmp39, < float 2.000000e+00, float 3.000000e+00, float 1.000000e+00, float 0.000000e+00 > ; <<4 x float>> [#uses=0] store <4 x float> zeroinitializer, <4 x float>* null br i1 false, label %bb7, label %bb56 diff --git a/test/Transforms/LCSSA/invoke-dest.ll b/test/Transforms/LCSSA/invoke-dest.ll index 22b3202..a36dce7 100644 --- a/test/Transforms/LCSSA/invoke-dest.ll +++ b/test/Transforms/LCSSA/invoke-dest.ll @@ -17,7 +17,7 @@ bb.i: ; preds = %entry br label %_ZN7cObjectnwEj.exit _ZN7cObjectnwEj.exit: ; preds = %bb.i, %entry - invoke void @_ZN7cObjectC2EPKc(i8* undef, i8* getelementptr ([12 x i8]* @.str21179, i32 0, i32 0)) + invoke void @_ZN7cObjectC2EPKc(i8* undef, i8* getelementptr ([12 x i8], [12 x i8]* @.str21179, i32 0, i32 0)) to label %bb1 unwind label %lpad bb1: ; preds = %_ZN7cObjectnwEj.exit @@ -39,7 +39,7 @@ bb2: ; preds = %_ZNK5cGate4sizeEv.exit122 unreachable bb8: ; preds = %_ZNK5cGate4sizeEv.exit122 - %tmp = invoke i8* @_ZN7cModule3parEPKc(i8* undef, i8* getelementptr ([10 x i8]* @.str25183, i32 0, i32 0)) + %tmp = invoke i8* @_ZN7cModule3parEPKc(i8* undef, i8* getelementptr ([10 x i8], [10 x i8]* @.str25183, i32 0, i32 0)) to label %invcont9 unwind label %lpad119 ; <i8*> [#uses=1] invcont9: ; preds = %bb8 @@ -54,7 +54,7 @@ invcont11: ; preds = %invcont10 br i1 undef, label %bb12, label %bb18 bb12: ; preds = %invcont11 - invoke void (i8*, i8*, ...)* @_ZN6cEnvir6printfEPKcz(i8* null, i8* getelementptr ([3 x i8]* @.str12, i32 0, i32 0), i32 undef) + invoke void (i8*, i8*, ...)* @_ZN6cEnvir6printfEPKcz(i8* null, i8* getelementptr ([3 x i8], [3 x i8]* @.str12, i32 0, i32 0), i32 undef) to label %bb.i.i159 unwind label %lpad119 bb.i.i159: ; preds = %bb12 @@ -77,7 +77,7 @@ invcont35: ; preds = %bb34 br i1 undef, label %bb49, label %bb61 bb49: ; preds = %invcont35 - invoke void (i8*, i8*, ...)* @_ZNK13cSimpleModule5errorEPKcz(i8* undef, i8* getelementptr ([92 x i8]* @.str32190, i32 0, i32 0)) + invoke void (i8*, i8*, ...)* @_ZNK13cSimpleModule5errorEPKcz(i8* undef, i8* getelementptr ([92 x i8], [92 x i8]* @.str32190, i32 0, i32 0)) to label %bb51 unwind label %lpad119 bb51: ; preds = %bb49 @@ -87,7 +87,7 @@ bb61: ; preds = %invcont35 br label %bb106 .noexc: ; preds = %bb106 - invoke void @_ZN7cObjectC2EPKc(i8* undef, i8* getelementptr ([25 x i8]* @.str41, i32 0, i32 0)) + invoke void @_ZN7cObjectC2EPKc(i8* undef, i8* getelementptr ([25 x i8], [25 x i8]* @.str41, i32 0, i32 0)) to label %bb102 unwind label %lpad123 bb102: ; preds = %.noexc @@ -99,7 +99,7 @@ invcont103: ; preds = %bb102 to label %invcont104 unwind label %lpad119 invcont104: ; preds = %invcont103 - %tmp3 = invoke i32 @_ZN13cSimpleModule11sendDelayedEP8cMessagedPKci(i8* undef, i8* undef, double 0.000000e+00, i8* getelementptr ([4 x i8]* @.str17175, i32 0, i32 0), i32 undef) + %tmp3 = invoke i32 @_ZN13cSimpleModule11sendDelayedEP8cMessagedPKci(i8* undef, i8* undef, double 0.000000e+00, i8* getelementptr ([4 x i8], [4 x i8]* @.str17175, i32 0, i32 0), i32 undef) to label %invcont105 unwind label %lpad119 ; <i32> [#uses=0] invcont105: ; preds = %invcont104 diff --git a/test/Transforms/LCSSA/unreachable-use.ll b/test/Transforms/LCSSA/unreachable-use.ll index 2ea7aeb..c9e456c 100644 --- a/test/Transforms/LCSSA/unreachable-use.ll +++ b/test/Transforms/LCSSA/unreachable-use.ll @@ -4,7 +4,7 @@ ; LCSSA doesn't need to transform uses in blocks not reachable ; from the entry block. -; CHECK: %tmp33 = load i1** %tmp +; CHECK: %tmp33 = load i1*, i1** %tmp define fastcc void @dfs() nounwind { bb: @@ -21,7 +21,7 @@ bb15: br label %bb44 bb32: - %tmp33 = load i1** %tmp, align 8 + %tmp33 = load i1*, i1** %tmp, align 8 br label %bb45 bb45: diff --git a/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll b/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll index ff20312..1b50a6c 100644 --- a/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll +++ b/test/Transforms/LICM/2003-02-26-LoopExitNotDominated.ll @@ -7,7 +7,7 @@ bb3: %X = alloca [2 x i64] ; <[2 x i64]*> [#uses=1] br i1 false, label %bb13, label %bb4 bb4: ; preds = %bb3 - %reg3011 = getelementptr [2 x i64]* %X, i64 0, i64 0 ; <i64*> [#uses=1] + %reg3011 = getelementptr [2 x i64], [2 x i64]* %X, i64 0, i64 0 ; <i64*> [#uses=1] br label %bb8 bb8: ; preds = %bb8, %bb4 store i64 0, i64* %reg3011 diff --git a/test/Transforms/LICM/2003-05-02-LoadHoist.ll b/test/Transforms/LICM/2003-05-02-LoadHoist.ll index 71d3e78..2f94dff 100644 --- a/test/Transforms/LICM/2003-05-02-LoadHoist.ll +++ b/test/Transforms/LICM/2003-05-02-LoadHoist.ll @@ -10,12 +10,12 @@ declare void @foo() define i32 @test(i1 %c) { - %A = load i32* @X ; <i32> [#uses=1] + %A = load i32, i32* @X ; <i32> [#uses=1] br label %Loop Loop: ; preds = %Loop, %0 call void @foo( ) ;; Should not hoist this load! - %B = load i32* @X ; <i32> [#uses=1] + %B = load i32, i32* @X ; <i32> [#uses=1] br i1 %c, label %Loop, label %Out Out: ; preds = %Loop %C = sub i32 %A, %B ; <i32> [#uses=1] diff --git a/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll b/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll index 16f4fed..73862db 100644 --- a/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll +++ b/test/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.ll @@ -7,8 +7,8 @@ define void @test() { Outer: ; preds = %Next, %0 br label %Inner Inner: ; preds = %Inner, %Outer - %tmp.114.i.i.i = load i8** @PL_regcomp_parse ; <i8*> [#uses=1] - %tmp.115.i.i.i = load i8* %tmp.114.i.i.i ; <i8> [#uses=0] + %tmp.114.i.i.i = load i8*, i8** @PL_regcomp_parse ; <i8*> [#uses=1] + %tmp.115.i.i.i = load i8, i8* %tmp.114.i.i.i ; <i8> [#uses=0] store i8* null, i8** @PL_regcomp_parse br i1 false, label %Inner, label %Next Next: ; preds = %Inner diff --git a/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll b/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll index a119865..9416028 100644 --- a/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll +++ b/test/Transforms/LICM/2004-11-17-UndefIndexCrash.ll @@ -11,10 +11,10 @@ define void @main() { __main.entry: br label %invoke_cont.3 invoke_cont.3: ; preds = %invoke_cont.3, %__main.entry - %tmp.34.i.i502.7 = getelementptr %struct.roadlet* null, i32 0, i32 3, i32 7 ; <%struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)**> [#uses=1] + %tmp.34.i.i502.7 = getelementptr %struct.roadlet, %struct.roadlet* null, i32 0, i32 3, i32 7 ; <%struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)**> [#uses=1] store %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)* @_Z11return_nullP7roadletP7vehicle9direction, %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)** %tmp.34.i.i502.7 store %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)* @_Z14lane_switch_okP7roadletP7vehicle9direction, %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)** null - %tmp.4.i.i339 = getelementptr %struct.roadlet* null, i32 0, i32 3, i32 undef ; <%struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)**> [#uses=1] + %tmp.4.i.i339 = getelementptr %struct.roadlet, %struct.roadlet* null, i32 0, i32 3, i32 undef ; <%struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)**> [#uses=1] store %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)* @_Z11return_nullP7roadletP7vehicle9direction, %struct.roadlet* (%struct.roadlet*, %struct.vehicle*, i32)** %tmp.4.i.i339 br label %invoke_cont.3 } diff --git a/test/Transforms/LICM/2007-05-22-VolatileSink.ll b/test/Transforms/LICM/2007-05-22-VolatileSink.ll index 94511cc..f5ce86b 100644 --- a/test/Transforms/LICM/2007-05-22-VolatileSink.ll +++ b/test/Transforms/LICM/2007-05-22-VolatileSink.ll @@ -10,8 +10,8 @@ entry: br label %bb6 bb: ; preds = %bb6 - %tmp2 = load volatile i32* %DataIn ; <i32> [#uses=1] - %tmp3 = getelementptr [64 x i32]* %buffer, i32 0, i32 %i.0 ; <i32*> [#uses=1] + %tmp2 = load volatile i32, i32* %DataIn ; <i32> [#uses=1] + %tmp3 = getelementptr [64 x i32], [64 x i32]* %buffer, i32 0, i32 %i.0 ; <i32*> [#uses=1] store i32 %tmp2, i32* %tmp3 %tmp5 = add i32 %i.0, 1 ; <i32> [#uses=1] br label %bb6 @@ -26,8 +26,8 @@ bb6: ; preds = %bb, %entry bb12: ; preds = %bb22 %tmp14 = mul i32 %j.1, 8 ; <i32> [#uses=1] %tmp16 = add i32 %tmp14, %i.1 ; <i32> [#uses=1] - %tmp17 = getelementptr [64 x i32]* %buffer, i32 0, i32 %tmp16 ; <i32*> [#uses=1] - %tmp18 = load i32* %tmp17 ; <i32> [#uses=1] + %tmp17 = getelementptr [64 x i32], [64 x i32]* %buffer, i32 0, i32 %tmp16 ; <i32*> [#uses=1] + %tmp18 = load i32, i32* %tmp17 ; <i32> [#uses=1] store volatile i32 %tmp18, i32* %DataOut %tmp21 = add i32 %j.1, 1 ; <i32> [#uses=1] br label %bb22 diff --git a/test/Transforms/LICM/2007-07-30-AliasSet.ll b/test/Transforms/LICM/2007-07-30-AliasSet.ll index 8ecd1bc..3e4fbb0 100644 --- a/test/Transforms/LICM/2007-07-30-AliasSet.ll +++ b/test/Transforms/LICM/2007-07-30-AliasSet.ll @@ -17,12 +17,12 @@ bb63.outer: ; preds = %bb73, %bb28 bb35: ; preds = %cond_next60, %bb63.outer %window.34 = phi i32 [ %tmp62, %cond_next60 ], [ 0, %bb63.outer ] ; <i32> [#uses=1] - %tmp44 = getelementptr [4 x i32]* null, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp46 = load i32* %tmp44, align 4 ; <i32> [#uses=0] + %tmp44 = getelementptr [4 x i32], [4 x i32]* null, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp46 = load i32, i32* %tmp44, align 4 ; <i32> [#uses=0] br i1 false, label %cond_true50, label %cond_next60 cond_true50: ; preds = %bb35 - %tmp59 = getelementptr [4 x i32]* null, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp59 = getelementptr [4 x i32], [4 x i32]* null, i32 0, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %tmp59, align 4 br label %cond_next60 diff --git a/test/Transforms/LICM/2007-09-17-PromoteValue.ll b/test/Transforms/LICM/2007-09-17-PromoteValue.ll index 31abd8c..1d25d17 100644 --- a/test/Transforms/LICM/2007-09-17-PromoteValue.ll +++ b/test/Transforms/LICM/2007-09-17-PromoteValue.ll @@ -14,7 +14,7 @@ blah.i: ; preds = %cond_true.i, %entry br i1 %tmp3.i, label %clear_modes.exit, label %cond_true.i cond_true.i: ; preds = %blah.i - %tmp1.i = getelementptr %struct.decision* null, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp1.i = getelementptr %struct.decision, %struct.decision* null, i32 0, i32 0 ; <i8*> [#uses=1] store i8 0, i8* %tmp1.i br label %blah.i @@ -33,7 +33,7 @@ loop.head: ; preds = %cond.true, %entry br i1 %tmp3.i, label %cond.true, label %exit cond.true: ; preds = %loop.head - %ptr.i = getelementptr i8* %ptr, i32 0 ; <i8*> [#uses=2] + %ptr.i = getelementptr i8, i8* %ptr, i32 0 ; <i8*> [#uses=2] store i8 0, i8* %ptr.i br label %loop.head @@ -50,7 +50,7 @@ loop.head: ; preds = %cond.true, %entry br i1 %tmp3.i, label %exit, label %cond.true cond.true: ; preds = %loop.head - %ptr.i = getelementptr i8* %p, i32 0 ; <i8*> [#uses=2] + %ptr.i = getelementptr i8, i8* %p, i32 0 ; <i8*> [#uses=2] store i8 0, i8* %ptr.i br label %loop.head diff --git a/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll b/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll index d4df26e..a715af0 100644 --- a/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll +++ b/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll @@ -6,7 +6,7 @@ define void @test(i32 %count) { entry: br label %forcond -; CHECK: %tmp3 = load float** @a +; CHECK: %tmp3 = load float*, float** @a ; CHECK: br label %forcond forcond: @@ -19,14 +19,14 @@ forcond: ; CHECK: br i1 %cmp, label %forbody, label %afterfor forbody: - %tmp3 = load float** @a - %arrayidx = getelementptr float* %tmp3, i32 %i.0 + %tmp3 = load float*, float** @a + %arrayidx = getelementptr float, float* %tmp3, i32 %i.0 %tmp7 = uitofp i32 %i.0 to float store float %tmp7, float* %arrayidx %inc = add i32 %i.0, 1 br label %forcond -; CHECK: %arrayidx = getelementptr float* %tmp3, i32 %i.0 +; CHECK: %arrayidx = getelementptr float, float* %tmp3, i32 %i.0 ; CHECK: %tmp7 = uitofp i32 %i.0 to float ; CHECK: store float %tmp7, float* %arrayidx ; CHECK: %inc = add i32 %i.0, 1 diff --git a/test/Transforms/LICM/2009-12-10-LICM-Indbr-Crash.ll b/test/Transforms/LICM/2009-12-10-LICM-Indbr-Crash.ll index e3cdbb3..1b3ff5b 100644 --- a/test/Transforms/LICM/2009-12-10-LICM-Indbr-Crash.ll +++ b/test/Transforms/LICM/2009-12-10-LICM-Indbr-Crash.ll @@ -12,7 +12,7 @@ define void @foo (i8* %v) indirectbr i8* undef, [label %preheader, label %stuff] stuff: - %0 = load i8* undef, align 1 + %0 = load i8, i8* undef, align 1 br label %loop return: diff --git a/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll b/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll index 2bbc6ab..b462885 100644 --- a/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll +++ b/test/Transforms/LICM/2011-04-06-HoistMissedASTUpdate.ll @@ -15,11 +15,11 @@ for.body4.lr.ph: br label %for.body4 ; CHECK: for.body4: -; CHECK: load volatile i16* @g_39 +; CHECK: load volatile i16, i16* @g_39 for.body4: %l_612.11 = phi i32* [ undef, %for.body4.lr.ph ], [ %call19, %for.body4 ] - %tmp7 = load volatile i16* @g_39, align 2 + %tmp7 = load volatile i16, i16* @g_39, align 2 %call = call i32** @func_108(i32*** undef) %call19 = call i32* @func_84(i32** %call) br i1 false, label %for.body4, label %for.cond.loopexit diff --git a/test/Transforms/LICM/2011-04-06-PromoteResultOfPromotion.ll b/test/Transforms/LICM/2011-04-06-PromoteResultOfPromotion.ll index 5587142..370491e 100644 --- a/test/Transforms/LICM/2011-04-06-PromoteResultOfPromotion.ll +++ b/test/Transforms/LICM/2011-04-06-PromoteResultOfPromotion.ll @@ -8,7 +8,7 @@ define void @f() nounwind { ; CHECK: entry: ; CHECK: alloca [9 x i16] -; CHECK: load i32* @g_58 +; CHECK: load i32, i32* @g_58 ; CHECK: br label %for.body entry: @@ -18,8 +18,8 @@ entry: for.body: ; preds = %entry, %for.inc %inc12 = phi i32 [ 0, %entry ], [ %inc, %for.body ] store i32* @g_58, i32** @g_116, align 8, !tbaa !0 - %tmp2 = load i32** @g_116, align 8, !tbaa !0 - %tmp3 = load i32* %tmp2, !tbaa !4 + %tmp2 = load i32*, i32** @g_116, align 8, !tbaa !0 + %tmp3 = load i32, i32* %tmp2, !tbaa !4 %or = or i32 %tmp3, 10 store i32 %or, i32* %tmp2, !tbaa !4 %inc = add nsw i32 %inc12, 1 diff --git a/test/Transforms/LICM/2011-04-09-RAUW-AST.ll b/test/Transforms/LICM/2011-04-09-RAUW-AST.ll index 4285bd1..f5ef29c 100644 --- a/test/Transforms/LICM/2011-04-09-RAUW-AST.ll +++ b/test/Transforms/LICM/2011-04-09-RAUW-AST.ll @@ -6,7 +6,7 @@ define i32 @main() nounwind { entry: - %tmp = load i32* @g_3, align 4 + %tmp = load i32, i32* @g_3, align 4 %tobool = icmp eq i32 %tmp, 0 br i1 %tobool, label %for.cond, label %if.then @@ -40,8 +40,8 @@ for.inc10: ; preds = %for.cond4 br label %for.cond for.end13: ; preds = %for.cond - %tmp14 = load i32* @g_3, align 4 - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %tmp14) nounwind + %tmp14 = load i32, i32* @g_3, align 4 + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %tmp14) nounwind ret i32 0 } diff --git a/test/Transforms/LICM/2011-07-06-Alignment.ll b/test/Transforms/LICM/2011-07-06-Alignment.ll index 5692314..c71dd80 100644 --- a/test/Transforms/LICM/2011-07-06-Alignment.ll +++ b/test/Transforms/LICM/2011-07-06-Alignment.ll @@ -8,7 +8,7 @@ entry: for.cond: %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr [1024 x float]* @A, i64 0, i64 3 + %arrayidx = getelementptr [1024 x float], [1024 x float]* @A, i64 0, i64 3 %vecidx = bitcast float* %arrayidx to <4 x float>* store <4 x float> zeroinitializer, <4 x float>* %vecidx, align 4 %indvar.next = add i64 %indvar, 1 diff --git a/test/Transforms/LICM/PR21582.ll b/test/Transforms/LICM/PR21582.ll index c068c2f..5664f2e 100644 --- a/test/Transforms/LICM/PR21582.ll +++ b/test/Transforms/LICM/PR21582.ll @@ -19,8 +19,8 @@ for.body.preheader: ; preds = %for.cond for.body: ; preds = %for.body, %for.body.preheader %g.15 = phi i32 [ undef, %for.body ], [ 0, %for.body.preheader ] - %arrayidx2 = getelementptr inbounds i32* @fn3.i, i64 0 - %0 = load i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* @fn3.i, i64 0 + %0 = load i32, i32* %arrayidx2, align 4 %call = call i32 @g() br i1 false, label %for.body, label %for.end.loopexit diff --git a/test/Transforms/LICM/atomics.ll b/test/Transforms/LICM/atomics.ll index acf605d..4fe197a 100644 --- a/test/Transforms/LICM/atomics.ll +++ b/test/Transforms/LICM/atomics.ll @@ -7,7 +7,7 @@ entry: loop: %i = phi i32 [ %inc, %loop ], [ 0, %entry ] - %val = load atomic i32* %y unordered, align 4 + %val = load atomic i32, i32* %y unordered, align 4 %inc = add nsw i32 %i, 1 %exitcond = icmp eq i32 %inc, %val br i1 %exitcond, label %end, label %loop @@ -27,7 +27,7 @@ entry: br label %loop loop: - %val = load atomic i32* %y monotonic, align 4 + %val = load atomic i32, i32* %y monotonic, align 4 %exitcond = icmp ne i32 %val, 0 br i1 %exitcond, label %end, label %loop @@ -47,15 +47,15 @@ entry: br label %loop loop: - %vala = load atomic i32* %y monotonic, align 4 - %valb = load atomic i32* %x unordered, align 4 + %vala = load atomic i32, i32* %y monotonic, align 4 + %valb = load atomic i32, i32* %x unordered, align 4 %exitcond = icmp ne i32 %vala, %valb br i1 %exitcond, label %end, label %loop end: ret i32 %vala ; CHECK-LABEL: define i32 @test3( -; CHECK: load atomic i32* %x unordered +; CHECK: load atomic i32, i32* %x unordered ; CHECK-NEXT: br label %loop } @@ -66,7 +66,7 @@ entry: br label %loop loop: - %vala = load atomic i32* %y monotonic, align 4 + %vala = load atomic i32, i32* %y monotonic, align 4 store atomic i32 %vala, i32* %x unordered, align 4 %exitcond = icmp ne i32 %vala, 0 br i1 %exitcond, label %end, label %loop @@ -74,6 +74,6 @@ loop: end: ret i32 %vala ; CHECK-LABEL: define i32 @test4( -; CHECK: load atomic i32* %y monotonic +; CHECK: load atomic i32, i32* %y monotonic ; CHECK-NEXT: store atomic } diff --git a/test/Transforms/LICM/constexpr.ll b/test/Transforms/LICM/constexpr.ll index f788787..506721f 100644 --- a/test/Transforms/LICM/constexpr.ll +++ b/test/Transforms/LICM/constexpr.ll @@ -9,7 +9,7 @@ target triple = "x86_64-pc-windows-msvc" ; CHECK-LABEL: @bar ; CHECK: entry: -; CHECK: load i64* bitcast (i32** @in to i64*) +; CHECK: load i64, i64* bitcast (i32** @in to i64*) ; CHECK: do.body: ; CHECK-NOT: load @@ -24,11 +24,11 @@ do.body: ; preds = %l2, %entry br i1 %c, label %l1, label %do.body.l2_crit_edge do.body.l2_crit_edge: ; preds = %do.body - %inval.pre = load i32** @in, align 8 + %inval.pre = load i32*, i32** @in, align 8 br label %l2 l1: ; preds = %do.body - %v1 = load i64* bitcast (i32** @in to i64*), align 8 + %v1 = load i64, i64* bitcast (i32** @in to i64*), align 8 store i64 %v1, i64* bitcast (i32** @out to i64*), align 8 %0 = inttoptr i64 %v1 to i32* br label %l2 diff --git a/test/Transforms/LICM/crash.ll b/test/Transforms/LICM/crash.ll index b43477a..7fa4115 100644 --- a/test/Transforms/LICM/crash.ll +++ b/test/Transforms/LICM/crash.ll @@ -12,7 +12,7 @@ entry: for.body: ; preds = %for.cond, %bb.nph store i8 0, i8* @g_12, align 1 - %tmp6 = load i8* @g_12, align 1 + %tmp6 = load i8, i8* @g_12, align 1 br label %for.cond for.cond: ; preds = %for.body @@ -34,7 +34,7 @@ entry: br label %for.body for.body: ; preds = %for.body, %entry - %tmp7 = load i32* @g_8, align 4 + %tmp7 = load i32, i32* @g_8, align 4 store i32* @g_8, i32** undef, align 16 store i32 undef, i32* @g_8, align 4 br label %for.body @@ -47,10 +47,10 @@ entry: br i1 undef, label %for.cond, label %for.end for.cond: ; preds = %for.cond, %entry - %tmp1 = getelementptr { i32*}* %__first, i32 0, i32 0 - %tmp2 = load i32** %tmp1, align 4 + %tmp1 = getelementptr { i32*}, { i32*}* %__first, i32 0, i32 0 + %tmp2 = load i32*, i32** %tmp1, align 4 %call = tail call i32* @test3helper(i32* %tmp2) - %tmp3 = getelementptr { i32*}* %__first, i32 0, i32 0 + %tmp3 = getelementptr { i32*}, { i32*}* %__first, i32 0, i32 0 store i32* %call, i32** %tmp3, align 4 br i1 false, label %for.cond, label %for.end diff --git a/test/Transforms/LICM/debug-value.ll b/test/Transforms/LICM/debug-value.ll index b49c559..2220698 100644 --- a/test/Transforms/LICM/debug-value.ll +++ b/test/Transforms/LICM/debug-value.ll @@ -15,7 +15,7 @@ if.then: ; preds = %for.body if.then27: ; preds = %if.then ; CHECK: tail call void @llvm.dbg.value - tail call void @llvm.dbg.value(metadata double undef, i64 0, metadata !19, metadata !{}), !dbg !21 + tail call void @llvm.dbg.value(metadata double undef, i64 0, metadata !19, metadata !MDExpression()), !dbg !21 br label %for.body61.us if.end.if.end.split_crit_edge.critedge: ; preds = %if.then @@ -36,30 +36,30 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.module.flags = !{!26} !llvm.dbg.sp = !{!0, !6, !9, !10} -!0 = !{!"0x2e\00idamax\00idamax\00\00112\000\001\000\006\00256\000\000", !25, !1, !3, i32 0, null, null, null, null} ; [ DW_TAG_subprogram ] -!1 = !{!"0x29", !25} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00clang version 2.9 (trunk 127169)\001\00\000\00\000", !25, !8, !8, !8, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !25, !1, null, !4, i32 0} ; [ DW_TAG_subroutine_type ] +!0 = !MDSubprogram(name: "idamax", line: 112, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !25, scope: !1, type: !3) +!1 = !MDFile(filename: "/Volumes/Lalgate/work/llvm/projects/llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c", directory: "/private/tmp") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 127169)", isOptimized: true, emissionKind: 0, file: !25, enums: !8, retainedTypes: !8, subprograms: !8) +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !2} ; [ DW_TAG_base_type ] -!6 = !{!"0x2e\00dscal\00dscal\00\00206\000\001\000\006\00256\000\000", !25, !1, !7, i32 0, null, null, null, null} ; [ DW_TAG_subprogram ] -!7 = !{!"0x15\00\000\000\000\000\000\000", !25, !1, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !MDSubprogram(name: "dscal", line: 206, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !25, scope: !1, type: !7) +!7 = !MDSubroutineType(types: !8) !8 = !{null} -!9 = !{!"0x2e\00daxpy\00daxpy\00\00230\000\001\000\006\00256\000\000", !25, !1, !7, i32 0, null, null, null, null} ; [ DW_TAG_subprogram ] -!10 = !{!"0x2e\00dgefa\00dgefa\00\00267\000\001\000\006\00256\000\000", !25, !1, !7, null, null, null, null, null} ; [ DW_TAG_subprogram ] [line 267] [def] [scope 0] [dgefa] +!9 = !MDSubprogram(name: "daxpy", line: 230, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !25, scope: !1, type: !7) +!10 = !MDSubprogram(name: "dgefa", line: 267, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !25, scope: !1, type: !7) !11 = !MDLocation(line: 281, column: 9, scope: !12) -!12 = !{!"0xb\00272\005\0032", !25, !13} ; [ DW_TAG_lexical_block ] -!13 = !{!"0xb\00271\005\0031", !25, !14} ; [ DW_TAG_lexical_block ] -!14 = !{!"0xb\00267\001\0030", !25, !10} ; [ DW_TAG_lexical_block ] +!12 = distinct !MDLexicalBlock(line: 272, column: 5, file: !25, scope: !13) +!13 = distinct !MDLexicalBlock(line: 271, column: 5, file: !25, scope: !14) +!14 = distinct !MDLexicalBlock(line: 267, column: 1, file: !25, scope: !10) !15 = !MDLocation(line: 271, column: 5, scope: !14) !16 = !MDLocation(line: 284, column: 10, scope: !17) -!17 = !{!"0xb\00282\009\0033", !25, !12} ; [ DW_TAG_lexical_block ] +!17 = distinct !MDLexicalBlock(line: 282, column: 9, file: !25, scope: !12) !18 = !{double undef} -!19 = !{!"0x100\00temp\00268\000", !14, !1, !20} ; [ DW_TAG_auto_variable ] -!20 = !{!"0x24\00double\000\0064\0064\000\000\004", null, !2} ; [ DW_TAG_base_type ] +!19 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "temp", line: 268, scope: !14, file: !1, type: !20) +!20 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) !21 = !MDLocation(line: 286, column: 14, scope: !22) -!22 = !{!"0xb\00285\0013\0034", !25, !17} ; [ DW_TAG_lexical_block ] +!22 = distinct !MDLexicalBlock(line: 285, column: 13, file: !25, scope: !17) !23 = !MDLocation(line: 296, column: 13, scope: !17) !24 = !MDLocation(line: 313, column: 1, scope: !14) -!25 = !{!"/Volumes/Lalgate/work/llvm/projects/llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c", !"/private/tmp"} -!26 = !{i32 1, !"Debug Info Version", i32 2} +!25 = !MDFile(filename: "/Volumes/Lalgate/work/llvm/projects/llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c", directory: "/private/tmp") +!26 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/LICM/hoist-bitcast-load.ll b/test/Transforms/LICM/hoist-bitcast-load.ll index fa61eaf..47c474c 100644 --- a/test/Transforms/LICM/hoist-bitcast-load.ll +++ b/test/Transforms/LICM/hoist-bitcast-load.ll @@ -4,7 +4,7 @@ target triple = "x86_64-unknown-linux-gnu" ; Make sure the basic alloca pointer hoisting works: ; CHECK-LABEL: @test1 -; CHECK: load i32* %c, align 4 +; CHECK: load i32, i32* %c, align 4 ; CHECK: for.body: ; Function Attrs: nounwind uwtable @@ -16,15 +16,15 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %1 = load i32* %c, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %1 = load i32, i32* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc @@ -42,7 +42,7 @@ for.end: ; preds = %for.inc, %entry ; Make sure the basic alloca pointer hoisting works through a bitcast to a ; pointer to a smaller type: ; CHECK-LABEL: @test2 -; CHECK: load i32* %c, align 4 +; CHECK: load i32, i32* %c, align 4 ; CHECK: for.body: ; Function Attrs: nounwind uwtable @@ -55,15 +55,15 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %1 = load i32* %c, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %1 = load i32, i32* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc @@ -80,7 +80,7 @@ for.end: ; preds = %for.inc, %entry ; Make sure the basic alloca pointer hoisting works through an addrspacecast ; CHECK-LABEL: @test2_addrspacecast -; CHECK: load i32 addrspace(1)* %c, align 4 +; CHECK: load i32, i32 addrspace(1)* %c, align 4 ; CHECK: for.body: ; Function Attrs: nounwind uwtable @@ -93,15 +93,15 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32 addrspace(1)* %a, i64 %indvars.iv - %0 = load i32 addrspace(1)* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %a, i64 %indvars.iv + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %1 = load i32 addrspace(1)* %c, align 4 - %arrayidx3 = getelementptr inbounds i32 addrspace(1)* %b, i64 %indvars.iv - %2 = load i32 addrspace(1)* %arrayidx3, align 4 + %1 = load i32, i32 addrspace(1)* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %indvars.iv + %2 = load i32, i32 addrspace(1)* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32 addrspace(1)* %arrayidx, align 4 br label %for.inc @@ -119,7 +119,7 @@ for.end: ; preds = %for.inc, %entry ; Make sure the basic alloca pointer hoisting works through a bitcast to a ; pointer to a smaller type (where the bitcast also needs to be hoisted): ; CHECK-LABEL: @test3 -; CHECK: load i32* %c, align 4 +; CHECK: load i32, i32* %c, align 4 ; CHECK: for.body: ; Function Attrs: nounwind uwtable @@ -131,16 +131,16 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %c = bitcast i64* %ca to i32* - %1 = load i32* %c, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %1 = load i32, i32* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc @@ -159,7 +159,7 @@ for.end: ; preds = %for.inc, %entry ; to a pointer to a larger type: ; CHECK-LABEL: @test4 ; CHECK: for.body: -; CHECK: load i32* %c, align 4 +; CHECK: load i32, i32* %c, align 4 ; Function Attrs: nounwind uwtable define void @test4(i32* nocapture %a, i32* nocapture readonly %b, i32 %n) #0 { @@ -171,15 +171,15 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %1 = load i32* %c, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %1 = load i32, i32* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc @@ -197,7 +197,7 @@ for.end: ; preds = %for.inc, %entry ; Don't crash on bitcasts to unsized types. ; CHECK-LABEL: @test5 ; CHECK: for.body: -; CHECK: load i32* %c, align 4 +; CHECK: load i32, i32* %c, align 4 %atype = type opaque @@ -212,15 +212,15 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %1 = load i32* %c, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %1 = load i32, i32* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc diff --git a/test/Transforms/LICM/hoist-deref-load.ll b/test/Transforms/LICM/hoist-deref-load.ll index c230d1d..4d0ae45 100644 --- a/test/Transforms/LICM/hoist-deref-load.ll +++ b/test/Transforms/LICM/hoist-deref-load.ll @@ -12,7 +12,7 @@ target triple = "x86_64-unknown-linux-gnu" ; because the dereferenceable attribute is on %c. ; CHECK-LABEL: @test1 -; CHECK: load i32* %c, align 4 +; CHECK: load i32, i32* %c, align 4 ; CHECK: for.body: define void @test1(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32* nocapture readonly nonnull dereferenceable(4) %c, i32 %n) #0 { @@ -22,15 +22,15 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %1 = load i32* %c, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %1 = load i32, i32* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc @@ -50,7 +50,7 @@ for.end: ; preds = %for.inc, %entry ; CHECK-LABEL: @test2 ; CHECK: if.then: -; CHECK: load i32* %c, align 4 +; CHECK: load i32, i32* %c, align 4 define void @test2(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32* nocapture readonly nonnull %c, i32 %n) #0 { entry: @@ -59,15 +59,15 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %1 = load i32* %c, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %1 = load i32, i32* %c, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc @@ -92,7 +92,7 @@ for.end: ; preds = %for.inc, %entry ; because the dereferenceable attribute is on %c. ; CHECK-LABEL: @test3 -; CHECK: load i32* %c2, align 4 +; CHECK: load i32, i32* %c2, align 4 ; CHECK: for.body: define void @test3(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32* nocapture readonly dereferenceable(12) %c, i32 %n) #0 { @@ -102,16 +102,16 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %c2 = getelementptr inbounds i32* %c, i64 2 - %1 = load i32* %c2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %c2 = getelementptr inbounds i32, i32* %c, i64 2 + %1 = load i32, i32* %c2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc @@ -131,7 +131,7 @@ for.end: ; preds = %for.inc, %entry ; CHECK-LABEL: @test4 ; CHECK: if.then: -; CHECK: load i32* %c2, align 4 +; CHECK: load i32, i32* %c2, align 4 define void @test4(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32* nocapture readonly dereferenceable(11) %c, i32 %n) #0 { entry: @@ -140,16 +140,16 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body - %c2 = getelementptr inbounds i32* %c, i64 2 - %1 = load i32* %c2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx3, align 4 + %c2 = getelementptr inbounds i32, i32* %c, i64 2 + %1 = load i32, i32* %c2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx3, align 4 %mul = mul nsw i32 %2, %1 store i32 %mul, i32* %arrayidx, align 4 br label %for.inc diff --git a/test/Transforms/LICM/hoist-invariant-load.ll b/test/Transforms/LICM/hoist-invariant-load.ll index 59904ba..aec155b 100644 --- a/test/Transforms/LICM/hoist-invariant-load.ll +++ b/test/Transforms/LICM/hoist-invariant-load.ll @@ -2,9 +2,9 @@ ; RUN: opt < %s -licm -stats -S 2>&1 | grep "1 licm" @"\01L_OBJC_METH_VAR_NAME_" = internal global [4 x i8] c"foo\00", section "__TEXT,__objc_methname,cstring_literals", align 1 -@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" +@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" @"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__DATA, __objc_imageinfo, regular, no_dead_strip" -@llvm.used = appending global [3 x i8*] [i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*)], section "llvm.metadata" +@llvm.used = appending global [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*)], section "llvm.metadata" define void @test(i8* %x) uwtable ssp { entry: @@ -15,18 +15,18 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp ult i32 %0, 10000 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i8** %x.addr, align 8 - %2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", !invariant.load !0 + %1 = load i8*, i8** %x.addr, align 8 + %2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", !invariant.load !0 %call = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %1, i8* %2) br label %for.inc for.inc: ; preds = %for.body - %3 = load i32* %i, align 4 + %3 = load i32, i32* %i, align 4 %inc = add i32 %3, 1 store i32 %inc, i32* %i, align 4 br label %for.cond diff --git a/test/Transforms/LICM/hoisting.ll b/test/Transforms/LICM/hoisting.ll index b4d297a..8609407 100644 --- a/test/Transforms/LICM/hoisting.ll +++ b/test/Transforms/LICM/hoisting.ll @@ -8,7 +8,7 @@ declare void @foo() ; potentially trapping instructions when they are not guaranteed to execute. define i32 @test1(i1 %c) { ; CHECK-LABEL: @test1( - %A = load i32* @X ; <i32> [#uses=2] + %A = load i32, i32* @X ; <i32> [#uses=2] br label %Loop Loop: ; preds = %LoopTail, %0 call void @foo( ) @@ -35,9 +35,9 @@ declare void @foo2(i32) nounwind ;; It is ok and desirable to hoist this potentially trapping instruction. define i32 @test2(i1 %c) { ; CHECK-LABEL: @test2( -; CHECK-NEXT: load i32* @X +; CHECK-NEXT: load i32, i32* @X ; CHECK-NEXT: %B = sdiv i32 4, %A - %A = load i32* @X ; <i32> [#uses=2] + %A = load i32, i32* @X ; <i32> [#uses=2] br label %Loop Loop: ;; Should have hoisted this div! @@ -54,7 +54,7 @@ Out: ; preds = %Loop define i32 @test3(i1 %c) { ; CHECK-LABEL: define i32 @test3( ; CHECK: call void @foo2(i32 6) - %A = load i32* @X ; <i32> [#uses=2] + %A = load i32, i32* @X ; <i32> [#uses=2] br label %Loop Loop: %B = add i32 4, 2 ; <i32> [#uses=2] diff --git a/test/Transforms/LICM/lcssa-ssa-promoter.ll b/test/Transforms/LICM/lcssa-ssa-promoter.ll index 5df3ef1..b0cae87 100644 --- a/test/Transforms/LICM/lcssa-ssa-promoter.ll +++ b/test/Transforms/LICM/lcssa-ssa-promoter.ll @@ -44,7 +44,7 @@ inner.body.rhs: ; CHECK-NEXT: br label %inner.latch inner.latch: - %y_val = load i32* @y, align 4 + %y_val = load i32, i32* @y, align 4 %icmp = icmp eq i32 %y_val, 0 br i1 %icmp, label %inner.exit, label %inner.header ; CHECK: inner.latch: diff --git a/test/Transforms/LICM/scalar-promote-memmodel.ll b/test/Transforms/LICM/scalar-promote-memmodel.ll index 23d70f5..3603c25 100644 --- a/test/Transforms/LICM/scalar-promote-memmodel.ll +++ b/test/Transforms/LICM/scalar-promote-memmodel.ll @@ -19,12 +19,12 @@ for.body: ; preds = %for.cond br i1 %tobool, label %for.inc, label %if.then if.then: ; preds = %for.body - %tmp3 = load i32* @g, align 4 + %tmp3 = load i32, i32* @g, align 4 %inc = add nsw i32 %tmp3, 1 store i32 %inc, i32* @g, align 4 br label %for.inc -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK-NEXT: add ; CHECK-NEXT: store i32 diff --git a/test/Transforms/LICM/scalar_promote.ll b/test/Transforms/LICM/scalar_promote.ll index 80afb3c..6ef4bac 100644 --- a/test/Transforms/LICM/scalar_promote.ll +++ b/test/Transforms/LICM/scalar_promote.ll @@ -8,13 +8,13 @@ Entry: br label %Loop ; CHECK-LABEL: @test1( ; CHECK: Entry: -; CHECK-NEXT: load i32* @X +; CHECK-NEXT: load i32, i32* @X ; CHECK-NEXT: br label %Loop Loop: ; preds = %Loop, %0 %j = phi i32 [ 0, %Entry ], [ %Next, %Loop ] ; <i32> [#uses=1] - %x = load i32* @X ; <i32> [#uses=1] + %x = load i32, i32* @X ; <i32> [#uses=1] %x2 = add i32 %x, 1 ; <i32> [#uses=1] store i32 %x2, i32* @X %Next = add i32 %j, 1 ; <i32> [#uses=2] @@ -35,14 +35,14 @@ Entry: br label %Loop ; CHECK-LABEL: @test2( ; CHECK: Entry: -; CHECK-NEXT: %.promoted = load i32* getelementptr inbounds (i32* @X, i64 1) +; CHECK-NEXT: %.promoted = load i32, i32* getelementptr inbounds (i32, i32* @X, i64 1) ; CHECK-NEXT: br label %Loop Loop: ; preds = %Loop, %0 - %X1 = getelementptr i32* @X, i64 1 ; <i32*> [#uses=1] - %A = load i32* %X1 ; <i32> [#uses=1] + %X1 = getelementptr i32, i32* @X, i64 1 ; <i32*> [#uses=1] + %A = load i32, i32* %X1 ; <i32> [#uses=1] %V = add i32 %A, 1 ; <i32> [#uses=1] - %X2 = getelementptr i32* @X, i64 1 ; <i32*> [#uses=1] + %X2 = getelementptr i32, i32* @X, i64 1 ; <i32*> [#uses=1] store i32 %V, i32* %X2 br i1 false, label %Loop, label %Exit @@ -50,7 +50,7 @@ Exit: ; preds = %Loop ret void ; CHECK: Exit: ; CHECK-NEXT: %[[LCSSAPHI:.*]] = phi i32 [ %V -; CHECK-NEXT: store i32 %[[LCSSAPHI]], i32* getelementptr inbounds (i32* @X, i64 1) +; CHECK-NEXT: store i32 %[[LCSSAPHI]], i32* getelementptr inbounds (i32, i32* @X, i64 1) ; CHECK-NEXT: ret void } @@ -61,7 +61,7 @@ define void @test3(i32 %i) { br label %Loop Loop: ; Should not promote this to a register - %x = load volatile i32* @X + %x = load volatile i32, i32* @X %x2 = add i32 %x, 1 store i32 %x2, i32* @X br i1 true, label %Out, label %Loop @@ -82,15 +82,15 @@ define void @test4(i8* %x, i8 %n) { br label %loop loop: - %tmp = getelementptr i8* %x, i64 8 + %tmp = getelementptr i8, i8* %x, i64 8 store i8* %tmp, i8** %handle2 br label %subloop subloop: %count = phi i8 [ 0, %loop ], [ %nextcount, %subloop ] - %offsetx2 = load i8** %handle2 + %offsetx2 = load i8*, i8** %handle2 store i8 %n, i8* %offsetx2 - %newoffsetx2 = getelementptr i8* %offsetx2, i64 -1 + %newoffsetx2 = getelementptr i8, i8* %offsetx2, i64 -1 store i8* %newoffsetx2, i8** %handle2 %nextcount = add i8 %count, 1 %innerexitcond = icmp sge i8 %nextcount, 8 @@ -105,14 +105,14 @@ subloop: ; CHECK: br i1 innerexit: - %offsetx1 = load i8** %handle1 - %val = load i8* %offsetx1 + %offsetx1 = load i8*, i8** %handle1 + %val = load i8, i8* %offsetx1 %cond = icmp eq i8 %val, %n br i1 %cond, label %exit, label %loop ; Should not have promoted offsetx1 loads. ; CHECK: innerexit: -; CHECK: %val = load i8* %offsetx1 +; CHECK: %val = load i8, i8* %offsetx1 ; CHECK: %cond = icmp eq i8 %val, %n ; CHECK: br i1 %cond, label %exit, label %loop @@ -125,13 +125,13 @@ Entry: br label %Loop ; CHECK-LABEL: @test5( ; CHECK: Entry: -; CHECK-NEXT: load i32* @X +; CHECK-NEXT: load i32, i32* @X ; CHECK-NEXT: br label %Loop Loop: ; preds = %Loop, %0 %j = phi i32 [ 0, %Entry ], [ %Next, %Loop ] ; <i32> [#uses=1] - %x = load i32* @X ; <i32> [#uses=1] + %x = load i32, i32* @X ; <i32> [#uses=1] %x2 = add i32 %x, 1 ; <i32> [#uses=1] store i32 %x2, i32* @X @@ -164,9 +164,9 @@ for.body.lr.ph: ; preds = %entry for.body: ; preds = %for.body.lr.ph, %for.body %storemerge2 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %idxprom = sext i32 %storemerge2 to i64 - %arrayidx = getelementptr inbounds float* %a, i64 %idxprom + %arrayidx = getelementptr inbounds float, float* %a, i64 %idxprom store float 0.000000e+00, float* %arrayidx, align 4, !tbaa !3 - %0 = load i32* %gi, align 4, !tbaa !0 + %0 = load i32, i32* %gi, align 4, !tbaa !0 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %gi, align 4, !tbaa !0 %cmp = icmp slt i32 %inc, %n @@ -179,7 +179,7 @@ for.end: ; preds = %for.cond.for.end_cr ret void ; CHECK: for.body.lr.ph: -; CHECK-NEXT: %gi.promoted = load i32* %gi, align 4, !tbaa !0 +; CHECK-NEXT: %gi.promoted = load i32, i32* %gi, align 4, !tbaa !0 ; CHECK: for.cond.for.end_crit_edge: ; CHECK-NEXT: %[[LCSSAPHI:.*]] = phi i32 [ %inc ; CHECK-NEXT: store i32 %[[LCSSAPHI]], i32* %gi, align 4, !tbaa !0 diff --git a/test/Transforms/LICM/sinking.ll b/test/Transforms/LICM/sinking.ll index d7a8fcd..02bf584 100644 --- a/test/Transforms/LICM/sinking.ll +++ b/test/Transforms/LICM/sinking.ll @@ -93,7 +93,7 @@ Entry: br label %Loop Loop: ; preds = %Loop, %Entry %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ] - %tmp.6 = load i32* @X ; <i32> [#uses=1] + %tmp.6 = load i32, i32* @X ; <i32> [#uses=1] %dec = add i32 %N_addr.0.pn, -1 ; <i32> [#uses=1] %tmp.1 = icmp ne i32 %N_addr.0.pn, 1 ; <i1> [#uses=1] br i1 %tmp.1, label %Loop, label %Out @@ -101,7 +101,7 @@ Out: ; preds = %Loop ret i32 %tmp.6 ; CHECK-LABEL: @test5( ; CHECK: Out: -; CHECK-NEXT: %tmp.6.le = load i32* @X +; CHECK-NEXT: %tmp.6.le = load i32, i32* @X ; CHECK-NEXT: ret i32 %tmp.6.le } @@ -118,15 +118,15 @@ Out: ; preds = %Loop define i32 @test6() { br label %Loop Loop: - %dead = getelementptr %Ty* @X2, i64 0, i32 0 - %sunk2 = load i32* %dead + %dead = getelementptr %Ty, %Ty* @X2, i64 0, i32 0 + %sunk2 = load i32, i32* %dead br i1 false, label %Loop, label %Out Out: ; preds = %Loop ret i32 %sunk2 ; CHECK-LABEL: @test6( ; CHECK: Out: -; CHECK-NEXT: %dead.le = getelementptr %Ty* @X2, i64 0, i32 0 -; CHECK-NEXT: %sunk2.le = load i32* %dead.le +; CHECK-NEXT: %dead.le = getelementptr %Ty, %Ty* @X2, i64 0, i32 0 +; CHECK-NEXT: %sunk2.le = load i32, i32* %dead.le ; CHECK-NEXT: ret i32 %sunk2.le } @@ -174,7 +174,7 @@ Entry: Loop: ; preds = %Cont, %Entry br i1 %C1, label %Cont, label %exit1 Cont: ; preds = %Loop - %X = load i32* %P ; <i32> [#uses=2] + %X = load i32, i32* %P ; <i32> [#uses=2] store i32 %X, i32* %Q %V = add i32 %X, 1 ; <i32> [#uses=1] br i1 %C2, label %Loop, label %exit2 @@ -242,7 +242,7 @@ Out: ; preds = %Loop define void @test11() { br label %Loop Loop: - %dead = getelementptr %Ty* @X2, i64 0, i32 0 + %dead = getelementptr %Ty, %Ty* @X2, i64 0, i32 0 br i1 false, label %Loop, label %Out Out: ret void @@ -261,36 +261,36 @@ entry: l1.header: %iv = phi i64 [ %iv.next, %l1.latch ], [ 0, %entry ] - %arrayidx.i = getelementptr inbounds [1 x i32]* @c, i64 0, i64 %iv + %arrayidx.i = getelementptr inbounds [1 x i32], [1 x i32]* @c, i64 0, i64 %iv br label %l2.header l2.header: - %x0 = load i1* %c, align 4 + %x0 = load i1, i1* %c, align 4 br i1 %x0, label %l1.latch, label %l3.preheader l3.preheader: br label %l3.header l3.header: - %x1 = load i1* %d, align 4 + %x1 = load i1, i1* %d, align 4 br i1 %x1, label %l2.latch, label %l4.preheader l4.preheader: br label %l4.header l4.header: - %x2 = load i1* %a + %x2 = load i1, i1* %a br i1 %x2, label %l3.latch, label %l4.body l4.body: call void @f(i32* %arrayidx.i) - %x3 = load i1* %b + %x3 = load i1, i1* %b %l = trunc i64 %iv to i32 br i1 %x3, label %l4.latch, label %exit l4.latch: call void @g() - %x4 = load i1* %b, align 4 + %x4 = load i1, i1* %b, align 4 br i1 %x4, label %l4.header, label %exit l3.latch: diff --git a/test/Transforms/LICM/speculate.ll b/test/Transforms/LICM/speculate.ll index 6926669..91b5a25 100644 --- a/test/Transforms/LICM/speculate.ll +++ b/test/Transforms/LICM/speculate.ll @@ -12,14 +12,14 @@ entry: for.body: ; preds = %entry, %for.inc %i.02 = phi i64 [ %inc, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %p, i64 %i.02 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %p, i64 %i.02 + %0 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %for.inc, label %if.then if.then: ; preds = %for.body %div = udiv i64 %x, 2 - %arrayidx1 = getelementptr inbounds i64* %q, i64 %i.02 + %arrayidx1 = getelementptr inbounds i64, i64* %q, i64 %i.02 store i64 %div, i64* %arrayidx1, align 8 br label %for.inc @@ -44,14 +44,14 @@ entry: for.body: ; preds = %entry, %for.inc %i.02 = phi i64 [ %inc, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %p, i64 %i.02 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %p, i64 %i.02 + %0 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %for.inc, label %if.then if.then: ; preds = %for.body %div = udiv i64 %x, %m - %arrayidx1 = getelementptr inbounds i64* %q, i64 %i.02 + %arrayidx1 = getelementptr inbounds i64, i64* %q, i64 %i.02 store i64 %div, i64* %arrayidx1, align 8 br label %for.inc @@ -78,14 +78,14 @@ entry: for.body: ; preds = %entry, %for.inc %i.02 = phi i64 [ %inc, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %p, i64 %i.02 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %p, i64 %i.02 + %0 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %for.inc, label %if.then if.then: ; preds = %for.body %div = sdiv i64 %x, 2 - %arrayidx1 = getelementptr inbounds i64* %q, i64 %i.02 + %arrayidx1 = getelementptr inbounds i64, i64* %q, i64 %i.02 store i64 %div, i64* %arrayidx1, align 8 br label %for.inc @@ -111,14 +111,14 @@ entry: for.body: ; preds = %entry, %for.inc %i.02 = phi i64 [ %inc, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %p, i64 %i.02 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %p, i64 %i.02 + %0 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %for.inc, label %if.then if.then: ; preds = %for.body %div = sdiv i64 %x, %or - %arrayidx1 = getelementptr inbounds i64* %q, i64 %i.02 + %arrayidx1 = getelementptr inbounds i64, i64* %q, i64 %i.02 store i64 %div, i64* %arrayidx1, align 8 br label %for.inc @@ -144,14 +144,14 @@ entry: for.body: ; preds = %entry, %for.inc %i.02 = phi i64 [ %inc, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %p, i64 %i.02 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %p, i64 %i.02 + %0 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %for.inc, label %if.then if.then: ; preds = %for.body %div = sdiv i64 %x, %and - %arrayidx1 = getelementptr inbounds i64* %q, i64 %i.02 + %arrayidx1 = getelementptr inbounds i64, i64* %q, i64 %i.02 store i64 %div, i64* %arrayidx1, align 8 br label %for.inc diff --git a/test/Transforms/LICM/volatile-alias.ll b/test/Transforms/LICM/volatile-alias.ll index df7f0a9..fda930d 100644 --- a/test/Transforms/LICM/volatile-alias.ll +++ b/test/Transforms/LICM/volatile-alias.ll @@ -2,9 +2,9 @@ ; The objects *p and *q are aliased to each other, but even though *q is ; volatile, *p can be considered invariant in the loop. Check if it is moved ; out of the loop. -; CHECK: load i32* %p +; CHECK: load i32, i32* %p ; CHECK: for.body: -; CHECK: load volatile i32* %q +; CHECK: load volatile i32, i32* %q target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" @@ -24,30 +24,30 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 - %1 = load i32* %n.addr, align 4 + %0 = load i32, i32* %i, align 4 + %1 = load i32, i32* %n.addr, align 4 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %2 = load i32** %p.addr, align 8 - %3 = load i32* %2, align 4 - %4 = load i32** %q.addr, align 8 - %5 = load volatile i32* %4, align 4 + %2 = load i32*, i32** %p.addr, align 8 + %3 = load i32, i32* %2, align 4 + %4 = load i32*, i32** %q.addr, align 8 + %5 = load volatile i32, i32* %4, align 4 %add = add nsw i32 %3, %5 - %6 = load i32* %s, align 4 + %6 = load i32, i32* %s, align 4 %add1 = add nsw i32 %6, %add store i32 %add1, i32* %s, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32* %s, align 4 + %8 = load i32, i32* %s, align 4 ret i32 %8 } diff --git a/test/Transforms/LoadCombine/load-combine-aa.ll b/test/Transforms/LoadCombine/load-combine-aa.ll index 3542dce..fc639c0 100644 --- a/test/Transforms/LoadCombine/load-combine-aa.ll +++ b/test/Transforms/LoadCombine/load-combine-aa.ll @@ -5,14 +5,14 @@ target triple = "x86_64-unknown-linux-gnu" define i64 @test1(i32* nocapture readonly noalias %a, i32* nocapture readonly noalias %b) { ; CHECK-LABEL: @test1 -; CHECK: load i64* +; CHECK: load i64, i64* ; CHECK: ret i64 - %load1 = load i32* %a, align 4 + %load1 = load i32, i32* %a, align 4 %conv = zext i32 %load1 to i64 - %arrayidx1 = getelementptr inbounds i32* %a, i64 1 + %arrayidx1 = getelementptr inbounds i32, i32* %a, i64 1 store i32 %load1, i32* %b, align 4 - %load2 = load i32* %arrayidx1, align 4 + %load2 = load i32, i32* %arrayidx1, align 4 %conv2 = zext i32 %load2 to i64 %shl = shl nuw i64 %conv2, 32 %add = or i64 %shl, %conv @@ -22,15 +22,15 @@ define i64 @test1(i32* nocapture readonly noalias %a, i32* nocapture readonly no define i64 @test2(i32* nocapture readonly %a, i32* nocapture readonly %b) { ; CHECK-LABEL: @test2 -; CHECK: load i32* -; CHECK: load i32* +; CHECK: load i32, i32* +; CHECK: load i32, i32* ; CHECK: ret i64 - %load1 = load i32* %a, align 4 + %load1 = load i32, i32* %a, align 4 %conv = zext i32 %load1 to i64 - %arrayidx1 = getelementptr inbounds i32* %a, i64 1 + %arrayidx1 = getelementptr inbounds i32, i32* %a, i64 1 store i32 %load1, i32* %b, align 4 - %load2 = load i32* %arrayidx1, align 4 + %load2 = load i32, i32* %arrayidx1, align 4 %conv2 = zext i32 %load2 to i64 %shl = shl nuw i64 %conv2, 32 %add = or i64 %shl, %conv diff --git a/test/Transforms/LoadCombine/load-combine-assume.ll b/test/Transforms/LoadCombine/load-combine-assume.ll index 94f6300..2d6d160 100644 --- a/test/Transforms/LoadCombine/load-combine-assume.ll +++ b/test/Transforms/LoadCombine/load-combine-assume.ll @@ -8,14 +8,14 @@ declare void @llvm.assume(i1) nounwind define i64 @test1(i32* nocapture readonly %a, i1 %b) { ; CHECK-LABEL: @test1 -; CHECK-DAG: load i64* %1, align 4 +; CHECK-DAG: load i64, i64* %1, align 4 ; CHECK-DAG: tail call void @llvm.assume(i1 %b) ; CHECK: ret i64 - %load1 = load i32* %a, align 4 + %load1 = load i32, i32* %a, align 4 %conv = zext i32 %load1 to i64 - %arrayidx1 = getelementptr inbounds i32* %a, i64 1 - %load2 = load i32* %arrayidx1, align 4 + %arrayidx1 = getelementptr inbounds i32, i32* %a, i64 1 + %load2 = load i32, i32* %arrayidx1, align 4 tail call void @llvm.assume(i1 %b) %conv2 = zext i32 %load2 to i64 %shl = shl nuw i64 %conv2, 32 @@ -27,15 +27,15 @@ define i64 @test1(i32* nocapture readonly %a, i1 %b) { define i64 @test2(i32* nocapture readonly %a, i1 %b) { ; CHECK-LABEL: @test2 -; CHECK-DAG: load i64* %1, align 4 +; CHECK-DAG: load i64, i64* %1, align 4 ; CHECK-DAG: tail call void @llvm.assume(i1 %b) ; CHECK: ret i64 - %load1 = load i32* %a, align 4 + %load1 = load i32, i32* %a, align 4 %conv = zext i32 %load1 to i64 - %arrayidx1 = getelementptr inbounds i32* %a, i64 1 + %arrayidx1 = getelementptr inbounds i32, i32* %a, i64 1 tail call void @llvm.assume(i1 %b) - %load2 = load i32* %arrayidx1, align 4 + %load2 = load i32, i32* %arrayidx1, align 4 %conv2 = zext i32 %load2 to i64 %shl = shl nuw i64 %conv2, 32 %add = or i64 %shl, %conv diff --git a/test/Transforms/LoadCombine/load-combine.ll b/test/Transforms/LoadCombine/load-combine.ll index c4d9241..d506878 100644 --- a/test/Transforms/LoadCombine/load-combine.ll +++ b/test/Transforms/LoadCombine/load-combine.ll @@ -6,138 +6,138 @@ target triple = "x86_64-unknown-linux-gnu" ; Combine read from char* idiom. define i64 @LoadU64_x64_0(i64* %pData) { %1 = bitcast i64* %pData to i8* - %2 = load i8* %1, align 1 + %2 = load i8, i8* %1, align 1 %3 = zext i8 %2 to i64 %4 = shl nuw i64 %3, 56 - %5 = getelementptr inbounds i8* %1, i64 1 - %6 = load i8* %5, align 1 + %5 = getelementptr inbounds i8, i8* %1, i64 1 + %6 = load i8, i8* %5, align 1 %7 = zext i8 %6 to i64 %8 = shl nuw nsw i64 %7, 48 %9 = or i64 %8, %4 - %10 = getelementptr inbounds i8* %1, i64 2 - %11 = load i8* %10, align 1 + %10 = getelementptr inbounds i8, i8* %1, i64 2 + %11 = load i8, i8* %10, align 1 %12 = zext i8 %11 to i64 %13 = shl nuw nsw i64 %12, 40 %14 = or i64 %9, %13 - %15 = getelementptr inbounds i8* %1, i64 3 - %16 = load i8* %15, align 1 + %15 = getelementptr inbounds i8, i8* %1, i64 3 + %16 = load i8, i8* %15, align 1 %17 = zext i8 %16 to i64 %18 = shl nuw nsw i64 %17, 32 %19 = or i64 %14, %18 - %20 = getelementptr inbounds i8* %1, i64 4 - %21 = load i8* %20, align 1 + %20 = getelementptr inbounds i8, i8* %1, i64 4 + %21 = load i8, i8* %20, align 1 %22 = zext i8 %21 to i64 %23 = shl nuw nsw i64 %22, 24 %24 = or i64 %19, %23 - %25 = getelementptr inbounds i8* %1, i64 5 - %26 = load i8* %25, align 1 + %25 = getelementptr inbounds i8, i8* %1, i64 5 + %26 = load i8, i8* %25, align 1 %27 = zext i8 %26 to i64 %28 = shl nuw nsw i64 %27, 16 %29 = or i64 %24, %28 - %30 = getelementptr inbounds i8* %1, i64 6 - %31 = load i8* %30, align 1 + %30 = getelementptr inbounds i8, i8* %1, i64 6 + %31 = load i8, i8* %30, align 1 %32 = zext i8 %31 to i64 %33 = shl nuw nsw i64 %32, 8 %34 = or i64 %29, %33 - %35 = getelementptr inbounds i8* %1, i64 7 - %36 = load i8* %35, align 1 + %35 = getelementptr inbounds i8, i8* %1, i64 7 + %36 = load i8, i8* %35, align 1 %37 = zext i8 %36 to i64 %38 = or i64 %34, %37 ret i64 %38 ; CHECK-LABEL: @LoadU64_x64_0( -; CHECK: load i64* %{{.*}}, align 1 +; CHECK: load i64, i64* %{{.*}}, align 1 ; CHECK-NOT: load } ; Combine simple adjacent loads. define i32 @"2xi16_i32"(i16* %x) { - %1 = load i16* %x, align 2 - %2 = getelementptr inbounds i16* %x, i64 1 - %3 = load i16* %2, align 2 + %1 = load i16, i16* %x, align 2 + %2 = getelementptr inbounds i16, i16* %x, i64 1 + %3 = load i16, i16* %2, align 2 %4 = zext i16 %3 to i32 %5 = shl nuw i32 %4, 16 %6 = zext i16 %1 to i32 %7 = or i32 %5, %6 ret i32 %7 ; CHECK-LABEL: @"2xi16_i32"( -; CHECK: load i32* %{{.*}}, align 2 +; CHECK: load i32, i32* %{{.*}}, align 2 ; CHECK-NOT: load } ; Don't combine loads across stores. define i32 @"2xi16_i32_store"(i16* %x, i16* %y) { - %1 = load i16* %x, align 2 + %1 = load i16, i16* %x, align 2 store i16 0, i16* %y, align 2 - %2 = getelementptr inbounds i16* %x, i64 1 - %3 = load i16* %2, align 2 + %2 = getelementptr inbounds i16, i16* %x, i64 1 + %3 = load i16, i16* %2, align 2 %4 = zext i16 %3 to i32 %5 = shl nuw i32 %4, 16 %6 = zext i16 %1 to i32 %7 = or i32 %5, %6 ret i32 %7 ; CHECK-LABEL: @"2xi16_i32_store"( -; CHECK: load i16* %{{.*}}, align 2 +; CHECK: load i16, i16* %{{.*}}, align 2 ; CHECK: store -; CHECK: load i16* %{{.*}}, align 2 +; CHECK: load i16, i16* %{{.*}}, align 2 } ; Don't combine loads with a gap. define i32 @"2xi16_i32_gap"(i16* %x) { - %1 = load i16* %x, align 2 - %2 = getelementptr inbounds i16* %x, i64 2 - %3 = load i16* %2, align 2 + %1 = load i16, i16* %x, align 2 + %2 = getelementptr inbounds i16, i16* %x, i64 2 + %3 = load i16, i16* %2, align 2 %4 = zext i16 %3 to i32 %5 = shl nuw i32 %4, 16 %6 = zext i16 %1 to i32 %7 = or i32 %5, %6 ret i32 %7 ; CHECK-LABEL: @"2xi16_i32_gap"( -; CHECK: load i16* %{{.*}}, align 2 -; CHECK: load i16* %{{.*}}, align 2 +; CHECK: load i16, i16* %{{.*}}, align 2 +; CHECK: load i16, i16* %{{.*}}, align 2 } ; Combine out of order loads. define i32 @"2xi16_i32_order"(i16* %x) { - %1 = getelementptr inbounds i16* %x, i64 1 - %2 = load i16* %1, align 2 + %1 = getelementptr inbounds i16, i16* %x, i64 1 + %2 = load i16, i16* %1, align 2 %3 = zext i16 %2 to i32 - %4 = load i16* %x, align 2 + %4 = load i16, i16* %x, align 2 %5 = shl nuw i32 %3, 16 %6 = zext i16 %4 to i32 %7 = or i32 %5, %6 ret i32 %7 ; CHECK-LABEL: @"2xi16_i32_order"( -; CHECK: load i32* %{{.*}}, align 2 +; CHECK: load i32, i32* %{{.*}}, align 2 ; CHECK-NOT: load } ; Overlapping loads. define i32 @"2xi16_i32_overlap"(i8* %x) { %1 = bitcast i8* %x to i16* - %2 = load i16* %1, align 2 - %3 = getelementptr inbounds i8* %x, i64 1 + %2 = load i16, i16* %1, align 2 + %3 = getelementptr inbounds i8, i8* %x, i64 1 %4 = bitcast i8* %3 to i16* - %5 = load i16* %4, align 2 + %5 = load i16, i16* %4, align 2 %6 = zext i16 %5 to i32 %7 = shl nuw i32 %6, 16 %8 = zext i16 %2 to i32 %9 = or i32 %7, %8 ret i32 %9 ; CHECK-LABEL: @"2xi16_i32_overlap"( -; CHECK: load i16* %{{.*}}, align 2 -; CHECK: load i16* %{{.*}}, align 2 +; CHECK: load i16, i16* %{{.*}}, align 2 +; CHECK: load i16, i16* %{{.*}}, align 2 } ; Combine valid alignments. define i64 @"2xi16_i64_align"(i8* %x) { %1 = bitcast i8* %x to i32* - %2 = load i32* %1, align 4 - %3 = getelementptr inbounds i8* %x, i64 4 + %2 = load i32, i32* %1, align 4 + %3 = getelementptr inbounds i8, i8* %x, i64 4 %4 = bitcast i8* %3 to i16* - %5 = load i16* %4, align 2 - %6 = getelementptr inbounds i8* %x, i64 6 + %5 = load i16, i16* %4, align 2 + %6 = getelementptr inbounds i8, i8* %x, i64 6 %7 = bitcast i8* %6 to i16* - %8 = load i16* %7, align 2 + %8 = load i16, i16* %7, align 2 %9 = zext i16 %8 to i64 %10 = shl nuw i64 %9, 48 %11 = zext i16 %5 to i64 @@ -147,44 +147,44 @@ define i64 @"2xi16_i64_align"(i8* %x) { %15 = or i64 %14, %10 ret i64 %15 ; CHECK-LABEL: @"2xi16_i64_align"( -; CHECK: load i64* %{{.*}}, align 4 +; CHECK: load i64, i64* %{{.*}}, align 4 } ; Non power of two. define i64 @"2xi16_i64_npo2"(i8* %x) { - %1 = load i8* %x, align 1 + %1 = load i8, i8* %x, align 1 %2 = zext i8 %1 to i64 - %3 = getelementptr inbounds i8* %x, i64 1 - %4 = load i8* %3, align 1 + %3 = getelementptr inbounds i8, i8* %x, i64 1 + %4 = load i8, i8* %3, align 1 %5 = zext i8 %4 to i64 %6 = shl nuw nsw i64 %5, 8 %7 = or i64 %6, %2 - %8 = getelementptr inbounds i8* %x, i64 2 - %9 = load i8* %8, align 1 + %8 = getelementptr inbounds i8, i8* %x, i64 2 + %9 = load i8, i8* %8, align 1 %10 = zext i8 %9 to i64 %11 = shl nuw nsw i64 %10, 16 %12 = or i64 %11, %7 - %13 = getelementptr inbounds i8* %x, i64 3 - %14 = load i8* %13, align 1 + %13 = getelementptr inbounds i8, i8* %x, i64 3 + %14 = load i8, i8* %13, align 1 %15 = zext i8 %14 to i64 %16 = shl nuw nsw i64 %15, 24 %17 = or i64 %16, %12 - %18 = getelementptr inbounds i8* %x, i64 4 - %19 = load i8* %18, align 1 + %18 = getelementptr inbounds i8, i8* %x, i64 4 + %19 = load i8, i8* %18, align 1 %20 = zext i8 %19 to i64 %21 = shl nuw nsw i64 %20, 32 %22 = or i64 %21, %17 - %23 = getelementptr inbounds i8* %x, i64 5 - %24 = load i8* %23, align 1 + %23 = getelementptr inbounds i8, i8* %x, i64 5 + %24 = load i8, i8* %23, align 1 %25 = zext i8 %24 to i64 %26 = shl nuw nsw i64 %25, 40 %27 = or i64 %26, %22 - %28 = getelementptr inbounds i8* %x, i64 6 - %29 = load i8* %28, align 1 + %28 = getelementptr inbounds i8, i8* %x, i64 6 + %29 = load i8, i8* %28, align 1 %30 = zext i8 %29 to i64 %31 = shl nuw nsw i64 %30, 48 %32 = or i64 %31, %27 ret i64 %32 ; CHECK-LABEL: @"2xi16_i64_npo2"( -; CHECK: load i32* %{{.*}}, align 1 +; CHECK: load i32, i32* %{{.*}}, align 1 } diff --git a/test/Transforms/LoopDeletion/2008-05-06-Phi.ll b/test/Transforms/LoopDeletion/2008-05-06-Phi.ll index ff6a30d..fcf5ede 100644 --- a/test/Transforms/LoopDeletion/2008-05-06-Phi.ll +++ b/test/Transforms/LoopDeletion/2008-05-06-Phi.ll @@ -23,7 +23,7 @@ declare %struct.BF_PartHolder* @BF_addElement(%struct.BF_PartHolder*, %struct.BF define %struct.BF_PartHolder* @BF_addEntry(%struct.BF_PartHolder* %thePH, i32 %value, i32 %length) nounwind { entry: %myElement = alloca %struct.BF_BitstreamElement ; <%struct.BF_BitstreamElement*> [#uses=2] - %tmp1 = getelementptr %struct.BF_BitstreamElement* %myElement, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp1 = getelementptr %struct.BF_BitstreamElement, %struct.BF_BitstreamElement* %myElement, i32 0, i32 0 ; <i32*> [#uses=1] store i32 %value, i32* %tmp1, align 8 %tmp7 = icmp eq i32 %length, 0 ; <i1> [#uses=1] br i1 %tmp7, label %bb13, label %bb @@ -44,15 +44,15 @@ entry: define internal fastcc void @encodeMainData(%struct.lame_global_flags* %gfp, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %si, [2 x %struct.III_scalefac_t]* %scalefac) nounwind { entry: - %tmp69 = getelementptr %struct.lame_global_flags* %gfp, i32 0, i32 43 ; <i32*> [#uses=1] - %tmp70 = load i32* %tmp69, align 4 ; <i32> [#uses=1] + %tmp69 = getelementptr %struct.lame_global_flags, %struct.lame_global_flags* %gfp, i32 0, i32 43 ; <i32*> [#uses=1] + %tmp70 = load i32, i32* %tmp69, align 4 ; <i32> [#uses=1] %tmp71 = icmp eq i32 %tmp70, 1 ; <i1> [#uses=1] br i1 %tmp71, label %bb352, label %bb498 bb113: ; preds = %bb132 - %tmp123 = getelementptr [2 x %struct.III_scalefac_t]* %scalefac, i32 0, i32 0, i32 1, i32 %sfb.0, i32 %window.0 ; <i32*> [#uses=1] - %tmp124 = load i32* %tmp123, align 4 ; <i32> [#uses=1] - %tmp126 = load %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1] + %tmp123 = getelementptr [2 x %struct.III_scalefac_t], [2 x %struct.III_scalefac_t]* %scalefac, i32 0, i32 0, i32 1, i32 %sfb.0, i32 %window.0 ; <i32*> [#uses=1] + %tmp124 = load i32, i32* %tmp123, align 4 ; <i32> [#uses=1] + %tmp126 = load %struct.BF_PartHolder*, %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1] %tmp128 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp126, i32 %tmp124, i32 %tmp93 ) nounwind ; <%struct.BF_PartHolder*> [#uses=1] store %struct.BF_PartHolder* %tmp128, %struct.BF_PartHolder** %tmp80, align 4 %tmp131 = add i32 %window.0, 1 ; <i32> [#uses=1] @@ -73,7 +73,7 @@ bb140: ; preds = %bb341, %bb137 br i1 %tmp142, label %bb132, label %bb174 bb166: ; preds = %bb174 - %tmp160 = load %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1] + %tmp160 = load %struct.BF_PartHolder*, %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1] %tmp162 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp160, i32 0, i32 0 ) nounwind ; <%struct.BF_PartHolder*> [#uses=0] unreachable @@ -82,9 +82,9 @@ bb174: ; preds = %bb140 br i1 %tmp176, label %bb166, label %bb341 bb341: ; preds = %bb352, %bb174 - %tmp80 = getelementptr [2 x [2 x %struct.BF_PartHolder*]]* @scaleFactorsPH, i32 0, i32 0, i32 0 ; <%struct.BF_PartHolder**> [#uses=3] - %tmp92 = getelementptr [16 x i32]* @slen1_tab, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp93 = load i32* %tmp92, align 4 ; <i32> [#uses=1] + %tmp80 = getelementptr [2 x [2 x %struct.BF_PartHolder*]], [2 x [2 x %struct.BF_PartHolder*]]* @scaleFactorsPH, i32 0, i32 0, i32 0 ; <%struct.BF_PartHolder**> [#uses=3] + %tmp92 = getelementptr [16 x i32], [16 x i32]* @slen1_tab, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp93 = load i32, i32* %tmp92, align 4 ; <i32> [#uses=1] br label %bb140 bb352: ; preds = %entry diff --git a/test/Transforms/LoopIdiom/basic-address-space.ll b/test/Transforms/LoopIdiom/basic-address-space.ll index 697ab37..67cabf3 100644 --- a/test/Transforms/LoopIdiom/basic-address-space.ll +++ b/test/Transforms/LoopIdiom/basic-address-space.ll @@ -22,7 +22,7 @@ for.body5: ; preds = %for.body5, %bb.nph %j.02 = phi i16 [ 0, %bb.nph ], [ %inc, %for.body5 ] %mul = mul nsw i16 %i.04, 100 %add = add nsw i16 %j.02, %mul - %arrayidx = getelementptr inbounds i8 addrspace(2)* %X, i16 %add + %arrayidx = getelementptr inbounds i8, i8 addrspace(2)* %X, i16 %add store i8 0, i8 addrspace(2)* %arrayidx, align 1 %inc = add nsw i16 %j.02, 1 %cmp4 = icmp eq i16 %inc, 100 @@ -45,7 +45,7 @@ entry: for.body: ; preds = %entry, %for.body %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ] - %arrayidx = getelementptr i32 addrspace(2)* %P, i64 %indvar + %arrayidx = getelementptr i32, i32 addrspace(2)* %P, i64 %indvar store i32 1, i32 addrspace(2)* %arrayidx, align 4 %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, 10000 @@ -74,18 +74,18 @@ for.body: ; preds = %for.inc, %for.body. %tmp5 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %add = add nsw i32 %tmp5, 4 %idxprom = sext i32 %add to i64 - %arrayidx = getelementptr inbounds [7 x i32] addrspace(2)* @g_50, i32 0, i64 %idxprom - %tmp2 = load i32 addrspace(2)* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [7 x i32], [7 x i32] addrspace(2)* @g_50, i32 0, i64 %idxprom + %tmp2 = load i32, i32 addrspace(2)* %arrayidx, align 4 %add4 = add nsw i32 %tmp5, 5 %idxprom5 = sext i32 %add4 to i64 - %arrayidx6 = getelementptr inbounds [7 x i32] addrspace(2)* @g_50, i32 0, i64 %idxprom5 + %arrayidx6 = getelementptr inbounds [7 x i32], [7 x i32] addrspace(2)* @g_50, i32 0, i64 %idxprom5 store i32 %tmp2, i32 addrspace(2)* %arrayidx6, align 4 %inc = add nsw i32 %tmp5, 1 %cmp = icmp slt i32 %inc, 2 br i1 %cmp, label %for.body, label %for.end for.end: ; preds = %for.inc - %tmp8 = load i32 addrspace(2)* getelementptr inbounds ([7 x i32] addrspace(2)* @g_50, i32 0, i64 6), align 4 + %tmp8 = load i32, i32 addrspace(2)* getelementptr inbounds ([7 x i32], [7 x i32] addrspace(2)* @g_50, i32 0, i64 6), align 4 ret i32 %tmp8 } diff --git a/test/Transforms/LoopIdiom/basic.ll b/test/Transforms/LoopIdiom/basic.ll index 835a9f6..488cffc 100644 --- a/test/Transforms/LoopIdiom/basic.ll +++ b/test/Transforms/LoopIdiom/basic.ll @@ -1,5 +1,12 @@ ; RUN: opt -basicaa -loop-idiom < %s -S | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" + +; For @test11_pattern +; CHECK: @.memset_pattern = private unnamed_addr constant [4 x i32] [i32 1, i32 1, i32 1, i32 1] + +; For @test13_pattern +; CHECK: @.memset_pattern1 = private unnamed_addr constant [2 x i32*] [i32* @G, i32* @G] + target triple = "x86_64-apple-darwin10.0.0" define void @test1(i8* %Base, i64 %Size) nounwind ssp { @@ -8,7 +15,7 @@ bb.nph: ; preds = %entry for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %I.0.014 = getelementptr i8* %Base, i64 %indvar + %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar store i8 0, i8* %I.0.014, align 1 %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, %Size @@ -29,7 +36,7 @@ bb.nph: ; preds = %entry for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body.cont ] - %I.0.014 = getelementptr i8* %Base, i64 %indvar + %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar store i8 0, i8* %I.0.014, align 1 %indvar.next = add i64 %indvar, 1 br label %for.body.cont @@ -52,7 +59,7 @@ entry: for.body: ; preds = %entry, %for.body %i.011 = phi i64 [ %inc, %for.body ], [ 0, %entry ] - %add.ptr.i = getelementptr i32* %Base, i64 %i.011 + %add.ptr.i = getelementptr i32, i32* %Base, i64 %i.011 store i32 16843009, i32* %add.ptr.i, align 4 %inc = add nsw i64 %i.011, 1 %exitcond = icmp eq i64 %inc, %Size @@ -75,7 +82,7 @@ entry: for.body: ; preds = %entry, %for.body %i.011 = phi i64 [ %inc, %for.body ], [ 0, %entry ] - %add.ptr.i = getelementptr i32* %Base, i64 %i.011 + %add.ptr.i = getelementptr i32, i32* %Base, i64 %i.011 store i32 16843009, i32* %add.ptr.i, align 4 store i8 42, i8* %MayAlias @@ -94,12 +101,12 @@ for.end: ; preds = %entry ;; TODO: We should be able to promote this memset. Not yet though. define void @test4(i8* %Base) nounwind ssp { bb.nph: ; preds = %entry - %Base100 = getelementptr i8* %Base, i64 1000 + %Base100 = getelementptr i8, i8* %Base, i64 1000 br label %for.body for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %I.0.014 = getelementptr i8* %Base, i64 %indvar + %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar store i8 0, i8* %I.0.014, align 1 ;; Store beyond the range memset, should be safe to promote. @@ -123,7 +130,7 @@ bb.nph: ; preds = %entry for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %I.0.014 = getelementptr i8* %Base, i64 %indvar + %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar %V = trunc i64 %indvar to i8 store i8 %V, i8* %I.0.014, align 1 @@ -148,9 +155,9 @@ bb.nph: for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %I.0.014 = getelementptr i8* %Base, i64 %indvar - %DestI = getelementptr i8* %Dest, i64 %indvar - %V = load i8* %I.0.014, align 1 + %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar + %DestI = getelementptr i8, i8* %Dest, i64 %indvar + %V = load i8, i8* %I.0.014, align 1 store i8 %V, i8* %DestI, align 1 %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, %Size @@ -175,7 +182,7 @@ for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body.cont ] br label %for.body.cont for.body.cont: - %I.0.014 = getelementptr i8* %Base, i64 %indvar + %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar store i8 0, i8* %I.0.014, align 1 %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, %Size @@ -195,7 +202,7 @@ bb.nph: ; preds = %entry for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %PI = getelementptr i64* %Ptr, i64 %indvar + %PI = getelementptr i64, i64* %Ptr, i64 %indvar store i64 0, i64 *%PI %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, 1 @@ -221,9 +228,9 @@ bb.nph: for.body: ; preds = %bb.nph, %for.body %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %I.0.014 = getelementptr i8* %Base, i64 %indvar - %DestI = getelementptr i8* %Dest, i64 %indvar - %V = load i8* %I.0.014, align 1 + %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar + %DestI = getelementptr i8, i8* %Dest, i64 %indvar + %V = load i8, i8* %I.0.014, align 1 store i8 %V, i8* %DestI, align 1 ;; This store can clobber the input. @@ -254,7 +261,7 @@ for.body5: ; preds = %for.body5, %bb.nph %mul = mul nsw i32 %i.04, 100 %add = add nsw i32 %j.02, %mul %idxprom = sext i32 %add to i64 - %arrayidx = getelementptr inbounds i8* %X, i64 %idxprom + %arrayidx = getelementptr inbounds i8, i8* %X, i64 %idxprom store i8 0, i8* %arrayidx, align 1 %inc = add nsw i32 %j.02, 1 %cmp4 = icmp eq i32 %inc, 100 @@ -283,7 +290,7 @@ entry: for.body: ; preds = %entry, %for.body %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ] - %arrayidx = getelementptr i32* %P, i64 %indvar + %arrayidx = getelementptr i32, i32* %P, i64 %indvar store i32 1, i32* %arrayidx, align 4 %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, 10000 @@ -306,7 +313,7 @@ entry: for.body: ; preds = %entry, %for.body %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ] - %arrayidx = getelementptr i32** %P, i64 %indvar + %arrayidx = getelementptr i32*, i32** %P, i64 %indvar store i32* null, i32** %arrayidx, align 4 %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, 10000 @@ -332,7 +339,7 @@ entry: for.body: ; preds = %entry, %for.body %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ] - %arrayidx = getelementptr i32** %P, i64 %indvar + %arrayidx = getelementptr i32*, i32** %P, i64 %indvar store i32* @G, i32** %arrayidx, align 4 %indvar.next = add i64 %indvar, 1 %exitcond = icmp eq i64 %indvar.next, 10000 @@ -362,18 +369,18 @@ for.body: ; preds = %for.inc, %for.body. %tmp5 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %add = add nsw i32 %tmp5, 4 %idxprom = sext i32 %add to i64 - %arrayidx = getelementptr inbounds [7 x i32]* @g_50, i32 0, i64 %idxprom - %tmp2 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [7 x i32], [7 x i32]* @g_50, i32 0, i64 %idxprom + %tmp2 = load i32, i32* %arrayidx, align 4 %add4 = add nsw i32 %tmp5, 5 %idxprom5 = sext i32 %add4 to i64 - %arrayidx6 = getelementptr inbounds [7 x i32]* @g_50, i32 0, i64 %idxprom5 + %arrayidx6 = getelementptr inbounds [7 x i32], [7 x i32]* @g_50, i32 0, i64 %idxprom5 store i32 %tmp2, i32* %arrayidx6, align 4 %inc = add nsw i32 %tmp5, 1 %cmp = icmp slt i32 %inc, 2 br i1 %cmp, label %for.body, label %for.end for.end: ; preds = %for.inc - %tmp8 = load i32* getelementptr inbounds ([7 x i32]* @g_50, i32 0, i64 6), align 4 + %tmp8 = load i32, i32* getelementptr inbounds ([7 x i32], [7 x i32]* @g_50, i32 0, i64 6), align 4 ret i32 %tmp8 ; CHECK-LABEL: @test14( ; CHECK: for.body: @@ -393,7 +400,7 @@ define void @PR14241(i32* %s, i64 %size) { entry: %end.idx = add i64 %size, -1 - %end.ptr = getelementptr inbounds i32* %s, i64 %end.idx + %end.ptr = getelementptr inbounds i32, i32* %s, i64 %end.idx br label %while.body ; CHECK-NOT: memcpy ; @@ -403,13 +410,13 @@ entry: while.body: %phi.ptr = phi i32* [ %s, %entry ], [ %next.ptr, %while.body ] - %src.ptr = getelementptr inbounds i32* %phi.ptr, i64 1 - %val = load i32* %src.ptr, align 4 + %src.ptr = getelementptr inbounds i32, i32* %phi.ptr, i64 1 + %val = load i32, i32* %src.ptr, align 4 ; CHECK: load - %dst.ptr = getelementptr inbounds i32* %phi.ptr, i64 0 + %dst.ptr = getelementptr inbounds i32, i32* %phi.ptr, i64 0 store i32 %val, i32* %dst.ptr, align 4 ; CHECK: store - %next.ptr = getelementptr inbounds i32* %phi.ptr, i64 1 + %next.ptr = getelementptr inbounds i32, i32* %phi.ptr, i64 1 %cmp = icmp eq i32* %next.ptr, %end.ptr br i1 %cmp, label %exit, label %while.body diff --git a/test/Transforms/LoopIdiom/crash.ll b/test/Transforms/LoopIdiom/crash.ll index 969adbc..c964aac 100644 --- a/test/Transforms/LoopIdiom/crash.ll +++ b/test/Transforms/LoopIdiom/crash.ll @@ -8,13 +8,13 @@ define void @test1(i64* %iwork, i64 %x) { bb0: %mul116 = mul nsw i64 %x, %x %incdec.ptr6.sum175 = add i64 42, %x - %arrayidx135 = getelementptr inbounds i64* %iwork, i64 %incdec.ptr6.sum175 + %arrayidx135 = getelementptr inbounds i64, i64* %iwork, i64 %incdec.ptr6.sum175 br label %bb1 bb1: %storemerge4226 = phi i64 [ 0, %bb0 ], [ %inc139, %bb1 ] store i64 1, i64* %arrayidx135, align 8 %incdec.ptr6.sum176 = add i64 %mul116, %storemerge4226 - %arrayidx137 = getelementptr inbounds i64* %iwork, i64 %incdec.ptr6.sum176 + %arrayidx137 = getelementptr inbounds i64, i64* %iwork, i64 %incdec.ptr6.sum176 store i64 1, i64* %arrayidx137, align 8 %inc139 = add nsw i64 %storemerge4226, 1 %cmp131 = icmp sgt i64 %storemerge4226, 42 diff --git a/test/Transforms/LoopIdiom/debug-line.ll b/test/Transforms/LoopIdiom/debug-line.ll index 863df3c..84bfafd 100644 --- a/test/Transforms/LoopIdiom/debug-line.ll +++ b/test/Transforms/LoopIdiom/debug-line.ll @@ -5,13 +5,13 @@ target triple = "x86_64-apple-darwin10.0.0" define void @foo(double* nocapture %a) nounwind ssp { entry: - tail call void @llvm.dbg.value(metadata double* %a, i64 0, metadata !5, metadata !{}), !dbg !8 - tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !10, metadata !{}), !dbg !14 + tail call void @llvm.dbg.value(metadata double* %a, i64 0, metadata !5, metadata !MDExpression()), !dbg !8 + tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !10, metadata !MDExpression()), !dbg !14 br label %for.body for.body: ; preds = %entry, %for.body %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.body ] - %arrayidx = getelementptr double* %a, i64 %indvar + %arrayidx = getelementptr double, double* %a, i64 %indvar ; CHECK: call void @llvm.memset{{.+}} !dbg store double 0.000000e+00, double* %arrayidx, align 8, !dbg !15 %indvar.next = add i64 %indvar, 1 @@ -19,7 +19,7 @@ for.body: ; preds = %entry, %for.body br i1 %exitcond, label %for.body, label %for.end, !dbg !14 for.end: ; preds = %for.body - tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !10, metadata !{}), !dbg !16 + tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !10, metadata !MDExpression()), !dbg !16 ret void, !dbg !17 } @@ -30,23 +30,23 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.module.flags = !{!19} !llvm.dbg.sp = !{!0} -!0 = !{!"0x2e\00foo\00foo\00\002\000\001\000\006\00256\000\000", !18, !1, !3, null, void (double*)* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 0] [foo] -!1 = !{!"0x29", !18} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00clang version 2.9 (trunk 127165:127174)\001\00\000\00\000", !18, !9, !9, null, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !18, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !18, scope: !1, type: !3, function: void (double*)* @foo) +!1 = !MDFile(filename: "li.c", directory: "/private/tmp") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 127165:127174)", isOptimized: true, emissionKind: 0, file: !18, enums: !9, retainedTypes: !9) +!3 = !MDSubroutineType(types: !4) !4 = !{null} -!5 = !{!"0x101\00a\0016777218\000", !0, !1, !6} ; [ DW_TAG_arg_variable ] -!6 = !{!"0xf\00\000\0064\0064\000\000", null, !2, !7} ; [ DW_TAG_pointer_type ] -!7 = !{!"0x24\00double\000\0064\0064\000\000\004", null, !2} ; [ DW_TAG_base_type ] +!5 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 2, arg: 1, scope: !0, file: !1, type: !6) +!6 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !7) +!7 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) !8 = !MDLocation(line: 2, column: 18, scope: !0) !9 = !{i32 0} -!10 = !{!"0x100\00i\003\000", !11, !1, !13} ; [ DW_TAG_auto_variable ] -!11 = !{!"0xb\003\003\001", !18, !12} ; [ DW_TAG_lexical_block ] -!12 = !{!"0xb\002\0021\000", !18, !0} ; [ DW_TAG_lexical_block ] -!13 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !2} ; [ DW_TAG_base_type ] +!10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 3, scope: !11, file: !1, type: !13) +!11 = distinct !MDLexicalBlock(line: 3, column: 3, file: !18, scope: !12) +!12 = distinct !MDLexicalBlock(line: 2, column: 21, file: !18, scope: !0) +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !14 = !MDLocation(line: 3, column: 3, scope: !12) !15 = !MDLocation(line: 4, column: 5, scope: !11) !16 = !MDLocation(line: 3, column: 29, scope: !11) !17 = !MDLocation(line: 5, column: 1, scope: !12) -!18 = !{!"li.c", !"/private/tmp"} -!19 = !{i32 1, !"Debug Info Version", i32 2} +!18 = !MDFile(filename: "li.c", directory: "/private/tmp") +!19 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/LoopIdiom/memset_noidiom.ll b/test/Transforms/LoopIdiom/memset_noidiom.ll index f2b55ae..f039d99 100644 --- a/test/Transforms/LoopIdiom/memset_noidiom.ll +++ b/test/Transforms/LoopIdiom/memset_noidiom.ll @@ -15,7 +15,7 @@ for.body.lr.ph: ; preds = %entry for.body: ; preds = %for.body.lr.ph, %for.body %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.body ] - %p.02 = getelementptr i8* %b, i64 %indvar + %p.02 = getelementptr i8, i8* %b, i64 %indvar store i8 %conv6, i8* %p.02, align 1 %indvar.next = add i64 %indvar, 1 %exitcond = icmp ne i64 %indvar.next, %len diff --git a/test/Transforms/LoopIdiom/non-canonical-loop.ll b/test/Transforms/LoopIdiom/non-canonical-loop.ll index a6a4f92..77c818f 100644 --- a/test/Transforms/LoopIdiom/non-canonical-loop.ll +++ b/test/Transforms/LoopIdiom/non-canonical-loop.ll @@ -20,7 +20,7 @@ start.exit: ; preds = %entry for.bodyprime: ; preds = %for.bodyprime, %start.exit %i.057375 = phi i32 [ 0, %start.exit ], [ %1, %for.bodyprime ] - %arrayidx8prime = getelementptr inbounds i32* %currMB, i32 %i.057375 + %arrayidx8prime = getelementptr inbounds i32, i32* %currMB, i32 %i.057375 store i32 0, i32* %arrayidx8prime, align 4 %1 = add i32 %i.057375, 1 %cmp5prime = icmp slt i32 %1, 4 diff --git a/test/Transforms/LoopIdiom/scev-invalidation.ll b/test/Transforms/LoopIdiom/scev-invalidation.ll index a244d9a..2fe8a30 100644 --- a/test/Transforms/LoopIdiom/scev-invalidation.ll +++ b/test/Transforms/LoopIdiom/scev-invalidation.ll @@ -11,7 +11,7 @@ for.cond: ; preds = %for.inc, %entry %backslashes.0 = phi i32 [ undef, %entry ], [ %backslashes.2, %for.inc ] %p.0 = phi i8* [ undef, %entry ], [ %incdec.ptr3, %for.inc ] %q.0 = phi i8* [ undef, %entry ], [ %q.2, %for.inc ] - %0 = load i8* %p.0, align 1 + %0 = load i8, i8* %p.0, align 1 switch i8 %0, label %while.cond.preheader [ i8 0, label %for.cond4.preheader i8 92, label %for.inc @@ -36,7 +36,7 @@ for.body6.lr.ph: ; preds = %for.cond4.preheader while.body: ; preds = %while.body.lr.ph, %while.body %q.112 = phi i8* [ %q.0, %while.body.lr.ph ], [ %incdec.ptr, %while.body ] %backslashes.111 = phi i32 [ %backslashes.0, %while.body.lr.ph ], [ %dec, %while.body ] - %incdec.ptr = getelementptr inbounds i8* %q.112, i64 1 + %incdec.ptr = getelementptr inbounds i8, i8* %q.112, i64 1 store i8 92, i8* %incdec.ptr, align 1 %dec = add nsw i32 %backslashes.111, -1 %tobool2 = icmp eq i32 %dec, 0 @@ -44,7 +44,7 @@ while.body: ; preds = %while.body.lr.ph, % while.cond.for.inc.loopexit_crit_edge: ; preds = %while.body %scevgep.sum = add i64 %2, 1 - %scevgep13 = getelementptr i8* %q.0, i64 %scevgep.sum + %scevgep13 = getelementptr i8, i8* %q.0, i64 %scevgep.sum br label %for.inc.loopexit for.inc.loopexit: ; preds = %while.cond.for.inc.loopexit_crit_edge, %while.cond.preheader @@ -54,13 +54,13 @@ for.inc.loopexit: ; preds = %while.cond.for.inc. for.inc: ; preds = %for.inc.loopexit, %for.cond %backslashes.2 = phi i32 [ %backslashes.0, %for.cond ], [ 0, %for.inc.loopexit ] %q.2 = phi i8* [ %q.0, %for.cond ], [ %q.1.lcssa, %for.inc.loopexit ] - %incdec.ptr3 = getelementptr inbounds i8* %p.0, i64 1 + %incdec.ptr3 = getelementptr inbounds i8, i8* %p.0, i64 1 br label %for.cond for.body6: ; preds = %for.body6.lr.ph, %for.body6 %q.39 = phi i8* [ %q.0, %for.body6.lr.ph ], [ %incdec.ptr7, %for.body6 ] %backslashes.38 = phi i32 [ %backslashes.0, %for.body6.lr.ph ], [ %dec9, %for.body6 ] - %incdec.ptr7 = getelementptr inbounds i8* %q.39, i64 1 + %incdec.ptr7 = getelementptr inbounds i8, i8* %q.39, i64 1 store i8 92, i8* %incdec.ptr7, align 1 %dec9 = add nsw i32 %backslashes.38, -1 %tobool5 = icmp eq i32 %dec9, 0 diff --git a/test/Transforms/LoopInterchange/currentLimitation.ll b/test/Transforms/LoopInterchange/currentLimitation.ll new file mode 100644 index 0000000..8045dd8 --- /dev/null +++ b/test/Transforms/LoopInterchange/currentLimitation.ll @@ -0,0 +1,58 @@ +; RUN: opt < %s -basicaa -loop-interchange -S | FileCheck %s +;; These are test that fail to interchange due to current limitation. This will go off once we extend the loop interchange pass. + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@A = common global [100 x [100 x i32]] zeroinitializer +@B = common global [100 x [100 x [100 x i32]]] zeroinitializer + +;;--------------------------------------Test case 01------------------------------------ +;; [FIXME] This loop though valid is currently not interchanged due to the limitation that we cannot split the inner loop latch due to multiple use of inner induction +;; variable.(used to increment the loop counter and to access A[j+1][i+1] +;; for(int i=0;i<N-1;i++) +;; for(int j=1;j<N-1;j++) +;; A[j+1][i+1] = A[j+1][i+1] + k; + +define void @interchange_01(i32 %k, i32 %N) { + entry: + %sub = add nsw i32 %N, -1 + %cmp26 = icmp sgt i32 %N, 1 + br i1 %cmp26, label %for.cond1.preheader.lr.ph, label %for.end17 + + for.cond1.preheader.lr.ph: + %cmp324 = icmp sgt i32 %sub, 1 + %0 = add i32 %N, -2 + %1 = sext i32 %sub to i64 + br label %for.cond1.preheader + + for.cond.loopexit: + %cmp = icmp slt i64 %indvars.iv.next29, %1 + br i1 %cmp, label %for.cond1.preheader, label %for.end17 + + for.cond1.preheader: + %indvars.iv28 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next29, %for.cond.loopexit ] + %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1 + br i1 %cmp324, label %for.body4, label %for.cond.loopexit + + for.body4: + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.cond1.preheader ] + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next29 + %2 = load i32, i32* %arrayidx7 + %add8 = add nsw i32 %2, %k + store i32 %add8, i32* %arrayidx7 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.cond.loopexit, label %for.body4 + + for.end17: + ret void +} +;; Inner loop not split so it is not interchanged. +; CHECK-LABEL: @interchange_01 +; CHECK: for.body4: +; CHECK-NEXT: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.body4.preheader ] +; CHECK-NEXT: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 +; CHECK-NEXT: %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next29 + diff --git a/test/Transforms/LoopInterchange/interchange.ll b/test/Transforms/LoopInterchange/interchange.ll new file mode 100644 index 0000000..30a4a71 --- /dev/null +++ b/test/Transforms/LoopInterchange/interchange.ll @@ -0,0 +1,557 @@ +; RUN: opt < %s -basicaa -loop-interchange -S | FileCheck %s +;; We test the complete .ll for adjustment in outer loop header/latch and inner loop header/latch. + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@A = common global [100 x [100 x i32]] zeroinitializer +@B = common global [100 x i32] zeroinitializer +@C = common global [100 x [100 x i32]] zeroinitializer +@D = common global [100 x [100 x [100 x i32]]] zeroinitializer + +declare void @foo(...) + +;;--------------------------------------Test case 01------------------------------------ +;; for(int i=0;i<N;i++) +;; for(int j=1;j<N;j++) +;; A[j][i] = A[j][i]+k; + +define void @interchange_01(i32 %k, i32 %N) { +entry: + %cmp21 = icmp sgt i32 %N, 0 + br i1 %cmp21, label %for.cond1.preheader.lr.ph, label %for.end12 + +for.cond1.preheader.lr.ph: + %cmp219 = icmp sgt i32 %N, 1 + %0 = add i32 %N, -1 + br label %for.cond1.preheader + +for.cond1.preheader: + %indvars.iv23 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next24, %for.inc10 ] + br i1 %cmp219, label %for.body3, label %for.inc10 + +for.body3: + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.cond1.preheader ] + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv, i64 %indvars.iv23 + %1 = load i32, i32* %arrayidx5 + %add = add nsw i32 %1, %k + store i32 %add, i32* %arrayidx5 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.inc10, label %for.body3 + +for.inc10: + %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 + %lftr.wideiv25 = trunc i64 %indvars.iv23 to i32 + %exitcond26 = icmp eq i32 %lftr.wideiv25, %0 + br i1 %exitcond26, label %for.end12, label %for.cond1.preheader + +for.end12: + ret void +} + +; CHECK-LABEL: @interchange_01 +; CHECK: entry: +; CHECK: %cmp21 = icmp sgt i32 %N, 0 +; CHECK: br i1 %cmp21, label %for.body3.preheader, label %for.end12 +; CHECK: for.cond1.preheader.lr.ph: +; CHECK: br label %for.cond1.preheader +; CHECK: for.cond1.preheader: +; CHECK: %indvars.iv23 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next24, %for.inc10 ] +; CHECK: br i1 %cmp219, label %for.body3.split1, label %for.end12.loopexit +; CHECK: for.body3.preheader: +; CHECK: %cmp219 = icmp sgt i32 %N, 1 +; CHECK: %0 = add i32 %N, -1 +; CHECK: br label %for.body3 +; CHECK: for.body3: +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.split ], [ 1, %for.body3.preheader ] +; CHECK: br label %for.cond1.preheader.lr.ph +; CHECK: for.body3.split1: +; CHECK: %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv, i64 %indvars.iv23 +; CHECK: %1 = load i32, i32* %arrayidx5 +; CHECK: %add = add nsw i32 %1, %k +; CHECK: store i32 %add, i32* %arrayidx5 +; CHECK: br label %for.inc10.loopexit +; CHECK: for.body3.split: +; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 +; CHECK: %lftr.wideiv = trunc i64 %indvars.iv to i32 +; CHECK: %exitcond = icmp eq i32 %lftr.wideiv, %0 +; CHECK: br i1 %exitcond, label %for.end12.loopexit, label %for.body3 +; CHECK: for.inc10.loopexit: +; CHECK: br label %for.inc10 +; CHECK: for.inc10: +; CHECK: %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 +; CHECK: %lftr.wideiv25 = trunc i64 %indvars.iv23 to i32 +; CHECK: %exitcond26 = icmp eq i32 %lftr.wideiv25, %0 +; CHECK: br i1 %exitcond26, label %for.body3.split, label %for.cond1.preheader +; CHECK: for.end12.loopexit: +; CHECK: br label %for.end12 +; CHECK: for.end12: +; CHECK: ret void + +;;--------------------------------------Test case 02------------------------------------- + +;; for(int i=0;i<100;i++) +;; for(int j=100;j>=0;j--) +;; A[j][i] = A[j][i]+k; + +define void @interchange_02(i32 %k) { +entry: + br label %for.cond1.preheader + +for.cond1.preheader: + %indvars.iv19 = phi i64 [ 0, %entry ], [ %indvars.iv.next20, %for.inc10 ] + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ 100, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv, i64 %indvars.iv19 + %0 = load i32, i32* %arrayidx5 + %add = add nsw i32 %0, %k + store i32 %add, i32* %arrayidx5 + %indvars.iv.next = add nsw i64 %indvars.iv, -1 + %cmp2 = icmp sgt i64 %indvars.iv, 0 + br i1 %cmp2, label %for.body3, label %for.inc10 + +for.inc10: + %indvars.iv.next20 = add nuw nsw i64 %indvars.iv19, 1 + %exitcond = icmp eq i64 %indvars.iv.next20, 100 + br i1 %exitcond, label %for.end11, label %for.cond1.preheader + +for.end11: + ret void +} + +; CHECK-LABEL: @interchange_02 +; CHECK: entry: +; CHECK: br label %for.body3.preheader +; CHECK: for.cond1.preheader.preheader: +; CHECK: br label %for.cond1.preheader +; CHECK: for.cond1.preheader: +; CHECK: %indvars.iv19 = phi i64 [ %indvars.iv.next20, %for.inc10 ], [ 0, %for.cond1.preheader.preheader ] +; CHECK: br label %for.body3.split1 +; CHECK: for.body3.preheader: +; CHECK: br label %for.body3 +; CHECK: for.body3: +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.split ], [ 100, %for.body3.preheader ] +; CHECK: br label %for.cond1.preheader.preheader +; CHECK: for.body3.split1: ; preds = %for.cond1.preheader +; CHECK: %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv, i64 %indvars.iv19 +; CHECK: %0 = load i32, i32* %arrayidx5 +; CHECK: %add = add nsw i32 %0, %k +; CHECK: store i32 %add, i32* %arrayidx5 +; CHECK: br label %for.inc10 +; CHECK: for.body3.split: +; CHECK: %indvars.iv.next = add nsw i64 %indvars.iv, -1 +; CHECK: %cmp2 = icmp sgt i64 %indvars.iv, 0 +; CHECK: br i1 %cmp2, label %for.body3, label %for.end11 +; CHECK: for.inc10: +; CHECK: %indvars.iv.next20 = add nuw nsw i64 %indvars.iv19, 1 +; CHECK: %exitcond = icmp eq i64 %indvars.iv.next20, 100 +; CHECK: br i1 %exitcond, label %for.body3.split, label %for.cond1.preheader +; CHECK: for.end11: +; CHECK: ret void + +;;--------------------------------------Test case 03------------------------------------- +;; Loops should not be interchanged in this case as it is not profitable. +;; for(int i=0;i<100;i++) +;; for(int j=0;j<100;j++) +;; A[i][j] = A[i][j]+k; + +define void @interchange_03(i32 %k) { +entry: + br label %for.cond1.preheader + +for.cond1.preheader: + %indvars.iv21 = phi i64 [ 0, %entry ], [ %indvars.iv.next22, %for.inc10 ] + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv21, i64 %indvars.iv + %0 = load i32, i32* %arrayidx5 + %add = add nsw i32 %0, %k + store i32 %add, i32* %arrayidx5 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %exitcond = icmp eq i64 %indvars.iv.next, 100 + br i1 %exitcond, label %for.inc10, label %for.body3 + +for.inc10: + %indvars.iv.next22 = add nuw nsw i64 %indvars.iv21, 1 + %exitcond23 = icmp eq i64 %indvars.iv.next22, 100 + br i1 %exitcond23, label %for.end12, label %for.cond1.preheader + +for.end12: + ret void +} + +; CHECK-LABEL: @interchange_03 +; CHECK: entry: +; CHECK: br label %for.cond1.preheader.preheader +; CHECK: for.cond1.preheader.preheader: ; preds = %entry +; CHECK: br label %for.cond1.preheader +; CHECK: for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc10 +; CHECK: %indvars.iv21 = phi i64 [ %indvars.iv.next22, %for.inc10 ], [ 0, %for.cond1.preheader.preheader ] +; CHECK: br label %for.body3.preheader +; CHECK: for.body3.preheader: ; preds = %for.cond1.preheader +; CHECK: br label %for.body3 +; CHECK: for.body3: ; preds = %for.body3.preheader, %for.body3 +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.body3.preheader ] +; CHECK: %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv21, i64 %indvars.iv +; CHECK: %0 = load i32, i32* %arrayidx5 +; CHECK: %add = add nsw i32 %0, %k +; CHECK: store i32 %add, i32* %arrayidx5 +; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 +; CHECK: %exitcond = icmp eq i64 %indvars.iv.next, 100 +; CHECK: br i1 %exitcond, label %for.inc10, label %for.body3 +; CHECK: for.inc10: ; preds = %for.body3 +; CHECK: %indvars.iv.next22 = add nuw nsw i64 %indvars.iv21, 1 +; CHECK: %exitcond23 = icmp eq i64 %indvars.iv.next22, 100 +; CHECK: br i1 %exitcond23, label %for.end12, label %for.cond1.preheader +; CHECK: for.end12: ; preds = %for.inc10 +; CHECK: ret void + + +;;--------------------------------------Test case 04------------------------------------- +;; Loops should not be interchanged in this case as it is not legal due to dependency. +;; for(int j=0;j<99;j++) +;; for(int i=0;i<99;i++) +;; A[j][i+1] = A[j+1][i]+k; + +define void @interchange_04(i32 %k){ +entry: + br label %for.cond1.preheader + +for.cond1.preheader: + %indvars.iv23 = phi i64 [ 0, %entry ], [ %indvars.iv.next24, %for.inc12 ] + %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv.next24, i64 %indvars.iv + %0 = load i32, i32* %arrayidx5 + %add6 = add nsw i32 %0, %k + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %arrayidx11 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv23, i64 %indvars.iv.next + store i32 %add6, i32* %arrayidx11 + %exitcond = icmp eq i64 %indvars.iv.next, 99 + br i1 %exitcond, label %for.inc12, label %for.body3 + +for.inc12: + %exitcond25 = icmp eq i64 %indvars.iv.next24, 99 + br i1 %exitcond25, label %for.end14, label %for.cond1.preheader + +for.end14: + ret void +} + +; CHECK-LABEL: @interchange_04 +; CHECK: entry: +; CHECK: br label %for.cond1.preheader +; CHECK: for.cond1.preheader: ; preds = %for.inc12, %entry +; CHECK: %indvars.iv23 = phi i64 [ 0, %entry ], [ %indvars.iv.next24, %for.inc12 ] +; CHECK: %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 +; CHECK: br label %for.body3 +; CHECK: for.body3: ; preds = %for.body3, %for.cond1.preheader +; CHECK: %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] +; CHECK: %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv.next24, i64 %indvars.iv +; CHECK: %0 = load i32, i32* %arrayidx5 +; CHECK: %add6 = add nsw i32 %0, %k +; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 +; CHECK: %arrayidx11 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv23, i64 %indvars.iv.next +; CHECK: store i32 %add6, i32* %arrayidx11 +; CHECK: %exitcond = icmp eq i64 %indvars.iv.next, 99 +; CHECK: br i1 %exitcond, label %for.inc12, label %for.body3 +; CHECK: for.inc12: ; preds = %for.body3 +; CHECK: %exitcond25 = icmp eq i64 %indvars.iv.next24, 99 +; CHECK: br i1 %exitcond25, label %for.end14, label %for.cond1.preheader +; CHECK: for.end14: ; preds = %for.inc12 +; CHECK: ret void + + + +;;--------------------------------------Test case 05------------------------------------- +;; Loops not tightly nested are not interchanged +;; for(int j=0;j<N;j++) { +;; B[j] = j+k; +;; for(int i=0;i<N;i++) +;; A[j][i] = A[j][i]+B[j]; +;; } + +define void @interchange_05(i32 %k, i32 %N){ +entry: + %cmp30 = icmp sgt i32 %N, 0 + br i1 %cmp30, label %for.body.lr.ph, label %for.end17 + +for.body.lr.ph: + %0 = add i32 %N, -1 + %1 = zext i32 %k to i64 + br label %for.body + +for.body: + %indvars.iv32 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next33, %for.inc15 ] + %2 = add nsw i64 %indvars.iv32, %1 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* @B, i64 0, i64 %indvars.iv32 + %3 = trunc i64 %2 to i32 + store i32 %3, i32* %arrayidx + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ 0, %for.body ], [ %indvars.iv.next, %for.body3 ] + %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv32, i64 %indvars.iv + %4 = load i32, i32* %arrayidx7 + %add10 = add nsw i32 %3, %4 + store i32 %add10, i32* %arrayidx7 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.inc15, label %for.body3 + +for.inc15: + %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1 + %lftr.wideiv35 = trunc i64 %indvars.iv32 to i32 + %exitcond36 = icmp eq i32 %lftr.wideiv35, %0 + br i1 %exitcond36, label %for.end17, label %for.body + +for.end17: + ret void +} + +; CHECK-LABEL: @interchange_05 +; CHECK: entry: +; CHECK: %cmp30 = icmp sgt i32 %N, 0 +; CHECK: br i1 %cmp30, label %for.body.lr.ph, label %for.end17 +; CHECK: for.body.lr.ph: +; CHECK: %0 = add i32 %N, -1 +; CHECK: %1 = zext i32 %k to i64 +; CHECK: br label %for.body +; CHECK: for.body: +; CHECK: %indvars.iv32 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next33, %for.inc15 ] +; CHECK: %2 = add nsw i64 %indvars.iv32, %1 +; CHECK: %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* @B, i64 0, i64 %indvars.iv32 +; CHECK: %3 = trunc i64 %2 to i32 +; CHECK: store i32 %3, i32* %arrayidx +; CHECK: br label %for.body3.preheader +; CHECK: for.body3.preheader: +; CHECK: br label %for.body3 +; CHECK: for.body3: +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.body3.preheader ] +; CHECK: %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv32, i64 %indvars.iv +; CHECK: %4 = load i32, i32* %arrayidx7 +; CHECK: %add10 = add nsw i32 %3, %4 +; CHECK: store i32 %add10, i32* %arrayidx7 +; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 +; CHECK: %lftr.wideiv = trunc i64 %indvars.iv to i32 +; CHECK: %exitcond = icmp eq i32 %lftr.wideiv, %0 +; CHECK: br i1 %exitcond, label %for.inc15, label %for.body3 +; CHECK: for.inc15: +; CHECK: %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1 +; CHECK: %lftr.wideiv35 = trunc i64 %indvars.iv32 to i32 +; CHECK: %exitcond36 = icmp eq i32 %lftr.wideiv35, %0 +; CHECK: br i1 %exitcond36, label %for.end17.loopexit, label %for.body +; CHECK: for.end17.loopexit: +; CHECK: br label %for.end17 +; CHECK: for.end17: +; CHECK: ret void + + +;;--------------------------------------Test case 06------------------------------------- +;; Loops not tightly nested are not interchanged +;; for(int j=0;j<N;j++) { +;; foo(); +;; for(int i=2;i<N;i++) +;; A[j][i] = A[j][i]+k; +;; } + +define void @interchange_06(i32 %k, i32 %N) { +entry: + %cmp22 = icmp sgt i32 %N, 0 + br i1 %cmp22, label %for.body.lr.ph, label %for.end12 + +for.body.lr.ph: + %0 = add i32 %N, -1 + br label %for.body + +for.body: + %indvars.iv24 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next25, %for.inc10 ] + tail call void (...)* @foo() + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 2, %for.body ] + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv24, i64 %indvars.iv + %1 = load i32, i32* %arrayidx5 + %add = add nsw i32 %1, %k + store i32 %add, i32* %arrayidx5 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.inc10, label %for.body3 + +for.inc10: + %indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1 + %lftr.wideiv26 = trunc i64 %indvars.iv24 to i32 + %exitcond27 = icmp eq i32 %lftr.wideiv26, %0 + br i1 %exitcond27, label %for.end12, label %for.body + +for.end12: + ret void +} +;; Here we are checking if the inner phi is not split then we have not interchanged. +; CHECK-LABEL: @interchange_06 +; CHECK: phi i64 [ %indvars.iv.next, %for.body3 ], [ 2, %for.body3.preheader ] +; CHECK-NEXT: getelementptr +; CHECK-NEXT: %1 = load + +;;--------------------------------------Test case 07------------------------------------- +;; FIXME: +;; Test for interchange when we have an lcssa phi. This should ideally be interchanged but it is currently not supported. +;; for(gi=1;gi<N;gi++) +;; for(gj=1;gj<M;gj++) +;; A[gj][gi] = A[gj - 1][gi] + C[gj][gi]; + +@gi = common global i32 0 +@gj = common global i32 0 + +define void @interchange_07(i32 %N, i32 %M){ +entry: + store i32 1, i32* @gi + %cmp21 = icmp sgt i32 %N, 1 + br i1 %cmp21, label %for.cond1.preheader.lr.ph, label %for.end16 + +for.cond1.preheader.lr.ph: + %cmp218 = icmp sgt i32 %M, 1 + %gi.promoted = load i32, i32* @gi + %0 = add i32 %M, -1 + %1 = sext i32 %gi.promoted to i64 + %2 = sext i32 %N to i64 + %3 = add i32 %gi.promoted, 1 + %4 = icmp slt i32 %3, %N + %smax = select i1 %4, i32 %N, i32 %3 + br label %for.cond1.preheader + +for.cond1.preheader: + %indvars.iv25 = phi i64 [ %1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next26, %for.inc14 ] + br i1 %cmp218, label %for.body3, label %for.inc14 + +for.body3: + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.cond1.preheader ] + %5 = add nsw i64 %indvars.iv, -1 + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %5, i64 %indvars.iv25 + %6 = load i32, i32* %arrayidx5 + %arrayidx9 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @C, i64 0, i64 %indvars.iv, i64 %indvars.iv25 + %7 = load i32, i32* %arrayidx9 + %add = add nsw i32 %7, %6 + %arrayidx13 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv, i64 %indvars.iv25 + store i32 %add, i32* %arrayidx13 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.inc14, label %for.body3 + +for.inc14: + %inc.lcssa23 = phi i32 [ 1, %for.cond1.preheader ], [ %M, %for.body3 ] + %indvars.iv.next26 = add nsw i64 %indvars.iv25, 1 + %cmp = icmp slt i64 %indvars.iv.next26, %2 + br i1 %cmp, label %for.cond1.preheader, label %for.cond.for.end16_crit_edge + +for.cond.for.end16_crit_edge: + store i32 %inc.lcssa23, i32* @gj + store i32 %smax, i32* @gi + br label %for.end16 + +for.end16: + ret void +} + +; CHECK-LABEL: @interchange_07 +; CHECK: for.body3: ; preds = %for.body3.preheader, %for.body3 +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.body3.preheader ] +; CHECK: %5 = add nsw i64 %indvars.iv, -1 +; CHECK: %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %5, i64 %indvars.iv25 +; CHECK: %6 = load i32, i32* %arrayidx5 +; CHECK: %arrayidx9 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @C, i64 0, i64 %indvars.iv, i64 %indvars.iv25 + +;;------------------------------------------------Test case 08------------------------------- +;; Test for interchange in loop nest greater than 2. +;; for(int i=0;i<100;i++) +;; for(int j=0;j<100;j++) +;; for(int k=0;k<100;k++) +;; D[i][k][j] = D[i][k][j]+t; + +define void @interchange_08(i32 %t){ +entry: + br label %for.cond1.preheader + +for.cond1.preheader: ; preds = %for.inc15, %entry + %i.028 = phi i32 [ 0, %entry ], [ %inc16, %for.inc15 ] + br label %for.cond4.preheader + +for.cond4.preheader: ; preds = %for.inc12, %for.cond1.preheader + %j.027 = phi i32 [ 0, %for.cond1.preheader ], [ %inc13, %for.inc12 ] + br label %for.body6 + +for.body6: ; preds = %for.body6, %for.cond4.preheader + %k.026 = phi i32 [ 0, %for.cond4.preheader ], [ %inc, %for.body6 ] + %arrayidx8 = getelementptr inbounds [100 x [100 x [100 x i32]]], [100 x [100 x [100 x i32]]]* @D, i32 0, i32 %i.028, i32 %k.026, i32 %j.027 + %0 = load i32, i32* %arrayidx8 + %add = add nsw i32 %0, %t + store i32 %add, i32* %arrayidx8 + %inc = add nuw nsw i32 %k.026, 1 + %exitcond = icmp eq i32 %inc, 100 + br i1 %exitcond, label %for.inc12, label %for.body6 + +for.inc12: ; preds = %for.body6 + %inc13 = add nuw nsw i32 %j.027, 1 + %exitcond29 = icmp eq i32 %inc13, 100 + br i1 %exitcond29, label %for.inc15, label %for.cond4.preheader + +for.inc15: ; preds = %for.inc12 + %inc16 = add nuw nsw i32 %i.028, 1 + %exitcond30 = icmp eq i32 %inc16, 100 + br i1 %exitcond30, label %for.end17, label %for.cond1.preheader + +for.end17: ; preds = %for.inc15 + ret void +} +; CHECK-LABEL: @interchange_08 +; CHECK: entry: +; CHECK: br label %for.cond1.preheader.preheader +; CHECK: for.cond1.preheader.preheader: ; preds = %entry +; CHECK: br label %for.cond1.preheader +; CHECK: for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc15 +; CHECK: %i.028 = phi i32 [ %inc16, %for.inc15 ], [ 0, %for.cond1.preheader.preheader ] +; CHECK: br label %for.body6.preheader +; CHECK: for.cond4.preheader.preheader: ; preds = %for.body6 +; CHECK: br label %for.cond4.preheader +; CHECK: for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.inc12 +; CHECK: %j.027 = phi i32 [ %inc13, %for.inc12 ], [ 0, %for.cond4.preheader.preheader ] +; CHECK: br label %for.body6.split1 +; CHECK: for.body6.preheader: ; preds = %for.cond1.preheader +; CHECK: br label %for.body6 +; CHECK: for.body6: ; preds = %for.body6.preheader, %for.body6.split +; CHECK: %k.026 = phi i32 [ %inc, %for.body6.split ], [ 0, %for.body6.preheader ] +; CHECK: br label %for.cond4.preheader.preheader +; CHECK: for.body6.split1: ; preds = %for.cond4.preheader +; CHECK: %arrayidx8 = getelementptr inbounds [100 x [100 x [100 x i32]]], [100 x [100 x [100 x i32]]]* @D, i32 0, i32 %i.028, i32 %k.026, i32 %j.027 +; CHECK: %0 = load i32, i32* %arrayidx8 +; CHECK: %add = add nsw i32 %0, %t +; CHECK: store i32 %add, i32* %arrayidx8 +; CHECK: br label %for.inc12 +; CHECK: for.body6.split: ; preds = %for.inc12 +; CHECK: %inc = add nuw nsw i32 %k.026, 1 +; CHECK: %exitcond = icmp eq i32 %inc, 100 +; CHECK: br i1 %exitcond, label %for.inc15, label %for.body6 +; CHECK: for.inc12: ; preds = %for.body6.split1 +; CHECK: %inc13 = add nuw nsw i32 %j.027, 1 +; CHECK: %exitcond29 = icmp eq i32 %inc13, 100 +; CHECK: br i1 %exitcond29, label %for.body6.split, label %for.cond4.preheader +; CHECK: for.inc15: ; preds = %for.body6.split +; CHECK: %inc16 = add nuw nsw i32 %i.028, 1 +; CHECK: %exitcond30 = icmp eq i32 %inc16, 100 +; CHECK: br i1 %exitcond30, label %for.end17, label %for.cond1.preheader +; CHECK: for.end17: ; preds = %for.inc15 +; CHECK: ret void + diff --git a/test/Transforms/LoopInterchange/profitability.ll b/test/Transforms/LoopInterchange/profitability.ll new file mode 100644 index 0000000..ae1f793 --- /dev/null +++ b/test/Transforms/LoopInterchange/profitability.ll @@ -0,0 +1,205 @@ +; RUN: opt < %s -basicaa -loop-interchange -S | FileCheck %s +;; We test profitability model in these test cases. + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@A = common global [100 x [100 x i32]] zeroinitializer +@B = common global [100 x [100 x i32]] zeroinitializer + +;;---------------------------------------Test case 01--------------------------------- +;; Loops interchange will result in code vectorization and hence profitable. Check for interchange. +;; for(int i=1;i<N;i++) +;; for(int j=1;j<N;j++) +;; A[j][i] = A[j - 1][i] + B[j][i]; + +define void @interchange_01(i32 %N) { +entry: + %cmp27 = icmp sgt i32 %N, 1 + br i1 %cmp27, label %for.cond1.preheader.lr.ph, label %for.end16 + +for.cond1.preheader.lr.ph: + %0 = add i32 %N, -1 + br label %for.body3.preheader + +for.body3.preheader: + %indvars.iv30 = phi i64 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next31, %for.inc14 ] + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.body3.preheader ] + %1 = add nsw i64 %indvars.iv, -1 + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %1, i64 %indvars.iv30 + %2 = load i32, i32* %arrayidx5 + %arrayidx9 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @B, i64 0, i64 %indvars.iv, i64 %indvars.iv30 + %3 = load i32, i32* %arrayidx9 + %add = add nsw i32 %3, %2 + %arrayidx13 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv, i64 %indvars.iv30 + store i32 %add, i32* %arrayidx13 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.inc14, label %for.body3 + +for.inc14: + %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1 + %lftr.wideiv32 = trunc i64 %indvars.iv30 to i32 + %exitcond33 = icmp eq i32 %lftr.wideiv32, %0 + br i1 %exitcond33, label %for.end16, label %for.body3.preheader + +for.end16: + ret void +} +;; Here we are checking partial .ll to check if loop are interchanged. +; CHECK-LABEL: @interchange_01 +; CHECK: for.body3.preheader: ; preds = %for.inc14, %for.cond1.preheader.lr.ph +; CHECK: %indvars.iv30 = phi i64 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next31, %for.inc14 ] +; CHECK: br label %for.body3.split2 + +; CHECK: for.body3.preheader1: ; preds = %entry +; CHECK: br label %for.body3 + +; CHECK: for.body3: ; preds = %for.body3.preheader1, %for.body3.split +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.split ], [ 1, %for.body3.preheader1 ] +; CHECK: br label %for.cond1.preheader.lr.ph + +; CHECK: for.body3.split2: ; preds = %for.body3.preheader +; CHECK: %1 = add nsw i64 %indvars.iv, -1 +; CHECK: %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %1, i64 %indvars.iv30 +; CHECK: %2 = load i32, i32* %arrayidx5 +; CHECK: %arrayidx9 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @B, i64 0, i64 %indvars.iv, i64 %indvars.iv30 +; CHECK: %3 = load i32, i32* %arrayidx9 +; CHECK: %add = add nsw i32 %3, %2 +; CHECK: %arrayidx13 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %indvars.iv, i64 %indvars.iv30 +; CHECK: store i32 %add, i32* %arrayidx13 +; CHECK: br label %for.inc14 + + +;; ---------------------------------------Test case 02--------------------------------- +;; Check loop interchange profitability model. +;; This tests profitability model when operands of getelementpointer and not exactly the induction variable but some +;; arithmetic operation on them. +;; for(int i=1;i<N;i++) +;; for(int j=1;j<N;j++) +;; A[j-1][i-1] = A[j - 1][i-1] + B[j-1][i-1]; + +define void @interchange_02(i32 %N) { +entry: + %cmp32 = icmp sgt i32 %N, 1 + br i1 %cmp32, label %for.cond1.preheader.lr.ph, label %for.end21 + +for.cond1.preheader.lr.ph: + %0 = add i32 %N, -1 + br label %for.body3.lr.ph + +for.body3.lr.ph: + %indvars.iv35 = phi i64 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next36, %for.inc19 ] + %1 = add nsw i64 %indvars.iv35, -1 + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ 1, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ] + %2 = add nsw i64 %indvars.iv, -1 + %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %2, i64 %1 + %3 = load i32, i32* %arrayidx6 + %arrayidx12 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @B, i64 0, i64 %2, i64 %1 + %4 = load i32, i32* %arrayidx12 + %add = add nsw i32 %4, %3 + store i32 %add, i32* %arrayidx6 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.inc19, label %for.body3 + +for.inc19: + %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1 + %lftr.wideiv38 = trunc i64 %indvars.iv35 to i32 + %exitcond39 = icmp eq i32 %lftr.wideiv38, %0 + br i1 %exitcond39, label %for.end21, label %for.body3.lr.ph + +for.end21: + ret void +} +; CHECK-LABEL: @interchange_02 +; CHECK: for.body3.lr.ph: ; preds = %for.inc19, %for.cond1.preheader.lr.ph +; CHECK: %indvars.iv35 = phi i64 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next36, %for.inc19 ] +; CHECK: %0 = add nsw i64 %indvars.iv35, -1 +; CHECK: br label %for.body3.split1 + +; CHECK: for.body3.preheader: ; preds = %entry +; CHECK: %1 = add i32 %N, -1 +; CHECK: br label %for.body3 + +; CHECK: for.body3: ; preds = %for.body3.preheader, %for.body3.split +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.split ], [ 1, %for.body3.preheader ] +; CHECK: br label %for.cond1.preheader.lr.ph + +; CHECK: for.body3.split1: ; preds = %for.body3.lr.ph +; CHECK: %2 = add nsw i64 %indvars.iv, -1 +; CHECK: %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %2, i64 %0 +; CHECK: %3 = load i32, i32* %arrayidx6 +; CHECK: %arrayidx12 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @B, i64 0, i64 %2, i64 %0 +; CHECK: %4 = load i32, i32* %arrayidx12 +; CHECK: %add = add nsw i32 %4, %3 +; CHECK: store i32 %add, i32* %arrayidx6 +; CHECK: br label %for.inc19 + + +;;---------------------------------------Test case 03--------------------------------- +;; Loops interchange is not profitable. +;; for(int i=1;i<N;i++) +;; for(int j=1;j<N;j++) +;; A[i-1][j-1] = A[i - 1][j-1] + B[i][j]; + +define void @interchange_03(i32 %N){ +entry: + %cmp31 = icmp sgt i32 %N, 1 + br i1 %cmp31, label %for.cond1.preheader.lr.ph, label %for.end19 + +for.cond1.preheader.lr.ph: + %0 = add i32 %N, -1 + br label %for.body3.lr.ph + +for.body3.lr.ph: + %indvars.iv34 = phi i64 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next35, %for.inc17 ] + %1 = add nsw i64 %indvars.iv34, -1 + br label %for.body3 + +for.body3: + %indvars.iv = phi i64 [ 1, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ] + %2 = add nsw i64 %indvars.iv, -1 + %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %1, i64 %2 + %3 = load i32, i32* %arrayidx6 + %arrayidx10 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @B, i64 0, i64 %indvars.iv34, i64 %indvars.iv + %4 = load i32, i32* %arrayidx10 + %add = add nsw i32 %4, %3 + store i32 %add, i32* %arrayidx6 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %0 + br i1 %exitcond, label %for.inc17, label %for.body3 + +for.inc17: + %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1 + %lftr.wideiv37 = trunc i64 %indvars.iv34 to i32 + %exitcond38 = icmp eq i32 %lftr.wideiv37, %0 + br i1 %exitcond38, label %for.end19, label %for.body3.lr.ph + +for.end19: + ret void +} + +; CHECK-LABEL: @interchange_03 +; CHECK: for.body3.lr.ph: +; CHECK: %indvars.iv34 = phi i64 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next35, %for.inc17 ] +; CHECK: %1 = add nsw i64 %indvars.iv34, -1 +; CHECK: br label %for.body3.preheader +; CHECK: for.body3.preheader: +; CHECK: br label %for.body3 +; CHECK: for.body3: +; CHECK: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.body3.preheader ] +; CHECK: %2 = add nsw i64 %indvars.iv, -1 +; CHECK: %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @A, i64 0, i64 %1, i64 %2 +; CHECK: %3 = load i32, i32* %arrayidx6 +; CHECK: %arrayidx10 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* @B, i64 0, i64 %indvars.iv34, i64 %indvars.iv +; CHECK: %4 = load i32, i32* %arrayidx10 diff --git a/test/Transforms/LoopReroll/basic.ll b/test/Transforms/LoopReroll/basic.ll index 7533461..16a6dc8 100644 --- a/test/Transforms/LoopReroll/basic.ll +++ b/test/Transforms/LoopReroll/basic.ll @@ -60,15 +60,15 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %call = tail call i32 @foo(i32 0) #1 - %arrayidx = getelementptr inbounds i32* %x, i64 %indvars.iv + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvars.iv store i32 %call, i32* %arrayidx, align 4 %call1 = tail call i32 @foo(i32 0) #1 %0 = add nsw i64 %indvars.iv, 1 - %arrayidx3 = getelementptr inbounds i32* %x, i64 %0 + %arrayidx3 = getelementptr inbounds i32, i32* %x, i64 %0 store i32 %call1, i32* %arrayidx3, align 4 %call4 = tail call i32 @foo(i32 0) #1 %1 = add nsw i64 %indvars.iv, 2 - %arrayidx7 = getelementptr inbounds i32* %x, i64 %1 + %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %1 store i32 %call4, i32* %arrayidx7, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 3 %2 = trunc i64 %indvars.iv.next to i32 @@ -80,7 +80,7 @@ for.body: ; preds = %entry, %for.body ; CHECK: for.body: ; CHECK: %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ] ; CHECK: %call = tail call i32 @foo(i32 0) #1 -; CHECK: %arrayidx = getelementptr inbounds i32* %x, i64 %indvar +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvar ; CHECK: store i32 %call, i32* %arrayidx, align 4 ; CHECK: %indvar.next = add i64 %indvar, 1 ; CHECK: %exitcond = icmp eq i64 %indvar, 1499 @@ -109,15 +109,15 @@ for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %call = tail call i32 @foo(i32 0) #1 %0 = mul nsw i64 %indvars.iv, 3 - %arrayidx = getelementptr inbounds i32* %x, i64 %0 + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0 store i32 %call, i32* %arrayidx, align 4 %call1 = tail call i32 @foo(i32 0) #1 %1 = add nsw i64 %0, 1 - %arrayidx4 = getelementptr inbounds i32* %x, i64 %1 + %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1 store i32 %call1, i32* %arrayidx4, align 4 %call5 = tail call i32 @foo(i32 0) #1 %2 = add nsw i64 %0, 2 - %arrayidx9 = getelementptr inbounds i32* %x, i64 %2 + %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2 store i32 %call5, i32* %arrayidx9, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 500 @@ -128,7 +128,7 @@ for.body: ; preds = %for.body, %entry ; CHECK: for.body: ; CHECK: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] ; CHECK: %call = tail call i32 @foo(i32 0) #1 -; CHECK: %arrayidx = getelementptr inbounds i32* %x, i64 %indvars.iv +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvars.iv ; CHECK: store i32 %call, i32* %arrayidx, align 4 ; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 ; CHECK: %exitcond1 = icmp eq i64 %indvars.iv, 1499 @@ -157,43 +157,43 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %mul = fmul float %0, %alpha - %arrayidx2 = getelementptr inbounds float* %a, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %a, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 %add = fadd float %1, %mul store float %add, float* %arrayidx2, align 4 %2 = add nsw i64 %indvars.iv, 1 - %arrayidx5 = getelementptr inbounds float* %b, i64 %2 - %3 = load float* %arrayidx5, align 4 + %arrayidx5 = getelementptr inbounds float, float* %b, i64 %2 + %3 = load float, float* %arrayidx5, align 4 %mul6 = fmul float %3, %alpha - %arrayidx9 = getelementptr inbounds float* %a, i64 %2 - %4 = load float* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds float, float* %a, i64 %2 + %4 = load float, float* %arrayidx9, align 4 %add10 = fadd float %4, %mul6 store float %add10, float* %arrayidx9, align 4 %5 = add nsw i64 %indvars.iv, 2 - %arrayidx13 = getelementptr inbounds float* %b, i64 %5 - %6 = load float* %arrayidx13, align 4 + %arrayidx13 = getelementptr inbounds float, float* %b, i64 %5 + %6 = load float, float* %arrayidx13, align 4 %mul14 = fmul float %6, %alpha - %arrayidx17 = getelementptr inbounds float* %a, i64 %5 - %7 = load float* %arrayidx17, align 4 + %arrayidx17 = getelementptr inbounds float, float* %a, i64 %5 + %7 = load float, float* %arrayidx17, align 4 %add18 = fadd float %7, %mul14 store float %add18, float* %arrayidx17, align 4 %8 = add nsw i64 %indvars.iv, 3 - %arrayidx21 = getelementptr inbounds float* %b, i64 %8 - %9 = load float* %arrayidx21, align 4 + %arrayidx21 = getelementptr inbounds float, float* %b, i64 %8 + %9 = load float, float* %arrayidx21, align 4 %mul22 = fmul float %9, %alpha - %arrayidx25 = getelementptr inbounds float* %a, i64 %8 - %10 = load float* %arrayidx25, align 4 + %arrayidx25 = getelementptr inbounds float, float* %a, i64 %8 + %10 = load float, float* %arrayidx25, align 4 %add26 = fadd float %10, %mul22 store float %add26, float* %arrayidx25, align 4 %11 = add nsw i64 %indvars.iv, 4 - %arrayidx29 = getelementptr inbounds float* %b, i64 %11 - %12 = load float* %arrayidx29, align 4 + %arrayidx29 = getelementptr inbounds float, float* %b, i64 %11 + %12 = load float, float* %arrayidx29, align 4 %mul30 = fmul float %12, %alpha - %arrayidx33 = getelementptr inbounds float* %a, i64 %11 - %13 = load float* %arrayidx33, align 4 + %arrayidx33 = getelementptr inbounds float, float* %a, i64 %11 + %13 = load float, float* %arrayidx33, align 4 %add34 = fadd float %13, %mul30 store float %add34, float* %arrayidx33, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 5 @@ -205,11 +205,11 @@ for.body: ; preds = %entry, %for.body ; CHECK: for.body: ; CHECK: %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ] -; CHECK: %arrayidx = getelementptr inbounds float* %b, i64 %indvar -; CHECK: %0 = load float* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %b, i64 %indvar +; CHECK: %0 = load float, float* %arrayidx, align 4 ; CHECK: %mul = fmul float %0, %alpha -; CHECK: %arrayidx2 = getelementptr inbounds float* %a, i64 %indvar -; CHECK: %1 = load float* %arrayidx2, align 4 +; CHECK: %arrayidx2 = getelementptr inbounds float, float* %a, i64 %indvar +; CHECK: %1 = load float, float* %arrayidx2, align 4 ; CHECK: %add = fadd float %1, %mul ; CHECK: store float %add, float* %arrayidx2, align 4 ; CHECK: %indvar.next = add i64 %indvar, 1 @@ -239,58 +239,58 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %ip, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %ip, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %idxprom1 = sext i32 %0 to i64 - %arrayidx2 = getelementptr inbounds float* %b, i64 %idxprom1 - %1 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %b, i64 %idxprom1 + %1 = load float, float* %arrayidx2, align 4 %mul = fmul float %1, %alpha - %arrayidx4 = getelementptr inbounds float* %a, i64 %indvars.iv - %2 = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds float, float* %a, i64 %indvars.iv + %2 = load float, float* %arrayidx4, align 4 %add = fadd float %2, %mul store float %add, float* %arrayidx4, align 4 %3 = add nsw i64 %indvars.iv, 1 - %arrayidx7 = getelementptr inbounds i32* %ip, i64 %3 - %4 = load i32* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %ip, i64 %3 + %4 = load i32, i32* %arrayidx7, align 4 %idxprom8 = sext i32 %4 to i64 - %arrayidx9 = getelementptr inbounds float* %b, i64 %idxprom8 - %5 = load float* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds float, float* %b, i64 %idxprom8 + %5 = load float, float* %arrayidx9, align 4 %mul10 = fmul float %5, %alpha - %arrayidx13 = getelementptr inbounds float* %a, i64 %3 - %6 = load float* %arrayidx13, align 4 + %arrayidx13 = getelementptr inbounds float, float* %a, i64 %3 + %6 = load float, float* %arrayidx13, align 4 %add14 = fadd float %6, %mul10 store float %add14, float* %arrayidx13, align 4 %7 = add nsw i64 %indvars.iv, 2 - %arrayidx17 = getelementptr inbounds i32* %ip, i64 %7 - %8 = load i32* %arrayidx17, align 4 + %arrayidx17 = getelementptr inbounds i32, i32* %ip, i64 %7 + %8 = load i32, i32* %arrayidx17, align 4 %idxprom18 = sext i32 %8 to i64 - %arrayidx19 = getelementptr inbounds float* %b, i64 %idxprom18 - %9 = load float* %arrayidx19, align 4 + %arrayidx19 = getelementptr inbounds float, float* %b, i64 %idxprom18 + %9 = load float, float* %arrayidx19, align 4 %mul20 = fmul float %9, %alpha - %arrayidx23 = getelementptr inbounds float* %a, i64 %7 - %10 = load float* %arrayidx23, align 4 + %arrayidx23 = getelementptr inbounds float, float* %a, i64 %7 + %10 = load float, float* %arrayidx23, align 4 %add24 = fadd float %10, %mul20 store float %add24, float* %arrayidx23, align 4 %11 = add nsw i64 %indvars.iv, 3 - %arrayidx27 = getelementptr inbounds i32* %ip, i64 %11 - %12 = load i32* %arrayidx27, align 4 + %arrayidx27 = getelementptr inbounds i32, i32* %ip, i64 %11 + %12 = load i32, i32* %arrayidx27, align 4 %idxprom28 = sext i32 %12 to i64 - %arrayidx29 = getelementptr inbounds float* %b, i64 %idxprom28 - %13 = load float* %arrayidx29, align 4 + %arrayidx29 = getelementptr inbounds float, float* %b, i64 %idxprom28 + %13 = load float, float* %arrayidx29, align 4 %mul30 = fmul float %13, %alpha - %arrayidx33 = getelementptr inbounds float* %a, i64 %11 - %14 = load float* %arrayidx33, align 4 + %arrayidx33 = getelementptr inbounds float, float* %a, i64 %11 + %14 = load float, float* %arrayidx33, align 4 %add34 = fadd float %14, %mul30 store float %add34, float* %arrayidx33, align 4 %15 = add nsw i64 %indvars.iv, 4 - %arrayidx37 = getelementptr inbounds i32* %ip, i64 %15 - %16 = load i32* %arrayidx37, align 4 + %arrayidx37 = getelementptr inbounds i32, i32* %ip, i64 %15 + %16 = load i32, i32* %arrayidx37, align 4 %idxprom38 = sext i32 %16 to i64 - %arrayidx39 = getelementptr inbounds float* %b, i64 %idxprom38 - %17 = load float* %arrayidx39, align 4 + %arrayidx39 = getelementptr inbounds float, float* %b, i64 %idxprom38 + %17 = load float, float* %arrayidx39, align 4 %mul40 = fmul float %17, %alpha - %arrayidx43 = getelementptr inbounds float* %a, i64 %15 - %18 = load float* %arrayidx43, align 4 + %arrayidx43 = getelementptr inbounds float, float* %a, i64 %15 + %18 = load float, float* %arrayidx43, align 4 %add44 = fadd float %18, %mul40 store float %add44, float* %arrayidx43, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 5 @@ -302,14 +302,14 @@ for.body: ; preds = %entry, %for.body ; CHECK: for.body: ; CHECK: %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ] -; CHECK: %arrayidx = getelementptr inbounds i32* %ip, i64 %indvar -; CHECK: %0 = load i32* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %ip, i64 %indvar +; CHECK: %0 = load i32, i32* %arrayidx, align 4 ; CHECK: %idxprom1 = sext i32 %0 to i64 -; CHECK: %arrayidx2 = getelementptr inbounds float* %b, i64 %idxprom1 -; CHECK: %1 = load float* %arrayidx2, align 4 +; CHECK: %arrayidx2 = getelementptr inbounds float, float* %b, i64 %idxprom1 +; CHECK: %1 = load float, float* %arrayidx2, align 4 ; CHECK: %mul = fmul float %1, %alpha -; CHECK: %arrayidx4 = getelementptr inbounds float* %a, i64 %indvar -; CHECK: %2 = load float* %arrayidx4, align 4 +; CHECK: %arrayidx4 = getelementptr inbounds float, float* %a, i64 %indvar +; CHECK: %2 = load float, float* %arrayidx4, align 4 ; CHECK: %add = fadd float %2, %mul ; CHECK: store float %add, float* %arrayidx4, align 4 ; CHECK: %indvar.next = add i64 %indvar, 1 @@ -343,22 +343,22 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %0 = mul nsw i64 %indvars.iv, 3 - %arrayidx = getelementptr inbounds i32* %x, i64 %0 + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0 store i32 %call, i32* %arrayidx, align 4 %1 = add nsw i64 %0, 1 - %arrayidx4 = getelementptr inbounds i32* %x, i64 %1 + %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1 store i32 %call, i32* %arrayidx4, align 4 %2 = add nsw i64 %0, 2 - %arrayidx9 = getelementptr inbounds i32* %x, i64 %2 + %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2 store i32 %call, i32* %arrayidx9, align 4 %3 = add nsw i64 %0, 6 - %arrayidx6 = getelementptr inbounds i32* %x, i64 %3 + %arrayidx6 = getelementptr inbounds i32, i32* %x, i64 %3 store i32 %call, i32* %arrayidx6, align 4 %4 = add nsw i64 %0, 7 - %arrayidx7 = getelementptr inbounds i32* %x, i64 %4 + %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %4 store i32 %call, i32* %arrayidx7, align 4 %5 = add nsw i64 %0, 8 - %arrayidx8 = getelementptr inbounds i32* %x, i64 %5 + %arrayidx8 = getelementptr inbounds i32, i32* %x, i64 %5 store i32 %call, i32* %arrayidx8, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 500 @@ -369,9 +369,9 @@ for.body: ; preds = %for.body, %entry ; CHECK:for.body: ; CHECK: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] ; CHECK: %0 = add i64 %indvars.iv, 6 -; CHECK: %arrayidx = getelementptr inbounds i32* %x, i64 %indvars.iv +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvars.iv ; CHECK: store i32 %call, i32* %arrayidx, align 4 -; CHECK: %arrayidx6 = getelementptr inbounds i32* %x, i64 %0 +; CHECK: %arrayidx6 = getelementptr inbounds i32, i32* %x, i64 %0 ; CHECK: store i32 %call, i32* %arrayidx6, align 4 ; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 ; CHECK: %exitcond2 = icmp eq i64 %0, 1505 @@ -404,21 +404,21 @@ for.body: ; preds = %for.body, %entry %0 = mul nsw i64 %indvars.iv, 3 %add = add nsw i64 %indvars.iv, 1 %newmul = mul nsw i64 %add, 3 - %arrayidx = getelementptr inbounds i32* %x, i64 %0 + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0 store i32 %call, i32* %arrayidx, align 4 %1 = add nsw i64 %0, 1 - %arrayidx4 = getelementptr inbounds i32* %x, i64 %1 + %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1 store i32 %call, i32* %arrayidx4, align 4 %2 = add nsw i64 %0, 2 - %arrayidx9 = getelementptr inbounds i32* %x, i64 %2 + %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2 store i32 %call, i32* %arrayidx9, align 4 - %arrayidx6 = getelementptr inbounds i32* %x, i64 %newmul + %arrayidx6 = getelementptr inbounds i32, i32* %x, i64 %newmul store i32 %call, i32* %arrayidx6, align 4 %3 = add nsw i64 %newmul, 1 - %arrayidx7 = getelementptr inbounds i32* %x, i64 %3 + %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %3 store i32 %call, i32* %arrayidx7, align 4 %4 = add nsw i64 %newmul, 2 - %arrayidx8 = getelementptr inbounds i32* %x, i64 %4 + %arrayidx8 = getelementptr inbounds i32, i32* %x, i64 %4 store i32 %call, i32* %arrayidx8, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 500 @@ -429,9 +429,9 @@ for.body: ; preds = %for.body, %entry ; CHECK:for.body: ; CHECK: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] ; CHECK: %0 = add i64 %indvars.iv, 3 -; CHECK: %arrayidx = getelementptr inbounds i32* %x, i64 %indvars.iv +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvars.iv ; CHECK: store i32 %call, i32* %arrayidx, align 4 -; CHECK: %arrayidx6 = getelementptr inbounds i32* %x, i64 %0 +; CHECK: %arrayidx6 = getelementptr inbounds i32, i32* %x, i64 %0 ; CHECK: store i32 %call, i32* %arrayidx6, align 4 ; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 ; CHECK: %exitcond2 = icmp eq i64 %indvars.iv, 1499 @@ -462,13 +462,13 @@ for.body: ; preds = %for.body, %entry %0 = mul nsw i64 %indvars.iv, 3 %x0 = add nsw i64 %0, 3 %add = add nsw i64 %indvars.iv, 1 - %arrayidx = getelementptr inbounds i32* %x, i64 %x0 + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %x0 store i32 %call, i32* %arrayidx, align 4 %1 = add nsw i64 %0, 4 - %arrayidx4 = getelementptr inbounds i32* %x, i64 %1 + %arrayidx4 = getelementptr inbounds i32, i32* %x, i64 %1 store i32 %call, i32* %arrayidx4, align 4 %2 = add nsw i64 %0, 5 - %arrayidx9 = getelementptr inbounds i32* %x, i64 %2 + %arrayidx9 = getelementptr inbounds i32, i32* %x, i64 %2 store i32 %call, i32* %arrayidx9, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 500 @@ -478,7 +478,7 @@ for.body: ; preds = %for.body, %entry ; CHECK: for.body: ; CHECK: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] ; CHECK: %0 = add i64 %indvars.iv, 3 -; CHECK: %arrayidx = getelementptr inbounds i32* %x, i64 %0 +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %x, i64 %0 ; CHECK: store i32 %call, i32* %arrayidx, align 4 ; CHECK: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 ; CHECK: %exitcond1 = icmp eq i64 %0, 1502 @@ -556,13 +556,13 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %0 = mul nsw i64 %indvars.iv, 3 - %arrayidx = getelementptr inbounds %struct.s* %x, i64 %0, i32 0 + %arrayidx = getelementptr inbounds %struct.s, %struct.s* %x, i64 %0, i32 0 store i32 %call, i32* %arrayidx, align 4 %1 = add nsw i64 %0, 1 - %arrayidx4 = getelementptr inbounds %struct.s* %x, i64 %1, i32 0 + %arrayidx4 = getelementptr inbounds %struct.s, %struct.s* %x, i64 %1, i32 0 store i32 %call, i32* %arrayidx4, align 4 %2 = add nsw i64 %0, 2 - %arrayidx9 = getelementptr inbounds %struct.s* %x, i64 %2, i32 0 + %arrayidx9 = getelementptr inbounds %struct.s, %struct.s* %x, i64 %2, i32 0 store i32 %call, i32* %arrayidx9, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 500 diff --git a/test/Transforms/LoopReroll/nonconst_lb.ll b/test/Transforms/LoopReroll/nonconst_lb.ll index a45469b..5effa42 100644 --- a/test/Transforms/LoopReroll/nonconst_lb.ll +++ b/test/Transforms/LoopReroll/nonconst_lb.ll @@ -17,28 +17,28 @@ entry: for.body: ; preds = %entry, %for.body %i.035 = phi i32 [ %add18, %for.body ], [ %m, %entry ] - %arrayidx = getelementptr inbounds i32* %B, i32 %i.035 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i32 %i.035 + %0 = load i32, i32* %arrayidx, align 4 %mul = shl nsw i32 %0, 2 - %arrayidx2 = getelementptr inbounds i32* %A, i32 %i.035 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i32 %i.035 store i32 %mul, i32* %arrayidx2, align 4 %add3 = add nsw i32 %i.035, 1 - %arrayidx4 = getelementptr inbounds i32* %B, i32 %add3 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %B, i32 %add3 + %1 = load i32, i32* %arrayidx4, align 4 %mul5 = shl nsw i32 %1, 2 - %arrayidx7 = getelementptr inbounds i32* %A, i32 %add3 + %arrayidx7 = getelementptr inbounds i32, i32* %A, i32 %add3 store i32 %mul5, i32* %arrayidx7, align 4 %add8 = add nsw i32 %i.035, 2 - %arrayidx9 = getelementptr inbounds i32* %B, i32 %add8 - %2 = load i32* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds i32, i32* %B, i32 %add8 + %2 = load i32, i32* %arrayidx9, align 4 %mul10 = shl nsw i32 %2, 2 - %arrayidx12 = getelementptr inbounds i32* %A, i32 %add8 + %arrayidx12 = getelementptr inbounds i32, i32* %A, i32 %add8 store i32 %mul10, i32* %arrayidx12, align 4 %add13 = add nsw i32 %i.035, 3 - %arrayidx14 = getelementptr inbounds i32* %B, i32 %add13 - %3 = load i32* %arrayidx14, align 4 + %arrayidx14 = getelementptr inbounds i32, i32* %B, i32 %add13 + %3 = load i32, i32* %arrayidx14, align 4 %mul15 = shl nsw i32 %3, 2 - %arrayidx17 = getelementptr inbounds i32* %A, i32 %add13 + %arrayidx17 = getelementptr inbounds i32, i32* %A, i32 %add13 store i32 %mul15, i32* %arrayidx17, align 4 %add18 = add nsw i32 %i.035, 4 %cmp = icmp slt i32 %add18, %n @@ -60,10 +60,10 @@ for.end: ; preds = %for.body, %entry ; CHECK: for.body: ; preds = %for.body, %for.body.preheader ; CHECK: %indvar = phi i32 [ %indvar.next, %for.body ], [ 0, %for.body.preheader ] ; CHECK: %6 = add i32 %m, %indvar -; CHECK: %arrayidx = getelementptr inbounds i32* %B, i32 %6 -; CHECK: %7 = load i32* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %B, i32 %6 +; CHECK: %7 = load i32, i32* %arrayidx, align 4 ; CHECK: %mul = shl nsw i32 %7, 2 -; CHECK: %arrayidx2 = getelementptr inbounds i32* %A, i32 %6 +; CHECK: %arrayidx2 = getelementptr inbounds i32, i32* %A, i32 %6 ; CHECK: store i32 %mul, i32* %arrayidx2, align 4 ; CHECK: %indvar.next = add i32 %indvar, 1 ; CHECK: %exitcond = icmp eq i32 %6, %5 @@ -88,34 +88,34 @@ entry: for.body: ; preds = %entry, %for.body %i.056 = phi i32 [ %add27, %for.body ], [ %rem, %entry ] - %arrayidx = getelementptr inbounds float* %dy, i32 %i.056 - %0 = load float* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds float* %dx, i32 %i.056 - %1 = load float* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds float, float* %dy, i32 %i.056 + %0 = load float, float* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds float, float* %dx, i32 %i.056 + %1 = load float, float* %arrayidx1, align 4 %mul = fmul float %1, %da %add = fadd float %0, %mul store float %add, float* %arrayidx, align 4 %add3 = add nsw i32 %i.056, 1 - %arrayidx4 = getelementptr inbounds float* %dy, i32 %add3 - %2 = load float* %arrayidx4, align 4 - %arrayidx6 = getelementptr inbounds float* %dx, i32 %add3 - %3 = load float* %arrayidx6, align 4 + %arrayidx4 = getelementptr inbounds float, float* %dy, i32 %add3 + %2 = load float, float* %arrayidx4, align 4 + %arrayidx6 = getelementptr inbounds float, float* %dx, i32 %add3 + %3 = load float, float* %arrayidx6, align 4 %mul7 = fmul float %3, %da %add8 = fadd float %2, %mul7 store float %add8, float* %arrayidx4, align 4 %add11 = add nsw i32 %i.056, 2 - %arrayidx12 = getelementptr inbounds float* %dy, i32 %add11 - %4 = load float* %arrayidx12, align 4 - %arrayidx14 = getelementptr inbounds float* %dx, i32 %add11 - %5 = load float* %arrayidx14, align 4 + %arrayidx12 = getelementptr inbounds float, float* %dy, i32 %add11 + %4 = load float, float* %arrayidx12, align 4 + %arrayidx14 = getelementptr inbounds float, float* %dx, i32 %add11 + %5 = load float, float* %arrayidx14, align 4 %mul15 = fmul float %5, %da %add16 = fadd float %4, %mul15 store float %add16, float* %arrayidx12, align 4 %add19 = add nsw i32 %i.056, 3 - %arrayidx20 = getelementptr inbounds float* %dy, i32 %add19 - %6 = load float* %arrayidx20, align 4 - %arrayidx22 = getelementptr inbounds float* %dx, i32 %add19 - %7 = load float* %arrayidx22, align 4 + %arrayidx20 = getelementptr inbounds float, float* %dy, i32 %add19 + %6 = load float, float* %arrayidx20, align 4 + %arrayidx22 = getelementptr inbounds float, float* %dx, i32 %add19 + %7 = load float, float* %arrayidx22, align 4 %mul23 = fmul float %7, %da %add24 = fadd float %6, %mul23 store float %add24, float* %arrayidx20, align 4 @@ -140,10 +140,10 @@ for.end: ; preds = %for.body, %entry ; CHECK: for.body: ; CHECK: %indvar = phi i32 [ %indvar.next, %for.body ], [ 0, %for.body.preheader ] ; CHECK: %6 = add i32 %rem, %indvar -; CHECK: %arrayidx = getelementptr inbounds float* %dy, i32 %6 -; CHECK: %7 = load float* %arrayidx, align 4 -; CHECK: %arrayidx1 = getelementptr inbounds float* %dx, i32 %6 -; CHECK: %8 = load float* %arrayidx1, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %dy, i32 %6 +; CHECK: %7 = load float, float* %arrayidx, align 4 +; CHECK: %arrayidx1 = getelementptr inbounds float, float* %dx, i32 %6 +; CHECK: %8 = load float, float* %arrayidx1, align 4 ; CHECK: %mul = fmul float %8, %da ; CHECK: %add = fadd float %7, %mul ; CHECK: store float %add, float* %arrayidx, align 4 diff --git a/test/Transforms/LoopReroll/reduction.ll b/test/Transforms/LoopReroll/reduction.ll index a4f168a..1915185 100644 --- a/test/Transforms/LoopReroll/reduction.ll +++ b/test/Transforms/LoopReroll/reduction.ll @@ -9,20 +9,20 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.029 = phi i32 [ 0, %entry ], [ %add12, %for.body ] - %arrayidx = getelementptr inbounds i32* %x, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %r.029 %1 = or i64 %indvars.iv, 1 - %arrayidx3 = getelementptr inbounds i32* %x, i64 %1 - %2 = load i32* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %x, i64 %1 + %2 = load i32, i32* %arrayidx3, align 4 %add4 = add nsw i32 %add, %2 %3 = or i64 %indvars.iv, 2 - %arrayidx7 = getelementptr inbounds i32* %x, i64 %3 - %4 = load i32* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %3 + %4 = load i32, i32* %arrayidx7, align 4 %add8 = add nsw i32 %add4, %4 %5 = or i64 %indvars.iv, 3 - %arrayidx11 = getelementptr inbounds i32* %x, i64 %5 - %6 = load i32* %arrayidx11, align 4 + %arrayidx11 = getelementptr inbounds i32, i32* %x, i64 %5 + %6 = load i32, i32* %arrayidx11, align 4 %add12 = add nsw i32 %add8, %6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 4 %7 = trunc i64 %indvars.iv.next to i32 @@ -34,8 +34,8 @@ for.body: ; preds = %entry, %for.body ; CHECK: for.body: ; CHECK: %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ] ; CHECK: %r.029 = phi i32 [ 0, %entry ], [ %add, %for.body ] -; CHECK: %arrayidx = getelementptr inbounds i32* %x, i64 %indvar -; CHECK: %0 = load i32* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvar +; CHECK: %0 = load i32, i32* %arrayidx, align 4 ; CHECK: %add = add nsw i32 %0, %r.029 ; CHECK: %indvar.next = add i64 %indvar, 1 ; CHECK: %exitcond = icmp eq i64 %indvar, 399 @@ -54,20 +54,20 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.029 = phi float [ 0.0, %entry ], [ %add12, %for.body ] - %arrayidx = getelementptr inbounds float* %x, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %x, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %add = fadd float %0, %r.029 %1 = or i64 %indvars.iv, 1 - %arrayidx3 = getelementptr inbounds float* %x, i64 %1 - %2 = load float* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds float, float* %x, i64 %1 + %2 = load float, float* %arrayidx3, align 4 %add4 = fadd float %add, %2 %3 = or i64 %indvars.iv, 2 - %arrayidx7 = getelementptr inbounds float* %x, i64 %3 - %4 = load float* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds float, float* %x, i64 %3 + %4 = load float, float* %arrayidx7, align 4 %add8 = fadd float %add4, %4 %5 = or i64 %indvars.iv, 3 - %arrayidx11 = getelementptr inbounds float* %x, i64 %5 - %6 = load float* %arrayidx11, align 4 + %arrayidx11 = getelementptr inbounds float, float* %x, i64 %5 + %6 = load float, float* %arrayidx11, align 4 %add12 = fadd float %add8, %6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 4 %7 = trunc i64 %indvars.iv.next to i32 @@ -79,8 +79,8 @@ for.body: ; preds = %entry, %for.body ; CHECK: for.body: ; CHECK: %indvar = phi i64 [ %indvar.next, %for.body ], [ 0, %entry ] ; CHECK: %r.029 = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ] -; CHECK: %arrayidx = getelementptr inbounds float* %x, i64 %indvar -; CHECK: %0 = load float* %arrayidx, align 4 +; CHECK: %arrayidx = getelementptr inbounds float, float* %x, i64 %indvar +; CHECK: %0 = load float, float* %arrayidx, align 4 ; CHECK: %add = fadd float %0, %r.029 ; CHECK: %indvar.next = add i64 %indvar, 1 ; CHECK: %exitcond = icmp eq i64 %indvar, 399 @@ -99,20 +99,20 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.029 = phi i32 [ 0, %entry ], [ %add12, %for.body ] - %arrayidx = getelementptr inbounds i32* %x, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %0 %1 = or i64 %indvars.iv, 1 - %arrayidx3 = getelementptr inbounds i32* %x, i64 %1 - %2 = load i32* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %x, i64 %1 + %2 = load i32, i32* %arrayidx3, align 4 %add4 = add nsw i32 %add, %2 %3 = or i64 %indvars.iv, 2 - %arrayidx7 = getelementptr inbounds i32* %x, i64 %3 - %4 = load i32* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %x, i64 %3 + %4 = load i32, i32* %arrayidx7, align 4 %add8 = add nsw i32 %add4, %4 %5 = or i64 %indvars.iv, 3 - %arrayidx11 = getelementptr inbounds i32* %x, i64 %5 - %6 = load i32* %arrayidx11, align 4 + %arrayidx11 = getelementptr inbounds i32, i32* %x, i64 %5 + %6 = load i32, i32* %arrayidx11, align 4 %add12 = add nsw i32 %add8, %6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 4 %7 = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopRotate/PhiRename-1.ll b/test/Transforms/LoopRotate/PhiRename-1.ll index a224777..8ec0fbf 100644 --- a/test/Transforms/LoopRotate/PhiRename-1.ll +++ b/test/Transforms/LoopRotate/PhiRename-1.ll @@ -36,59 +36,59 @@ entry: %op = alloca %struct.operator*, align 4 ; <%struct.operator**> [#uses=3] store i32 %arity, i32* %arity_addr store i32 0, i32* %c - %tmp1 = load %struct.list** @operators ; <%struct.list*> [#uses=1] + %tmp1 = load %struct.list*, %struct.list** @operators ; <%struct.list*> [#uses=1] store %struct.list* %tmp1, %struct.list** %l br label %bb21 bb: ; preds = %bb21 - %tmp3 = getelementptr %struct.list* %tmp22, i32 0, i32 0 ; <i8**> [#uses=1] - %tmp4 = load i8** %tmp3 ; <i8*> [#uses=1] + %tmp3 = getelementptr %struct.list, %struct.list* %tmp22, i32 0, i32 0 ; <i8**> [#uses=1] + %tmp4 = load i8*, i8** %tmp3 ; <i8*> [#uses=1] %tmp45 = bitcast i8* %tmp4 to %struct.operator* ; <%struct.operator*> [#uses=1] store %struct.operator* %tmp45, %struct.operator** %op - %tmp6 = load %struct.operator** %op ; <%struct.operator*> [#uses=1] - %tmp7 = getelementptr %struct.operator* %tmp6, i32 0, i32 5 ; <i32*> [#uses=1] - %tmp8 = load i32* %tmp7 ; <i32> [#uses=1] - %tmp9 = load i32* %arity_addr ; <i32> [#uses=1] + %tmp6 = load %struct.operator*, %struct.operator** %op ; <%struct.operator*> [#uses=1] + %tmp7 = getelementptr %struct.operator, %struct.operator* %tmp6, i32 0, i32 5 ; <i32*> [#uses=1] + %tmp8 = load i32, i32* %tmp7 ; <i32> [#uses=1] + %tmp9 = load i32, i32* %arity_addr ; <i32> [#uses=1] icmp eq i32 %tmp8, %tmp9 ; <i1>:0 [#uses=1] zext i1 %0 to i8 ; <i8>:1 [#uses=1] icmp ne i8 %1, 0 ; <i1>:2 [#uses=1] br i1 %2, label %cond_true, label %cond_next cond_true: ; preds = %bb - %tmp10 = load %struct.operator** %op ; <%struct.operator*> [#uses=1] - %tmp11 = getelementptr %struct.operator* %tmp10, i32 0, i32 2 ; <i32*> [#uses=1] - %tmp12 = load i32* %tmp11 ; <i32> [#uses=1] - %tmp13 = load %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1] - %tmp14 = getelementptr [11 x i8]* @str1, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp10 = load %struct.operator*, %struct.operator** %op ; <%struct.operator*> [#uses=1] + %tmp11 = getelementptr %struct.operator, %struct.operator* %tmp10, i32 0, i32 2 ; <i32*> [#uses=1] + %tmp12 = load i32, i32* %tmp11 ; <i32> [#uses=1] + %tmp13 = load %struct.FILE*, %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1] + %tmp14 = getelementptr [11 x i8], [11 x i8]* @str1, i32 0, i32 0 ; <i8*> [#uses=1] %tmp15 = call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 ) ; <i32> [#uses=0] - %tmp16 = load i32* %c ; <i32> [#uses=1] + %tmp16 = load i32, i32* %c ; <i32> [#uses=1] %tmp17 = add i32 %tmp16, 1 ; <i32> [#uses=1] store i32 %tmp17, i32* %c br label %cond_next cond_next: ; preds = %cond_true, %bb - %tmp19 = getelementptr %struct.list* %tmp22, i32 0, i32 1 ; <%struct.list**> [#uses=1] - %tmp20 = load %struct.list** %tmp19 ; <%struct.list*> [#uses=1] + %tmp19 = getelementptr %struct.list, %struct.list* %tmp22, i32 0, i32 1 ; <%struct.list**> [#uses=1] + %tmp20 = load %struct.list*, %struct.list** %tmp19 ; <%struct.list*> [#uses=1] store %struct.list* %tmp20, %struct.list** %l br label %bb21 bb21: ; preds = %cond_next, %entry %l.in = phi %struct.list** [ @operators, %entry ], [ %tmp19, %cond_next ] - %tmp22 = load %struct.list** %l.in ; <%struct.list*> [#uses=1] + %tmp22 = load %struct.list*, %struct.list** %l.in ; <%struct.list*> [#uses=1] icmp ne %struct.list* %tmp22, null ; <i1>:3 [#uses=1] zext i1 %3 to i8 ; <i8>:4 [#uses=1] icmp ne i8 %4, 0 ; <i1>:5 [#uses=1] br i1 %5, label %bb, label %bb23 bb23: ; preds = %bb21 - %tmp24 = load i32* %c ; <i32> [#uses=1] + %tmp24 = load i32, i32* %c ; <i32> [#uses=1] store i32 %tmp24, i32* %tmp - %tmp25 = load i32* %tmp ; <i32> [#uses=1] + %tmp25 = load i32, i32* %tmp ; <i32> [#uses=1] store i32 %tmp25, i32* %retval br label %return return: ; preds = %bb23 - %retval26 = load i32* %retval ; <i32> [#uses=1] + %retval26 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval26 } diff --git a/test/Transforms/LoopRotate/PhiSelfReference-1.ll b/test/Transforms/LoopRotate/PhiSelfReference-1.ll index aa1708e..ed49448 100644 --- a/test/Transforms/LoopRotate/PhiSelfReference-1.ll +++ b/test/Transforms/LoopRotate/PhiSelfReference-1.ll @@ -28,7 +28,7 @@ bb243: ; preds = %bb307 bb307: ; preds = %bb243, %bb52 %sx_addr.2.pn = phi float* [ %sx_addr.5, %bb243 ], [ null, %bb52 ] ; <float*> [#uses=1] - %sx_addr.5 = getelementptr float* %sx_addr.2.pn, i32 %incx ; <float*> [#uses=1] + %sx_addr.5 = getelementptr float, float* %sx_addr.2.pn, i32 %incx ; <float*> [#uses=1] br i1 false, label %bb243, label %bb310 bb310: ; preds = %bb307 diff --git a/test/Transforms/LoopRotate/alloca.ll b/test/Transforms/LoopRotate/alloca.ll index fd217ea..bbcfb39 100644 --- a/test/Transforms/LoopRotate/alloca.ll +++ b/test/Transforms/LoopRotate/alloca.ll @@ -14,7 +14,7 @@ declare void @use(i8*) define void @test() { entry: - %end = load i16* @e + %end = load i16, i16* @e br label %loop loop: diff --git a/test/Transforms/LoopRotate/basic.ll b/test/Transforms/LoopRotate/basic.ll index 6b92a6e..9c04fa2 100644 --- a/test/Transforms/LoopRotate/basic.ll +++ b/test/Transforms/LoopRotate/basic.ll @@ -13,7 +13,7 @@ entry: for.cond: ; preds = %for.body, %entry %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ] %cmp = icmp slt i32 %i.0, 100 - %arrayidx = getelementptr inbounds [20 x i32]* %array, i64 0, i64 0 + %arrayidx = getelementptr inbounds [20 x i32], [20 x i32]* %array, i64 0, i64 0 br i1 %cmp, label %for.body, label %for.end ; CHECK: for.body: diff --git a/test/Transforms/LoopRotate/crash.ll b/test/Transforms/LoopRotate/crash.ll index e95f9a1..5e2b66d 100644 --- a/test/Transforms/LoopRotate/crash.ll +++ b/test/Transforms/LoopRotate/crash.ll @@ -125,7 +125,7 @@ entry: br label %bb15 bb6: ; preds = %bb15 %gep.upgrd.1 = zext i32 %offset.1 to i64 ; <i64> [#uses=1] - %tmp11 = getelementptr i8* %msg, i64 %gep.upgrd.1 ; <i8*> [#uses=0] + %tmp11 = getelementptr i8, i8* %msg, i64 %gep.upgrd.1 ; <i8*> [#uses=0] br label %bb15 bb15: ; preds = %bb6, %entry %offset.1 = add i32 0, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/LoopRotate/dbgvalue.ll b/test/Transforms/LoopRotate/dbgvalue.ll index 846b366..075cdf9 100644 --- a/test/Transforms/LoopRotate/dbgvalue.ll +++ b/test/Transforms/LoopRotate/dbgvalue.ll @@ -15,9 +15,9 @@ tailrecurse: ; preds = %if.then, %entry %x.tr = phi i32 [ %x, %entry ], [ %call, %if.then ] %y.tr = phi i32 [ %y, %entry ], [ %call9, %if.then ] %z.tr = phi i32 [ %z, %entry ], [ %call14, %if.then ] - tail call void @llvm.dbg.value(metadata i32 %x.tr, i64 0, metadata !6, metadata !{}), !dbg !7 - tail call void @llvm.dbg.value(metadata i32 %y.tr, i64 0, metadata !8, metadata !{}), !dbg !9 - tail call void @llvm.dbg.value(metadata i32 %z.tr, i64 0, metadata !10, metadata !{}), !dbg !11 + tail call void @llvm.dbg.value(metadata i32 %x.tr, i64 0, metadata !6, metadata !MDExpression()), !dbg !7 + tail call void @llvm.dbg.value(metadata i32 %y.tr, i64 0, metadata !8, metadata !MDExpression()), !dbg !9 + tail call void @llvm.dbg.value(metadata i32 %z.tr, i64 0, metadata !10, metadata !MDExpression()), !dbg !11 %cmp = icmp slt i32 %y.tr, %x.tr, !dbg !12 br i1 %cmp, label %if.then, label %if.end, !dbg !12 @@ -61,18 +61,18 @@ for.cond: br i1 %cmp, label %for.end, label %for.body for.body: - %0 = load i64* @channelColumns, align 8 + %0 = load i64, i64* @channelColumns, align 8 %mul = mul i64 %0, %row %add = add i64 %mul, %i.0 - %1 = load i8** @horzPlane, align 8 - %arrayidx = getelementptr inbounds i8* %1, i64 %add - %2 = load i8* %arrayidx, align 1 + %1 = load i8*, i8** @horzPlane, align 8 + %arrayidx = getelementptr inbounds i8, i8* %1, i64 %add + %2 = load i8, i8* %arrayidx, align 1 %tobool = icmp eq i8 %2, 0 br i1 %tobool, label %for.inc, label %for.end for.inc: %dec = add i64 %i.0, -1 - tail call void @llvm.dbg.value(metadata i64 %dec, i64 0, metadata !{!"undef"}, metadata !{}) + tail call void @llvm.dbg.value(metadata i64 %dec, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !0), metadata !MDExpression()) br label %for.cond for.end: @@ -84,24 +84,24 @@ for.end: !llvm.module.flags = !{!20} !llvm.dbg.sp = !{!0} -!0 = !{!"0x2e\00tak\00tak\00\0032\000\001\000\006\00256\000\000", !18, !1, !3, null, i32 (i32, i32, i32)* @tak, null, null, null} ; [ DW_TAG_subprogram ] [line 32] [def] [scope 0] [tak] -!1 = !{!"0x29", !18} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00clang version 2.9 (trunk 125492)\001\00\000\00\000", !18, !19, !19, null, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !18, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "tak", line: 32, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !18, scope: !1, type: !3, function: i32 (i32, i32, i32)* @tak) +!1 = !MDFile(filename: "/Volumes/Lalgate/cj/llvm/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame/recursive.c", directory: "/Volumes/Lalgate/cj/D/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 125492)", isOptimized: true, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19) +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !2} ; [ DW_TAG_base_type ] -!6 = !{!"0x101\00x\0032\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 32, arg: 0, scope: !0, file: !1, type: !5) !7 = !MDLocation(line: 32, column: 13, scope: !0) -!8 = !{!"0x101\00y\0032\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] +!8 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 32, arg: 0, scope: !0, file: !1, type: !5) !9 = !MDLocation(line: 32, column: 20, scope: !0) -!10 = !{!"0x101\00z\0032\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] +!10 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "z", line: 32, arg: 0, scope: !0, file: !1, type: !5) !11 = !MDLocation(line: 32, column: 27, scope: !0) !12 = !MDLocation(line: 33, column: 3, scope: !13) -!13 = !{!"0xb\0032\0030\006", !18, !0} ; [ DW_TAG_lexical_block ] +!13 = distinct !MDLexicalBlock(line: 32, column: 30, file: !18, scope: !0) !14 = !MDLocation(line: 34, column: 5, scope: !15) -!15 = !{!"0xb\0033\0014\007", !18, !13} ; [ DW_TAG_lexical_block ] +!15 = distinct !MDLexicalBlock(line: 33, column: 14, file: !18, scope: !13) !16 = !MDLocation(line: 36, column: 3, scope: !13) !17 = !MDLocation(line: 37, column: 1, scope: !13) -!18 = !{!"/Volumes/Lalgate/cj/llvm/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame/recursive.c", !"/Volumes/Lalgate/cj/D/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame"} +!18 = !MDFile(filename: "/Volumes/Lalgate/cj/llvm/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame/recursive.c", directory: "/Volumes/Lalgate/cj/D/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame") !19 = !{i32 0} -!20 = !{i32 1, !"Debug Info Version", i32 2} +!20 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/LoopRotate/indirectbr.ll b/test/Transforms/LoopRotate/indirectbr.ll index 9c82aa8..2ccc546 100644 --- a/test/Transforms/LoopRotate/indirectbr.ll +++ b/test/Transforms/LoopRotate/indirectbr.ll @@ -12,7 +12,7 @@ while.body: ; preds = %while.cond br label %indirectgoto run_opcode: ; preds = %indirectgoto - %tmp276 = load i8* undef ; <i8> [#uses=1] + %tmp276 = load i8, i8* undef ; <i8> [#uses=1] br label %indirectgoto if.else295: ; preds = %divide_late diff --git a/test/Transforms/LoopRotate/multiple-exits.ll b/test/Transforms/LoopRotate/multiple-exits.ll index cc8738e..f31ed7f 100644 --- a/test/Transforms/LoopRotate/multiple-exits.ll +++ b/test/Transforms/LoopRotate/multiple-exits.ll @@ -21,8 +21,8 @@ for.cond1: ; preds = %for.cond, %land.rhs land.rhs: ; preds = %for.cond1 %conv = zext i32 %i.1 to i64 - %arrayidx = getelementptr inbounds [100 x i32]* %a, i64 0, i64 %conv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* %a, i64 0, i64 %conv + %0 = load i32, i32* %arrayidx, align 4 %add = add i32 %0, %sum.1 %cmp4 = icmp ugt i32 %add, 1000 %inc = add i32 %i.1, 1 diff --git a/test/Transforms/LoopRotate/nosimplifylatch.ll b/test/Transforms/LoopRotate/nosimplifylatch.ll index 8e858b4..07ff664 100644 --- a/test/Transforms/LoopRotate/nosimplifylatch.ll +++ b/test/Transforms/LoopRotate/nosimplifylatch.ll @@ -18,13 +18,13 @@ for.cond: ; preds = %for.inc, %entry br i1 %lnot.i, label %for.end, label %for.body for.body: ; preds = %for.cond - %0 = load i32* %coerce.val.ip9, align 4 - %1 = load i32* %__value_, align 4 + %0 = load i32, i32* %coerce.val.ip9, align 4 + %1 = load i32, i32* %__value_, align 4 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %for.end, label %for.inc for.inc: ; preds = %for.body - %incdec.ptr.i = getelementptr inbounds i32* %coerce.val.ip9, i64 1 + %incdec.ptr.i = getelementptr inbounds i32, i32* %coerce.val.ip9, i64 1 br label %for.cond for.end: ; preds = %for.cond, %for.body diff --git a/test/Transforms/LoopRotate/phi-duplicate.ll b/test/Transforms/LoopRotate/phi-duplicate.ll index 86a4f2a..46ee596 100644 --- a/test/Transforms/LoopRotate/phi-duplicate.ll +++ b/test/Transforms/LoopRotate/phi-duplicate.ll @@ -13,13 +13,13 @@ for.cond: ; preds = %for.body, %entry br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %arrayidx = getelementptr inbounds double* %G, i64 %j.0 ; <double*> [#uses=1] - %tmp3 = load double* %arrayidx ; <double> [#uses=1] + %arrayidx = getelementptr inbounds double, double* %G, i64 %j.0 ; <double*> [#uses=1] + %tmp3 = load double, double* %arrayidx ; <double> [#uses=1] %sub = sub i64 %j.0, 1 ; <i64> [#uses=1] - %arrayidx6 = getelementptr inbounds double* %G, i64 %sub ; <double*> [#uses=1] - %tmp7 = load double* %arrayidx6 ; <double> [#uses=1] + %arrayidx6 = getelementptr inbounds double, double* %G, i64 %sub ; <double*> [#uses=1] + %tmp7 = load double, double* %arrayidx6 ; <double> [#uses=1] %add = fadd double %tmp3, %tmp7 ; <double> [#uses=1] - %arrayidx10 = getelementptr inbounds double* %G, i64 %j.0 ; <double*> [#uses=1] + %arrayidx10 = getelementptr inbounds double, double* %G, i64 %j.0 ; <double*> [#uses=1] store double %add, double* %arrayidx10 %inc = add nsw i64 %j.0, 1 ; <i64> [#uses=1] br label %for.cond diff --git a/test/Transforms/LoopRotate/pr22337.ll b/test/Transforms/LoopRotate/pr22337.ll index c2893db..03e804b 100644 --- a/test/Transforms/LoopRotate/pr22337.ll +++ b/test/Transforms/LoopRotate/pr22337.ll @@ -5,7 +5,7 @@ define void @f() { ; CHECK-LABEL: define void @f( -; CHECK: getelementptr i8* @a, i32 0 +; CHECK: getelementptr i8, i8* @a, i32 0 entry: br label %for.preheader @@ -16,7 +16,7 @@ for.body: br i1 undef, label %if.end, label %if.then8 if.end: - %arrayidx = getelementptr i8* @a, i32 0 + %arrayidx = getelementptr i8, i8* @a, i32 0 br label %for.preheader if.then8: diff --git a/test/Transforms/LoopRotate/simplifylatch.ll b/test/Transforms/LoopRotate/simplifylatch.ll index 62e5b1a..215622f 100644 --- a/test/Transforms/LoopRotate/simplifylatch.ll +++ b/test/Transforms/LoopRotate/simplifylatch.ll @@ -13,8 +13,8 @@ entry: bb: ; preds = %bb4, %entry %mode.0 = phi i8 [ 0, %entry ], [ %indvar.next, %bb4 ] ; <i8> [#uses=4] zext i8 %mode.0 to i32 ; <i32>:1 [#uses=1] - getelementptr [4 x i32]* @mode_table, i32 0, i32 %1 ; <i32*>:2 [#uses=1] - load i32* %2, align 4 ; <i32>:3 [#uses=1] + getelementptr [4 x i32], [4 x i32]* @mode_table, i32 0, i32 %1 ; <i32*>:2 [#uses=1] + load i32, i32* %2, align 4 ; <i32>:3 [#uses=1] icmp eq i32 %3, %0 ; <i1>:4 [#uses=1] br i1 %4, label %bb1, label %bb2 @@ -39,8 +39,8 @@ declare i32 @fegetround() declare void @raise_exception() noreturn ;CHECK: for.body.lr.ph: -;CHECK-NEXT: %arrayidx1 = getelementptr inbounds i8* %CurPtr, i64 0 -;CHECK-NEXT: %0 = load i8* %arrayidx1, align 1 +;CHECK-NEXT: %arrayidx1 = getelementptr inbounds i8, i8* %CurPtr, i64 0 +;CHECK-NEXT: %0 = load i8, i8* %arrayidx1, align 1 ;CHECK-NEXT: %conv2 = sext i8 %0 to i32 ;CHECK-NEXT: br label %for.body @@ -55,11 +55,11 @@ for.cond: ; preds = %for.inc, %entry for.body: ; preds = %for.cond %idxprom = zext i32 %i.0 to i64 - %arrayidx = getelementptr inbounds i8* %CurPtr, i64 %idxprom - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %CurPtr, i64 %idxprom + %0 = load i8, i8* %arrayidx, align 1 %conv = sext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8* %CurPtr, i64 0 - %1 = load i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %CurPtr, i64 0 + %1 = load i8, i8* %arrayidx1, align 1 %conv2 = sext i8 %1 to i32 %cmp3 = icmp ne i32 %conv, %conv2 br i1 %cmp3, label %return, label %for.inc diff --git a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll index 73f0813..4a69067 100644 --- a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll +++ b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll @@ -8,29 +8,29 @@ target datalayout = "e-p:32:32" define i32 @_yylex() { br label %loopentry.0 loopentry.0: ; preds = %else.26, %0 - store i32* getelementptr ([16386 x i32]* @yy_state_buf, i64 0, i64 0), i32** @yy_state_ptr - %tmp.35 = load i32** @yy_state_ptr ; <i32*> [#uses=2] - %inc.0 = getelementptr i32* %tmp.35, i64 1 ; <i32*> [#uses=1] + store i32* getelementptr ([16386 x i32], [16386 x i32]* @yy_state_buf, i64 0, i64 0), i32** @yy_state_ptr + %tmp.35 = load i32*, i32** @yy_state_ptr ; <i32*> [#uses=2] + %inc.0 = getelementptr i32, i32* %tmp.35, i64 1 ; <i32*> [#uses=1] store i32* %inc.0, i32** @yy_state_ptr - %tmp.36 = load i32* null ; <i32> [#uses=1] + %tmp.36 = load i32, i32* null ; <i32> [#uses=1] store i32 %tmp.36, i32* %tmp.35 br label %loopexit.2 loopexit.2: ; preds = %else.26, %loopexit.2, %loopentry.0 store i8* null, i8** null - %tmp.91 = load i32* null ; <i32> [#uses=1] + %tmp.91 = load i32, i32* null ; <i32> [#uses=1] %tmp.92 = sext i32 %tmp.91 to i64 ; <i64> [#uses=1] - %tmp.93 = getelementptr [787 x i16]* @yy_base, i64 0, i64 %tmp.92 ; <i16*> [#uses=1] - %tmp.94 = load i16* %tmp.93 ; <i16> [#uses=1] + %tmp.93 = getelementptr [787 x i16], [787 x i16]* @yy_base, i64 0, i64 %tmp.92 ; <i16*> [#uses=1] + %tmp.94 = load i16, i16* %tmp.93 ; <i16> [#uses=1] %tmp.95 = icmp ne i16 %tmp.94, 4394 ; <i1> [#uses=1] br i1 %tmp.95, label %loopexit.2, label %yy_find_action yy_find_action: ; preds = %else.26, %loopexit.2 br label %loopentry.3 loopentry.3: ; preds = %then.9, %shortcirc_done.0, %yy_find_action - %tmp.105 = load i32* @yy_lp ; <i32> [#uses=1] + %tmp.105 = load i32, i32* @yy_lp ; <i32> [#uses=1] %tmp.106 = icmp ne i32 %tmp.105, 0 ; <i1> [#uses=1] br i1 %tmp.106, label %shortcirc_next.0, label %shortcirc_done.0 shortcirc_next.0: ; preds = %loopentry.3 - %tmp.114 = load i16* null ; <i16> [#uses=1] + %tmp.114 = load i16, i16* null ; <i16> [#uses=1] %tmp.115 = sext i16 %tmp.114 to i32 ; <i32> [#uses=1] %tmp.116 = icmp slt i32 0, %tmp.115 ; <i1> [#uses=1] br label %shortcirc_done.0 @@ -38,7 +38,7 @@ shortcirc_done.0: ; preds = %shortcirc_next.0, %loopentry.3 %shortcirc_val.0 = phi i1 [ false, %loopentry.3 ], [ %tmp.116, %shortcirc_next.0 ] ; <i1> [#uses=1] br i1 %shortcirc_val.0, label %else.0, label %loopentry.3 else.0: ; preds = %shortcirc_done.0 - %tmp.144 = load i32* null ; <i32> [#uses=1] + %tmp.144 = load i32, i32* null ; <i32> [#uses=1] %tmp.145 = and i32 %tmp.144, 8192 ; <i32> [#uses=1] %tmp.146 = icmp ne i32 %tmp.145, 0 ; <i1> [#uses=1] br i1 %tmp.146, label %then.9, label %else.26 diff --git a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll index fb39f05..32b6322 100644 --- a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll +++ b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll @@ -14,15 +14,15 @@ entry: store i32 123, i32* @G br label %loopentry.i loopentry.i: ; preds = %endif.1.i, %entry - %tmp.0.i = load i32* @G ; <i32> [#uses=1] + %tmp.0.i = load i32, i32* @G ; <i32> [#uses=1] %tmp.1.i = icmp eq i32 %tmp.0.i, 123 ; <i1> [#uses=1] br i1 %tmp.1.i, label %Out.i, label %endif.0.i endif.0.i: ; preds = %loopentry.i - %tmp.3.i = load i32* @G ; <i32> [#uses=1] + %tmp.3.i = load i32, i32* @G ; <i32> [#uses=1] %tmp.4.i = icmp eq i32 %tmp.3.i, 126 ; <i1> [#uses=1] br i1 %tmp.4.i, label %ExitBlock.i, label %endif.1.i endif.1.i: ; preds = %endif.0.i - %tmp.6.i = load i32* @G ; <i32> [#uses=1] + %tmp.6.i = load i32, i32* @G ; <i32> [#uses=1] %inc.i = add i32 %tmp.6.i, 1 ; <i32> [#uses=1] store i32 %inc.i, i32* @G br label %loopentry.i @@ -30,7 +30,7 @@ Out.i: ; preds = %loopentry.i store i32 0, i32* @G br label %ExitBlock.i ExitBlock.i: ; preds = %Out.i, %endif.0.i - %tmp.7.i = load i32* @G ; <i32> [#uses=1] + %tmp.7.i = load i32, i32* @G ; <i32> [#uses=1] ret i32 %tmp.7.i } diff --git a/test/Transforms/LoopSimplify/ashr-crash.ll b/test/Transforms/LoopSimplify/ashr-crash.ll index c58903d..b5cc144 100644 --- a/test/Transforms/LoopSimplify/ashr-crash.ll +++ b/test/Transforms/LoopSimplify/ashr-crash.ll @@ -51,10 +51,10 @@ for.cond1: ; preds = %for.cond, %for.body br i1 %cmp2, label %for.body3, label %for.inc7 for.body3: ; preds = %for.cond1 - %0 = load i32* @c, align 4 + %0 = load i32, i32* @c, align 4 %cmp4 = icmp sge i32 %storemerge1, %0 %conv = zext i1 %cmp4 to i32 - %1 = load i32* @d, align 4 + %1 = load i32, i32* @d, align 4 %add = add nsw i32 %conv, %1 %sext = shl i32 %add, 16 %conv6 = ashr exact i32 %sext, 16 @@ -63,7 +63,7 @@ for.body3: ; preds = %for.cond1 br label %for.cond1 for.inc7: ; preds = %for.cond1 - %2 = load i32* @d, align 4 + %2 = load i32, i32* @d, align 4 %inc8 = add nsw i32 %2, 1 br label %for.cond diff --git a/test/Transforms/LoopSimplify/merge-exits.ll b/test/Transforms/LoopSimplify/merge-exits.ll index 9678148..5cdf814 100644 --- a/test/Transforms/LoopSimplify/merge-exits.ll +++ b/test/Transforms/LoopSimplify/merge-exits.ll @@ -15,18 +15,18 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define float @test1(float* %pTmp1, float* %peakWeight, i32 %bandEdgeIndex) nounwind { entry: - %t0 = load float* %peakWeight, align 4 + %t0 = load float, float* %peakWeight, align 4 br label %bb1 bb: ; preds = %bb2 %t1 = sext i32 %hiPart.0 to i64 - %t2 = getelementptr float* %pTmp1, i64 %t1 - %t3 = load float* %t2, align 4 + %t2 = getelementptr float, float* %pTmp1, i64 %t1 + %t3 = load float, float* %t2, align 4 %t4 = fadd float %t3, %distERBhi.0 %t5 = add i32 %hiPart.0, 1 %t6 = sext i32 %t5 to i64 - %t7 = getelementptr float* %peakWeight, i64 %t6 - %t8 = load float* %t7, align 4 + %t7 = getelementptr float, float* %peakWeight, i64 %t6 + %t8 = load float, float* %t7, align 4 %t9 = fadd float %t8, %peakCount.0 br label %bb1 diff --git a/test/Transforms/LoopSimplify/notify-scev.ll b/test/Transforms/LoopSimplify/notify-scev.ll index ee8e2ee..059b589 100644 --- a/test/Transforms/LoopSimplify/notify-scev.ll +++ b/test/Transforms/LoopSimplify/notify-scev.ll @@ -60,7 +60,7 @@ for.inc172.us: br i1 undef, label %for.cond142.preheader.us, label %for.end174.us for.body145.us: - %arrayidx163.us = getelementptr inbounds %struct.Params* undef, i64 0, i32 0, i64 %idxprom130, i64 %idxprom146.us + %arrayidx163.us = getelementptr inbounds %struct.Params, %struct.Params* undef, i64 0, i32 0, i64 %idxprom130, i64 %idxprom146.us br i1 undef, label %for.body145.us, label %for.inc172.us for.cond142.preheader.us: diff --git a/test/Transforms/LoopSimplify/phi-node-simplify.ll b/test/Transforms/LoopSimplify/phi-node-simplify.ll index 8eb63d9..6536acb 100644 --- a/test/Transforms/LoopSimplify/phi-node-simplify.ll +++ b/test/Transforms/LoopSimplify/phi-node-simplify.ll @@ -12,29 +12,29 @@ entry: br label %loopentry.1 loopentry.1: ; preds = %loopexit.1, %entry %indvar20 = phi i32 [ 0, %entry ], [ %indvar.next21, %loopexit.1 ] ; <i32> [#uses=1] - %a.1 = phi i32* [ getelementptr ([3000000 x i32]* @A, i32 0, i32 0), %entry ], [ %inc.0, %loopexit.1 ] ; <i32*> [#uses=1] + %a.1 = phi i32* [ getelementptr ([3000000 x i32], [3000000 x i32]* @A, i32 0, i32 0), %entry ], [ %inc.0, %loopexit.1 ] ; <i32*> [#uses=1] br label %no_exit.2 no_exit.2: ; preds = %loopexit.2, %no_exit.2, %loopentry.1 %a.0.4.ph = phi i32* [ %a.1, %loopentry.1 ], [ %inc.0, %loopexit.2 ], [ %a.0.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] - %b.1.4.ph = phi i32* [ getelementptr ([20000 x i32]* @B, i32 0, i32 0), %loopentry.1 ], [ %inc.1, %loopexit.2 ], [ %b.1.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] + %b.1.4.ph = phi i32* [ getelementptr ([20000 x i32], [20000 x i32]* @B, i32 0, i32 0), %loopentry.1 ], [ %inc.1, %loopexit.2 ], [ %b.1.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] %indvar17 = phi i32 [ 0, %loopentry.1 ], [ %indvar.next18, %loopexit.2 ], [ %indvar17, %no_exit.2 ] ; <i32> [#uses=2] %indvar = phi i32 [ %indvar.next, %no_exit.2 ], [ 0, %loopexit.2 ], [ 0, %loopentry.1 ] ; <i32> [#uses=5] %b.1.4.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=1] %gep.upgrd.1 = zext i32 %indvar to i64 ; <i64> [#uses=1] - %c.2.4 = getelementptr [100 x i32]* @C, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %c.2.4 = getelementptr [100 x i32], [100 x i32]* @C, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] %gep.upgrd.2 = zext i32 %indvar to i64 ; <i64> [#uses=1] - %a.0.4 = getelementptr i32* %a.0.4.ph, i64 %gep.upgrd.2 ; <i32*> [#uses=1] + %a.0.4 = getelementptr i32, i32* %a.0.4.ph, i64 %gep.upgrd.2 ; <i32*> [#uses=1] %gep.upgrd.3 = zext i32 %indvar to i64 ; <i64> [#uses=1] - %b.1.4 = getelementptr i32* %b.1.4.ph, i64 %gep.upgrd.3 ; <i32*> [#uses=1] + %b.1.4 = getelementptr i32, i32* %b.1.4.ph, i64 %gep.upgrd.3 ; <i32*> [#uses=1] %inc.0.rec = add i32 %b.1.4.rec, 1 ; <i32> [#uses=2] - %inc.0 = getelementptr i32* %a.0.4.ph, i32 %inc.0.rec ; <i32*> [#uses=2] - %tmp.13 = load i32* %a.0.4 ; <i32> [#uses=1] - %inc.1 = getelementptr i32* %b.1.4.ph, i32 %inc.0.rec ; <i32*> [#uses=1] - %tmp.15 = load i32* %b.1.4 ; <i32> [#uses=1] - %tmp.18 = load i32* %c.2.4 ; <i32> [#uses=1] + %inc.0 = getelementptr i32, i32* %a.0.4.ph, i32 %inc.0.rec ; <i32*> [#uses=2] + %tmp.13 = load i32, i32* %a.0.4 ; <i32> [#uses=1] + %inc.1 = getelementptr i32, i32* %b.1.4.ph, i32 %inc.0.rec ; <i32*> [#uses=1] + %tmp.15 = load i32, i32* %b.1.4 ; <i32> [#uses=1] + %tmp.18 = load i32, i32* %c.2.4 ; <i32> [#uses=1] %tmp.16 = mul i32 %tmp.15, %tmp.13 ; <i32> [#uses=1] %tmp.19 = mul i32 %tmp.16, %tmp.18 ; <i32> [#uses=1] - %tmp.20 = load i32* @Z ; <i32> [#uses=1] + %tmp.20 = load i32, i32* @Z ; <i32> [#uses=1] %tmp.21 = add i32 %tmp.19, %tmp.20 ; <i32> [#uses=1] store i32 %tmp.21, i32* @Z %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/LoopSimplify/preserve-scev.ll b/test/Transforms/LoopSimplify/preserve-scev.ll index 89626b2..f6fa8af 100644 --- a/test/Transforms/LoopSimplify/preserve-scev.ll +++ b/test/Transforms/LoopSimplify/preserve-scev.ll @@ -1,6 +1,9 @@ ; RUN: opt -S < %s -indvars | opt -analyze -iv-users | grep "%cmp = icmp slt i32" | grep "= {%\.ph,+,1}<%for.cond>" ; PR8079 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + ; LoopSimplify should invalidate indvars when splitting out the ; inner loop. @@ -15,7 +18,7 @@ for.cond: ; preds = %if.then5, %if.end, %0 = phi i32 [ 0, %entry ], [ %add, %if.end ], [ %add, %if.then5 ] %add = add i32 %0, 1 %cmp = icmp slt i32 %0, 1 - %tmp1 = load i32* @maxStat, align 4 + %tmp1 = load i32, i32* @maxStat, align 4 br i1 %cmp, label %for.body, label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond @@ -39,7 +42,7 @@ for.body18: ; preds = %for.body18, %for.co %i13.027 = phi i32 [ %1, %for.body18 ], [ 0, %for.cond14.preheader ] call void @foo() nounwind %1 = add nsw i32 %i13.027, 1 - %tmp16 = load i32* @maxStat, align 4 + %tmp16 = load i32, i32* @maxStat, align 4 %cmp17 = icmp slt i32 %1, %tmp16 br i1 %cmp17, label %for.body18, label %return diff --git a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll index 1f08a43..7ee1e63 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll @@ -48,9 +48,9 @@ loopexit.3: ; preds = %loopentry.3 loopentry.4: ; preds = %loopentry.4, %loopexit.3 %indvar340 = phi i32 [ 0, %loopexit.3 ], [ %indvar.next341, %loopentry.4 ] ; <i32> [#uses=2] %tmp. = add i32 %indvar340, %indvar342 ; <i32> [#uses=1] - %tmp.526 = load i32** null ; <i32*> [#uses=1] + %tmp.526 = load i32*, i32** null ; <i32*> [#uses=1] %gep.upgrd.1 = zext i32 %tmp. to i64 ; <i64> [#uses=1] - %tmp.528 = getelementptr i32* %tmp.526, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %tmp.528 = getelementptr i32, i32* %tmp.526, i64 %gep.upgrd.1 ; <i32*> [#uses=1] store i32 0, i32* %tmp.528 %indvar.next341 = add i32 %indvar340, 1 ; <i32> [#uses=1] br label %loopentry.4 diff --git a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll index f1c523a..3e52dff 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll @@ -6,7 +6,7 @@ loopentry.1.outer: br label %loopentry.1 loopentry.1: ; preds = %loopentry.1, %loopentry.1.outer %i.3 = phi i32 [ 0, %loopentry.1.outer ], [ %i.3.be, %loopentry.1 ] ; <i32> [#uses=2] - %tmp.390 = load i32* null ; <i32> [#uses=1] + %tmp.390 = load i32, i32* null ; <i32> [#uses=1] %tmp.392 = mul i32 %tmp.390, %j.2.1.ph ; <i32> [#uses=1] %tmp.394 = add i32 %tmp.392, %i.3 ; <i32> [#uses=1] %i.3.be = add i32 %i.3, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll b/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll index 8c2cfaf..44f9801 100644 --- a/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll +++ b/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll @@ -24,7 +24,7 @@ bb16: ; preds = %cond_next102, %bb16.preheader cond_next102: ; preds = %bb16 %tmp138145.rec = add i32 %ABC.2146.0.rec, 3 ; <i32> [#uses=1] - %tmp138145 = getelementptr i8* %ABC, i32 %tmp138145.rec ; <i8*> [#uses=4] + %tmp138145 = getelementptr i8, i8* %ABC, i32 %tmp138145.rec ; <i8*> [#uses=4] %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1] switch i8 0, label %bb129.loopexit [ i8 0, label %UnifiedReturnBlock.loopexit diff --git a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll index ce56bd3..d1454cf 100644 --- a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll +++ b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -loop-reduce -S | grep add | count 2 ; PR 2662 + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + @g_3 = common global i16 0 ; <i16*> [#uses=2] @"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] @@ -22,9 +26,9 @@ return: ; preds = %bb define i32 @main() nounwind { entry: tail call void @func_1( ) nounwind - load volatile i16* @g_3, align 2 ; <i16>:0 [#uses=1] + load volatile i16, i16* @g_3, align 2 ; <i16>:0 [#uses=1] zext i16 %0 to i32 ; <i32>:1 [#uses=1] - tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i32 %1 ) nounwind ; <i32>:2 [#uses=0] + tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %1 ) nounwind ; <i32>:2 [#uses=0] ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll index 1ee6b5c..481569c 100644 --- a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll +++ b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -loop-reduce -S | grep phi | count 2 ; PR 2779 + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + @g_19 = common global i32 0 ; <i32*> [#uses=3] @"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] @@ -21,7 +25,7 @@ bb: ; preds = %bb, %entry %indvar = phi i16 [ 0, %entry ], [ %indvar.next, %bb ] ; <i16> [#uses=2] %tmp = sub i16 0, %indvar ; <i16> [#uses=1] %tmp27 = trunc i16 %tmp to i8 ; <i8> [#uses=1] - load i32* @g_19, align 4 ; <i32>:0 [#uses=2] + load i32, i32* @g_19, align 4 ; <i32>:0 [#uses=2] add i32 %0, 1 ; <i32>:1 [#uses=1] store i32 %1, i32* @g_19, align 4 trunc i32 %0 to i8 ; <i8>:2 [#uses=1] @@ -40,8 +44,8 @@ return: ; preds = %bb define i32 @main() nounwind { entry: tail call void @func_1( ) nounwind - load i32* @g_19, align 4 ; <i32>:0 [#uses=1] - tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i32 %0 ) nounwind ; <i32>:1 [#uses=0] + load i32, i32* @g_19, align 4 ; <i32>:0 [#uses=1] + tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %0 ) nounwind ; <i32>:1 [#uses=0] ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll index b2cf818..8304f76 100644 --- a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll +++ b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll @@ -26,14 +26,14 @@ bb1.i: ; preds = %bb.i2, %entry br i1 %0, label %bb2.i3, label %nactive_heaps.exit bb2.i3: ; preds = %bb1.i - %1 = load %struct.obj** null, align 4 ; <%struct.obj*> [#uses=1] + %1 = load %struct.obj*, %struct.obj** null, align 4 ; <%struct.obj*> [#uses=1] %2 = icmp eq %struct.obj* %1, null ; <i1> [#uses=1] br i1 %2, label %nactive_heaps.exit, label %bb.i2 nactive_heaps.exit: ; preds = %bb2.i3, %bb1.i - %3 = load i32* @heap_size, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* @heap_size, align 4 ; <i32> [#uses=1] %4 = mul i32 %3, %m.0.i ; <i32> [#uses=1] %5 = sub i32 %4, 0 ; <i32> [#uses=1] - %6 = tail call i32 (i8*, i8*, ...)* @sprintf(i8* null, i8* getelementptr ([39 x i8]* @"\01LC85", i32 0, i32 0), i32 %m.0.i, i32 0, i32 %5, i32 0) nounwind ; <i32> [#uses=0] + %6 = tail call i32 (i8*, i8*, ...)* @sprintf(i8* null, i8* getelementptr ([39 x i8], [39 x i8]* @"\01LC85", i32 0, i32 0), i32 %m.0.i, i32 0, i32 %5, i32 0) nounwind ; <i32> [#uses=0] ret %struct.obj* null } diff --git a/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll b/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll index 002a878..8e890e8 100644 --- a/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll +++ b/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll @@ -21,7 +21,7 @@ bb2: ; preds = %bb4, %bb2, %bb4.thread %0 = trunc i32 %j.0.reg2mem.0 to i8 ; <i8> [#uses=1] %1 = sext i8 %0 to i32 ; <i32> [#uses=1] %2 = mul i32 %1, %i.0.reg2mem.0.ph ; <i32> [#uses=1] - %3 = getelementptr [32 x [256 x i32]]* @table, i32 0, i32 %i.0.reg2mem.0.ph, i32 %j.0.reg2mem.0 ; <i32*> [#uses=1] + %3 = getelementptr [32 x [256 x i32]], [32 x [256 x i32]]* @table, i32 0, i32 %i.0.reg2mem.0.ph, i32 %j.0.reg2mem.0 ; <i32*> [#uses=1] store i32 %2, i32* %3, align 4 %indvar.next = add i32 %j.0.reg2mem.0, 1 ; <i32> [#uses=2] %exitcond = icmp eq i32 %indvar.next, 256 ; <i1> [#uses=1] @@ -33,7 +33,7 @@ bb4: ; preds = %bb2 br i1 %exitcond10, label %bb5, label %bb2 bb5: ; preds = %bb4 - %4 = load i32* getelementptr ([32 x [256 x i32]]* @table, i32 0, i32 9, i32 132), align 16 ; <i32> [#uses=1] + %4 = load i32, i32* getelementptr ([32 x [256 x i32]], [32 x [256 x i32]]* @table, i32 0, i32 9, i32 132), align 16 ; <i32> [#uses=1] %5 = icmp eq i32 %4, -1116 ; <i1> [#uses=1] br i1 %5, label %bb7, label %bb6 diff --git a/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll b/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll index b9bd7c9..cf549fc 100644 --- a/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll +++ b/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll @@ -24,12 +24,12 @@ H_MPZ_LBL: ; preds = %indirectgoto while.cond.i: ; preds = %while.body.i15795, %if.then.i15791 %phi = phi i64 [ %tmp20916, %while.body.i15795 ], [ 0, %H_MPZ_LBL ] %tmp20916 = add i64 %phi, 1 - %incdec.ptr.i15793 = getelementptr i64* %pc.0.lcssa.i1610719352, i64 %tmp20916 + %incdec.ptr.i15793 = getelementptr i64, i64* %pc.0.lcssa.i1610719352, i64 %tmp20916 %boo2 = call i1 @foo() br i1 %boo2, label %indirectgoto, label %while.body.i15795 while.body.i15795: ; preds = %while.cond.i - %tmp20.i = load i64* %incdec.ptr.i15793, align 8 + %tmp20.i = load i64, i64* %incdec.ptr.i15793, align 8 %boo1 = call i1 @foo() br i1 %boo1, label %while.cond.i, label %body_failed diff --git a/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll b/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll index ccf8ebd..5588995 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll @@ -4,6 +4,10 @@ target triple = "x86-apple-darwin" +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; Verify that identical edges are merged. rdar://problem/6453893 ; CHECK-LABEL: @test1( ; CHECK: bb89: @@ -16,7 +20,7 @@ entry: loop: %rec = phi i32 [ %next, %loop ], [ 0, %entry ] %next = add i32 %rec, 1 - %tmp75 = getelementptr i8* null, i32 %next + %tmp75 = getelementptr i8, i8* null, i32 %next br i1 false, label %loop, label %loopexit loopexit: @@ -53,7 +57,7 @@ entry: loop: %rec = phi i32 [ %next, %loop ], [ 0, %entry ] %next = add i32 %rec, 1 - %tmp75 = getelementptr i8* null, i32 %next + %tmp75 = getelementptr i8, i8* null, i32 %next br i1 false, label %loop, label %loopexit loopexit: diff --git a/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll b/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll index 83963e3..cc8226e 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll @@ -5,6 +5,10 @@ target triple = "x86-apple-darwin" +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; CHECK-LABEL: @test( ; multiplies are hoisted out of the loop ; CHECK: while.body.lr.ph: @@ -17,10 +21,10 @@ target triple = "x86-apple-darwin" ; CHECK: phi ; CHECK: phi ; CHECK-NOT: phi -; CHECK: bitcast float* {{.*}} to i8* -; CHECK: bitcast float* {{.*}} to i8* -; CHECK: getelementptr i8* -; CHECK: getelementptr i8* +; CHECK: bitcast float* {{.*}} to i1* +; CHECK: bitcast float* {{.*}} to i1* +; CHECK: getelementptr i1, i1* +; CHECK: getelementptr i1, i1* define float @test(float* nocapture %A, float* nocapture %B, i32 %N, i32 %IA, i32 %IB) nounwind uwtable readonly ssp { entry: @@ -37,12 +41,12 @@ while.body: ; preds = %while.body.lr.ph, % %B.addr.04 = phi float* [ %B, %while.body.lr.ph ], [ %add.ptr3, %while.body ] %N.addr.03 = phi i32 [ %N, %while.body.lr.ph ], [ %sub, %while.body ] %Sum0.02 = phi float [ 0.000000e+00, %while.body.lr.ph ], [ %add, %while.body ] - %0 = load float* %A.addr.05, align 4 - %1 = load float* %B.addr.04, align 4 + %0 = load float, float* %A.addr.05, align 4 + %1 = load float, float* %B.addr.04, align 4 %mul = fmul float %0, %1 %add = fadd float %Sum0.02, %mul - %add.ptr = getelementptr inbounds float* %A.addr.05, i64 %idx.ext - %add.ptr3 = getelementptr inbounds float* %B.addr.04, i64 %idx.ext2 + %add.ptr = getelementptr inbounds float, float* %A.addr.05, i64 %idx.ext + %add.ptr3 = getelementptr inbounds float, float* %B.addr.04, i64 %idx.ext2 %sub = add nsw i32 %N.addr.03, -1 %cmp = icmp sgt i32 %sub, 0 br i1 %cmp, label %while.body, label %while.end diff --git a/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll b/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll index 484fefa..a61de24 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll @@ -95,14 +95,14 @@ bb1: %t15 = icmp ugt i32 %n15, -4 %m15 = select i1 %t15, i32 %n15, i32 -4 %a16 = add i32 %m15, %a15 - %gep = getelementptr i8* %base, i32 %a16 + %gep = getelementptr i8, i8* %base, i32 %a16 %ofs = add i32 %a16, 4 - %limit = getelementptr i8* %base, i32 %ofs + %limit = getelementptr i8, i8* %base, i32 %ofs br label %loop loop: %iv = phi i8* [ %gep, %bb1 ], [ %inc, %loop ] - %inc = getelementptr inbounds i8* %iv, i64 1 + %inc = getelementptr inbounds i8, i8* %iv, i64 1 %exitcond = icmp eq i8* %inc, %limit br i1 %exitcond, label %loop, label %exit diff --git a/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll b/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll index 068b716..fe9f8cb 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll @@ -22,6 +22,6 @@ for.end: ; preds = %for.end.critedge, % for.body83: ; preds = %for.body83, %for.end %ptr.0157 = phi i8* [ %add.ptr96, %for.body83 ], [ null, %for.end ] store i8 undef, i8* %ptr.0157, align 1 - %add.ptr96 = getelementptr inbounds i8* %ptr.0157, i32 %cond + %add.ptr96 = getelementptr inbounds i8, i8* %ptr.0157, i32 %cond br label %for.body83 } diff --git a/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll b/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll index 6c128fe..317b0b0 100644 --- a/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll +++ b/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll @@ -15,7 +15,7 @@ target triple = "i386-unknown-freebsd10.0" ; Inner recurrence: ; CHECK: %lsr.iv = phi i32 ; Outer step (relative to inner recurrence): -; CHECK: %scevgep = getelementptr i1* %{{.*}}, i32 %lsr.iv +; CHECK: %scevgep = getelementptr i1, i1* %{{.*}}, i32 %lsr.iv ; Outer use: ; CHECK: %lsr.iv3 = phi [121 x i32]* [ %lsr.iv1, %for.body43.preheader ] define void @vb() nounwind { @@ -32,8 +32,8 @@ for.body7: for.body43: %bf.459 = phi i32 [ %inc44, %for.body43 ], [ %t1, %for.body7 ] %inc44 = add nsw i32 %bf.459, 1 - %arrayidx45 = getelementptr inbounds [121 x i32]* @b, i32 0, i32 %bf.459 - %t2 = load i32* %arrayidx45, align 4 + %arrayidx45 = getelementptr inbounds [121 x i32], [121 x i32]* @b, i32 0, i32 %bf.459 + %t2 = load i32, i32* %arrayidx45, align 4 br label %for.body43 } diff --git a/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll b/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll index 87dd397..d8aa264 100644 --- a/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll +++ b/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll @@ -35,7 +35,7 @@ bb7.lr.ph.us: ; preds = %bb9.us, %bb8.prehea bb7.us: ; preds = %bb7.lr.ph.us, %bb7.us %j.01.us = phi i32 [ 0, %bb7.lr.ph.us ], [ %1, %bb7.us ] %tmp31 = add i32 %tmp30, %j.01.us - %scevgep9 = getelementptr float* %a, i32 %tmp31 + %scevgep9 = getelementptr float, float* %a, i32 %tmp31 store float undef, float* %scevgep9, align 1 %1 = add nsw i32 %j.01.us, 1 indirectbr i8* undef, [label %bb9.us, label %bb7.us] @@ -74,7 +74,7 @@ bb8.preheader: ; preds = %bb9, %bb3 bb7: ; preds = %bb8.preheader, %bb7 %indvar = phi i32 [ 0, %bb8.preheader ], [ %indvar.next, %bb7 ] - %scevgep = getelementptr [200 x i32]* %Array2, i32 %tmp26, i32 %indvar + %scevgep = getelementptr [200 x i32], [200 x i32]* %Array2, i32 %tmp26, i32 %indvar store i32 undef, i32* %scevgep, align 4 %indvar.next = add i32 %indvar, 1 indirectbr i8* undef, [label %bb9, label %bb7] diff --git a/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll b/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll index 94a037e..7f1eed0 100644 --- a/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll +++ b/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll @@ -48,7 +48,7 @@ while.cond238.preheader: ; preds = %lor.lhs.false227, % while.cond238: ; preds = %land.rhs243, %while.cond238.preheader %1 = phi i64 [ %indvar.next15, %land.rhs243 ], [ 0, %while.cond238.preheader ] %tmp36 = add i64 %tmp16, %1 - %s.3 = getelementptr i8* %s.1, i64 %tmp36 + %s.3 = getelementptr i8, i8* %s.1, i64 %tmp36 %cmp241 = icmp ult i8* %s.3, %end indirectbr i8* undef, [label %land.rhs243, label %while.end256] @@ -75,7 +75,7 @@ if.end340: ; preds = %while.end334 indirectbr i8* undef, [label %PREMATURE, label %if.end348] if.end348: ; preds = %if.end340 - %incdec.ptr356 = getelementptr inbounds i8* undef, i64 2 + %incdec.ptr356 = getelementptr inbounds i8, i8* undef, i64 2 indirectbr i8* undef, [label %while.cond179] if.else386: ; preds = %if.else diff --git a/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll b/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll index 5fa3838..62064cb 100644 --- a/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll +++ b/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll @@ -34,8 +34,8 @@ lor.lhs.false184: ; preds = %lor.lhs.false177 for.cond: ; preds = %for.inc, %lor.lhs.false184, %if.end152 %indvar65 = phi i64 [ %indvar.next66, %for.inc ], [ 0, %lor.lhs.false184 ], [ 0, %if.end152 ] %tmp128 = add i64 %0, %indvar65 - %s.4 = getelementptr i8* %cmd, i64 %tmp128 - %tmp195 = load i8* %s.4, align 1 + %s.4 = getelementptr i8, i8* %cmd, i64 %tmp128 + %tmp195 = load i8, i8* %s.4, align 1 indirectbr i8* undef, [label %return, label %land.rhs198] land.rhs198: ; preds = %for.cond diff --git a/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll b/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll index c9b11a9..ce6161c 100644 --- a/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll +++ b/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll @@ -10,11 +10,11 @@ target datalayout = "e-p:64:64:64-n32:64" define internal fastcc void @someFunction(%struct.this_structure_s.0.5* nocapture %scratch, i32 %stage, i32 %cbSize) nounwind { entry: - %0 = getelementptr inbounds %struct.this_structure_s.0.5* %scratch, i32 0, i32 4, i32 %stage - %1 = load i8** %0, align 4 - %2 = getelementptr inbounds %struct.this_structure_s.0.5* %scratch, i32 0, i32 5, i32 %stage - %3 = load i8** %2, align 4 - %4 = getelementptr inbounds %struct.this_structure_s.0.5* %scratch, i32 0, i32 2, i32 0, i32 0 + %0 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 4, i32 %stage + %1 = load i8*, i8** %0, align 4 + %2 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 5, i32 %stage + %3 = load i8*, i8** %2, align 4 + %4 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 2, i32 0, i32 0 %tmp11 = shl i32 %stage, 1 %tmp1325 = or i32 %tmp11, 1 br label %__label_D_1608 @@ -22,18 +22,18 @@ entry: __label_D_1608: ; preds = %__label_D_1608, %entry %i.12 = phi i32 [ 0, %entry ], [ %10, %__label_D_1608 ] %tmp = shl i32 %i.12, 2 - %lvar_g.13 = getelementptr i32* %4, i32 %tmp + %lvar_g.13 = getelementptr i32, i32* %4, i32 %tmp %tmp626 = or i32 %tmp, 1 - %scevgep = getelementptr i32* %4, i32 %tmp626 + %scevgep = getelementptr i32, i32* %4, i32 %tmp626 %tmp727 = or i32 %tmp, 2 - %scevgep8 = getelementptr i32* %4, i32 %tmp727 + %scevgep8 = getelementptr i32, i32* %4, i32 %tmp727 %tmp928 = or i32 %tmp, 3 - %scevgep10 = getelementptr i32* %4, i32 %tmp928 - %scevgep12 = getelementptr %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp11, i32 %i.12 - %scevgep14 = getelementptr %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp1325, i32 %i.12 - %5 = load i8* %scevgep12, align 1 + %scevgep10 = getelementptr i32, i32* %4, i32 %tmp928 + %scevgep12 = getelementptr %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp11, i32 %i.12 + %scevgep14 = getelementptr %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp1325, i32 %i.12 + %5 = load i8, i8* %scevgep12, align 1 %6 = sext i8 %5 to i32 - %7 = load i8* %scevgep14, align 1 + %7 = load i8, i8* %scevgep14, align 1 %8 = sext i8 %7 to i32 store i32 0, i32* %lvar_g.13, align 4 store i32 %8, i32* %scevgep, align 4 diff --git a/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll b/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll index ea1d65b..80095c3 100644 --- a/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll +++ b/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll @@ -17,12 +17,12 @@ target triple = "x86_64-apple-darwin" define i32 @main() nounwind uwtable ssp { entry: %l_2 = alloca [1 x i32], align 4 - %arrayidx = getelementptr inbounds [1 x i32]* %l_2, i64 0, i64 0 + %arrayidx = getelementptr inbounds [1 x i32], [1 x i32]* %l_2, i64 0, i64 0 store i32 0, i32* %arrayidx, align 4 - %tmp = load i32* @g_3, align 4 + %tmp = load i32, i32* @g_3, align 4 %idxprom = sext i32 %tmp to i64 - %arrayidx1 = getelementptr inbounds [1 x i32]* %l_2, i64 0, i64 %idxprom - %tmp1 = load i32* %arrayidx1, align 4 + %arrayidx1 = getelementptr inbounds [1 x i32], [1 x i32]* %l_2, i64 0, i64 %idxprom + %tmp1 = load i32, i32* %arrayidx1, align 4 %conv.i.i = and i32 %tmp1, 65535 %tobool.i.i.i = icmp ne i32 %tmp, 0 br label %codeRepl diff --git a/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll b/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll index 9524be3..dba97f5 100644 --- a/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll +++ b/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll @@ -1,5 +1,4 @@ -; RUN: opt -loop-reduce -disable-output -debug-only=loop-reduce < %s 2> %t -; RUN: FileCheck %s < %t +; RUN: opt -loop-reduce -disable-output -debug-only=loop-reduce < %s 2>&1 | FileCheck %s ; REQUIRES: asserts ; ; PR13361: LSR + SCEV "hangs" on reasonably sized test with sequence of loops @@ -18,6 +17,10 @@ ; CHECK-NOT:reg ; CHECK: Filtering for use +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + %struct.snork = type { %struct.fuga, i32, i32, i32, i32, i32, i32 } %struct.fuga = type { %struct.gork, i64 } %struct.gork = type { i8*, i32, i32, %struct.noot* } @@ -44,18 +47,18 @@ bb: br i1 %tmp4, label %bb6, label %bb5 bb5: ; preds = %bb - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2021) nounwind - tail call void (...)* @snork(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 3, i64 1), i32 -2146631418) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2021) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 1), i32 -2146631418) nounwind unreachable bb6: ; preds = %bb - tail call void @zot(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 5, i64 0), i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 3, i64 1), i64 undef, i32 1, i1 false) nounwind - %tmp7 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 5, i64 undef + tail call void @zot(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 0), i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 1), i64 undef, i32 1, i1 false) nounwind + %tmp7 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 undef store i8 0, i8* %tmp7, align 1 %tmp8 = add nsw i32 0, 1 %tmp9 = sext i32 %tmp8 to i64 %tmp10 = add i64 %tmp9, 1 - %tmp11 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 %tmp10 + %tmp11 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 %tmp10 %tmp12 = sub i64 2047, %tmp9 %tmp13 = icmp eq i32 undef, 1 br i1 %tmp13, label %bb14, label %bb15 @@ -76,8 +79,8 @@ bb17: ; preds = %bb26, %bb15 br i1 %tmp21, label %bb22, label %bb32 bb22: ; preds = %bb17 - %tmp23 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 0 - %tmp24 = load i8* %tmp23, align 1 + %tmp23 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 0 + %tmp24 = load i8, i8* %tmp23, align 1 %tmp25 = icmp eq i8 %tmp24, 58 br i1 %tmp25, label %bb30, label %bb26 @@ -92,18 +95,18 @@ bb30: ; preds = %bb22 br i1 %tmp31, label %bb33, label %bb32 bb32: ; preds = %bb30, %bb26, %bb17 - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2038) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2038) nounwind tail call void (...)* @snork(i8* %tmp11, i32 -2146631418) nounwind unreachable bb33: ; preds = %bb30 - tail call void @zot(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp11, i64 undef, i32 1, i1 false) nounwind - %tmp34 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 5, i64 undef + tail call void @zot(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp11, i64 undef, i32 1, i1 false) nounwind + %tmp34 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 undef store i8 0, i8* %tmp34, align 1 %tmp35 = add nsw i32 %tmp19, 1 %tmp36 = sext i32 %tmp35 to i64 %tmp37 = add i64 %tmp36, %tmp10 - %tmp38 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 %tmp37 + %tmp38 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 %tmp37 %tmp39 = sub i64 %tmp12, %tmp36 br i1 false, label %bb40, label %bb41 @@ -123,7 +126,7 @@ bb43: ; preds = %bb52, %bb41 bb48: ; preds = %bb43 %tmp49 = add i64 %tmp44, %tmp37 - %tmp50 = load i8* undef, align 1 + %tmp50 = load i8, i8* undef, align 1 %tmp51 = icmp eq i8 %tmp50, 58 br i1 %tmp51, label %bb55, label %bb52 @@ -138,14 +141,14 @@ bb55: ; preds = %bb48 br i1 %tmp57, label %bb59, label %bb58 bb58: ; preds = %bb55, %bb52, %bb43 - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2055) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2055) nounwind tail call void (...)* @snork(i8* %tmp38, i32 -2146631418) nounwind br label %bb247 bb59: ; preds = %bb55 %tmp60 = sext i32 %tmp45 to i64 - tail call void @zot(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp38, i64 %tmp60, i32 1, i1 false) nounwind - %tmp61 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 5, i64 %tmp60 + tail call void @zot(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp38, i64 %tmp60, i32 1, i1 false) nounwind + %tmp61 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 %tmp60 store i8 0, i8* %tmp61, align 1 %tmp62 = add nsw i32 %tmp45, 1 %tmp63 = sext i32 %tmp62 to i64 @@ -165,12 +168,12 @@ bb68: ; preds = %bb59 ] bb69: ; preds = %bb68 - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2071) nounwind - %tmp70 = load i32* getelementptr inbounds (%struct.snork* @global, i64 0, i32 2), align 4 + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2071) nounwind + %tmp70 = load i32, i32* getelementptr inbounds (%struct.snork, %struct.snork* @global, i64 0, i32 2), align 4 unreachable bb71: ; preds = %bb68 - %tmp72 = load i32* getelementptr inbounds (%struct.snork* @global, i64 0, i32 4), align 4 + %tmp72 = load i32, i32* getelementptr inbounds (%struct.snork, %struct.snork* @global, i64 0, i32 4), align 4 %tmp73 = icmp eq i32 undef, 0 br i1 %tmp73, label %bb247, label %bb74 @@ -461,8 +464,8 @@ bb221: ; preds = %bb230, %bb219 bb226: ; preds = %bb221 %tmp227 = add i64 %tmp222, %tmp216 - %tmp228 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 %tmp227 - %tmp229 = load i8* %tmp228, align 1 + %tmp228 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 %tmp227 + %tmp229 = load i8, i8* %tmp228, align 1 br i1 false, label %bb233, label %bb230 bb230: ; preds = %bb226 diff --git a/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll b/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll index 79dbf0d..dcd0681 100644 --- a/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll +++ b/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll @@ -72,8 +72,8 @@ bb61: ; preds = %bb63, %bb58 br i1 %tmp62, label %_ZNK4llvm9StringRef4findEcm.exit._crit_edge, label %bb63 bb63: ; preds = %bb61 - %tmp64 = getelementptr inbounds i8* %tmp3, i64 %i.0.i - %tmp65 = load i8* %tmp64, align 1 + %tmp64 = getelementptr inbounds i8, i8* %tmp3, i64 %i.0.i + %tmp65 = load i8, i8* %tmp64, align 1 %tmp67 = add i64 %i.0.i, 1 br i1 undef, label %_ZNK4llvm9StringRef4findEcm.exit.loopexit, label %bb61 diff --git a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll index 9a175ad..2120b2a 100644 --- a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll +++ b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll @@ -19,9 +19,9 @@ while.body: ; preds = %while.body, %entry %len.06 = phi i64 [ 1288, %entry ], [ %sub, %while.body ] %pDst.05 = phi i64* [ inttoptr (i64 6442450944 to i64*), %entry ], [ %incdec.ptr1, %while.body ] %pSrc.04 = phi i64* [ inttoptr (i64 4294967296 to i64*), %entry ], [ %incdec.ptr, %while.body ] - %incdec.ptr = getelementptr inbounds i64* %pSrc.04, i64 1 - %tmp = load volatile i64* %pSrc.04, align 8 - %incdec.ptr1 = getelementptr inbounds i64* %pDst.05, i64 1 + %incdec.ptr = getelementptr inbounds i64, i64* %pSrc.04, i64 1 + %tmp = load volatile i64, i64* %pSrc.04, align 8 + %incdec.ptr1 = getelementptr inbounds i64, i64* %pDst.05, i64 1 store volatile i64 %tmp, i64* %pDst.05, align 8 %sub = add i64 %len.06, -8 %cmp = icmp sgt i64 %sub, -1 diff --git a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll index 48b7094..e84f675 100644 --- a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll +++ b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll @@ -38,7 +38,7 @@ land.rhs: ; preds = %while.cond br i1 %cmp5, label %if.end9, label %while.body while.body: ; preds = %land.rhs - %incdec.ptr = getelementptr inbounds i8* %ptr.0, i64 1 + %incdec.ptr = getelementptr inbounds i8, i8* %ptr.0, i64 1 store i8 %conv, i8* %ptr.0, align 1, !tbaa !0 %dec = add i64 %len.addr.0, -1 br label %while.cond @@ -67,7 +67,7 @@ if.end9: ; preds = %land.rhs while.body18: ; preds = %if.end9, %while.body18 %wideptr.038 = phi i64* [ %incdec.ptr19, %while.body18 ], [ %9, %if.end9 ] %len.addr.137 = phi i64 [ %sub, %while.body18 ], [ %len.addr.0, %if.end9 ] - %incdec.ptr19 = getelementptr inbounds i64* %wideptr.038, i64 1 + %incdec.ptr19 = getelementptr inbounds i64, i64* %wideptr.038, i64 1 store i64 %ins, i64* %wideptr.038, align 8, !tbaa !2 %sub = add i64 %len.addr.137, -8 %cmp16 = icmp ugt i64 %sub, 7 @@ -87,7 +87,7 @@ while.body29: ; preds = %while.body29, %whil %len.addr.235 = phi i64 [ %len.addr.1.lcssa49, %while.body29.lr.ph ], [ %dec26, %while.body29 ] %ptr.134 = phi i8* [ %10, %while.body29.lr.ph ], [ %incdec.ptr31, %while.body29 ] %dec26 = add i64 %len.addr.235, -1 - %incdec.ptr31 = getelementptr inbounds i8* %ptr.134, i64 1 + %incdec.ptr31 = getelementptr inbounds i8, i8* %ptr.134, i64 1 store i8 %conv, i8* %ptr.134, align 1, !tbaa !0 %cmp27 = icmp eq i64 %dec26, 0 br i1 %cmp27, label %done, label %while.body29 diff --git a/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll b/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll index 217896e..c877ace 100644 --- a/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll +++ b/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll @@ -11,7 +11,7 @@ target triple = "arm64-apple-ios" define void @do_integer_add(i64 %iterations, i8* nocapture readonly %cookie) { entry: %N = bitcast i8* %cookie to i32* - %0 = load i32* %N, align 4 + %0 = load i32, i32* %N, align 4 %add = add nsw i32 %0, 57 %cmp56 = icmp eq i64 %iterations, 0 br i1 %cmp56, label %while.end, label %for.cond.preheader.preheader diff --git a/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll b/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll index 1d56dde..56ff69c 100644 --- a/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll +++ b/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll @@ -50,7 +50,7 @@ declare %s* @getstruct() nounwind ; CHECK: ldr{{.*}}lsl #2 define i32 @main() nounwind ssp { entry: - %v0 = load i32* @ncol, align 4 + %v0 = load i32, i32* @ncol, align 4 %v1 = tail call i32* @getptr() nounwind %cmp10.i = icmp eq i32 %v0, 0 br label %while.cond.outer @@ -64,12 +64,12 @@ while.cond: br label %while.body while.body: - %v3 = load i32* @ncol, align 4 + %v3 = load i32, i32* @ncol, align 4 br label %end_of_chain end_of_chain: - %state.i = getelementptr inbounds %s* %call18, i32 0, i32 0 - %v4 = load i32** %state.i, align 4 + %state.i = getelementptr inbounds %s, %s* %call18, i32 0, i32 0 + %v4 = load i32*, i32** %state.i, align 4 br label %while.cond.i.i while.cond.i.i: @@ -79,10 +79,10 @@ while.cond.i.i: br i1 %tobool.i.i, label %where.exit, label %land.rhs.i.i land.rhs.i.i: - %arrayidx.i.i = getelementptr inbounds i32* %v4, i32 %dec.i.i - %v5 = load i32* %arrayidx.i.i, align 4 - %arrayidx1.i.i = getelementptr inbounds i32* %v1, i32 %dec.i.i - %v6 = load i32* %arrayidx1.i.i, align 4 + %arrayidx.i.i = getelementptr inbounds i32, i32* %v4, i32 %dec.i.i + %v5 = load i32, i32* %arrayidx.i.i, align 4 + %arrayidx1.i.i = getelementptr inbounds i32, i32* %v1, i32 %dec.i.i + %v6 = load i32, i32* %arrayidx1.i.i, align 4 %cmp.i.i = icmp eq i32 %v5, %v6 br i1 %cmp.i.i, label %while.cond.i.i, label %equal_data.exit.i diff --git a/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll b/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll index 26b2940..2ad6c2e 100644 --- a/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll +++ b/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll @@ -18,18 +18,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop exit: @@ -52,18 +52,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x store i32 %s4, i32* %iv %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop @@ -103,26 +103,26 @@ for.body: ; preds = %for.body.lr.ph, %fo %i.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %res.addr.09 = phi i32* [ %res, %for.body.lr.ph ], [ %add.ptr7, %for.body ] %0 = bitcast i8* %main.addr.011 to i32* - %1 = load i32* %0, align 4 - %add.ptr = getelementptr inbounds i8* %main.addr.011, i32 %main_stride + %1 = load i32, i32* %0, align 4 + %add.ptr = getelementptr inbounds i8, i8* %main.addr.011, i32 %main_stride %2 = bitcast i8* %add.ptr to i32* - %3 = load i32* %2, align 4 - %add.ptr1 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr.sum + %3 = load i32, i32* %2, align 4 + %add.ptr1 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr.sum %4 = bitcast i8* %add.ptr1 to i32* - %5 = load i32* %4, align 4 - %add.ptr2 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr1.sum + %5 = load i32, i32* %4, align 4 + %add.ptr2 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr1.sum %6 = bitcast i8* %add.ptr2 to i32* - %7 = load i32* %6, align 4 - %add.ptr3 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr4.sum + %7 = load i32, i32* %6, align 4 + %add.ptr3 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr4.sum %8 = bitcast i8* %add.ptr3 to i32* - %9 = load i32* %8, align 4 + %9 = load i32, i32* %8, align 4 %add = add i32 %3, %1 %add4 = add i32 %add, %5 %add5 = add i32 %add4, %7 %add6 = add i32 %add5, %9 store i32 %add6, i32* %res.addr.09, align 4 - %add.ptr6 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr3.sum - %add.ptr7 = getelementptr inbounds i32* %res.addr.09, i32 %y + %add.ptr6 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr3.sum + %add.ptr7 = getelementptr inbounds i32, i32* %res.addr.09, i32 %y %inc = add i32 %i.010, 1 %cmp = icmp eq i32 %inc, %z br i1 %cmp, label %for.end, label %for.body @@ -146,48 +146,48 @@ entry: for.body: ; preds = %for.body, %entry %i.07 = phi i32 [ 0, %entry ], [ %inc.3, %for.body ] - %arrayidx = getelementptr inbounds i8* %a, i32 %i.07 - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %a, i32 %i.07 + %0 = load i8, i8* %arrayidx, align 1 %conv5 = zext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8* %b, i32 %i.07 - %1 = load i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %b, i32 %i.07 + %1 = load i8, i8* %arrayidx1, align 1 %conv26 = zext i8 %1 to i32 %add = add nsw i32 %conv26, %conv5 %conv3 = trunc i32 %add to i8 - %arrayidx4 = getelementptr inbounds i8* %c, i32 %i.07 + %arrayidx4 = getelementptr inbounds i8, i8* %c, i32 %i.07 store i8 %conv3, i8* %arrayidx4, align 1 %inc1 = or i32 %i.07, 1 - %arrayidx.1 = getelementptr inbounds i8* %a, i32 %inc1 - %2 = load i8* %arrayidx.1, align 1 + %arrayidx.1 = getelementptr inbounds i8, i8* %a, i32 %inc1 + %2 = load i8, i8* %arrayidx.1, align 1 %conv5.1 = zext i8 %2 to i32 - %arrayidx1.1 = getelementptr inbounds i8* %b, i32 %inc1 - %3 = load i8* %arrayidx1.1, align 1 + %arrayidx1.1 = getelementptr inbounds i8, i8* %b, i32 %inc1 + %3 = load i8, i8* %arrayidx1.1, align 1 %conv26.1 = zext i8 %3 to i32 %add.1 = add nsw i32 %conv26.1, %conv5.1 %conv3.1 = trunc i32 %add.1 to i8 - %arrayidx4.1 = getelementptr inbounds i8* %c, i32 %inc1 + %arrayidx4.1 = getelementptr inbounds i8, i8* %c, i32 %inc1 store i8 %conv3.1, i8* %arrayidx4.1, align 1 %inc.12 = or i32 %i.07, 2 - %arrayidx.2 = getelementptr inbounds i8* %a, i32 %inc.12 - %4 = load i8* %arrayidx.2, align 1 + %arrayidx.2 = getelementptr inbounds i8, i8* %a, i32 %inc.12 + %4 = load i8, i8* %arrayidx.2, align 1 %conv5.2 = zext i8 %4 to i32 - %arrayidx1.2 = getelementptr inbounds i8* %b, i32 %inc.12 - %5 = load i8* %arrayidx1.2, align 1 + %arrayidx1.2 = getelementptr inbounds i8, i8* %b, i32 %inc.12 + %5 = load i8, i8* %arrayidx1.2, align 1 %conv26.2 = zext i8 %5 to i32 %add.2 = add nsw i32 %conv26.2, %conv5.2 %conv3.2 = trunc i32 %add.2 to i8 - %arrayidx4.2 = getelementptr inbounds i8* %c, i32 %inc.12 + %arrayidx4.2 = getelementptr inbounds i8, i8* %c, i32 %inc.12 store i8 %conv3.2, i8* %arrayidx4.2, align 1 %inc.23 = or i32 %i.07, 3 - %arrayidx.3 = getelementptr inbounds i8* %a, i32 %inc.23 - %6 = load i8* %arrayidx.3, align 1 + %arrayidx.3 = getelementptr inbounds i8, i8* %a, i32 %inc.23 + %6 = load i8, i8* %arrayidx.3, align 1 %conv5.3 = zext i8 %6 to i32 - %arrayidx1.3 = getelementptr inbounds i8* %b, i32 %inc.23 - %7 = load i8* %arrayidx1.3, align 1 + %arrayidx1.3 = getelementptr inbounds i8, i8* %b, i32 %inc.23 + %7 = load i8, i8* %arrayidx1.3, align 1 %conv26.3 = zext i8 %7 to i32 %add.3 = add nsw i32 %conv26.3, %conv5.3 %conv3.3 = trunc i32 %add.3 to i8 - %arrayidx4.3 = getelementptr inbounds i8* %c, i32 %inc.23 + %arrayidx4.3 = getelementptr inbounds i8, i8* %c, i32 %inc.23 store i8 %conv3.3, i8* %arrayidx4.3, align 1 %inc.3 = add nsw i32 %i.07, 4 %exitcond.3 = icmp eq i32 %inc.3, 400 @@ -240,31 +240,31 @@ define hidden void @testNeon(i8* %ref_data, i32 %ref_stride, i32 %limit, <16 x i %result.03 = phi <16 x i8> [ zeroinitializer, %.lr.ph ], [ %41, %11 ] %.012 = phi <16 x i8>* [ %data, %.lr.ph ], [ %43, %11 ] %12 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %.05, i32 1) nounwind - %13 = getelementptr inbounds i8* %.05, i32 %ref_stride + %13 = getelementptr inbounds i8, i8* %.05, i32 %ref_stride %14 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %13, i32 1) nounwind %15 = shufflevector <1 x i64> %12, <1 x i64> %14, <2 x i32> <i32 0, i32 1> %16 = bitcast <2 x i64> %15 to <16 x i8> - %17 = getelementptr inbounds <16 x i8>* %.012, i32 1 + %17 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 1 store <16 x i8> %16, <16 x i8>* %.012, align 4 - %18 = getelementptr inbounds i8* %.05, i32 %2 + %18 = getelementptr inbounds i8, i8* %.05, i32 %2 %19 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %18, i32 1) nounwind - %20 = getelementptr inbounds i8* %.05, i32 %3 + %20 = getelementptr inbounds i8, i8* %.05, i32 %3 %21 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %20, i32 1) nounwind %22 = shufflevector <1 x i64> %19, <1 x i64> %21, <2 x i32> <i32 0, i32 1> %23 = bitcast <2 x i64> %22 to <16 x i8> - %24 = getelementptr inbounds <16 x i8>* %.012, i32 2 + %24 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 2 store <16 x i8> %23, <16 x i8>* %17, align 4 - %25 = getelementptr inbounds i8* %.05, i32 %4 + %25 = getelementptr inbounds i8, i8* %.05, i32 %4 %26 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %25, i32 1) nounwind - %27 = getelementptr inbounds i8* %.05, i32 %5 + %27 = getelementptr inbounds i8, i8* %.05, i32 %5 %28 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %27, i32 1) nounwind %29 = shufflevector <1 x i64> %26, <1 x i64> %28, <2 x i32> <i32 0, i32 1> %30 = bitcast <2 x i64> %29 to <16 x i8> - %31 = getelementptr inbounds <16 x i8>* %.012, i32 3 + %31 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 3 store <16 x i8> %30, <16 x i8>* %24, align 4 - %32 = getelementptr inbounds i8* %.05, i32 %6 + %32 = getelementptr inbounds i8, i8* %.05, i32 %6 %33 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %32, i32 1) nounwind - %34 = getelementptr inbounds i8* %.05, i32 %7 + %34 = getelementptr inbounds i8, i8* %.05, i32 %7 %35 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %34, i32 1) nounwind %36 = shufflevector <1 x i64> %33, <1 x i64> %35, <2 x i32> <i32 0, i32 1> %37 = bitcast <2 x i64> %36 to <16 x i8> @@ -273,14 +273,14 @@ define hidden void @testNeon(i8* %ref_data, i32 %ref_stride, i32 %limit, <16 x i %39 = add <16 x i8> %38, %30 %40 = add <16 x i8> %39, %37 %41 = add <16 x i8> %result.03, %40 - %42 = getelementptr i8* %.05, i32 %9 - %43 = getelementptr inbounds <16 x i8>* %.012, i32 -64 + %42 = getelementptr i8, i8* %.05, i32 %9 + %43 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 -64 %44 = add nsw i32 %counter.04, 1 %exitcond = icmp eq i32 %44, %limit br i1 %exitcond, label %._crit_edge, label %11 ._crit_edge: ; preds = %11 - %scevgep = getelementptr <16 x i8>* %data, i32 %10 + %scevgep = getelementptr <16 x i8>, <16 x i8>* %data, i32 %10 br label %45 ; <label>:45 ; preds = %._crit_edge, %0 @@ -327,20 +327,20 @@ entry: for.body: ; preds = %for.body, %entry %i.0110 = phi i32 [ 0, %entry ], [ %inc, %for.body ] %src.addr = phi i8* [ %src, %entry ], [ %add.ptr45, %for.body ] - %add.ptr = getelementptr inbounds i8* %src.addr, i32 %idx.neg + %add.ptr = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg %vld1 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr, i32 1) - %add.ptr3 = getelementptr inbounds i8* %src.addr, i32 %idx.neg2 + %add.ptr3 = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg2 %vld2 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr3, i32 1) - %add.ptr7 = getelementptr inbounds i8* %src.addr, i32 %idx.neg6 + %add.ptr7 = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg6 %vld3 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr7, i32 1) - %add.ptr11 = getelementptr inbounds i8* %src.addr, i32 %idx.neg10 + %add.ptr11 = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg10 %vld4 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr11, i32 1) %vld5 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %src.addr, i32 1) - %add.ptr17 = getelementptr inbounds i8* %src.addr, i32 %stride + %add.ptr17 = getelementptr inbounds i8, i8* %src.addr, i32 %stride %vld6 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr17, i32 1) - %add.ptr20 = getelementptr inbounds i8* %src.addr, i32 %mul5 + %add.ptr20 = getelementptr inbounds i8, i8* %src.addr, i32 %mul5 %vld7 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr20, i32 1) - %add.ptr23 = getelementptr inbounds i8* %src.addr, i32 %mul1 + %add.ptr23 = getelementptr inbounds i8, i8* %src.addr, i32 %mul1 %vld8 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr23, i32 1) %vadd1 = tail call <8 x i8> @llvm.arm.neon.vhaddu.v8i8(<8 x i8> %vld1, <8 x i8> %vld2) nounwind %vadd2 = tail call <8 x i8> @llvm.arm.neon.vhaddu.v8i8(<8 x i8> %vld2, <8 x i8> %vld3) nounwind @@ -355,7 +355,7 @@ for.body: ; preds = %for.body, %entry tail call void @llvm.arm.neon.vst1.v8i8(i8* %add.ptr17, <8 x i8> %vadd5, i32 1) tail call void @llvm.arm.neon.vst1.v8i8(i8* %add.ptr20, <8 x i8> %vadd6, i32 1) %inc = add nsw i32 %i.0110, 1 - %add.ptr45 = getelementptr inbounds i8* %src.addr, i32 8 + %add.ptr45 = getelementptr inbounds i8, i8* %src.addr, i32 8 %exitcond = icmp eq i32 %inc, 4 br i1 %exitcond, label %for.end, label %for.body diff --git a/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll b/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll index 9a7f486..ba03597 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -loop-reduce -S -mtriple=x86_64-unknown-unknown | grep "phi double" | count 1 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @foobar(i32 %n) nounwind { entry: icmp eq i32 %n, 0 ; <i1>:0 [#uses=2] diff --git a/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll b/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll index 2fe62e3..0fc928c 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll @@ -4,6 +4,10 @@ ; nonzero initial value. ; rdar://9786536 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; First, make sure LSR doesn't crash on an empty IVUsers list. ; CHECK-LABEL: @dummyIV( ; CHECK-NOT: phi diff --git a/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll b/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll index 001a1d6..862fff2 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll @@ -29,34 +29,34 @@ for.body: ; preds = %entry, %for.body %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body ], [ 0, %entry ] %dp.036 = phi i32* [ %add.ptr, %for.body ], [ %destrow, %entry ] %p.035 = phi float* [ %incdec.ptr4, %for.body ], [ %srcrow, %entry ] - %incdec.ptr = getelementptr inbounds float* %p.035, i64 1 - %0 = load float* %incdec.ptr, align 4 - %incdec.ptr2 = getelementptr inbounds float* %p.035, i64 2 - %1 = load float* %incdec.ptr2, align 4 - %incdec.ptr3 = getelementptr inbounds float* %p.035, i64 3 - %2 = load float* %incdec.ptr3, align 4 - %incdec.ptr4 = getelementptr inbounds float* %p.035, i64 4 - %3 = load float* %incdec.ptr4, align 4 - %4 = load i32* %dp.036, align 4 + %incdec.ptr = getelementptr inbounds float, float* %p.035, i64 1 + %0 = load float, float* %incdec.ptr, align 4 + %incdec.ptr2 = getelementptr inbounds float, float* %p.035, i64 2 + %1 = load float, float* %incdec.ptr2, align 4 + %incdec.ptr3 = getelementptr inbounds float, float* %p.035, i64 3 + %2 = load float, float* %incdec.ptr3, align 4 + %incdec.ptr4 = getelementptr inbounds float, float* %p.035, i64 4 + %3 = load float, float* %incdec.ptr4, align 4 + %4 = load i32, i32* %dp.036, align 4 %conv5 = fptoui float %0 to i32 %or = or i32 %4, %conv5 - %arrayidx6 = getelementptr inbounds i32* %dp.036, i64 1 - %5 = load i32* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %dp.036, i64 1 + %5 = load i32, i32* %arrayidx6, align 4 %conv7 = fptoui float %1 to i32 %or8 = or i32 %5, %conv7 - %arrayidx9 = getelementptr inbounds i32* %dp.036, i64 2 - %6 = load i32* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds i32, i32* %dp.036, i64 2 + %6 = load i32, i32* %arrayidx9, align 4 %conv10 = fptoui float %2 to i32 %or11 = or i32 %6, %conv10 - %arrayidx12 = getelementptr inbounds i32* %dp.036, i64 3 - %7 = load i32* %arrayidx12, align 4 + %arrayidx12 = getelementptr inbounds i32, i32* %dp.036, i64 3 + %7 = load i32, i32* %arrayidx12, align 4 %conv13 = fptoui float %3 to i32 %or14 = or i32 %7, %conv13 store i32 %or, i32* %dp.036, align 4 store i32 %or8, i32* %arrayidx6, align 4 store i32 %or11, i32* %arrayidx9, align 4 store i32 %or14, i32* %arrayidx12, align 4 - %add.ptr = getelementptr inbounds i32* %dp.036, i64 4 + %add.ptr = getelementptr inbounds i32, i32* %dp.036, i64 4 %indvars.iv.next40 = add i64 %indvars.iv39, 4 %dummycnt = add i64 %dummyiv, 1 %cmp = icmp ult i64 %indvars.iv.next40, %count @@ -76,14 +76,14 @@ for.body23: ; preds = %for.body23, %for.bo %indvars.iv = phi i64 [ 0, %for.body23.lr.ph ], [ %indvars.iv.next, %for.body23 ] %dp.132 = phi i32* [ %add.ptr, %for.body23.lr.ph ], [ %incdec.ptr28, %for.body23 ] %p.131 = phi float* [ %incdec.ptr4, %for.body23.lr.ph ], [ %incdec.ptr24, %for.body23 ] - %incdec.ptr24 = getelementptr inbounds float* %p.131, i64 1 - %9 = load float* %incdec.ptr24, align 4 - %10 = load i32* %dp.132, align 4 + %incdec.ptr24 = getelementptr inbounds float, float* %p.131, i64 1 + %9 = load float, float* %incdec.ptr24, align 4 + %10 = load i32, i32* %dp.132, align 4 %conv25 = fptoui float %9 to i32 %or26 = or i32 %10, %conv25 store i32 %or26, i32* %dp.132, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 - %incdec.ptr28 = getelementptr inbounds i32* %dp.132, i64 1 + %incdec.ptr28 = getelementptr inbounds i32, i32* %dp.132, i64 1 %exitcond = icmp eq i64 %indvars.iv.next, %8 br i1 %exitcond, label %for.end29, label %for.body23 diff --git a/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll b/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll index c3b8b89..184e300 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll @@ -27,14 +27,14 @@ while.body.i: ; preds = %cond.true29.i, %whi for.body.i: ; preds = %for.body.i, %while.body.i %indvars.iv.i = phi i64 [ 0, %while.body.i ], [ %indvars.iv.next.i, %for.body.i ] %add.ptr.sum = add i64 %add.ptr.sum.i, %indvars.iv.i - %arrayidx22.i = getelementptr inbounds i8* %base, i64 %add.ptr.sum - %0 = load i8* %arrayidx22.i, align 1 + %arrayidx22.i = getelementptr inbounds i8, i8* %base, i64 %add.ptr.sum + %0 = load i8, i8* %arrayidx22.i, align 1 %indvars.iv.next.i = add i64 %indvars.iv.i, 1 %cmp = call i1 @check() nounwind br i1 %cmp, label %for.end.i, label %for.body.i for.end.i: ; preds = %for.body.i - %add.ptr.i144 = getelementptr inbounds i8* %base, i64 %add.ptr.sum.i + %add.ptr.i144 = getelementptr inbounds i8, i8* %base, i64 %add.ptr.sum.i %cmp2 = tail call i1 @foo(i8* %add.ptr.i144, i8* %add.ptr.i144, i8* undef) nounwind br i1 %cmp2, label %cond.true29.i, label %cond.false35.i @@ -68,19 +68,19 @@ entry: for.cond468: ; preds = %if.then477, %entry %indvars.iv1163 = phi i64 [ %indvars.iv.next1164, %if.then477 ], [ 1, %entry ] - %k.0.in = phi i32* [ %last, %if.then477 ], [ getelementptr inbounds ([5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 0, i32 2), %entry ] - %k.0 = load i32* %k.0.in, align 4 + %k.0.in = phi i32* [ %last, %if.then477 ], [ getelementptr inbounds ([5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771], [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 0, i32 2), %entry ] + %k.0 = load i32, i32* %k.0.in, align 4 %0 = trunc i64 %indvars.iv1163 to i32 %cmp469 = icmp slt i32 %0, %n br i1 %cmp469, label %for.body471, label %for.inc498 for.body471: ; preds = %for.cond468 - %first = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 1 - %1 = load i32* %first, align 4 + %first = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771], [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 1 + %1 = load i32, i32* %first, align 4 br i1 undef, label %if.then477, label %for.inc498 if.then477: ; preds = %for.body471 - %last = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 2 + %last = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771], [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 2 %indvars.iv.next1164 = add i64 %indvars.iv1163, 1 br label %for.cond468 @@ -118,14 +118,14 @@ for.body3.us.i: ; preds = %meshBB, %for.body3. %0 = add nsw i64 %indvars.iv.i.SV.phi, %indvars.iv8.i.SV.phi26 %1 = trunc i64 %0 to i32 %mul.i.us.i = mul nsw i32 0, %1 - %arrayidx5.us.i = getelementptr inbounds double* %u, i64 %indvars.iv.i.SV.phi - %2 = load double* %arrayidx5.us.i, align 8 + %arrayidx5.us.i = getelementptr inbounds double, double* %u, i64 %indvars.iv.i.SV.phi + %2 = load double, double* %arrayidx5.us.i, align 8 %indvars.iv.next.i = add i64 %indvars.iv.i.SV.phi, 1 br i1 undef, label %for.inc8.us.i, label %meshBB for.body3.lr.ph.us.i: ; preds = %meshBB1, %meshBB %indvars.iv8.i.SV.phi26 = phi i64 [ undef, %meshBB1 ], [ %indvars.iv8.i.SV.phi24, %meshBB ] - %arrayidx.us.i = getelementptr inbounds double* undef, i64 %indvars.iv8.i.SV.phi26 + %arrayidx.us.i = getelementptr inbounds double, double* undef, i64 %indvars.iv8.i.SV.phi26 %3 = add i64 %indvars.iv8.i.SV.phi26, 1 br label %for.body3.us.i diff --git a/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll b/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll index d8636a8..c1099b2 100644 --- a/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll +++ b/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll @@ -29,18 +29,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop exit: @@ -71,18 +71,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x store i32 %s4, i32* %iv %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop @@ -126,26 +126,26 @@ for.body: ; preds = %for.body.lr.ph, %fo %i.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %res.addr.09 = phi i32* [ %res, %for.body.lr.ph ], [ %add.ptr7, %for.body ] %0 = bitcast i8* %main.addr.011 to i32* - %1 = load i32* %0, align 4 - %add.ptr = getelementptr inbounds i8* %main.addr.011, i32 %main_stride + %1 = load i32, i32* %0, align 4 + %add.ptr = getelementptr inbounds i8, i8* %main.addr.011, i32 %main_stride %2 = bitcast i8* %add.ptr to i32* - %3 = load i32* %2, align 4 - %add.ptr1 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr.sum + %3 = load i32, i32* %2, align 4 + %add.ptr1 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr.sum %4 = bitcast i8* %add.ptr1 to i32* - %5 = load i32* %4, align 4 - %add.ptr2 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr1.sum + %5 = load i32, i32* %4, align 4 + %add.ptr2 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr1.sum %6 = bitcast i8* %add.ptr2 to i32* - %7 = load i32* %6, align 4 - %add.ptr3 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr4.sum + %7 = load i32, i32* %6, align 4 + %add.ptr3 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr4.sum %8 = bitcast i8* %add.ptr3 to i32* - %9 = load i32* %8, align 4 + %9 = load i32, i32* %8, align 4 %add = add i32 %3, %1 %add4 = add i32 %add, %5 %add5 = add i32 %add4, %7 %add6 = add i32 %add5, %9 store i32 %add6, i32* %res.addr.09, align 4 - %add.ptr6 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr3.sum - %add.ptr7 = getelementptr inbounds i32* %res.addr.09, i32 %y + %add.ptr6 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr3.sum + %add.ptr7 = getelementptr inbounds i32, i32* %res.addr.09, i32 %y %inc = add i32 %i.010, 1 %cmp = icmp eq i32 %inc, %z br i1 %cmp, label %for.end, label %for.body @@ -172,48 +172,48 @@ entry: for.body: ; preds = %for.body, %entry %i.07 = phi i32 [ 0, %entry ], [ %inc.3, %for.body ] - %arrayidx = getelementptr inbounds i8* %a, i32 %i.07 - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %a, i32 %i.07 + %0 = load i8, i8* %arrayidx, align 1 %conv5 = zext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8* %b, i32 %i.07 - %1 = load i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %b, i32 %i.07 + %1 = load i8, i8* %arrayidx1, align 1 %conv26 = zext i8 %1 to i32 %add = add nsw i32 %conv26, %conv5 %conv3 = trunc i32 %add to i8 - %arrayidx4 = getelementptr inbounds i8* %c, i32 %i.07 + %arrayidx4 = getelementptr inbounds i8, i8* %c, i32 %i.07 store i8 %conv3, i8* %arrayidx4, align 1 %inc1 = or i32 %i.07, 1 - %arrayidx.1 = getelementptr inbounds i8* %a, i32 %inc1 - %2 = load i8* %arrayidx.1, align 1 + %arrayidx.1 = getelementptr inbounds i8, i8* %a, i32 %inc1 + %2 = load i8, i8* %arrayidx.1, align 1 %conv5.1 = zext i8 %2 to i32 - %arrayidx1.1 = getelementptr inbounds i8* %b, i32 %inc1 - %3 = load i8* %arrayidx1.1, align 1 + %arrayidx1.1 = getelementptr inbounds i8, i8* %b, i32 %inc1 + %3 = load i8, i8* %arrayidx1.1, align 1 %conv26.1 = zext i8 %3 to i32 %add.1 = add nsw i32 %conv26.1, %conv5.1 %conv3.1 = trunc i32 %add.1 to i8 - %arrayidx4.1 = getelementptr inbounds i8* %c, i32 %inc1 + %arrayidx4.1 = getelementptr inbounds i8, i8* %c, i32 %inc1 store i8 %conv3.1, i8* %arrayidx4.1, align 1 %inc.12 = or i32 %i.07, 2 - %arrayidx.2 = getelementptr inbounds i8* %a, i32 %inc.12 - %4 = load i8* %arrayidx.2, align 1 + %arrayidx.2 = getelementptr inbounds i8, i8* %a, i32 %inc.12 + %4 = load i8, i8* %arrayidx.2, align 1 %conv5.2 = zext i8 %4 to i32 - %arrayidx1.2 = getelementptr inbounds i8* %b, i32 %inc.12 - %5 = load i8* %arrayidx1.2, align 1 + %arrayidx1.2 = getelementptr inbounds i8, i8* %b, i32 %inc.12 + %5 = load i8, i8* %arrayidx1.2, align 1 %conv26.2 = zext i8 %5 to i32 %add.2 = add nsw i32 %conv26.2, %conv5.2 %conv3.2 = trunc i32 %add.2 to i8 - %arrayidx4.2 = getelementptr inbounds i8* %c, i32 %inc.12 + %arrayidx4.2 = getelementptr inbounds i8, i8* %c, i32 %inc.12 store i8 %conv3.2, i8* %arrayidx4.2, align 1 %inc.23 = or i32 %i.07, 3 - %arrayidx.3 = getelementptr inbounds i8* %a, i32 %inc.23 - %6 = load i8* %arrayidx.3, align 1 + %arrayidx.3 = getelementptr inbounds i8, i8* %a, i32 %inc.23 + %6 = load i8, i8* %arrayidx.3, align 1 %conv5.3 = zext i8 %6 to i32 - %arrayidx1.3 = getelementptr inbounds i8* %b, i32 %inc.23 - %7 = load i8* %arrayidx1.3, align 1 + %arrayidx1.3 = getelementptr inbounds i8, i8* %b, i32 %inc.23 + %7 = load i8, i8* %arrayidx1.3, align 1 %conv26.3 = zext i8 %7 to i32 %add.3 = add nsw i32 %conv26.3, %conv5.3 %conv3.3 = trunc i32 %add.3 to i8 - %arrayidx4.3 = getelementptr inbounds i8* %c, i32 %inc.23 + %arrayidx4.3 = getelementptr inbounds i8, i8* %c, i32 %inc.23 store i8 %conv3.3, i8* %arrayidx4.3, align 1 %inc.3 = add nsw i32 %i.07, 4 %exitcond.3 = icmp eq i32 %inc.3, 400 @@ -254,15 +254,15 @@ for.body: %i = phi i32 [ %inc4, %for.body ], [ 0, %entry ] store i32 %i, i32* %p, align 4 %inc1 = or i32 %i, 1 - %add.ptr.i1 = getelementptr inbounds i32* %p, i32 1 + %add.ptr.i1 = getelementptr inbounds i32, i32* %p, i32 1 store i32 %inc1, i32* %add.ptr.i1, align 4 %inc2 = add nsw i32 %i, 2 - %add.ptr.i2 = getelementptr inbounds i32* %p, i32 2 + %add.ptr.i2 = getelementptr inbounds i32, i32* %p, i32 2 store i32 %inc2, i32* %add.ptr.i2, align 4 %inc3 = add nsw i32 %i, 3 - %add.ptr.i3 = getelementptr inbounds i32* %p, i32 3 + %add.ptr.i3 = getelementptr inbounds i32, i32* %p, i32 3 store i32 %inc3, i32* %add.ptr.i3, align 4 - %p.next = getelementptr inbounds i32* %p, i32 4 + %p.next = getelementptr inbounds i32, i32* %p, i32 4 %inc4 = add nsw i32 %i, 4 %cmp = icmp slt i32 %inc4, %n br i1 %cmp, label %for.body, label %exit @@ -281,20 +281,20 @@ exit: ; X32: jne define void @testCmpZero(i8* %src, i8* %dst, i32 %srcidx, i32 %dstidx, i32 %len) nounwind ssp { entry: - %dest0 = getelementptr inbounds i8* %src, i32 %srcidx - %source0 = getelementptr inbounds i8* %dst, i32 %dstidx + %dest0 = getelementptr inbounds i8, i8* %src, i32 %srcidx + %source0 = getelementptr inbounds i8, i8* %dst, i32 %dstidx %add.ptr79.us.sum = add i32 %srcidx, %len - %lftr.limit = getelementptr i8* %src, i32 %add.ptr79.us.sum + %lftr.limit = getelementptr i8, i8* %src, i32 %add.ptr79.us.sum br label %for.body82.us for.body82.us: %dest = phi i8* [ %dest0, %entry ], [ %incdec.ptr91.us, %for.body82.us ] %source = phi i8* [ %source0, %entry ], [ %add.ptr83.us, %for.body82.us ] %0 = bitcast i8* %source to i32* - %1 = load i32* %0, align 4 + %1 = load i32, i32* %0, align 4 %trunc = trunc i32 %1 to i8 - %add.ptr83.us = getelementptr inbounds i8* %source, i32 4 - %incdec.ptr91.us = getelementptr inbounds i8* %dest, i32 1 + %add.ptr83.us = getelementptr inbounds i8, i8* %source, i32 4 + %incdec.ptr91.us = getelementptr inbounds i8, i8* %dest, i32 1 store i8 %trunc, i8* %dest, align 1 %exitcond = icmp eq i8* %incdec.ptr91.us, %lftr.limit br i1 %exitcond, label %return, label %for.body82.us diff --git a/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll b/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll index d8e0aa9..7925bf0 100644 --- a/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll +++ b/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll @@ -32,15 +32,15 @@ entry: for.body: ; preds = %entry, %for.body.3 %i.09 = phi i32 [ %add5.3, %for.body.3 ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i8* %a, i32 %i.09 - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %a, i32 %i.09 + %0 = load i8, i8* %arrayidx, align 1 %conv6 = zext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8* %b, i32 %i.09 - %1 = load i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %b, i32 %i.09 + %1 = load i8, i8* %arrayidx1, align 1 %conv27 = zext i8 %1 to i32 %add = add nsw i32 %conv27, %conv6 %conv3 = trunc i32 %add to i8 - %arrayidx4 = getelementptr inbounds i8* %c, i32 %i.09 + %arrayidx4 = getelementptr inbounds i8, i8* %c, i32 %i.09 store i8 %conv3, i8* %arrayidx4, align 1 %add5 = add i32 %i.09, %s %cmp = icmp ult i32 %add5, %len @@ -50,45 +50,45 @@ for.end: ; preds = %for.body, %for.body ret void for.body.1: ; preds = %for.body - %arrayidx.1 = getelementptr inbounds i8* %a, i32 %add5 - %2 = load i8* %arrayidx.1, align 1 + %arrayidx.1 = getelementptr inbounds i8, i8* %a, i32 %add5 + %2 = load i8, i8* %arrayidx.1, align 1 %conv6.1 = zext i8 %2 to i32 - %arrayidx1.1 = getelementptr inbounds i8* %b, i32 %add5 - %3 = load i8* %arrayidx1.1, align 1 + %arrayidx1.1 = getelementptr inbounds i8, i8* %b, i32 %add5 + %3 = load i8, i8* %arrayidx1.1, align 1 %conv27.1 = zext i8 %3 to i32 %add.1 = add nsw i32 %conv27.1, %conv6.1 %conv3.1 = trunc i32 %add.1 to i8 - %arrayidx4.1 = getelementptr inbounds i8* %c, i32 %add5 + %arrayidx4.1 = getelementptr inbounds i8, i8* %c, i32 %add5 store i8 %conv3.1, i8* %arrayidx4.1, align 1 %add5.1 = add i32 %add5, %s %cmp.1 = icmp ult i32 %add5.1, %len br i1 %cmp.1, label %for.body.2, label %for.end for.body.2: ; preds = %for.body.1 - %arrayidx.2 = getelementptr inbounds i8* %a, i32 %add5.1 - %4 = load i8* %arrayidx.2, align 1 + %arrayidx.2 = getelementptr inbounds i8, i8* %a, i32 %add5.1 + %4 = load i8, i8* %arrayidx.2, align 1 %conv6.2 = zext i8 %4 to i32 - %arrayidx1.2 = getelementptr inbounds i8* %b, i32 %add5.1 - %5 = load i8* %arrayidx1.2, align 1 + %arrayidx1.2 = getelementptr inbounds i8, i8* %b, i32 %add5.1 + %5 = load i8, i8* %arrayidx1.2, align 1 %conv27.2 = zext i8 %5 to i32 %add.2 = add nsw i32 %conv27.2, %conv6.2 %conv3.2 = trunc i32 %add.2 to i8 - %arrayidx4.2 = getelementptr inbounds i8* %c, i32 %add5.1 + %arrayidx4.2 = getelementptr inbounds i8, i8* %c, i32 %add5.1 store i8 %conv3.2, i8* %arrayidx4.2, align 1 %add5.2 = add i32 %add5.1, %s %cmp.2 = icmp ult i32 %add5.2, %len br i1 %cmp.2, label %for.body.3, label %for.end for.body.3: ; preds = %for.body.2 - %arrayidx.3 = getelementptr inbounds i8* %a, i32 %add5.2 - %6 = load i8* %arrayidx.3, align 1 + %arrayidx.3 = getelementptr inbounds i8, i8* %a, i32 %add5.2 + %6 = load i8, i8* %arrayidx.3, align 1 %conv6.3 = zext i8 %6 to i32 - %arrayidx1.3 = getelementptr inbounds i8* %b, i32 %add5.2 - %7 = load i8* %arrayidx1.3, align 1 + %arrayidx1.3 = getelementptr inbounds i8, i8* %b, i32 %add5.2 + %7 = load i8, i8* %arrayidx1.3, align 1 %conv27.3 = zext i8 %7 to i32 %add.3 = add nsw i32 %conv27.3, %conv6.3 %conv3.3 = trunc i32 %add.3 to i8 - %arrayidx4.3 = getelementptr inbounds i8* %c, i32 %add5.2 + %arrayidx4.3 = getelementptr inbounds i8, i8* %c, i32 %add5.2 store i8 %conv3.3, i8* %arrayidx4.3, align 1 %add5.3 = add i32 %add5.2, %s %cmp.3 = icmp ult i32 %add5.3, %len diff --git a/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll b/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll index 5506994..a6613c5 100644 --- a/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll +++ b/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll @@ -38,9 +38,9 @@ for.body14.lr.ph: vector.body: %index = phi i64 [ %index.next, %vector.body ], [ %0, %for.body14.lr.ph ] - %4 = getelementptr inbounds i8* %rowsptr, i64 %index + %4 = getelementptr inbounds i8, i8* %rowsptr, i64 %index %5 = bitcast i8* %4 to <4 x i8>* - %wide.load = load <4 x i8>* %5, align 1 + %wide.load = load <4 x i8>, <4 x i8>* %5, align 1 %index.next = add i64 %index, 8 %6 = icmp eq i64 %index.next, %end.idx.rnd.down br i1 %6, label %for.end24, label %vector.body diff --git a/test/Transforms/LoopStrengthReduce/X86/pr17473.ll b/test/Transforms/LoopStrengthReduce/X86/pr17473.ll index e7ebaa8..093cf65 100644 --- a/test/Transforms/LoopStrengthReduce/X86/pr17473.ll +++ b/test/Transforms/LoopStrengthReduce/X86/pr17473.ll @@ -25,9 +25,9 @@ target triple = "x86_64-apple-macosx10.9.0" define i32 @main() #0 { entry: store i8 0, i8* @h, align 1 - %0 = load i32* @j, align 4 + %0 = load i32, i32* @j, align 4 %tobool.i = icmp eq i32 %0, 0 - %1 = load i32* @d, align 4 + %1 = load i32, i32* @d, align 4 %cmp3 = icmp sgt i32 %1, -1 %.lobit = lshr i32 %1, 31 %.lobit.not = xor i32 %.lobit, 1 @@ -55,7 +55,7 @@ for.end: ; preds = %fn3.exit %conv7 = sext i8 %inc to i32 %add = add nsw i32 %conv7, %conv store i32 %add, i32* @e, align 4 - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %add) #2 + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %add) #2 ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll b/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll index 6333291..5650f81 100644 --- a/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll +++ b/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll @@ -1,15 +1,15 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s ; CHECK: bb1: -; CHECK: load double addrspace(1)* [[IV:%[^,]+]] +; CHECK: load double, double addrspace(1)* [[IV:%[^,]+]] ; CHECK: store double {{.*}}, double addrspace(1)* [[IV]] ; CHECK-NOT: cast ; Make sure the GEP has the right index type -; CHECK: getelementptr double addrspace(1)* [[IV]], i16 1 +; CHECK: getelementptr double, double addrspace(1)* [[IV]], i16 1 ; CHECK: br {{.*}} label %bb1 ; Make sure the GEP has the right index type -; CHECK: getelementptr double addrspace(1)* {{.*}}, i16 +; CHECK: getelementptr double, double addrspace(1)* {{.*}}, i16 ; This test tests several things. The load and store should use the @@ -36,11 +36,11 @@ bb1: ; preds = %bb2, %bb.nph %tmp3 = add i64 %j.01, %tmp1 ; <i64> [#uses=1] %tmp4 = add i64 %j.01, %tmp2 ; <i64> [#uses=1] %z0 = add i64 %tmp3, 5203 - %tmp5 = getelementptr double addrspace(1)* %p, i64 %z0 ; <double addrspace(1)*> [#uses=1] - %tmp6 = load double addrspace(1)* %tmp5, align 8 ; <double> [#uses=1] + %tmp5 = getelementptr double, double addrspace(1)* %p, i64 %z0 ; <double addrspace(1)*> [#uses=1] + %tmp6 = load double, double addrspace(1)* %tmp5, align 8 ; <double> [#uses=1] %tmp7 = fdiv double %tmp6, 2.100000e+00 ; <double> [#uses=1] %z1 = add i64 %tmp4, 5203 - %tmp8 = getelementptr double addrspace(1)* %p, i64 %z1 ; <double addrspace(1)*> [#uses=1] + %tmp8 = getelementptr double, double addrspace(1)* %p, i64 %z1 ; <double addrspace(1)*> [#uses=1] store double %tmp7, double addrspace(1)* %tmp8, align 8 %tmp9 = add i64 %j.01, 1 ; <i64> [#uses=2] br label %bb2 diff --git a/test/Transforms/LoopStrengthReduce/addrec-gep.ll b/test/Transforms/LoopStrengthReduce/addrec-gep.ll index 3e4e369..6919a33 100644 --- a/test/Transforms/LoopStrengthReduce/addrec-gep.ll +++ b/test/Transforms/LoopStrengthReduce/addrec-gep.ll @@ -1,8 +1,8 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s ; CHECK: bb1: -; CHECK: load double* [[IV:%[^,]+]] +; CHECK: load double, double* [[IV:%[^,]+]] ; CHECK: store double {{.*}}, double* [[IV]] -; CHECK: getelementptr double* +; CHECK: getelementptr double, double* ; CHECK-NOT: cast ; CHECK: br {{.*}} label %bb1 @@ -30,11 +30,11 @@ bb1: ; preds = %bb2, %bb.nph %tmp3 = add i64 %j.01, %tmp1 ; <i64> [#uses=1] %tmp4 = add i64 %j.01, %tmp2 ; <i64> [#uses=1] %z0 = add i64 %tmp3, 5203 - %tmp5 = getelementptr double* %p, i64 %z0 ; <double*> [#uses=1] - %tmp6 = load double* %tmp5, align 8 ; <double> [#uses=1] + %tmp5 = getelementptr double, double* %p, i64 %z0 ; <double*> [#uses=1] + %tmp6 = load double, double* %tmp5, align 8 ; <double> [#uses=1] %tmp7 = fdiv double %tmp6, 2.100000e+00 ; <double> [#uses=1] %z1 = add i64 %tmp4, 5203 - %tmp8 = getelementptr double* %p, i64 %z1 ; <double*> [#uses=1] + %tmp8 = getelementptr double, double* %p, i64 %z1 ; <double*> [#uses=1] store double %tmp7, double* %tmp8, align 8 %tmp9 = add i64 %j.01, 1 ; <i64> [#uses=2] br label %bb2 diff --git a/test/Transforms/LoopStrengthReduce/address-space-loop.ll b/test/Transforms/LoopStrengthReduce/address-space-loop.ll index 9c1b213..57ba665 100644 --- a/test/Transforms/LoopStrengthReduce/address-space-loop.ll +++ b/test/Transforms/LoopStrengthReduce/address-space-loop.ll @@ -27,7 +27,7 @@ bb3: ; preds = %bb2, %bb ; CHECK: bb10: ; CHECK-NEXT: %t7 = icmp eq i16 %t4, 0 ; Host %t2 computation outside the loop. -; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8 addrspace(1)* undef, i16 %t4 +; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* undef, i16 %t4 ; CHECK-NEXT: br label %bb14 bb10: ; preds = %bb9 %t7 = icmp eq i16 %t4, 0 ; <i1> [#uses=1] @@ -36,20 +36,20 @@ bb10: ; preds = %bb9 ; CHECK: bb14: ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[SCEVGEP]] -; CHECK-NEXT: %t6 = load float addrspace(1)* addrspace(1)* undef +; CHECK-NEXT: %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef ; Fold %t3's add within the address. -; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float addrspace(1)* %t6, i16 4 +; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float, float addrspace(1)* %t6, i16 4 ; CHECK-NEXT: [[SCEVGEP2:%[^ ]+]] = bitcast float addrspace(1)* [[SCEVGEP1]] to i8 addrspace(1)* ; Use the induction variable (%t4) to access the right element -; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 +; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[ADDRESS]] ; CHECK-NEXT: br label %bb14 bb14: ; preds = %bb14, %bb10 - %t2 = getelementptr inbounds i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] + %t2 = getelementptr inbounds i8, i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t2 - %t6 = load float addrspace(1)* addrspace(1)* undef + %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef %t8 = bitcast float addrspace(1)* %t6 to i8 addrspace(1)* ; <i8*> [#uses=1] - %t9 = getelementptr inbounds i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] + %t9 = getelementptr inbounds i8, i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t9 br label %bb14 } diff --git a/test/Transforms/LoopStrengthReduce/count-to-zero.ll b/test/Transforms/LoopStrengthReduce/count-to-zero.ll index 0e96f02..ca93e38 100644 --- a/test/Transforms/LoopStrengthReduce/count-to-zero.ll +++ b/test/Transforms/LoopStrengthReduce/count-to-zero.ll @@ -1,6 +1,9 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s ; rdar://7382068 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + define void @t(i32 %c) nounwind optsize { entry: br label %bb6 diff --git a/test/Transforms/LoopStrengthReduce/dominate-assert.ll b/test/Transforms/LoopStrengthReduce/dominate-assert.ll index 3ba93ff..bca234c 100644 --- a/test/Transforms/LoopStrengthReduce/dominate-assert.ll +++ b/test/Transforms/LoopStrengthReduce/dominate-assert.ll @@ -23,7 +23,7 @@ bb4: br label %bb9 bb5: %v5 = bitcast i8* %v3 to i32** - %add.ptr.i = getelementptr inbounds i32** %v5, i64 %v0 + %add.ptr.i = getelementptr inbounds i32*, i32** %v5, i64 %v0 br label %bb6 bb6: %v6 = phi i32** [ null, %bb2 ], [ %add.ptr.i, %bb5 ] @@ -49,7 +49,7 @@ bb2: invoke void @g() optsize to label %bb3 unwind label %bb6 bb3: - %arrayctor.next = getelementptr inbounds i8* %arrayctor.cur, i64 1 + %arrayctor.next = getelementptr inbounds i8, i8* %arrayctor.cur, i64 1 br label %bb2 bb4: ret void @@ -76,17 +76,17 @@ entry: while.cond: ; preds = %while.cond, %entry %c.0 = phi i16* [ undef, %entry ], [ %incdec.ptr, %while.cond ] - %incdec.ptr = getelementptr inbounds i16* %c.0, i64 1 + %incdec.ptr = getelementptr inbounds i16, i16* %c.0, i64 1 br i1 undef, label %while.cond1, label %while.cond while.cond1: ; preds = %while.cond1, %while.cond %c.1 = phi i16* [ %incdec.ptr5, %while.cond1 ], [ %c.0, %while.cond ] - %incdec.ptr5 = getelementptr inbounds i16* %c.1, i64 1 + %incdec.ptr5 = getelementptr inbounds i16, i16* %c.1, i64 1 br i1 undef, label %while.cond7, label %while.cond1 while.cond7: ; preds = %while.cond7, %while.cond1 %0 = phi i16* [ %incdec.ptr10, %while.cond7 ], [ %c.1, %while.cond1 ] - %incdec.ptr10 = getelementptr inbounds i16* %0, i64 1 + %incdec.ptr10 = getelementptr inbounds i16, i16* %0, i64 1 br i1 undef, label %while.cond12.preheader, label %while.cond7 while.cond12.preheader: ; preds = %while.cond7 @@ -104,7 +104,7 @@ while.body13.lr.ph: ; preds = %while.cond12.outer. br label %while.body13 if.else: ; preds = %while.body13 - %incdec.ptr15 = getelementptr inbounds i16* %1, i64 1 + %incdec.ptr15 = getelementptr inbounds i16, i16* %1, i64 1 %cmp = icmp eq i16* %incdec.ptr15, %0 br i1 %cmp, label %while.end16, label %while.body13 diff --git a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll index f7a82f6..7b92ace 100644 --- a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll +++ b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll @@ -10,7 +10,7 @@ then.0: no_exit.2: ; preds = %no_exit.2, %then.0 %indvar630 = phi i32 [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <i32> [#uses=4] %gep.upgrd.1 = zext i32 %indvar630 to i64 ; <i64> [#uses=1] - %tmp.38 = getelementptr [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %tmp.38 = getelementptr [700 x i32], [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] store i32 0, i32* %tmp.38 %inc.2 = add i32 %indvar630, 2 ; <i32> [#uses=2] %tmp.34 = icmp slt i32 %inc.2, 701 ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll index 16bb508..4a6ec50 100644 --- a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll +++ b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll @@ -12,9 +12,9 @@ define void @test1({ i32, i32 }* %P) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=3] - %gep1 = getelementptr { i32, i32 }* %P, i32 %INDVAR, i32 0 ; <i32*> [#uses=1] + %gep1 = getelementptr { i32, i32 }, { i32, i32 }* %P, i32 %INDVAR, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %gep1 - %gep2 = getelementptr { i32, i32 }* %P, i32 %INDVAR, i32 1 ; <i32*> [#uses=1] + %gep2 = getelementptr { i32, i32 }, { i32, i32 }* %P, i32 %INDVAR, i32 1 ; <i32*> [#uses=1] store i32 0, i32* %gep2 %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] @@ -28,9 +28,9 @@ define void @test2([2 x i32]* %P) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=3] - %gep1 = getelementptr [2 x i32]* %P, i32 %INDVAR, i64 0 ; <i32*> [#uses=1] + %gep1 = getelementptr [2 x i32], [2 x i32]* %P, i32 %INDVAR, i64 0 ; <i32*> [#uses=1] store i32 0, i32* %gep1 - %gep2 = getelementptr [2 x i32]* %P, i32 %INDVAR, i64 1 ; <i32*> [#uses=1] + %gep2 = getelementptr [2 x i32], [2 x i32]* %P, i32 %INDVAR, i64 1 ; <i32*> [#uses=1] store i32 0, i32* %gep2 %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll b/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll index 2030000..4974f48 100644 --- a/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll +++ b/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll @@ -11,7 +11,7 @@ define void @test(i8* %PTR) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr i8* %PTR, i32 %INDVAR ; <i8*> [#uses=1] + %STRRED = getelementptr i8, i8* %PTR, i32 %INDVAR ; <i8*> [#uses=1] store i8 0, i8* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=2] ;; cannot eliminate indvar diff --git a/test/Transforms/LoopStrengthReduce/dont_reverse.ll b/test/Transforms/LoopStrengthReduce/dont_reverse.ll index d65213d..551bd03 100644 --- a/test/Transforms/LoopStrengthReduce/dont_reverse.ll +++ b/test/Transforms/LoopStrengthReduce/dont_reverse.ll @@ -4,6 +4,10 @@ ; Don't reverse the iteration if the rhs of the compare is defined ; inside the loop. +; Provide legal integer types. +; Declare i2 as legal so that IVUsers accepts to consider %indvar3451 +target datalayout = "n2:8:16:32:64" + define void @Fill_Buffer(i2* %p) nounwind { entry: br label %bb8 @@ -11,7 +15,7 @@ entry: bb8: %indvar34 = phi i32 [ 0, %entry ], [ %indvar.next35, %bb8 ] %indvar3451 = trunc i32 %indvar34 to i2 - %xmp4344 = load i2* %p + %xmp4344 = load i2, i2* %p %xmp104 = icmp eq i2 %indvar3451, %xmp4344 %indvar.next35 = add i32 %indvar34, 1 br i1 %xmp104, label %bb10, label %bb8 diff --git a/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll b/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll index 7982fbc..27371b5 100644 --- a/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll +++ b/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll @@ -15,7 +15,7 @@ loop2: ; preds = %loop1, %loop2.backe %indvar414 = phi i64 [ %indvar.next415, %loop2.backedge ], [ 0, %loop1 ] %tmp473 = mul i64 %indvar414, -4 %tmp485 = add i64 %tmp484, %tmp473 - %storemerge4 = getelementptr i8* %a, i64 %tmp485 + %storemerge4 = getelementptr i8, i8* %a, i64 %tmp485 %0 = icmp ugt i8* %storemerge4, %a br i1 false, label %loop2.exit, label %loop2.backedge diff --git a/test/Transforms/LoopStrengthReduce/invariant_value_first.ll b/test/Transforms/LoopStrengthReduce/invariant_value_first.ll index 5c18809..4d59ca9 100644 --- a/test/Transforms/LoopStrengthReduce/invariant_value_first.ll +++ b/test/Transforms/LoopStrengthReduce/invariant_value_first.ll @@ -13,7 +13,7 @@ define void @test([10000 x i32]* %P) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] + %STRRED = getelementptr [10000 x i32], [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll b/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll index 8eb8f05..5771640 100644 --- a/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll +++ b/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll @@ -10,7 +10,7 @@ define void @test([10000 x i32]* %P, i32 %outer) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] + %STRRED = getelementptr [10000 x i32], [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/ivchain.ll b/test/Transforms/LoopStrengthReduce/ivchain.ll index 233800b..d95220d 100644 --- a/test/Transforms/LoopStrengthReduce/ivchain.ll +++ b/test/Transforms/LoopStrengthReduce/ivchain.ll @@ -4,6 +4,10 @@ ; A sign extend feeds an IVUser and cannot be hoisted into the AddRec. ; CollectIVChains should bailout on this case. + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + %struct = type { i8*, i8*, i16, i64, i16, i16, i16, i64, i64, i16, i8*, i64, i64, i64 } ; CHECK-LABEL: @test( @@ -27,13 +31,13 @@ for.body: ; preds = %sw.epilog, %land.en br label %if.end388 if.end388: ; preds = %if.then380, %if.else356 - %ColLength = getelementptr inbounds %struct* %fbh.0, i64 0, i32 7 + %ColLength = getelementptr inbounds %struct, %struct* %fbh.0, i64 0, i32 7 %call405 = call signext i16 @SQLColAttribute(i8* undef, i16 zeroext %conv258, i16 zeroext 1003, i8* null, i16 signext 0, i16* null, i64* %ColLength) nounwind br label %sw.epilog sw.epilog: ; preds = %sw.bb542, %sw.bb523, %if.end475 %inc601 = add i16 %column_n.0, 1 - %incdec.ptr = getelementptr inbounds %struct* %fbh.0, i64 1 + %incdec.ptr = getelementptr inbounds %struct, %struct* %fbh.0, i64 1 br label %for.body return: ; preds = %entry diff --git a/test/Transforms/LoopStrengthReduce/nested-reduce.ll b/test/Transforms/LoopStrengthReduce/nested-reduce.ll index 58b8d3e..c05b19d 100644 --- a/test/Transforms/LoopStrengthReduce/nested-reduce.ll +++ b/test/Transforms/LoopStrengthReduce/nested-reduce.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -loop-reduce -S | not grep mul +; Provide legal integer types. +target datalayout = "n8:16:32:64" + ; Make sure we don't get a multiply by 6 in this loop. define i32 @foo(i32 %A, i32 %B, i32 %C, i32 %D) { diff --git a/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll b/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll index ec55179..ad2caeb 100644 --- a/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll +++ b/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll @@ -15,7 +15,7 @@ define void @test([10000 x i32]* %P) { Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] %idx = call i32 @getidx( ) ; <i32> [#uses=1] - %STRRED = getelementptr [10000 x i32]* %P, i32 %INDVAR, i32 %idx ; <i32*> [#uses=1] + %STRRED = getelementptr [10000 x i32], [10000 x i32]* %P, i32 %INDVAR, i32 %idx ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll b/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll index 7ef494d..6943ab9 100644 --- a/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll +++ b/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll @@ -10,12 +10,12 @@ entry: shortcirc_next: ; preds = %no_exit.2, %entry %indvar37 = phi i32 [ 0, %entry ], [ %indvar.next38, %no_exit.2 ] ; <i32> [#uses=3] %gep.upgrd.1 = zext i32 %indvar37 to i64 ; <i64> [#uses=1] - %wp.2.4 = getelementptr i8* null, i64 %gep.upgrd.1 ; <i8*> [#uses=1] + %wp.2.4 = getelementptr i8, i8* null, i64 %gep.upgrd.1 ; <i8*> [#uses=1] br i1 false, label %loopexit.2, label %no_exit.2 no_exit.2: ; preds = %shortcirc_next %wp.2.4.rec = bitcast i32 %indvar37 to i32 ; <i32> [#uses=1] %inc.1.rec = add i32 %wp.2.4.rec, 1 ; <i32> [#uses=1] - %inc.1 = getelementptr i8* null, i32 %inc.1.rec ; <i8*> [#uses=2] + %inc.1 = getelementptr i8, i8* null, i32 %inc.1.rec ; <i8*> [#uses=2] %indvar.next38 = add i32 %indvar37, 1 ; <i32> [#uses=1] switch i8 0, label %shortcirc_next [ i8 32, label %loopexit.2 diff --git a/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll b/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll index 45aeb4e..092b274 100644 --- a/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll +++ b/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll @@ -23,19 +23,19 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define void @_Z15IntegerToStringjjR7Vector2(i32 %i, i32 %radix, %struct.Vector2* nocapture %result) nounwind noinline { entry: %buffer = alloca [33 x i16], align 16 - %add.ptr = getelementptr inbounds [33 x i16]* %buffer, i64 0, i64 33 + %add.ptr = getelementptr inbounds [33 x i16], [33 x i16]* %buffer, i64 0, i64 33 br label %do.body do.body: ; preds = %do.body, %entry %0 = phi i64 [ %indvar.next44, %do.body ], [ 0, %entry ] %i.addr.0 = phi i32 [ %div, %do.body ], [ %i, %entry ] %tmp51 = sub i64 32, %0 - %incdec.ptr = getelementptr [33 x i16]* %buffer, i64 0, i64 %tmp51 + %incdec.ptr = getelementptr [33 x i16], [33 x i16]* %buffer, i64 0, i64 %tmp51 %rem = urem i32 %i.addr.0, 10 %div = udiv i32 %i.addr.0, 10 %idxprom = zext i32 %rem to i64 - %arrayidx = getelementptr inbounds [37 x i8]* @.str, i64 0, i64 %idxprom - %tmp5 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds [37 x i8], [37 x i8]* @.str, i64 0, i64 %idxprom + %tmp5 = load i8, i8* %arrayidx, align 1 %conv = sext i8 %tmp5 to i16 store i16 %conv, i16* %incdec.ptr, align 2 %1 = icmp ugt i32 %i.addr.0, 9 @@ -50,30 +50,30 @@ do.end: ; preds = %do.body %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %sub.ptr.div39 = lshr exact i64 %sub.ptr.sub, 1 %conv11 = trunc i64 %sub.ptr.div39 to i32 - %mLength = getelementptr inbounds %struct.Vector2* %result, i64 0, i32 2 + %mLength = getelementptr inbounds %struct.Vector2, %struct.Vector2* %result, i64 0, i32 2 %idx.ext21 = bitcast i64 %sub.ptr.div39 to i64 %incdec.ptr.sum = add i64 %idx.ext21, -1 %cp.0.sum = sub i64 %incdec.ptr.sum, %0 - %add.ptr22 = getelementptr [33 x i16]* %buffer, i64 1, i64 %cp.0.sum + %add.ptr22 = getelementptr [33 x i16], [33 x i16]* %buffer, i64 1, i64 %cp.0.sum %cmp2740 = icmp eq i64 %idx.ext21, 0 br i1 %cmp2740, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %do.end - %tmp16 = load i32* %mLength, align 4 - %mBegin = getelementptr inbounds %struct.Vector2* %result, i64 0, i32 0 - %tmp14 = load i16** %mBegin, align 8 + %tmp16 = load i32, i32* %mLength, align 4 + %mBegin = getelementptr inbounds %struct.Vector2, %struct.Vector2* %result, i64 0, i32 0 + %tmp14 = load i16*, i16** %mBegin, align 8 %tmp48 = zext i32 %tmp16 to i64 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.body ] %tmp46 = add i64 %tmp51, %indvar - %p.042 = getelementptr [33 x i16]* %buffer, i64 0, i64 %tmp46 + %p.042 = getelementptr [33 x i16], [33 x i16]* %buffer, i64 0, i64 %tmp46 %tmp47 = sub i64 %indvar, %0 - %incdec.ptr32 = getelementptr [33 x i16]* %buffer, i64 1, i64 %tmp47 + %incdec.ptr32 = getelementptr [33 x i16], [33 x i16]* %buffer, i64 1, i64 %tmp47 %tmp49 = add i64 %tmp48, %indvar - %dst.041 = getelementptr i16* %tmp14, i64 %tmp49 - %tmp29 = load i16* %p.042, align 2 + %dst.041 = getelementptr i16, i16* %tmp14, i64 %tmp49 + %tmp29 = load i16, i16* %p.042, align 2 store i16 %tmp29, i16* %dst.041, align 2 %cmp27 = icmp eq i16* %incdec.ptr32, %add.ptr22 %indvar.next = add i64 %indvar, 1 @@ -83,7 +83,7 @@ for.end.loopexit: ; preds = %for.body br label %for.end for.end: ; preds = %for.end.loopexit, %do.end - %tmp38 = load i32* %mLength, align 4 + %tmp38 = load i32, i32* %mLength, align 4 %add = add i32 %tmp38, %conv11 store i32 %add, i32* %mLength, align 4 ret void diff --git a/test/Transforms/LoopStrengthReduce/pr12018.ll b/test/Transforms/LoopStrengthReduce/pr12018.ll index e493cf8..df969ee 100644 --- a/test/Transforms/LoopStrengthReduce/pr12018.ll +++ b/test/Transforms/LoopStrengthReduce/pr12018.ll @@ -12,15 +12,15 @@ entry: for.body: ; preds = %_ZN8nsTArray9ElementAtEi.exit, %entry %i.06 = phi i32 [ %add, %_ZN8nsTArray9ElementAtEi.exit ], [ 0, %entry ] %call.i = call %struct.nsTArrayHeader* @_ZN8nsTArray4Hdr2Ev() nounwind - %add.ptr.i = getelementptr inbounds %struct.nsTArrayHeader* %call.i, i32 1 + %add.ptr.i = getelementptr inbounds %struct.nsTArrayHeader, %struct.nsTArrayHeader* %call.i, i32 1 %tmp = bitcast %struct.nsTArrayHeader* %add.ptr.i to %struct.nsTArray* - %arrayidx = getelementptr inbounds %struct.nsTArray* %tmp, i32 %i.06 + %arrayidx = getelementptr inbounds %struct.nsTArray, %struct.nsTArray* %tmp, i32 %i.06 %add = add nsw i32 %i.06, 1 call void @llvm.dbg.value(metadata %struct.nsTArray* %aValues, i64 0, metadata !0, metadata !{}) nounwind br label %_ZN8nsTArray9ElementAtEi.exit _ZN8nsTArray9ElementAtEi.exit: ; preds = %for.body - %arrayidx.i = getelementptr inbounds %struct.nsTArray* %tmp, i32 %add + %arrayidx.i = getelementptr inbounds %struct.nsTArray, %struct.nsTArray* %tmp, i32 %add call void @_ZN11nsTArray15ComputeDistanceERKS_Rd(%struct.nsTArray* %arrayidx, %struct.nsTArray* %arrayidx.i) nounwind %cmp = icmp slt i32 %add, %foo br i1 %cmp, label %for.body, label %for.end @@ -35,4 +35,4 @@ declare %struct.nsTArrayHeader* @_ZN8nsTArray4Hdr2Ev() declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone -!0 = !{!"0x101"} ; [ DW_TAG_arg_variable ] +!0 = !MDLocalVariable(tag: DW_TAG_arg_variable) diff --git a/test/Transforms/LoopStrengthReduce/pr12048.ll b/test/Transforms/LoopStrengthReduce/pr12048.ll index 7e0f2ad..212004b 100644 --- a/test/Transforms/LoopStrengthReduce/pr12048.ll +++ b/test/Transforms/LoopStrengthReduce/pr12048.ll @@ -13,8 +13,8 @@ while.cond40: i8 0, label %if.then59 ] while.body51: ; preds = %land.end50 - %incdec.ptr = getelementptr inbounds i8* %tmp.1, i64 1 - %scevgep = getelementptr i8* %indvars.iv194, i64 1 + %incdec.ptr = getelementptr inbounds i8, i8* %tmp.1, i64 1 + %scevgep = getelementptr i8, i8* %indvars.iv194, i64 1 br label %while.cond40 if.then59: ; preds = %while.end br i1 undef, label %if.then64, label %if.end113 @@ -29,7 +29,7 @@ while.cond132.preheader: ; preds = %if.end113 %cmp133173 = icmp eq i8* %tmp.1, %tmp.4 br i1 %cmp133173, label %while.cond40.preheader, label %while.body139.lr.ph while.body139.lr.ph: ; preds = %while.cond132.preheader - %scevgep198 = getelementptr i8* %indvars.iv194, i64 0 + %scevgep198 = getelementptr i8, i8* %indvars.iv194, i64 0 %scevgep198199 = ptrtoint i8* %scevgep198 to i64 br label %while.body139 while.body139: ; preds = %while.body139, %while.body139.lr.ph diff --git a/test/Transforms/LoopStrengthReduce/pr12691.ll b/test/Transforms/LoopStrengthReduce/pr12691.ll index 8399434..e33e405 100644 --- a/test/Transforms/LoopStrengthReduce/pr12691.ll +++ b/test/Transforms/LoopStrengthReduce/pr12691.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + @d = common global i32 0, align 4 define void @fn2(i32 %x) nounwind uwtable { @@ -13,13 +16,13 @@ for.cond: br i1 %tobool, label %for.cond, label %for.end for.end: -; CHECK: %tmp1 = load i32* @d, align 4 -; CHECK-NEXT: %tmp2 = load i32* @d, align 4 +; CHECK: %tmp1 = load i32, i32* @d, align 4 +; CHECK-NEXT: %tmp2 = load i32, i32* @d, align 4 ; CHECK-NEXT: %0 = sub i32 %tmp1, %tmp2 - %tmp1 = load i32* @d, align 4 + %tmp1 = load i32, i32* @d, align 4 %add = add nsw i32 %tmp1, %g.0 - %tmp2 = load i32* @d, align 4 + %tmp2 = load i32, i32* @d, align 4 %tobool26 = icmp eq i32 %x, 0 br i1 %tobool26, label %for.end5, label %for.body.lr.ph diff --git a/test/Transforms/LoopStrengthReduce/pr18165.ll b/test/Transforms/LoopStrengthReduce/pr18165.ll index cc878c4..42d960f 100644 --- a/test/Transforms/LoopStrengthReduce/pr18165.ll +++ b/test/Transforms/LoopStrengthReduce/pr18165.ll @@ -20,10 +20,10 @@ target triple = "x86_64-apple-macosx10.9.0" ; Function Attrs: nounwind optsize ssp uwtable define i32 @main() #0 { entry: - %0 = load i32* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 4, !tbaa !1 + %0 = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 0), align 4, !tbaa !1 %tobool7.i = icmp eq i32 %0, 0 - %.promoted.i = load i32* getelementptr inbounds (%struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 - %f.promoted.i = load i32* @f, align 4, !tbaa !7 + %.promoted.i = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 + %f.promoted.i = load i32, i32* @f, align 4, !tbaa !7 br label %for.body6.i.outer for.body6.i.outer: ; preds = %entry, %lor.end.i @@ -42,7 +42,7 @@ if.end9.i: ; preds = %for.body6.i.outer br i1 %tobool12.i, label %lor.rhs.i, label %lor.end.i lor.rhs.i: ; preds = %if.end9.i - %1 = load i32* @b, align 4, !tbaa !7 + %1 = load i32, i32* @b, align 4, !tbaa !7 %dec.i = add nsw i32 %1, -1 store i32 %dec.i, i32* @b, align 4, !tbaa !7 %tobool13.i = icmp ne i32 %1, 0 @@ -59,12 +59,12 @@ lor.end.i: ; preds = %lor.rhs.i, %if.end9 fn1.exit: ; preds = %lor.end.i store i32 0, i32* @g, align 4, !tbaa !7 - store i32 %or14.i, i32* getelementptr inbounds (%struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 + store i32 %or14.i, i32* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 store i32 %or15.i, i32* @f, align 4, !tbaa !7 - store i32 %add.i, i32* getelementptr inbounds (%struct.anon* @e, i64 0, i32 1), align 4, !tbaa !8 + store i32 %add.i, i32* getelementptr inbounds (%struct.anon, %struct.anon* @e, i64 0, i32 1), align 4, !tbaa !8 store i32 0, i32* @h, align 4, !tbaa !7 - %3 = load i32* @b, align 4, !tbaa !7 - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %3) #2 + %3 = load i32, i32* @b, align 4, !tbaa !7 + %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3) #2 ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/pr2570.ll b/test/Transforms/LoopStrengthReduce/pr2570.ll index 7b56971..671ffde 100644 --- a/test/Transforms/LoopStrengthReduce/pr2570.ll +++ b/test/Transforms/LoopStrengthReduce/pr2570.ll @@ -23,7 +23,7 @@ define i32 @func_44(i32 %p_45, i32 %p_46, i16 zeroext %p_48, i32 %p_49, i8 zero entry: tail call i32 @func_116( i8 zeroext 2 ) nounwind ; <i32>:0 [#uses=0] tail call i32 @func_63( i16 signext 2 ) nounwind ; <i32>:1 [#uses=1] - load i16* @g_39, align 2 ; <i16>:2 [#uses=1] + load i16, i16* @g_39, align 2 ; <i16>:2 [#uses=1] tail call i32 @func_63( i16 signext %2 ) nounwind ; <i32>:3 [#uses=1] trunc i32 %3 to i16 ; <i16>:4 [#uses=1] and i16 %4, 1 ; <i16>:5 [#uses=1] @@ -32,10 +32,10 @@ entry: tail call i32 @func_74( i16 zeroext %5, i8 zeroext %6, i16 zeroext %7, i16 zeroext 0 ) nounwind ; <i32>:8 [#uses=0] tail call i32 @func_124( i32 544824386 ) nounwind ; <i32>:9 [#uses=0] zext i8 %p_50 to i32 ; <i32>:10 [#uses=1] - load i32* @g_43, align 4 ; <i32>:11 [#uses=1] + load i32, i32* @g_43, align 4 ; <i32>:11 [#uses=1] icmp sle i32 %10, %11 ; <i1>:12 [#uses=1] zext i1 %12 to i32 ; <i32>:13 [#uses=2] - load i8* @g_247, align 1 ; <i8>:14 [#uses=1] + load i8, i8* @g_247, align 1 ; <i8>:14 [#uses=1] trunc i32 %p_45 to i16 ; <i16>:15 [#uses=1] zext i8 %14 to i16 ; <i16>:16 [#uses=1] tail call i32 @func_74( i16 zeroext %15, i8 zeroext 0, i16 zeroext %16, i16 zeroext 23618 ) nounwind ; <i32>:17 [#uses=4] @@ -72,7 +72,7 @@ bb172: ; preds = %bb168, %bb162 icmp eq i32 %.0343, 0 ; <i1>:30 [#uses=1] %.0341 = select i1 %30, i32 1, i32 %.0343 ; <i32> [#uses=1] urem i32 %23, %.0341 ; <i32>:31 [#uses=1] - load i32* @g_137, align 4 ; <i32>:32 [#uses=4] + load i32, i32* @g_137, align 4 ; <i32>:32 [#uses=4] icmp slt i32 %32, 0 ; <i1>:33 [#uses=1] br i1 %33, label %bb202, label %bb198 @@ -119,13 +119,13 @@ bb222: ; preds = %bb215, %bb205 bb223: ; preds = %bb222, %bb215 %iftmp.437.0 = phi i32 [ 0, %bb222 ], [ 1, %bb215 ] ; <i32> [#uses=1] - load i32* @g_91, align 4 ; <i32>:55 [#uses=3] + load i32, i32* @g_91, align 4 ; <i32>:55 [#uses=3] tail call i32 @func_103( i16 zeroext 4 ) nounwind ; <i32>:56 [#uses=0] tail call i32 @func_112( i32 0, i16 zeroext -31374 ) nounwind ; <i32>:57 [#uses=0] - load i32* @g_197, align 4 ; <i32>:58 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:58 [#uses=1] tail call i32 @func_124( i32 28156 ) nounwind ; <i32>:59 [#uses=1] - load i32* @g_260, align 4 ; <i32>:60 [#uses=1] - load i32* @g_43, align 4 ; <i32>:61 [#uses=1] + load i32, i32* @g_260, align 4 ; <i32>:60 [#uses=1] + load i32, i32* @g_43, align 4 ; <i32>:61 [#uses=1] xor i32 %61, %60 ; <i32>:62 [#uses=1] mul i32 %62, %59 ; <i32>:63 [#uses=1] trunc i32 %63 to i8 ; <i8>:64 [#uses=1] @@ -138,7 +138,7 @@ bb223: ; preds = %bb222, %bb215 %or.cond352 = or i1 %70, %67 ; <i1> [#uses=1] select i1 %or.cond352, i32 0, i32 %55 ; <i32>:71 [#uses=1] %.353 = ashr i32 %66, %71 ; <i32> [#uses=2] - load i16* @g_221, align 2 ; <i16>:72 [#uses=1] + load i16, i16* @g_221, align 2 ; <i16>:72 [#uses=1] zext i16 %72 to i32 ; <i32>:73 [#uses=1] icmp ugt i32 %.353, 31 ; <i1>:74 [#uses=1] select i1 %74, i32 0, i32 %.353 ; <i32>:75 [#uses=1] @@ -146,7 +146,7 @@ bb223: ; preds = %bb222, %bb215 add i32 %.0323, %iftmp.437.0 ; <i32>:76 [#uses=1] and i32 %48, 255 ; <i32>:77 [#uses=2] add i32 %77, 2042556439 ; <i32>:78 [#uses=1] - load i32* @g_207, align 4 ; <i32>:79 [#uses=2] + load i32, i32* @g_207, align 4 ; <i32>:79 [#uses=2] icmp ugt i32 %79, 31 ; <i1>:80 [#uses=1] select i1 %80, i32 0, i32 %79 ; <i32>:81 [#uses=1] %.0320 = lshr i32 %77, %81 ; <i32> [#uses=1] @@ -154,7 +154,7 @@ bb223: ; preds = %bb222, %bb215 zext i1 %82 to i8 ; <i8>:83 [#uses=1] tail call i32 @func_25( i8 zeroext %83 ) nounwind ; <i32>:84 [#uses=1] xor i32 %84, 1 ; <i32>:85 [#uses=1] - load i32* @g_197, align 4 ; <i32>:86 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:86 [#uses=1] add i32 %86, 1 ; <i32>:87 [#uses=1] add i32 %87, %85 ; <i32>:88 [#uses=1] icmp ugt i32 %76, %88 ; <i1>:89 [#uses=1] @@ -163,22 +163,22 @@ bb223: ; preds = %bb222, %bb215 bb241: ; preds = %bb223 store i16 -9, i16* @g_221, align 2 udiv i32 %p_52, 1538244727 ; <i32>:90 [#uses=1] - load i32* @g_207, align 4 ; <i32>:91 [#uses=1] + load i32, i32* @g_207, align 4 ; <i32>:91 [#uses=1] sub i32 %91, %90 ; <i32>:92 [#uses=1] - load i32* @g_14, align 4 ; <i32>:93 [#uses=1] + load i32, i32* @g_14, align 4 ; <i32>:93 [#uses=1] trunc i32 %93 to i16 ; <i16>:94 [#uses=1] trunc i32 %p_46 to i16 ; <i16>:95 [#uses=2] sub i16 %94, %95 ; <i16>:96 [#uses=1] - load i32* @g_197, align 4 ; <i32>:97 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:97 [#uses=1] trunc i32 %97 to i16 ; <i16>:98 [#uses=1] tail call i32 @func_55( i32 -346178830, i16 zeroext %98, i16 zeroext %95 ) nounwind ; <i32>:99 [#uses=0] zext i16 %p_48 to i32 ; <i32>:100 [#uses=1] - load i8* @g_247, align 1 ; <i8>:101 [#uses=1] + load i8, i8* @g_247, align 1 ; <i8>:101 [#uses=1] zext i8 %101 to i32 ; <i32>:102 [#uses=1] sub i32 %100, %102 ; <i32>:103 [#uses=1] tail call i32 @func_55( i32 %103, i16 zeroext -2972, i16 zeroext %96 ) nounwind ; <i32>:104 [#uses=0] xor i32 %92, 2968 ; <i32>:105 [#uses=1] - load i32* @g_197, align 4 ; <i32>:106 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:106 [#uses=1] icmp ugt i32 %105, %106 ; <i1>:107 [#uses=1] zext i1 %107 to i32 ; <i32>:108 [#uses=1] store i32 %108, i32* @g_33, align 4 @@ -195,12 +195,12 @@ bb248: ; preds = %bb284, %bb241 bb272.thread: ; preds = %bb248 store i32 1, i32* @g_82 - load i16* @g_267, align 2 ; <i16>:111 [#uses=1] + load i16, i16* @g_267, align 2 ; <i16>:111 [#uses=1] icmp eq i16 %111, 0 ; <i1>:112 [#uses=1] br i1 %112, label %bb311.loopexit.split, label %bb268 bb255.thread: ; preds = %bb248 - load i32* @g_260, align 4 ; <i32>:113 [#uses=1] + load i32, i32* @g_260, align 4 ; <i32>:113 [#uses=1] sub i32 %113, %p_52 ; <i32>:114 [#uses=1] and i32 %114, -20753 ; <i32>:115 [#uses=1] icmp ne i32 %115, 0 ; <i1>:116 [#uses=1] @@ -237,7 +237,7 @@ bb284: ; preds = %bb279, %bb276, %bb255.thread %p_49_addr.0 = phi i32 [ %p_49_addr.1.reg2mem.0, %bb279 ], [ %p_49_addr.1.reg2mem.0, %bb276 ], [ 0, %bb255.thread ] ; <i32> [#uses=1] %p_48_addr.1 = phi i16 [ %124, %bb279 ], [ %118, %bb276 ], [ %p_48_addr.2.reg2mem.0, %bb255.thread ] ; <i16> [#uses=1] %p_45_addr.0 = phi i32 [ %p_45_addr.1.reg2mem.0, %bb279 ], [ %p_45_addr.1.reg2mem.0, %bb276 ], [ 8, %bb255.thread ] ; <i32> [#uses=3] - load i32* @g_43, align 4 ; <i32>:125 [#uses=1] + load i32, i32* @g_43, align 4 ; <i32>:125 [#uses=1] trunc i32 %125 to i8 ; <i8>:126 [#uses=1] tail call i32 @func_116( i8 zeroext %126 ) nounwind ; <i32>:127 [#uses=0] lshr i32 65255, %p_45_addr.0 ; <i32>:128 [#uses=1] @@ -245,7 +245,7 @@ bb284: ; preds = %bb279, %bb276, %bb255.thread %.op = lshr i32 %128, 31 ; <i32> [#uses=1] %.op.op = xor i32 %.op, 1 ; <i32> [#uses=1] %.354..lobit.not = select i1 %129, i32 1, i32 %.op.op ; <i32> [#uses=1] - load i16* @g_39, align 2 ; <i16>:130 [#uses=1] + load i16, i16* @g_39, align 2 ; <i16>:130 [#uses=1] zext i16 %130 to i32 ; <i32>:131 [#uses=1] icmp slt i32 %.354..lobit.not, %131 ; <i1>:132 [#uses=1] zext i1 %132 to i32 ; <i32>:133 [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/pr3086.ll b/test/Transforms/LoopStrengthReduce/pr3086.ll index 599633a..187c14f 100644 --- a/test/Transforms/LoopStrengthReduce/pr3086.ll +++ b/test/Transforms/LoopStrengthReduce/pr3086.ll @@ -10,18 +10,18 @@ entry: br label %bb11 bb5: ; preds = %bb9 - %0 = load %struct.Lit** %storemerge, align 8 ; <%struct.Lit*> [#uses=0] + %0 = load %struct.Lit*, %struct.Lit** %storemerge, align 8 ; <%struct.Lit*> [#uses=0] %indvar.next8 = add i64 %storemerge.rec, 1 ; <i64> [#uses=1] br label %bb9 bb9: ; preds = %bb22, %bb5 %storemerge.rec = phi i64 [ %indvar.next8, %bb5 ], [ 0, %bb22 ] ; <i64> [#uses=2] - %storemerge = getelementptr %struct.Lit** null, i64 %storemerge.rec ; <%struct.Lit**> [#uses=2] + %storemerge = getelementptr %struct.Lit*, %struct.Lit** null, i64 %storemerge.rec ; <%struct.Lit**> [#uses=2] %1 = icmp ugt %struct.Lit** null, %storemerge ; <i1> [#uses=1] br i1 %1, label %bb5, label %bb22 bb11: ; preds = %bb22, %entry - %2 = load %struct.Cls** null, align 8 ; <%struct.Cls*> [#uses=0] + %2 = load %struct.Cls*, %struct.Cls** null, align 8 ; <%struct.Cls*> [#uses=0] br label %bb22 bb22: ; preds = %bb11, %bb9 diff --git a/test/Transforms/LoopStrengthReduce/pr3399.ll b/test/Transforms/LoopStrengthReduce/pr3399.ll index 26c5002..1037768 100644 --- a/test/Transforms/LoopStrengthReduce/pr3399.ll +++ b/test/Transforms/LoopStrengthReduce/pr3399.ll @@ -13,7 +13,7 @@ bb: ; preds = %bb5, %bb5.thread bb1: ; preds = %bb %l_2.0.reg2mem.0 = sub i32 0, %indvar ; <i32> [#uses=1] - %0 = load volatile i32* @g_53, align 4 ; <i32> [#uses=1] + %0 = load volatile i32, i32* @g_53, align 4 ; <i32> [#uses=1] %1 = trunc i32 %l_2.0.reg2mem.0 to i16 ; <i16> [#uses=1] %2 = trunc i32 %0 to i16 ; <i16> [#uses=1] %3 = mul i16 %2, %1 ; <i16> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/pr3571.ll b/test/Transforms/LoopStrengthReduce/pr3571.ll index a23e4db..1615a81 100644 --- a/test/Transforms/LoopStrengthReduce/pr3571.ll +++ b/test/Transforms/LoopStrengthReduce/pr3571.ll @@ -12,7 +12,7 @@ bb.i: ; preds = %_ZNK11QModelIndex7isValidEv.exit.i _ZNK11QModelIndex7isValidEv.exit.i: ; preds = %bb.i, %entry %result.0.i = phi i32 [ 0, %entry ], [ %indvar.next, %bb.i ] ; <i32> [#uses=2] - %0 = load i32** null, align 4 ; <%struct.QAbstractItemDelegate*> [#uses=0] + %0 = load i32*, i32** null, align 4 ; <%struct.QAbstractItemDelegate*> [#uses=0] br i1 false, label %_ZN18qdesigner_internalL5levelEP18QAbstractItemModelRK11QModelIndex.exit, label %bb.i _ZN18qdesigner_internalL5levelEP18QAbstractItemModelRK11QModelIndex.exit: ; preds = %_ZNK11QModelIndex7isValidEv.exit.i diff --git a/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll b/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll index f90d030..2b9920c 100644 --- a/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll +++ b/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll @@ -28,7 +28,7 @@ for.body: %conv3 = sext i8 %conv to i64 %add = add nsw i64 %call, %storemerge1 %add4 = add nsw i64 %add, %conv3 - %arrayidx = getelementptr inbounds i8* %p, i64 %add4 + %arrayidx = getelementptr inbounds i8, i8* %p, i64 %add4 store i8 0, i8* %arrayidx %inc = add nsw i64 %storemerge1, 1 br label %for.cond diff --git a/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll index 65aa61f..483becc 100644 --- a/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll +++ b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -analyze -iv-users | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + ; The value of %r is dependent on a polynomial iteration expression. ; ; CHECK-LABEL: IV Users for loop %foo.loop diff --git a/test/Transforms/LoopStrengthReduce/related_indvars.ll b/test/Transforms/LoopStrengthReduce/related_indvars.ll index 12942bf..fbe8ffd 100644 --- a/test/Transforms/LoopStrengthReduce/related_indvars.ll +++ b/test/Transforms/LoopStrengthReduce/related_indvars.ll @@ -14,9 +14,9 @@ entry: no_exit: ; preds = %no_exit, %entry %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=2] %D_addr.0.0.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=2] - %D_addr.0.0 = getelementptr double* %D, i32 %D_addr.0.0.rec ; <double*> [#uses=1] + %D_addr.0.0 = getelementptr double, double* %D, i32 %D_addr.0.0.rec ; <double*> [#uses=1] %inc.rec = add i32 %D_addr.0.0.rec, 1 ; <i32> [#uses=1] - %inc = getelementptr double* %D, i32 %inc.rec ; <double*> [#uses=1] + %inc = getelementptr double, double* %D, i32 %inc.rec ; <double*> [#uses=1] store double %F, double* %D_addr.0.0 %tmp.2 = icmp eq double* %inc, %E ; <i1> [#uses=1] %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/remove_indvar.ll b/test/Transforms/LoopStrengthReduce/remove_indvar.ll index bb39532..3b92c25 100644 --- a/test/Transforms/LoopStrengthReduce/remove_indvar.ll +++ b/test/Transforms/LoopStrengthReduce/remove_indvar.ll @@ -1,6 +1,9 @@ ; Check that this test makes INDVAR and related stuff dead. ; RUN: opt < %s -loop-reduce -S | not grep INDVAR +; Provide legal integer types. +target datalayout = "n8:16:32:64" + declare i1 @pred() define void @test(i32* %P) { @@ -9,7 +12,7 @@ define void @test(i32* %P) { Loop: ; preds = %Loop, %0 %i = phi i32 [ 0, %0 ], [ %i.next, %Loop ] %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr i32* %P, i32 %INDVAR ; <i32*> [#uses=1] + %STRRED = getelementptr i32, i32* %P, i32 %INDVAR ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %i.next = add i32 %i, 1 diff --git a/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll b/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll index a652a76..27212d7 100644 --- a/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll +++ b/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll @@ -55,7 +55,7 @@ define void @scalingFactorCrash() { ; <label>:16 ; preds = %16, %15 %17 = phi i32 [ %21, %16 ], [ undef, %15 ] %18 = sub i32 %17, 1623127498 - %19 = getelementptr inbounds i32* undef, i32 %18 + %19 = getelementptr inbounds i32, i32* undef, i32 %18 store i32 undef, i32* %19, align 4 %20 = add i32 %17, 1623127499 %21 = add i32 %20, -1623127498 diff --git a/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll b/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll index 412a716..1035ce1 100644 --- a/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll +++ b/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll @@ -12,10 +12,10 @@ no_exit: ; preds = %no_exit, %entry %indvar = bitcast i32 %indvar.ui to i32 ; <i32> [#uses=1] %N_addr.0.0 = sub i32 %N.s, %indvar ; <i32> [#uses=1] %tmp.8 = add i32 %N_addr.0.0, %tmp.6 ; <i32> [#uses=2] - %tmp.9 = getelementptr i8* %A, i32 %tmp.8 ; <i8*> [#uses=1] - %tmp.10 = load i8* %tmp.9 ; <i8> [#uses=1] - %tmp.17 = getelementptr i8* %B, i32 %tmp.8 ; <i8*> [#uses=1] - %tmp.18 = load i8* %tmp.17 ; <i8> [#uses=1] + %tmp.9 = getelementptr i8, i8* %A, i32 %tmp.8 ; <i8*> [#uses=1] + %tmp.10 = load i8, i8* %tmp.9 ; <i8> [#uses=1] + %tmp.17 = getelementptr i8, i8* %B, i32 %tmp.8 ; <i8*> [#uses=1] + %tmp.18 = load i8, i8* %tmp.17 ; <i8> [#uses=1] %tmp.19 = sub i8 %tmp.10, %tmp.18 ; <i8> [#uses=1] %tmp.21 = add i8 %tmp.19, %Sum.0.0 ; <i8> [#uses=2] %indvar.next = add i32 %indvar.ui, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll b/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll index 2c65261..a81e314 100644 --- a/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll +++ b/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll @@ -27,7 +27,7 @@ bb3: ; preds = %bb2, %bb ; CHECK: bb10: ; CHECK-NEXT: %t7 = icmp eq i16 %t4, 0 ; Host %t2 computation outside the loop. -; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8 addrspace(1)* undef, i16 %t4 +; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* undef, i16 %t4 ; CHECK-NEXT: br label %bb14 bb10: ; preds = %bb9 %t7 = icmp eq i16 %t4, 0 ; <i1> [#uses=1] @@ -36,20 +36,20 @@ bb10: ; preds = %bb9 ; CHECK: bb14: ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[SCEVGEP]] -; CHECK-NEXT: %t6 = load float addrspace(1)* addrspace(1)* undef +; CHECK-NEXT: %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef ; Fold %t3's add within the address. -; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float addrspace(1)* %t6, i16 4 +; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float, float addrspace(1)* %t6, i16 4 ; CHECK-NEXT: [[SCEVGEP2:%[^ ]+]] = bitcast float addrspace(1)* [[SCEVGEP1]] to i8 addrspace(1)* ; Use the induction variable (%t4) to access the right element -; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 +; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[ADDRESS]] ; CHECK-NEXT: br label %bb14 bb14: ; preds = %bb14, %bb10 - %t2 = getelementptr inbounds i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] + %t2 = getelementptr inbounds i8, i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t2 - %t6 = load float addrspace(1)* addrspace(1)* undef + %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef %t8 = bitcast float addrspace(1)* %t6 to i8 addrspace(1)* ; <i8*> [#uses=1] - %t9 = getelementptr inbounds i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] + %t9 = getelementptr inbounds i8, i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t9 br label %bb14 } diff --git a/test/Transforms/LoopStrengthReduce/uglygep.ll b/test/Transforms/LoopStrengthReduce/uglygep.ll index 5155087..430127b 100644 --- a/test/Transforms/LoopStrengthReduce/uglygep.ll +++ b/test/Transforms/LoopStrengthReduce/uglygep.ll @@ -24,7 +24,7 @@ bb3: ; preds = %bb2, %bb ; CHECK: bb10: ; CHECK-NEXT: %t7 = icmp eq i64 %t4, 0 ; Host %t2 computation outside the loop. -; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8* undef, i64 %t4 +; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8, i8* undef, i64 %t4 ; CHECK-NEXT: br label %bb14 bb10: ; preds = %bb9 %t7 = icmp eq i64 %t4, 0 ; <i1> [#uses=1] @@ -33,20 +33,20 @@ bb10: ; preds = %bb9 ; CHECK: bb14: ; CHECK-NEXT: store i8 undef, i8* [[SCEVGEP]] -; CHECK-NEXT: %t6 = load float** undef +; CHECK-NEXT: %t6 = load float*, float** undef ; Fold %t3's add within the address. -; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float* %t6, i64 4 +; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float, float* %t6, i64 4 ; CHECK-NEXT: [[SCEVGEP2:%[^ ]+]] = bitcast float* [[SCEVGEP1]] to i8* ; Use the induction variable (%t4) to access the right element -; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8* [[SCEVGEP2]], i64 %t4 +; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8, i8* [[SCEVGEP2]], i64 %t4 ; CHECK-NEXT: store i8 undef, i8* [[ADDRESS]] ; CHECK-NEXT: br label %bb14 bb14: ; preds = %bb14, %bb10 - %t2 = getelementptr inbounds i8* undef, i64 %t4 ; <i8*> [#uses=1] + %t2 = getelementptr inbounds i8, i8* undef, i64 %t4 ; <i8*> [#uses=1] store i8 undef, i8* %t2 - %t6 = load float** undef + %t6 = load float*, float** undef %t8 = bitcast float* %t6 to i8* ; <i8*> [#uses=1] - %t9 = getelementptr inbounds i8* %t8, i64 %t3 ; <i8*> [#uses=1] + %t9 = getelementptr inbounds i8, i8* %t8, i64 %t3 ; <i8*> [#uses=1] store i8 undef, i8* %t9 br label %bb14 } diff --git a/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll b/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll index 005e4c6..a673768 100644 --- a/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll +++ b/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll @@ -16,7 +16,7 @@ no_exit.2: ; preds = %no_exit.2, %then.0 %indvar630.ui = phi i32 [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <i32> [#uses=3] %indvar630 = bitcast i32 %indvar630.ui to i32 ; <i32> [#uses=2] %gep.upgrd.1 = zext i32 %indvar630.ui to i64 ; <i64> [#uses=1] - %tmp.38 = getelementptr [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %tmp.38 = getelementptr [700 x i32], [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] store i32 0, i32* %tmp.38 %inc.2 = add i32 %indvar630, 2 ; <i32> [#uses=1] %tmp.34 = call i1 @pred( i32 %indvar630 ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll b/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll index 3405b26..2dd14a0 100644 --- a/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll +++ b/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll @@ -28,7 +28,7 @@ bb: ; preds = %bb, %bb.preheader %tmp.16 = add i32 %tmp.15, %tmp. ; <i32> [#uses=2] %k_addr.0.0 = bitcast i32 %tmp.16 to i32 ; <i32> [#uses=1] %gep.upgrd.1 = zext i32 %tmp.16 to i64 ; <i64> [#uses=1] - %tmp = getelementptr [8193 x i8]* @flags2, i32 0, i64 %gep.upgrd.1 ; <i8*> [#uses=1] + %tmp = getelementptr [8193 x i8], [8193 x i8]* @flags2, i32 0, i64 %gep.upgrd.1 ; <i8*> [#uses=1] store i8 0, i8* %tmp %k_addr.0 = add i32 %k_addr.0.0, %i.s ; <i32> [#uses=1] %tmp.upgrd.2 = icmp sgt i32 %k_addr.0, 8192 ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/variable_stride.ll b/test/Transforms/LoopStrengthReduce/variable_stride.ll index 7c0f053..f82b2fc 100644 --- a/test/Transforms/LoopStrengthReduce/variable_stride.ll +++ b/test/Transforms/LoopStrengthReduce/variable_stride.ll @@ -1,6 +1,9 @@ ; Check that variable strides are reduced to adds instead of multiplies. ; RUN: opt < %s -loop-reduce -S | not grep mul +; Provide legal integer types. +target datalayout = "n8:16:32:64" + declare i1 @pred(i32) define void @test([10000 x i32]* %P, i32 %STRIDE) { diff --git a/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll b/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll index d4c8402..95e9dde 100644 --- a/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll +++ b/test/Transforms/LoopUnroll/2007-05-05-UnrollMiscomp.ll @@ -9,11 +9,11 @@ target triple = "i686-apple-darwin8" define void @Foo(%struct.__mpz_struct* %base) { entry: %want = alloca [1 x %struct.__mpz_struct], align 16 ; <[1 x %struct.__mpz_struct]*> [#uses=4] - %want1 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1] + %want1 = getelementptr [1 x %struct.__mpz_struct], [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1] call void @__gmpz_init( %struct.__mpz_struct* %want1 ) - %want27 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1] - %want3 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1] - %want2 = getelementptr [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=2] + %want27 = getelementptr [1 x %struct.__mpz_struct], [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1] + %want3 = getelementptr [1 x %struct.__mpz_struct], [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=1] + %want2 = getelementptr [1 x %struct.__mpz_struct], [1 x %struct.__mpz_struct]* %want, i32 0, i32 0 ; <%struct.__mpz_struct*> [#uses=2] br label %bb bb: ; preds = %bb, %entry diff --git a/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll b/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll index bf6d6d5..a87b16a 100644 --- a/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll +++ b/test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll @@ -46,8 +46,8 @@ bb.nph: ; preds = %entry bb: ; preds = %bb.nph, %bb1 %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %bb1 ] ; <i64> [#uses=2] %s.01 = phi i32 [ 0, %bb.nph ], [ %2, %bb1 ] ; <i32> [#uses=1] - %scevgep = getelementptr i32* %p, i64 %indvar ; <i32*> [#uses=1] - %1 = load i32* %scevgep, align 1 ; <i32> [#uses=1] + %scevgep = getelementptr i32, i32* %p, i64 %indvar ; <i32*> [#uses=1] + %1 = load i32, i32* %scevgep, align 1 ; <i32> [#uses=1] %2 = add nsw i32 %1, %s.01 ; <i32> [#uses=2] br label %bb1 @@ -84,7 +84,7 @@ do.body: ; preds = %do.cond, %if.end br i1 %cond2, label %exit, label %do.cond exit: ; preds = %do.body - %tmp7.i = load i32* undef, align 8 + %tmp7.i = load i32, i32* undef, align 8 br i1 undef, label %do.cond, label %land.lhs.true land.lhs.true: ; preds = %exit diff --git a/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll b/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll index a43a4ff..0b48409 100644 --- a/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll +++ b/test/Transforms/LoopUnroll/2011-08-09-IVSimplify.ll @@ -12,11 +12,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; CHECK: while.body: ; CHECK-NOT: while.body.1: ; CHECK: %shr.1 = lshr i32 %bit_addr.addr.01, 5 -; CHECK: %arrayidx.1 = getelementptr inbounds i32* %bitmap, i32 %shr.1 +; CHECK: %arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1 ; CHECK: %shr.2 = lshr i32 %bit_addr.addr.01, 5 -; CHECK: %arrayidx.2 = getelementptr inbounds i32* %bitmap, i32 %shr.2 +; CHECK: %arrayidx.2 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.2 ; CHECK: %shr.3 = lshr i32 %bit_addr.addr.01, 5 -; CHECK: %arrayidx.3 = getelementptr inbounds i32* %bitmap, i32 %shr.3 +; CHECK: %arrayidx.3 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.3 define void @FlipBit(i32* nocapture %bitmap, i32 %bit_addr, i32 %nbits) nounwind { entry: br label %while.body @@ -28,8 +28,8 @@ while.body: %shr = lshr i32 %bit_addr.addr.01, 5 %rem = and i32 %bit_addr.addr.01, 31 %shl = shl i32 1, %rem - %arrayidx = getelementptr inbounds i32* %bitmap, i32 %shr - %tmp6 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr + %tmp6 = load i32, i32* %arrayidx, align 4 %xor = xor i32 %tmp6, %shl store i32 %xor, i32* %arrayidx, align 4 %inc = add i32 %bit_addr.addr.01, 1 diff --git a/test/Transforms/LoopUnroll/2011-10-01-NoopTrunc.ll b/test/Transforms/LoopUnroll/2011-10-01-NoopTrunc.ll index 617d4db..5f9eec7 100644 --- a/test/Transforms/LoopUnroll/2011-10-01-NoopTrunc.ll +++ b/test/Transforms/LoopUnroll/2011-10-01-NoopTrunc.ll @@ -21,8 +21,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %sum.02 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i8* %arr, i64 %indvars.iv - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %arr, i64 %indvars.iv + %0 = load i8, i8* %arrayidx, align 1 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, %sum.02 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopUnroll/AArch64/lit.local.cfg b/test/Transforms/LoopUnroll/AArch64/lit.local.cfg new file mode 100644 index 0000000..cec29af --- /dev/null +++ b/test/Transforms/LoopUnroll/AArch64/lit.local.cfg @@ -0,0 +1,3 @@ +if not 'AArch64' in config.root.targets: + config.unsupported = True + diff --git a/test/Transforms/LoopUnroll/AArch64/partial.ll b/test/Transforms/LoopUnroll/AArch64/partial.ll new file mode 100644 index 0000000..8a1ea80 --- /dev/null +++ b/test/Transforms/LoopUnroll/AArch64/partial.ll @@ -0,0 +1,76 @@ +; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-a57 | FileCheck %s + +; Partial unroll 8 times for this loop. +define void @unroll1() nounwind { +entry: + br label %loop + +loop: + %iv = phi i32 [ 0, %entry ], [ %inc, %loop ] + %inc = add i32 %iv, 1 + %exitcnd = icmp uge i32 %inc, 1024 + br i1 %exitcnd, label %exit, label %loop + +exit: + ret void +} + +; CHECK: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: icmp + +; Partial unroll 16 times for this loop. +define void @unroll2() nounwind { +entry: + br label %loop1 + +loop1: + %iv1 = phi i32 [ 0, %entry ], [ %inc1, %loop1.latch ] + br label %loop2.header + +loop2.header: + br label %loop2 + +loop2: + %iv2 = phi i32 [ 0, %loop2.header ], [ %inc2, %loop2 ] + %inc2 = add i32 %iv2, 1 + %exitcnd2 = icmp uge i32 %inc2, 1024 + br i1 %exitcnd2, label %exit2, label %loop2 + +exit2: + br label %loop1.latch + +loop1.latch: + %inc1 = add i32 %iv1, 1 + %exitcnd1 = icmp uge i32 %inc1, 1024 + br i1 %exitcnd2, label %exit, label %loop1 + +exit: + ret void +} + + + +; CHECK: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: add +; CHECK-NEXT: icmp diff --git a/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll b/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll new file mode 100644 index 0000000..d3dc081 --- /dev/null +++ b/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll @@ -0,0 +1,33 @@ +; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-a57 | FileCheck %s + +; Tests for unrolling loops with run-time trip counts + +; CHECK: %xtraiter = and i32 %n +; CHECK: %lcmp.mod = icmp ne i32 %xtraiter, 0 +; CHECK: br i1 %lcmp.mod, label %for.body.prol, label %for.body.preheader.split + +; CHECK: for.body.prol: +; CHECK: for.body: + +define i32 @test(i32* nocapture %a, i32 %n) nounwind uwtable readonly { +entry: + %cmp1 = icmp eq i32 %n, 0 + br i1 %cmp1, label %for.end, label %for.body + +for.body: ; preds = %for.body, %entry + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %sum.02 = phi i32 [ %add, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %add = add nsw i32 %0, %sum.02 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] + ret i32 %sum.0.lcssa +} + + diff --git a/test/Transforms/LoopUnroll/PowerPC/a2-unrolling.ll b/test/Transforms/LoopUnroll/PowerPC/a2-unrolling.ll index aae79cb..e9aa1ac 100644 --- a/test/Transforms/LoopUnroll/PowerPC/a2-unrolling.ll +++ b/test/Transforms/LoopUnroll/PowerPC/a2-unrolling.ll @@ -27,8 +27,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.02 = phi i32 [ %add, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %sum.02 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopUnroll/X86/partial.ll b/test/Transforms/LoopUnroll/X86/partial.ll index a2b04c7..4566f79 100644 --- a/test/Transforms/LoopUnroll/X86/partial.ll +++ b/test/Transforms/LoopUnroll/X86/partial.ll @@ -9,20 +9,20 @@ entry: vector.body: ; preds = %vector.body, %entry %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ] - %0 = getelementptr inbounds double* %b, i64 %index + %0 = getelementptr inbounds double, double* %b, i64 %index %1 = bitcast double* %0 to <2 x double>* - %wide.load = load <2 x double>* %1, align 8 + %wide.load = load <2 x double>, <2 x double>* %1, align 8 %.sum9 = or i64 %index, 2 - %2 = getelementptr double* %b, i64 %.sum9 + %2 = getelementptr double, double* %b, i64 %.sum9 %3 = bitcast double* %2 to <2 x double>* - %wide.load8 = load <2 x double>* %3, align 8 + %wide.load8 = load <2 x double>, <2 x double>* %3, align 8 %4 = fadd <2 x double> %wide.load, <double 1.000000e+00, double 1.000000e+00> %5 = fadd <2 x double> %wide.load8, <double 1.000000e+00, double 1.000000e+00> - %6 = getelementptr inbounds double* %a, i64 %index + %6 = getelementptr inbounds double, double* %a, i64 %index %7 = bitcast double* %6 to <2 x double>* store <2 x double> %4, <2 x double>* %7, align 8 %.sum10 = or i64 %index, 2 - %8 = getelementptr double* %a, i64 %.sum10 + %8 = getelementptr double, double* %a, i64 %.sum10 %9 = bitcast double* %8 to <2 x double>* store <2 x double> %5, <2 x double>* %9, align 8 %index.next = add i64 %index, 4 @@ -45,12 +45,12 @@ entry: vector.body: ; preds = %vector.body, %entry %index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ] - %v0 = getelementptr inbounds double* %b, i64 %index + %v0 = getelementptr inbounds double, double* %b, i64 %index %v1 = bitcast double* %v0 to <2 x double>* - %wide.load = load <2 x double>* %v1, align 8 + %wide.load = load <2 x double>, <2 x double>* %v1, align 8 %v4 = fadd <2 x double> %wide.load, <double 1.000000e+00, double 1.000000e+00> %v5 = fmul <2 x double> %v4, <double 8.000000e+00, double 8.000000e+00> - %v6 = getelementptr inbounds double* %a, i64 %index + %v6 = getelementptr inbounds double, double* %a, i64 %index %v7 = bitcast double* %v6 to <2 x double>* store <2 x double> %v5, <2 x double>* %v7, align 8 %index.next = add i64 %index, 2 @@ -84,18 +84,18 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %reduction.026 = phi i16 [ %add14, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i16* %arr, i64 %indvars.iv - %0 = load i16* %arrayidx, align 2 + %arrayidx = getelementptr inbounds i16, i16* %arr, i64 %indvars.iv + %0 = load i16, i16* %arrayidx, align 2 %add = add i16 %0, %reduction.026 %sext = mul i64 %indvars.iv, 12884901888 %idxprom3 = ashr exact i64 %sext, 32 - %arrayidx4 = getelementptr inbounds i16* %arr, i64 %idxprom3 - %1 = load i16* %arrayidx4, align 2 + %arrayidx4 = getelementptr inbounds i16, i16* %arr, i64 %idxprom3 + %1 = load i16, i16* %arrayidx4, align 2 %add7 = add i16 %add, %1 %sext28 = mul i64 %indvars.iv, 21474836480 %idxprom10 = ashr exact i64 %sext28, 32 - %arrayidx11 = getelementptr inbounds i16* %arr, i64 %idxprom10 - %2 = load i16* %arrayidx11, align 2 + %arrayidx11 = getelementptr inbounds i16, i16* %arr, i64 %idxprom10 + %2 = load i16, i16* %arrayidx11, align 2 %add14 = add i16 %add7, %2 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopUnroll/ephemeral.ll b/test/Transforms/LoopUnroll/ephemeral.ll index 9d40613..d16eba7 100644 --- a/test/Transforms/LoopUnroll/ephemeral.ll +++ b/test/Transforms/LoopUnroll/ephemeral.ll @@ -12,8 +12,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %sum.01 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 ; This loop will be completely unrolled, even with these extra instructions, ; but only because they're ephemeral (and, thus, free). diff --git a/test/Transforms/LoopUnroll/full-unroll-heuristics.ll b/test/Transforms/LoopUnroll/full-unroll-heuristics.ll index a1bb4c5..a9104ad 100644 --- a/test/Transforms/LoopUnroll/full-unroll-heuristics.ll +++ b/test/Transforms/LoopUnroll/full-unroll-heuristics.ll @@ -24,14 +24,14 @@ ; If the absolute threshold is too low, or if we can't optimize away requested ; percent of instructions, we shouldn't unroll: -; TEST1: %array_const_idx = getelementptr inbounds [9 x i32]* @known_constant, i64 0, i64 %iv -; TEST3: %array_const_idx = getelementptr inbounds [9 x i32]* @known_constant, i64 0, i64 %iv +; TEST1: %array_const_idx = getelementptr inbounds [9 x i32], [9 x i32]* @known_constant, i64 0, i64 %iv +; TEST3: %array_const_idx = getelementptr inbounds [9 x i32], [9 x i32]* @known_constant, i64 0, i64 %iv ; Otherwise, we should: -; TEST2-NOT: %array_const_idx = getelementptr inbounds [9 x i32]* @known_constant, i64 0, i64 %iv +; TEST2-NOT: %array_const_idx = getelementptr inbounds [9 x i32], [9 x i32]* @known_constant, i64 0, i64 %iv ; Also, we should unroll if the 'unroll-threshold' is big enough: -; TEST4-NOT: %array_const_idx = getelementptr inbounds [9 x i32]* @known_constant, i64 0, i64 %iv +; TEST4-NOT: %array_const_idx = getelementptr inbounds [9 x i32], [9 x i32]* @known_constant, i64 0, i64 %iv ; And check that we don't crash when we're not allowed to do any analysis. ; RUN: opt < %s -loop-unroll -unroll-max-iteration-count-to-analyze=0 -disable-output @@ -46,10 +46,10 @@ entry: loop: ; preds = %loop, %entry %iv = phi i64 [ 0, %entry ], [ %inc, %loop ] %r = phi i32 [ 0, %entry ], [ %add, %loop ] - %arrayidx = getelementptr inbounds i32* %src, i64 %iv - %src_element = load i32* %arrayidx, align 4 - %array_const_idx = getelementptr inbounds [9 x i32]* @known_constant, i64 0, i64 %iv - %const_array_element = load i32* %array_const_idx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %src, i64 %iv + %src_element = load i32, i32* %arrayidx, align 4 + %array_const_idx = getelementptr inbounds [9 x i32], [9 x i32]* @known_constant, i64 0, i64 %iv + %const_array_element = load i32, i32* %array_const_idx, align 4 %mul = mul nsw i32 %src_element, %const_array_element %add = add nsw i32 %mul, %r %inc = add nuw nsw i64 %iv, 1 diff --git a/test/Transforms/LoopUnroll/ignore-annotation-intrinsic-cost.ll b/test/Transforms/LoopUnroll/ignore-annotation-intrinsic-cost.ll index dcb5d1c..2101b63 100644 --- a/test/Transforms/LoopUnroll/ignore-annotation-intrinsic-cost.ll +++ b/test/Transforms/LoopUnroll/ignore-annotation-intrinsic-cost.ll @@ -18,7 +18,7 @@ for.body: ; preds = %entry, %for.body %i.01 = phi i32 [ 0, %entry ], [ %inc, %for.body ] ; The real loop. %mul = mul nsw i32 %B, %C - %arrayidx = getelementptr inbounds i32* %A, i32 %i.01 + %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.01 store i32 %mul, i32* %arrayidx, align 4 %inc = add nsw i32 %i.01, 1 %exitcond = icmp ne i32 %inc, 4 diff --git a/test/Transforms/LoopUnroll/runtime-loop.ll b/test/Transforms/LoopUnroll/runtime-loop.ll index 80571ec..9e78edf 100644 --- a/test/Transforms/LoopUnroll/runtime-loop.ll +++ b/test/Transforms/LoopUnroll/runtime-loop.ll @@ -20,8 +20,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.02 = phi i32 [ %add, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %sum.02 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -47,8 +47,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %sum.01 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %sum.01 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -96,8 +96,8 @@ for.body: ; preds = %for.body, %entry %p.addr.05 = phi i16* [ %incdec.ptr, %for.body ], [ %p, %entry ] %len.addr.04 = phi i32 [ %sub, %for.body ], [ %len, %entry ] %res.03 = phi i32 [ %add, %for.body ], [ 0, %entry ] - %incdec.ptr = getelementptr inbounds i16* %p.addr.05, i64 1 - %0 = load i16* %p.addr.05, align 2 + %incdec.ptr = getelementptr inbounds i16, i16* %p.addr.05, i64 1 + %0 = load i16, i16* %p.addr.05, align 2 %conv = zext i16 %0 to i32 %add = add i32 %conv, %res.03 %sub = add nsw i32 %len.addr.04, -2 @@ -113,6 +113,39 @@ for.end: ; preds = %for.cond.for.end_cr ret i16 %res.0.lcssa } +; Test run-time unrolling disable metadata. +; CHECK: for.body: +; CHECK-NOT: for.body.prol: + +define zeroext i16 @test2(i16* nocapture %p, i32 %len) nounwind uwtable readonly { +entry: + %cmp2 = icmp eq i32 %len, 0 + br i1 %cmp2, label %for.end, label %for.body + +for.body: ; preds = %for.body, %entry + %p.addr.05 = phi i16* [ %incdec.ptr, %for.body ], [ %p, %entry ] + %len.addr.04 = phi i32 [ %sub, %for.body ], [ %len, %entry ] + %res.03 = phi i32 [ %add, %for.body ], [ 0, %entry ] + %incdec.ptr = getelementptr inbounds i16, i16* %p.addr.05, i64 1 + %0 = load i16, i16* %p.addr.05, align 2 + %conv = zext i16 %0 to i32 + %add = add i32 %conv, %res.03 + %sub = add nsw i32 %len.addr.04, -2 + %cmp = icmp eq i32 %sub, 0 + br i1 %cmp, label %for.cond.for.end_crit_edge, label %for.body, !llvm.loop !0 + +for.cond.for.end_crit_edge: ; preds = %for.body + %phitmp = trunc i32 %add to i16 + br label %for.end + +for.end: ; preds = %for.cond.for.end_crit_edge, %entry + %res.0.lcssa = phi i16 [ %phitmp, %for.cond.for.end_crit_edge ], [ 0, %entry ] + ret i16 %res.0.lcssa +} + +!0 = distinct !{!0, !1} +!1 = !{!"llvm.loop.unroll.runtime.disable"} + ; CHECK: !0 = distinct !{!0, !1} ; CHECK: !1 = !{!"llvm.loop.unroll.disable"} diff --git a/test/Transforms/LoopUnroll/runtime-loop1.ll b/test/Transforms/LoopUnroll/runtime-loop1.ll index 5ff75e3..7684e39 100644 --- a/test/Transforms/LoopUnroll/runtime-loop1.ll +++ b/test/Transforms/LoopUnroll/runtime-loop1.ll @@ -16,8 +16,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.02 = phi i32 [ %add, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %sum.02 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopUnroll/runtime-loop2.ll b/test/Transforms/LoopUnroll/runtime-loop2.ll index 176362a..7c6bb96 100644 --- a/test/Transforms/LoopUnroll/runtime-loop2.ll +++ b/test/Transforms/LoopUnroll/runtime-loop2.ll @@ -16,8 +16,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.02 = phi i32 [ %add, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %sum.02 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopUnroll/runtime-loop3.ll b/test/Transforms/LoopUnroll/runtime-loop3.ll index aa928cc..fd13ebf 100644 --- a/test/Transforms/LoopUnroll/runtime-loop3.ll +++ b/test/Transforms/LoopUnroll/runtime-loop3.ll @@ -23,8 +23,8 @@ for.body3: ; preds = %for.cond1.preheader %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %sum.19 = phi i32 [ %add4, %for.body3 ], [ %sum.012, %for.cond1.preheader ] %0 = add nsw i64 %indvars.iv, %indvars.iv16 - %arrayidx = getelementptr inbounds i32* %a, i64 %0 - %1 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %0 + %1 = load i32, i32* %arrayidx, align 4 %add4 = add nsw i32 %1, %sum.19 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopUnroll/runtime-loop4.ll b/test/Transforms/LoopUnroll/runtime-loop4.ll new file mode 100644 index 0000000..9be0ffd --- /dev/null +++ b/test/Transforms/LoopUnroll/runtime-loop4.ll @@ -0,0 +1,43 @@ +; RUN: opt < %s -S -O2 -unroll-runtime=true | FileCheck %s + +; Check runtime unrolling prologue can be promoted by LICM pass. + +; CHECK: entry: +; CHECK: %xtraiter +; CHECK: %lcmp.mod +; CHECK: loop1: +; CHECK: br i1 %lcmp.mod +; CHECK: loop2.prol: + +define void @unroll(i32 %iter, i32* %addr1, i32* %addr2) nounwind { +entry: + br label %loop1 + +loop1: + %iv1 = phi i32 [ 0, %entry ], [ %inc1, %loop1.latch ] + %offset1 = getelementptr i32, i32* %addr1, i32 %iv1 + store i32 %iv1, i32* %offset1, align 4 + br label %loop2.header + +loop2.header: + br label %loop2 + +loop2: + %iv2 = phi i32 [ 0, %loop2.header ], [ %inc2, %loop2 ] + %offset2 = getelementptr i32, i32* %addr2, i32 %iv2 + store i32 %iv2, i32* %offset2, align 4 + %inc2 = add i32 %iv2, 1 + %exitcnd2 = icmp uge i32 %inc2, %iter + br i1 %exitcnd2, label %exit2, label %loop2 + +exit2: + br label %loop1.latch + +loop1.latch: + %inc1 = add i32 %iv1, 1 + %exitcnd1 = icmp uge i32 %inc1, 1024 + br i1 %exitcnd1, label %exit, label %loop1 + +exit: + ret void +} diff --git a/test/Transforms/LoopUnroll/scevunroll.ll b/test/Transforms/LoopUnroll/scevunroll.ll index 20161d7..a5c9a6e 100644 --- a/test/Transforms/LoopUnroll/scevunroll.ll +++ b/test/Transforms/LoopUnroll/scevunroll.ll @@ -19,8 +19,8 @@ while.body: %iv = phi i64 [ 10, %entry ], [ %iv.next, %while.body ] %sum = phi i32 [ 0, %entry ], [ %sum.next, %while.body ] %iv.next = add i64 %iv, -1 - %adr = getelementptr inbounds i32* %base, i64 %iv.next - %tmp = load i32* %adr, align 8 + %adr = getelementptr inbounds i32, i32* %base, i64 %iv.next + %tmp = load i32, i32* %adr, align 8 %sum.next = add i32 %sum, %tmp %iv.narrow = trunc i64 %iv.next to i32 %cmp.i65 = icmp sgt i32 %iv.narrow, 0 @@ -46,8 +46,8 @@ entry: loop: %iv = phi i64 [ 0, %entry ], [ %inc, %tail ] %s = phi i64 [ 0, %entry ], [ %s.next, %tail ] - %adr = getelementptr i64* %base, i64 %iv - %val = load i64* %adr + %adr = getelementptr i64, i64* %base, i64 %iv + %val = load i64, i64* %adr %s.next = add i64 %s, %val %inc = add i64 %iv, 1 %cmp = icmp ne i64 %inc, 4 @@ -67,8 +67,8 @@ exit2: ; SCEV properly unrolls multi-exit loops. ; ; CHECK-LABEL: @multiExit( -; CHECK: getelementptr i32* %base, i32 10 -; CHECK-NEXT: load i32* +; CHECK: getelementptr i32, i32* %base, i32 10 +; CHECK-NEXT: load i32, i32* ; CHECK: br i1 false, label %l2.10, label %exit1 ; CHECK: l2.10: ; CHECK-NOT: br @@ -81,8 +81,8 @@ l1: %iv2 = phi i32 [ 0, %entry ], [ %inc2, %l2 ] %inc1 = add i32 %iv1, 1 %inc2 = add i32 %iv2, 1 - %adr = getelementptr i32* %base, i32 %iv1 - %val = load i32* %adr + %adr = getelementptr i32, i32* %base, i32 %iv1 + %val = load i32, i32* %adr %cmp1 = icmp slt i32 %iv1, 5 br i1 %cmp1, label %l2, label %exit1 l2: @@ -112,8 +112,8 @@ l1: %iv2 = phi i32 [ 0, %entry ], [ %inc2, %l3 ] %inc1 = add i32 %iv1, 1 %inc2 = add i32 %iv2, 1 - %adr = getelementptr i32* %base, i32 %iv1 - %val = load i32* %adr + %adr = getelementptr i32, i32* %base, i32 %iv1 + %val = load i32, i32* %adr %cmp1 = icmp slt i32 %iv1, 5 br i1 %cmp1, label %l2, label %exit1 l2: diff --git a/test/Transforms/LoopUnroll/shifted-tripcount.ll b/test/Transforms/LoopUnroll/shifted-tripcount.ll index a118a46..4c21698 100644 --- a/test/Transforms/LoopUnroll/shifted-tripcount.ll +++ b/test/Transforms/LoopUnroll/shifted-tripcount.ll @@ -13,11 +13,11 @@ entry: for.body: ; preds = %entry, %for.body %i.013 = phi i64 [ %tmp16, %for.body ], [ 0, %entry ] ; <i64> [#uses=2] - %arrayidx7 = getelementptr double* %p, i64 %i.013 ; <double*> [#uses=2] + %arrayidx7 = getelementptr double, double* %p, i64 %i.013 ; <double*> [#uses=2] %tmp16 = add i64 %i.013, 1 ; <i64> [#uses=3] - %arrayidx = getelementptr double* %p, i64 %tmp16 ; <double*> [#uses=1] - %tmp4 = load double* %arrayidx ; <double> [#uses=1] - %tmp8 = load double* %arrayidx7 ; <double> [#uses=1] + %arrayidx = getelementptr double, double* %p, i64 %tmp16 ; <double*> [#uses=1] + %tmp4 = load double, double* %arrayidx ; <double> [#uses=1] + %tmp8 = load double, double* %arrayidx7 ; <double> [#uses=1] %mul9 = fmul double %tmp8, %tmp4 ; <double> [#uses=1] store double %mul9, double* %arrayidx7 %exitcond = icmp eq i64 %tmp16, %mul10 ; <i1> [#uses=1] diff --git a/test/Transforms/LoopUnroll/unroll-pragmas-disabled.ll b/test/Transforms/LoopUnroll/unroll-pragmas-disabled.ll index 4f934a6..dc812fb 100644 --- a/test/Transforms/LoopUnroll/unroll-pragmas-disabled.ll +++ b/test/Transforms/LoopUnroll/unroll-pragmas-disabled.ll @@ -19,8 +19,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -51,8 +51,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -78,8 +78,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -110,8 +110,8 @@ entry: for.body3: ; preds = %for.body3, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body3 ] - %arrayidx = getelementptr inbounds i32* %List, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %List, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add4 = add nsw i32 %0, 10 store i32 %add4, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -124,8 +124,8 @@ for.body3.1.preheader: ; preds = %for.body3 for.body3.1: ; preds = %for.body3.1.preheader, %for.body3.1 %indvars.iv.1 = phi i64 [ %1, %for.body3.1 ], [ 0, %for.body3.1.preheader ] %1 = add nsw i64 %indvars.iv.1, 1 - %arrayidx.1 = getelementptr inbounds i32* %List, i64 %1 - %2 = load i32* %arrayidx.1, align 4 + %arrayidx.1 = getelementptr inbounds i32, i32* %List, i64 %1 + %2 = load i32, i32* %arrayidx.1, align 4 %add4.1 = add nsw i32 %2, 10 store i32 %add4.1, i32* %arrayidx.1, align 4 %exitcond.1 = icmp eq i64 %1, 4 diff --git a/test/Transforms/LoopUnroll/unroll-pragmas.ll b/test/Transforms/LoopUnroll/unroll-pragmas.ll index 5831557..1354181 100644 --- a/test/Transforms/LoopUnroll/unroll-pragmas.ll +++ b/test/Transforms/LoopUnroll/unroll-pragmas.ll @@ -19,8 +19,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -43,8 +43,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -71,8 +71,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -94,8 +94,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -124,8 +124,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -153,8 +153,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -190,8 +190,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -217,8 +217,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -245,8 +245,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %inc = add nsw i32 %0, 1 store i32 %inc, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll b/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll index bf5a61b..9da8dc2 100644 --- a/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll +++ b/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll @@ -17,7 +17,7 @@ bb36.outer: ; preds = %bb41, %bb36.preheader bb.nph: ; preds = %bb36.outer %ttmp8 = icmp eq i8* null, null ; <i1> [#uses=1] %ttmp6 = icmp eq i8* null, null ; <i1> [#uses=1] - %tmp31 = call i32 @strcspn( i8* null, i8* getelementptr ([3 x i8]* @str3, i64 0, i64 0) ) ; <i32> [#uses=1] + %tmp31 = call i32 @strcspn( i8* null, i8* getelementptr ([3 x i8], [3 x i8]* @str3, i64 0, i64 0) ) ; <i32> [#uses=1] br i1 %ttmp8, label %cond_next, label %cond_true cond_true: ; preds = %bb.nph diff --git a/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll b/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll index dfca154..c01bed1 100644 --- a/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll +++ b/test/Transforms/LoopUnswitch/2007-07-18-DomInfo.ll @@ -52,7 +52,7 @@ cond_next1929: ; preds = %cond_next1915 br i1 false, label %cond_next1961, label %cond_next2009 cond_next1961: ; preds = %cond_next1929 - %tmp1992 = getelementptr i8* %b.10.ph, i32 0 ; <i8*> [#uses=0] + %tmp1992 = getelementptr i8, i8* %b.10.ph, i32 0 ; <i8*> [#uses=0] br label %cond_next1915 cond_next2009: ; preds = %cond_next1929 diff --git a/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll b/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll index f83acaa..49b30bd 100644 --- a/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll +++ b/test/Transforms/LoopUnswitch/2007-08-01-LCSSA.ll @@ -19,7 +19,7 @@ declare i32 @strcmp(i8*, i8*) define i32 @_ZN9Generator6strregEPKc(%struct.Generator* %this, i8* %s) { entry: - %s_addr.0 = select i1 false, i8* getelementptr ([1 x i8]* @.str9, i32 0, i32 0), i8* %s ; <i8*> [#uses=2] + %s_addr.0 = select i1 false, i8* getelementptr ([1 x i8], [1 x i8]* @.str9, i32 0, i32 0), i8* %s ; <i8*> [#uses=2] %tmp122 = icmp eq i8* %s_addr.0, null ; <i1> [#uses=1] br label %bb184 diff --git a/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll b/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll index f74054a..d606ea9 100644 --- a/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll +++ b/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll @@ -17,6 +17,6 @@ bb36: ; preds = %bb19 store i16 0, i16* @g_56, align 2 br i1 false, label %bb44, label %bb3 bb44: ; preds = %bb44, %bb36 - %tmp46 = load i16* @g_56, align 2 ; <i16> [#uses=0] + %tmp46 = load i16, i16* @g_56, align 2 ; <i16> [#uses=0] br i1 false, label %bb, label %bb44 } diff --git a/test/Transforms/LoopUnswitch/2010-11-18-LCSSA.ll b/test/Transforms/LoopUnswitch/2010-11-18-LCSSA.ll index a976d18..3b89fa9 100644 --- a/test/Transforms/LoopUnswitch/2010-11-18-LCSSA.ll +++ b/test/Transforms/LoopUnswitch/2010-11-18-LCSSA.ll @@ -7,7 +7,7 @@ entry: br i1 true, label %for.end12, label %bb.nph bb.nph: ; preds = %entry - %g_38.promoted = load i32* @g_38 + %g_38.promoted = load i32, i32* @g_38 br label %for.body for.body: ; preds = %for.cond, %bb.nph diff --git a/test/Transforms/LoopUnswitch/2011-09-26-EHCrash.ll b/test/Transforms/LoopUnswitch/2011-09-26-EHCrash.ll index e8feef3..0b7f91f 100644 --- a/test/Transforms/LoopUnswitch/2011-09-26-EHCrash.ll +++ b/test/Transforms/LoopUnswitch/2011-09-26-EHCrash.ll @@ -22,9 +22,9 @@ for.body: ; preds = %for.cond if.then: ; preds = %for.body %idxprom = sext i32 %inc1 to i64 - %array_ = getelementptr inbounds %class.MyContainer.1.3.19.29* %this, i32 0, i32 0 - %arrayidx = getelementptr inbounds [6 x %class.MyMemVarClass.0.2.18.28*]* %array_, i32 0, i64 %idxprom - %tmp4 = load %class.MyMemVarClass.0.2.18.28** %arrayidx, align 8 + %array_ = getelementptr inbounds %class.MyContainer.1.3.19.29, %class.MyContainer.1.3.19.29* %this, i32 0, i32 0 + %arrayidx = getelementptr inbounds [6 x %class.MyMemVarClass.0.2.18.28*], [6 x %class.MyMemVarClass.0.2.18.28*]* %array_, i32 0, i64 %idxprom + %tmp4 = load %class.MyMemVarClass.0.2.18.28*, %class.MyMemVarClass.0.2.18.28** %arrayidx, align 8 %isnull = icmp eq %class.MyMemVarClass.0.2.18.28* %tmp4, null br i1 %isnull, label %for.inc, label %delete.notnull diff --git a/test/Transforms/LoopUnswitch/2011-11-18-SimpleSwitch.ll b/test/Transforms/LoopUnswitch/2011-11-18-SimpleSwitch.ll index a8608b87..a35596a 100644 --- a/test/Transforms/LoopUnswitch/2011-11-18-SimpleSwitch.ll +++ b/test/Transforms/LoopUnswitch/2011-11-18-SimpleSwitch.ll @@ -15,7 +15,7 @@ ; CHECK-NEXT: br label %loop_begin.us ; CHECK: loop_begin.us: ; preds = %loop_begin.backedge.us, %.split.us -; CHECK-NEXT: %var_val.us = load i32* %var +; CHECK-NEXT: %var_val.us = load i32, i32* %var ; CHECK-NEXT: switch i32 1, label %default.us-lcssa.us [ ; CHECK-NEXT: i32 1, label %inc.us @@ -34,7 +34,7 @@ ; CHECK-NEXT: br label %loop_begin.us1 ; CHECK: loop_begin.us1: ; preds = %loop_begin.backedge.us5, %.split.split.us -; CHECK-NEXT: %var_val.us2 = load i32* %var +; CHECK-NEXT: %var_val.us2 = load i32, i32* %var ; CHECK-NEXT: switch i32 2, label %default.us-lcssa.us-lcssa.us [ ; CHECK-NEXT: i32 1, label %inc.us4 ; CHECK-NEXT: i32 2, label %dec.us3 @@ -48,7 +48,7 @@ ; CHECK-NEXT: br label %loop_begin ; CHECK: loop_begin: ; preds = %loop_begin.backedge, %.split.split -; CHECK-NEXT: %var_val = load i32* %var +; CHECK-NEXT: %var_val = load i32, i32* %var ; CHECK-NEXT: switch i32 %c, label %default.us-lcssa.us-lcssa [ ; CHECK-NEXT: i32 1, label %inc ; CHECK-NEXT: i32 2, label %dec @@ -63,13 +63,13 @@ define i32 @test(i32* %var) { %mem = alloca i32 store i32 2, i32* %mem - %c = load i32* %mem + %c = load i32, i32* %mem br label %loop_begin loop_begin: - %var_val = load i32* %var + %var_val = load i32, i32* %var switch i32 %c, label %default [ i32 1, label %inc diff --git a/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches-Threshold.ll b/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches-Threshold.ll index 686cedb..393dd5c 100644 --- a/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches-Threshold.ll +++ b/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches-Threshold.ll @@ -52,14 +52,14 @@ define i32 @test(i32* %var) { %mem = alloca i32 store i32 2, i32* %mem - %c = load i32* %mem - %d = load i32* %mem + %c = load i32, i32* %mem + %d = load i32, i32* %mem br label %loop_begin loop_begin: - %var_val = load i32* %var + %var_val = load i32, i32* %var switch i32 %c, label %second_switch [ i32 1, label %inc diff --git a/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches.ll b/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches.ll index 3ba9fc2..20f03c9 100644 --- a/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches.ll +++ b/test/Transforms/LoopUnswitch/2011-11-18-TwoSwitches.ll @@ -22,7 +22,7 @@ ; CHECK-NEXT: br label %loop_begin.us.us ; CHECK: loop_begin.us.us: ; preds = %loop_begin.backedge.us.us, %.split.us.split.us -; CHECK-NEXT: %var_val.us.us = load i32* %var +; CHECK-NEXT: %var_val.us.us = load i32, i32* %var ; CHECK-NEXT: switch i32 1, label %second_switch.us.us [ ; CHECK-NEXT: i32 1, label %inc.us.us @@ -38,7 +38,7 @@ ; CHECK-NEXT: br label %loop_begin.us ; CHECK: loop_begin.us: ; preds = %loop_begin.backedge.us, %.split.us.split -; CHECK-NEXT: %var_val.us = load i32* %var +; CHECK-NEXT: %var_val.us = load i32, i32* %var ; CHECK-NEXT: switch i32 1, label %second_switch.us [ ; CHECK-NEXT: i32 1, label %inc.us @@ -65,7 +65,7 @@ ; CHECK-NEXT: br label %loop_begin.us1 ; CHECK: loop_begin.us1: ; preds = %loop_begin.backedge.us6, %.split.split.us -; CHECK-NEXT: %var_val.us2 = load i32* %var +; CHECK-NEXT: %var_val.us2 = load i32, i32* %var ; CHECK-NEXT: switch i32 %c, label %second_switch.us3 [ ; CHECK-NEXT: i32 1, label %loop_begin.inc_crit_edge.us ; CHECK-NEXT: ] @@ -86,7 +86,7 @@ ; CHECK-NEXT: br label %loop_begin ; CHECK: loop_begin: ; preds = %loop_begin.backedge, %.split.split -; CHECK-NEXT: %var_val = load i32* %var +; CHECK-NEXT: %var_val = load i32, i32* %var ; CHECK-NEXT: switch i32 %c, label %second_switch [ ; CHECK-NEXT: i32 1, label %loop_begin.inc_crit_edge ; CHECK-NEXT: ] @@ -106,14 +106,14 @@ define i32 @test(i32* %var) { %mem = alloca i32 store i32 2, i32* %mem - %c = load i32* %mem - %d = load i32* %mem + %c = load i32, i32* %mem + %d = load i32, i32* %mem br label %loop_begin loop_begin: - %var_val = load i32* %var + %var_val = load i32, i32* %var switch i32 %c, label %second_switch [ i32 1, label %inc diff --git a/test/Transforms/LoopUnswitch/2012-04-30-LoopUnswitch-LPad-Crash.ll b/test/Transforms/LoopUnswitch/2012-04-30-LoopUnswitch-LPad-Crash.ll index a6c0d83..223fbf1 100644 --- a/test/Transforms/LoopUnswitch/2012-04-30-LoopUnswitch-LPad-Crash.ll +++ b/test/Transforms/LoopUnswitch/2012-04-30-LoopUnswitch-LPad-Crash.ll @@ -46,9 +46,9 @@ define void @_ZN1DptEv(%class.D.22.42.66.102.138.158.178.198.238.242.246.250.262 entry: %this.addr = alloca %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379*, align 8 store %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379* %this, %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379** %this.addr, align 8 - %this1 = load %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379** %this.addr - %px = getelementptr inbounds %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379* %this1, i32 0, i32 0 - %0 = load %class.C.23.43.67.103.139.159.179.199.239.243.247.251.263.295.303.339.347.376** %px, align 8 + %this1 = load %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379*, %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379** %this.addr + %px = getelementptr inbounds %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379, %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379* %this1, i32 0, i32 0 + %0 = load %class.C.23.43.67.103.139.159.179.199.239.243.247.251.263.295.303.339.347.376*, %class.C.23.43.67.103.139.159.179.199.239.243.247.251.263.295.303.339.347.376** %px, align 8 %tobool = icmp ne %class.C.23.43.67.103.139.159.179.199.239.243.247.251.263.295.303.339.347.376* %0, null br i1 %tobool, label %cond.end, label %cond.false diff --git a/test/Transforms/LoopUnswitch/2012-05-20-Phi.ll b/test/Transforms/LoopUnswitch/2012-05-20-Phi.ll index 4c63a56..96bc28c 100644 --- a/test/Transforms/LoopUnswitch/2012-05-20-Phi.ll +++ b/test/Transforms/LoopUnswitch/2012-05-20-Phi.ll @@ -9,9 +9,9 @@ target triple = "x86_64-unknown-linux-gnu" define void @func() noreturn nounwind uwtable { entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %tobool = icmp eq i32 %0, 0 - %1 = load i32* @b, align 4 + %1 = load i32, i32* @b, align 4 br label %while.body while.body: ; preds = %while.body, %entry diff --git a/test/Transforms/LoopUnswitch/basictest.ll b/test/Transforms/LoopUnswitch/basictest.ll index 85e44ec..e990144 100644 --- a/test/Transforms/LoopUnswitch/basictest.ll +++ b/test/Transforms/LoopUnswitch/basictest.ll @@ -6,13 +6,13 @@ entry: no_exit: ; preds = %no_exit.backedge, %entry %i.0.0 = phi i32 [ 0, %entry ], [ %i.0.0.be, %no_exit.backedge ] ; <i32> [#uses=3] %gep.upgrd.1 = zext i32 %i.0.0 to i64 ; <i64> [#uses=1] - %tmp.7 = getelementptr i32* %A, i64 %gep.upgrd.1 ; <i32*> [#uses=4] - %tmp.13 = load i32* %tmp.7 ; <i32> [#uses=2] + %tmp.7 = getelementptr i32, i32* %A, i64 %gep.upgrd.1 ; <i32*> [#uses=4] + %tmp.13 = load i32, i32* %tmp.7 ; <i32> [#uses=2] %tmp.14 = add i32 %tmp.13, 1 ; <i32> [#uses=1] store i32 %tmp.14, i32* %tmp.7 br i1 %C, label %then, label %endif then: ; preds = %no_exit - %tmp.29 = load i32* %tmp.7 ; <i32> [#uses=1] + %tmp.29 = load i32, i32* %tmp.7 ; <i32> [#uses=1] %tmp.30 = add i32 %tmp.29, 2 ; <i32> [#uses=1] store i32 %tmp.30, i32* %tmp.7 %inc9 = add i32 %i.0.0, 1 ; <i32> [#uses=2] @@ -36,13 +36,13 @@ return: ; preds = %endif, %then define i32 @test2(i32* %var) { %mem = alloca i32 store i32 2, i32* %mem - %c = load i32* %mem + %c = load i32, i32* %mem br label %loop_begin loop_begin: - %var_val = load i32* %var + %var_val = load i32, i32* %var switch i32 %c, label %default [ i32 1, label %inc diff --git a/test/Transforms/LoopUnswitch/preserve-analyses.ll b/test/Transforms/LoopUnswitch/preserve-analyses.ll index f79612b..e3774a1 100644 --- a/test/Transforms/LoopUnswitch/preserve-analyses.ll +++ b/test/Transforms/LoopUnswitch/preserve-analyses.ll @@ -11,8 +11,8 @@ target triple = "armv6-apple-darwin9" define i32 @ineqn(i8* %s, i8* %p) nounwind readonly { entry: - %0 = load i32* @delim1, align 4 ; <i32> [#uses=1] - %1 = load i32* @delim2, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* @delim1, align 4 ; <i32> [#uses=1] + %1 = load i32, i32* @delim2, align 4 ; <i32> [#uses=1] br label %bb8.outer bb: ; preds = %bb8 @@ -20,7 +20,7 @@ bb: ; preds = %bb8 br i1 %2, label %bb10, label %bb2 bb2: ; preds = %bb - %3 = getelementptr inbounds i8* %p_addr.0, i32 1 ; <i8*> [#uses=3] + %3 = getelementptr inbounds i8, i8* %p_addr.0, i32 1 ; <i8*> [#uses=3] switch i32 %ineq.0.ph, label %bb8.backedge [ i32 0, label %bb3 i32 1, label %bb6 @@ -61,7 +61,7 @@ bb8.outer: ; preds = %bb8.outer.backedge, bb8: ; preds = %bb8.outer, %bb8.backedge %p_addr.0 = phi i8* [ %p_addr.0.ph, %bb8.outer ], [ %3, %bb8.backedge ] ; <i8*> [#uses=3] - %7 = load i8* %p_addr.0, align 1 ; <i8> [#uses=2] + %7 = load i8, i8* %p_addr.0, align 1 ; <i8> [#uses=2] %8 = sext i8 %7 to i32 ; <i32> [#uses=2] %9 = icmp eq i8 %7, 0 ; <i1> [#uses=1] br i1 %9, label %bb10, label %bb diff --git a/test/Transforms/LoopVectorize/12-12-11-if-conv.ll b/test/Transforms/LoopVectorize/12-12-11-if-conv.ll index a292afb..d5e020c 100644 --- a/test/Transforms/LoopVectorize/12-12-11-if-conv.ll +++ b/test/Transforms/LoopVectorize/12-12-11-if-conv.ll @@ -14,8 +14,8 @@ entry: for.body: ; preds = %entry, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %if.end, label %if.then diff --git a/test/Transforms/LoopVectorize/2012-10-22-isconsec.ll b/test/Transforms/LoopVectorize/2012-10-22-isconsec.ll index 16d64ea..9d848bd 100644 --- a/test/Transforms/LoopVectorize/2012-10-22-isconsec.ll +++ b/test/Transforms/LoopVectorize/2012-10-22-isconsec.ll @@ -22,7 +22,7 @@ entry: "3": ; preds = %"3.lr.ph", %"3" %indvars.iv = phi i64 [ 0, %"3.lr.ph" ], [ %indvars.iv.next, %"3" ] %3 = shl nsw i64 %indvars.iv, 2 - %4 = getelementptr inbounds i8* %1, i64 %3 + %4 = getelementptr inbounds i8, i8* %1, i64 %3 %5 = bitcast i8* %4 to float* store float %value, float* %5, align 4 %indvars.iv.next = add i64 %indvars.iv, %2 @@ -41,7 +41,7 @@ entry: "3": ; preds = %"3", %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %"3" ] %0 = shl nsw i64 %indvars.iv, 2 - %1 = getelementptr inbounds i8* bitcast (float* getelementptr inbounds ([32000 x float]* @b, i64 0, i64 16000) to i8*), i64 %0 + %1 = getelementptr inbounds i8, i8* bitcast (float* getelementptr inbounds ([32000 x float], [32000 x float]* @b, i64 0, i64 16000) to i8*), i64 %0 %2 = bitcast i8* %1 to float* store float -1.000000e+00, float* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/AArch64/aarch64-unroll.ll b/test/Transforms/LoopVectorize/AArch64/aarch64-unroll.ll index 9962c3d..a689f44 100644 --- a/test/Transforms/LoopVectorize/AArch64/aarch64-unroll.ll +++ b/test/Transforms/LoopVectorize/AArch64/aarch64-unroll.ll @@ -22,12 +22,12 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %b, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %add = add nsw i32 %1, %0 - %arrayidx4 = getelementptr inbounds i32* %c, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds i32, i32* %c, i64 %indvars.iv store i32 %add, i32* %arrayidx4, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/AArch64/arbitrary-induction-step.ll b/test/Transforms/LoopVectorize/AArch64/arbitrary-induction-step.ll index 95734bf..4cd703f 100644 --- a/test/Transforms/LoopVectorize/AArch64/arbitrary-induction-step.ll +++ b/test/Transforms/LoopVectorize/AArch64/arbitrary-induction-step.ll @@ -11,8 +11,8 @@ target triple = "aarch64--linux-gnueabi" ; } ; CHECK-LABEL: @ind_plus2( -; CHECK: load <4 x i32>* -; CHECK: load <4 x i32>* +; CHECK: load <4 x i32>, <4 x i32>* +; CHECK: load <4 x i32>, <4 x i32>* ; CHECK: mul nsw <4 x i32> ; CHECK: mul nsw <4 x i32> ; CHECK: add nsw <4 x i32> @@ -21,7 +21,7 @@ target triple = "aarch64--linux-gnueabi" ; CHECK: icmp eq i64 %index.next, 512 ; FORCE-VEC-LABEL: @ind_plus2( -; FORCE-VEC: %wide.load = load <2 x i32>* +; FORCE-VEC: %wide.load = load <2 x i32>, <2 x i32>* ; FORCE-VEC: mul nsw <2 x i32> ; FORCE-VEC: add nsw <2 x i32> ; FORCE-VEC: %index.next = add i64 %index, 2 @@ -34,8 +34,8 @@ for.body: ; preds = %entry, %for.body %A.addr = phi i32* [ %A, %entry ], [ %inc.ptr, %for.body ] %i = phi i32 [ 0, %entry ], [ %add1, %for.body ] %sum = phi i32 [ 0, %entry ], [ %add, %for.body ] - %inc.ptr = getelementptr inbounds i32* %A.addr, i64 1 - %0 = load i32* %A.addr, align 4 + %inc.ptr = getelementptr inbounds i32, i32* %A.addr, i64 1 + %0 = load i32, i32* %A.addr, align 4 %mul = mul nsw i32 %0, %i %add = add nsw i32 %mul, %sum %add1 = add nsw i32 %i, 2 @@ -55,8 +55,8 @@ for.end: ; preds = %for.body ; } ; CHECK-LABEL: @ind_minus2( -; CHECK: load <4 x i32>* -; CHECK: load <4 x i32>* +; CHECK: load <4 x i32>, <4 x i32>* +; CHECK: load <4 x i32>, <4 x i32>* ; CHECK: mul nsw <4 x i32> ; CHECK: mul nsw <4 x i32> ; CHECK: add nsw <4 x i32> @@ -65,7 +65,7 @@ for.end: ; preds = %for.body ; CHECK: icmp eq i64 %index.next, 512 ; FORCE-VEC-LABEL: @ind_minus2( -; FORCE-VEC: %wide.load = load <2 x i32>* +; FORCE-VEC: %wide.load = load <2 x i32>, <2 x i32>* ; FORCE-VEC: mul nsw <2 x i32> ; FORCE-VEC: add nsw <2 x i32> ; FORCE-VEC: %index.next = add i64 %index, 2 @@ -78,8 +78,8 @@ for.body: ; preds = %entry, %for.body %A.addr = phi i32* [ %A, %entry ], [ %inc.ptr, %for.body ] %i = phi i32 [ 1024, %entry ], [ %sub, %for.body ] %sum = phi i32 [ 0, %entry ], [ %add, %for.body ] - %inc.ptr = getelementptr inbounds i32* %A.addr, i64 1 - %0 = load i32* %A.addr, align 4 + %inc.ptr = getelementptr inbounds i32, i32* %A.addr, i64 1 + %0 = load i32, i32* %A.addr, align 4 %mul = mul nsw i32 %0, %i %add = add nsw i32 %mul, %sum %sub = add nsw i32 %i, -2 @@ -102,10 +102,10 @@ for.end: ; preds = %for.body ; } ; CHECK-LABEL: @ptr_ind_plus2( -; CHECK: load i32* -; CHECK: load i32* -; CHECK: load i32* -; CHECK: load i32* +; CHECK: load i32, i32* +; CHECK: load i32, i32* +; CHECK: load i32, i32* +; CHECK: load i32, i32* ; CHECK: mul nsw i32 ; CHECK: mul nsw i32 ; CHECK: add nsw i32 @@ -114,13 +114,13 @@ for.end: ; preds = %for.body ; CHECK: %21 = icmp eq i64 %index.next, 1024 ; FORCE-VEC-LABEL: @ptr_ind_plus2( -; FORCE-VEC: load i32* +; FORCE-VEC: load i32, i32* ; FORCE-VEC: insertelement <2 x i32> -; FORCE-VEC: load i32* +; FORCE-VEC: load i32, i32* ; FORCE-VEC: insertelement <2 x i32> -; FORCE-VEC: load i32* +; FORCE-VEC: load i32, i32* ; FORCE-VEC: insertelement <2 x i32> -; FORCE-VEC: load i32* +; FORCE-VEC: load i32, i32* ; FORCE-VEC: insertelement <2 x i32> ; FORCE-VEC: mul nsw <2 x i32> ; FORCE-VEC: add nsw <2 x i32> @@ -134,10 +134,10 @@ for.body: ; preds = %for.body, %entry %A.addr = phi i32* [ %A, %entry ], [ %inc.ptr1, %for.body ] %sum = phi i32 [ 0, %entry ], [ %add, %for.body ] %i = phi i32 [ 0, %entry ], [ %inc, %for.body ] - %inc.ptr = getelementptr inbounds i32* %A.addr, i64 1 - %0 = load i32* %A.addr, align 4 - %inc.ptr1 = getelementptr inbounds i32* %A.addr, i64 2 - %1 = load i32* %inc.ptr, align 4 + %inc.ptr = getelementptr inbounds i32, i32* %A.addr, i64 1 + %0 = load i32, i32* %A.addr, align 4 + %inc.ptr1 = getelementptr inbounds i32, i32* %A.addr, i64 2 + %1 = load i32, i32* %inc.ptr, align 4 %mul = mul nsw i32 %1, %0 %add = add nsw i32 %mul, %sum %inc = add nsw i32 %i, 1 diff --git a/test/Transforms/LoopVectorize/AArch64/arm64-unroll.ll b/test/Transforms/LoopVectorize/AArch64/arm64-unroll.ll index f8eb3ed..395b468 100644 --- a/test/Transforms/LoopVectorize/AArch64/arm64-unroll.ll +++ b/test/Transforms/LoopVectorize/AArch64/arm64-unroll.ll @@ -22,12 +22,12 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %b, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %add = add nsw i32 %1, %0 - %arrayidx4 = getelementptr inbounds i32* %c, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds i32, i32* %c, i64 %indvars.iv store i32 %add, i32* %arrayidx4, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/AArch64/gather-cost.ll b/test/Transforms/LoopVectorize/AArch64/gather-cost.ll index bb28538..46b8ef1 100644 --- a/test/Transforms/LoopVectorize/AArch64/gather-cost.ll +++ b/test/Transforms/LoopVectorize/AArch64/gather-cost.ll @@ -30,32 +30,32 @@ for.body: %b.054 = phi float [ 0.000000e+00, %for.body.lr.ph ], [ %add30, %for.body ] %add = add i64 %v.055, %offset %mul = mul i64 %add, 3 - %arrayidx = getelementptr inbounds [1536 x float]* @src_data, i64 0, i64 %mul - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds [512 x float]* @kernel, i64 0, i64 %v.055 - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i64 0, i64 %mul + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds [512 x float], [512 x float]* @kernel, i64 0, i64 %v.055 + %1 = load float, float* %arrayidx2, align 4 %mul3 = fmul fast float %0, %1 - %arrayidx4 = getelementptr inbounds [512 x float]* @kernel2, i64 0, i64 %v.055 - %2 = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds [512 x float], [512 x float]* @kernel2, i64 0, i64 %v.055 + %2 = load float, float* %arrayidx4, align 4 %mul5 = fmul fast float %mul3, %2 - %arrayidx6 = getelementptr inbounds [512 x float]* @kernel3, i64 0, i64 %v.055 - %3 = load float* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds [512 x float], [512 x float]* @kernel3, i64 0, i64 %v.055 + %3 = load float, float* %arrayidx6, align 4 %mul7 = fmul fast float %mul5, %3 - %arrayidx8 = getelementptr inbounds [512 x float]* @kernel4, i64 0, i64 %v.055 - %4 = load float* %arrayidx8, align 4 + %arrayidx8 = getelementptr inbounds [512 x float], [512 x float]* @kernel4, i64 0, i64 %v.055 + %4 = load float, float* %arrayidx8, align 4 %mul9 = fmul fast float %mul7, %4 %add10 = fadd fast float %r.057, %mul9 %arrayidx.sum = add i64 %mul, 1 - %arrayidx11 = getelementptr inbounds [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum - %5 = load float* %arrayidx11, align 4 + %arrayidx11 = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum + %5 = load float, float* %arrayidx11, align 4 %mul13 = fmul fast float %1, %5 %mul15 = fmul fast float %2, %mul13 %mul17 = fmul fast float %3, %mul15 %mul19 = fmul fast float %4, %mul17 %add20 = fadd fast float %g.056, %mul19 %arrayidx.sum52 = add i64 %mul, 2 - %arrayidx21 = getelementptr inbounds [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum52 - %6 = load float* %arrayidx21, align 4 + %arrayidx21 = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum52 + %6 = load float, float* %arrayidx21, align 4 %mul23 = fmul fast float %1, %6 %mul25 = fmul fast float %2, %mul23 %mul27 = fmul fast float %3, %mul25 diff --git a/test/Transforms/LoopVectorize/AArch64/sdiv-pow2.ll b/test/Transforms/LoopVectorize/AArch64/sdiv-pow2.ll index a01d543..f3c6548 100644 --- a/test/Transforms/LoopVectorize/AArch64/sdiv-pow2.ll +++ b/test/Transforms/LoopVectorize/AArch64/sdiv-pow2.ll @@ -7,7 +7,7 @@ target triple = "aarch64--linux-gnu" @Foo = common global %struct.anon zeroinitializer, align 4 ; CHECK-LABEL: @foo( -; CHECK: load <4 x i32>* +; CHECK: load <4 x i32>, <4 x i32>* ; CHECK: sdiv <4 x i32> ; CHECK: store <4 x i32> @@ -17,10 +17,10 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds %struct.anon* @Foo, i64 0, i32 2, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds %struct.anon, %struct.anon* @Foo, i64 0, i32 2, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %div = sdiv i32 %0, 2 - %arrayidx2 = getelementptr inbounds %struct.anon* @Foo, i64 0, i32 0, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds %struct.anon, %struct.anon* @Foo, i64 0, i32 0, i64 %indvars.iv store i32 %div, i32* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 100 diff --git a/test/Transforms/LoopVectorize/ARM/arm-unroll.ll b/test/Transforms/LoopVectorize/ARM/arm-unroll.ll index 8843fc2..7b09913 100644 --- a/test/Transforms/LoopVectorize/ARM/arm-unroll.ll +++ b/test/Transforms/LoopVectorize/ARM/arm-unroll.ll @@ -20,8 +20,8 @@ define i32 @foo(i32* nocapture %A, i32 %n) nounwind readonly ssp { .lr.ph: ; preds = %0, %.lr.ph %i.02 = phi i32 [ %5, %.lr.ph ], [ 0, %0 ] %sum.01 = phi i32 [ %4, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i32* %A, i32 %i.02 - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i32 %i.02 + %3 = load i32, i32* %2, align 4 %4 = add nsw i32 %3, %sum.01 %5 = add nsw i32 %i.02, 1 %exitcond = icmp eq i32 %5, %n @@ -48,8 +48,8 @@ define i32 @register_limit(i32* nocapture %A, i32 %n) { %sum.04 = phi i32 [ %8, %.lr.ph ], [ 0, %0 ] %sum.05 = phi i32 [ %9, %.lr.ph ], [ 0, %0 ] %sum.06 = phi i32 [ %10, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i32* %A, i32 %i.02 - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i32 %i.02 + %3 = load i32, i32* %2, align 4 %4 = add nsw i32 %3, %sum.01 %5 = add nsw i32 %i.02, 1 %6 = add nsw i32 %3, %sum.02 diff --git a/test/Transforms/LoopVectorize/ARM/gather-cost.ll b/test/Transforms/LoopVectorize/ARM/gather-cost.ll index 239a28f..f14a8cc 100644 --- a/test/Transforms/LoopVectorize/ARM/gather-cost.ll +++ b/test/Transforms/LoopVectorize/ARM/gather-cost.ll @@ -33,32 +33,32 @@ for.body: %b.054 = phi float [ 0.000000e+00, %for.body.lr.ph ], [ %add30, %for.body ] %add = add i32 %v.055, %offset %mul = mul i32 %add, 3 - %arrayidx = getelementptr inbounds [1536 x float]* @src_data, i32 0, i32 %mul - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds [512 x float]* @kernel, i32 0, i32 %v.055 - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i32 0, i32 %mul + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds [512 x float], [512 x float]* @kernel, i32 0, i32 %v.055 + %1 = load float, float* %arrayidx2, align 4 %mul3 = fmul fast float %0, %1 - %arrayidx4 = getelementptr inbounds [512 x float]* @kernel2, i32 0, i32 %v.055 - %2 = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds [512 x float], [512 x float]* @kernel2, i32 0, i32 %v.055 + %2 = load float, float* %arrayidx4, align 4 %mul5 = fmul fast float %mul3, %2 - %arrayidx6 = getelementptr inbounds [512 x float]* @kernel3, i32 0, i32 %v.055 - %3 = load float* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds [512 x float], [512 x float]* @kernel3, i32 0, i32 %v.055 + %3 = load float, float* %arrayidx6, align 4 %mul7 = fmul fast float %mul5, %3 - %arrayidx8 = getelementptr inbounds [512 x float]* @kernel4, i32 0, i32 %v.055 - %4 = load float* %arrayidx8, align 4 + %arrayidx8 = getelementptr inbounds [512 x float], [512 x float]* @kernel4, i32 0, i32 %v.055 + %4 = load float, float* %arrayidx8, align 4 %mul9 = fmul fast float %mul7, %4 %add10 = fadd fast float %r.057, %mul9 %arrayidx.sum = add i32 %mul, 1 - %arrayidx11 = getelementptr inbounds [1536 x float]* @src_data, i32 0, i32 %arrayidx.sum - %5 = load float* %arrayidx11, align 4 + %arrayidx11 = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i32 0, i32 %arrayidx.sum + %5 = load float, float* %arrayidx11, align 4 %mul13 = fmul fast float %1, %5 %mul15 = fmul fast float %2, %mul13 %mul17 = fmul fast float %3, %mul15 %mul19 = fmul fast float %4, %mul17 %add20 = fadd fast float %g.056, %mul19 %arrayidx.sum52 = add i32 %mul, 2 - %arrayidx21 = getelementptr inbounds [1536 x float]* @src_data, i32 0, i32 %arrayidx.sum52 - %6 = load float* %arrayidx21, align 4 + %arrayidx21 = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i32 0, i32 %arrayidx.sum52 + %6 = load float, float* %arrayidx21, align 4 %mul23 = fmul fast float %1, %6 %mul25 = fmul fast float %2, %mul23 %mul27 = fmul fast float %3, %mul25 diff --git a/test/Transforms/LoopVectorize/ARM/gcc-examples.ll b/test/Transforms/LoopVectorize/ARM/gcc-examples.ll index f2bd0ac..783156d 100644 --- a/test/Transforms/LoopVectorize/ARM/gcc-examples.ll +++ b/test/Transforms/LoopVectorize/ARM/gcc-examples.ll @@ -18,12 +18,12 @@ define void @example1() nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %6, i32* %7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -44,10 +44,10 @@ define void @example10b(i16* noalias nocapture %sa, i16* noalias nocapture %sb, ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds i16* %sb, i64 %indvars.iv - %3 = load i16* %2, align 2 + %2 = getelementptr inbounds i16, i16* %sb, i64 %indvars.iv + %3 = load i16, i16* %2, align 2 %4 = sext i16 %3 to i32 - %5 = getelementptr inbounds i32* %ia, i64 %indvars.iv + %5 = getelementptr inbounds i32, i32* %ia, i64 %indvars.iv store i32 %4, i32* %5, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/ARM/mul-cast-vect.ll b/test/Transforms/LoopVectorize/ARM/mul-cast-vect.ll index d2e3de2..e88fcca 100644 --- a/test/Transforms/LoopVectorize/ARM/mul-cast-vect.ll +++ b/test/Transforms/LoopVectorize/ARM/mul-cast-vect.ll @@ -16,9 +16,9 @@ target triple = "armv7--linux-gnueabihf" define void @direct(%T432* %loadaddr, %T432* %loadaddr2, %T432* %storeaddr) { ; COST: function 'direct': - %v0 = load %T432* %loadaddr + %v0 = load %T432, %T432* %loadaddr ; ASM: vld1.64 - %v1 = load %T432* %loadaddr2 + %v1 = load %T432, %T432* %loadaddr2 ; ASM: vld1.64 %r3 = mul %T432 %v0, %v1 ; COST: cost of 2 for instruction: {{.*}} mul <4 x i32> @@ -30,9 +30,9 @@ define void @direct(%T432* %loadaddr, %T432* %loadaddr2, %T432* %storeaddr) { define void @ups1632(%T416* %loadaddr, %T416* %loadaddr2, %T432* %storeaddr) { ; COST: function 'ups1632': - %v0 = load %T416* %loadaddr + %v0 = load %T416, %T416* %loadaddr ; ASM: vldr - %v1 = load %T416* %loadaddr2 + %v1 = load %T416, %T416* %loadaddr2 ; ASM: vldr %r1 = sext %T416 %v0 to %T432 %r2 = sext %T416 %v1 to %T432 @@ -47,9 +47,9 @@ define void @ups1632(%T416* %loadaddr, %T416* %loadaddr2, %T432* %storeaddr) { define void @upu1632(%T416* %loadaddr, %T416* %loadaddr2, %T432* %storeaddr) { ; COST: function 'upu1632': - %v0 = load %T416* %loadaddr + %v0 = load %T416, %T416* %loadaddr ; ASM: vldr - %v1 = load %T416* %loadaddr2 + %v1 = load %T416, %T416* %loadaddr2 ; ASM: vldr %r1 = zext %T416 %v0 to %T432 %r2 = zext %T416 %v1 to %T432 @@ -64,9 +64,9 @@ define void @upu1632(%T416* %loadaddr, %T416* %loadaddr2, %T432* %storeaddr) { define void @ups3264(%T232* %loadaddr, %T232* %loadaddr2, %T264* %storeaddr) { ; COST: function 'ups3264': - %v0 = load %T232* %loadaddr + %v0 = load %T232, %T232* %loadaddr ; ASM: vldr - %v1 = load %T232* %loadaddr2 + %v1 = load %T232, %T232* %loadaddr2 ; ASM: vldr %r3 = mul %T232 %v0, %v1 ; ASM: vmul.i32 @@ -81,9 +81,9 @@ define void @ups3264(%T232* %loadaddr, %T232* %loadaddr2, %T264* %storeaddr) { define void @upu3264(%T232* %loadaddr, %T232* %loadaddr2, %T264* %storeaddr) { ; COST: function 'upu3264': - %v0 = load %T232* %loadaddr + %v0 = load %T232, %T232* %loadaddr ; ASM: vldr - %v1 = load %T232* %loadaddr2 + %v1 = load %T232, %T232* %loadaddr2 ; ASM: vldr %r3 = mul %T232 %v0, %v1 ; ASM: vmul.i32 @@ -98,9 +98,9 @@ define void @upu3264(%T232* %loadaddr, %T232* %loadaddr2, %T264* %storeaddr) { define void @dn3216(%T432* %loadaddr, %T432* %loadaddr2, %T416* %storeaddr) { ; COST: function 'dn3216': - %v0 = load %T432* %loadaddr + %v0 = load %T432, %T432* %loadaddr ; ASM: vld1.64 - %v1 = load %T432* %loadaddr2 + %v1 = load %T432, %T432* %loadaddr2 ; ASM: vld1.64 %r3 = mul %T432 %v0, %v1 ; ASM: vmul.i32 diff --git a/test/Transforms/LoopVectorize/ARM/width-detect.ll b/test/Transforms/LoopVectorize/ARM/width-detect.ll index 99d7fa7..66d2556 100644 --- a/test/Transforms/LoopVectorize/ARM/width-detect.ll +++ b/test/Transforms/LoopVectorize/ARM/width-detect.ll @@ -13,8 +13,8 @@ define float @foo_F32(float* nocapture %A, i32 %n) nounwind uwtable readonly ssp .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %prod.01 = phi float [ %4, %.lr.ph ], [ 0.000000e+00, %0 ] - %2 = getelementptr inbounds float* %A, i64 %indvars.iv - %3 = load float* %2, align 8 + %2 = getelementptr inbounds float, float* %A, i64 %indvars.iv + %3 = load float, float* %2, align 8 %4 = fmul fast float %prod.01, %3 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -36,8 +36,8 @@ define signext i8 @foo_I8(i8* nocapture %A, i32 %n) nounwind uwtable readonly ss .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %red.01 = phi i8 [ %4, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i8* %A, i64 %indvars.iv - %3 = load i8* %2, align 1 + %2 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv + %3 = load i8, i8* %2, align 1 %4 = xor i8 %3, %red.01 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/PowerPC/large-loop-rdx.ll b/test/Transforms/LoopVectorize/PowerPC/large-loop-rdx.ll new file mode 100644 index 0000000..de6595f --- /dev/null +++ b/test/Transforms/LoopVectorize/PowerPC/large-loop-rdx.ll @@ -0,0 +1,73 @@ +; RUN: opt < %s -loop-vectorize -S | FileCheck %s + +; CHECK: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT: fadd +; CHECK-NEXT-NOT: fadd + +target datalayout = "e-m:e-i64:64-n32:64" +target triple = "powerpc64le-ibm-linux-gnu" + +define void @QLA_F3_r_veq_norm2_V(float* noalias nocapture %r, [3 x { float, float }]* noalias nocapture readonly %a, i32 signext %n) #0 { +entry: + %cmp24 = icmp sgt i32 %n, 0 + br i1 %cmp24, label %for.cond1.preheader.preheader, label %for.end13 + +for.cond1.preheader.preheader: ; preds = %entry + br label %for.cond1.preheader + +for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond1.preheader + %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %for.cond1.preheader.preheader ] + %sum.026 = phi double [ %add10.2, %for.cond1.preheader ], [ 0.000000e+00, %for.cond1.preheader.preheader ] + %arrayidx5.realp = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 0, i32 0 + %arrayidx5.real = load float, float* %arrayidx5.realp, align 8 + %arrayidx5.imagp = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 0, i32 1 + %arrayidx5.imag = load float, float* %arrayidx5.imagp, align 8 + %mul = fmul fast float %arrayidx5.real, %arrayidx5.real + %mul9 = fmul fast float %arrayidx5.imag, %arrayidx5.imag + %add = fadd fast float %mul9, %mul + %conv = fpext float %add to double + %add10 = fadd fast double %conv, %sum.026 + %arrayidx5.realp.1 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 1, i32 0 + %arrayidx5.real.1 = load float, float* %arrayidx5.realp.1, align 8 + %arrayidx5.imagp.1 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 1, i32 1 + %arrayidx5.imag.1 = load float, float* %arrayidx5.imagp.1, align 8 + %mul.1 = fmul fast float %arrayidx5.real.1, %arrayidx5.real.1 + %mul9.1 = fmul fast float %arrayidx5.imag.1, %arrayidx5.imag.1 + %add.1 = fadd fast float %mul9.1, %mul.1 + %conv.1 = fpext float %add.1 to double + %add10.1 = fadd fast double %conv.1, %add10 + %arrayidx5.realp.2 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 2, i32 0 + %arrayidx5.real.2 = load float, float* %arrayidx5.realp.2, align 8 + %arrayidx5.imagp.2 = getelementptr inbounds [3 x { float, float }], [3 x { float, float }]* %a, i64 %indvars.iv, i64 2, i32 1 + %arrayidx5.imag.2 = load float, float* %arrayidx5.imagp.2, align 8 + %mul.2 = fmul fast float %arrayidx5.real.2, %arrayidx5.real.2 + %mul9.2 = fmul fast float %arrayidx5.imag.2, %arrayidx5.imag.2 + %add.2 = fadd fast float %mul9.2, %mul.2 + %conv.2 = fpext float %add.2 to double + %add10.2 = fadd fast double %conv.2, %add10.1 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.cond.for.end13_crit_edge, label %for.cond1.preheader + +for.cond.for.end13_crit_edge: ; preds = %for.cond1.preheader + %add10.2.lcssa = phi double [ %add10.2, %for.cond1.preheader ] + %phitmp = fptrunc double %add10.2.lcssa to float + br label %for.end13 + +for.end13: ; preds = %for.cond.for.end13_crit_edge, %entry + %sum.0.lcssa = phi float [ %phitmp, %for.cond.for.end13_crit_edge ], [ 0.000000e+00, %entry ] + store float %sum.0.lcssa, float* %r, align 4 + ret void +} + diff --git a/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll b/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll index 25e7d24..2898af2 100644 --- a/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll +++ b/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll @@ -29,8 +29,8 @@ for.body.lr.ph: ; preds = %entry for.body: ; preds = %for.body, %for.body.lr.ph %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %redx.05 = phi double [ 0.000000e+00, %for.body.lr.ph ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds double* %arr, i64 %indvars.iv - %1 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %arr, i64 %indvars.iv + %1 = load double, double* %arrayidx, align 8 %add = fadd fast double %1, %redx.05 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv to i32 diff --git a/test/Transforms/LoopVectorize/PowerPC/vsx-tsvc-s173.ll b/test/Transforms/LoopVectorize/PowerPC/vsx-tsvc-s173.ll index 6cd9c4d..65b3919 100644 --- a/test/Transforms/LoopVectorize/PowerPC/vsx-tsvc-s173.ll +++ b/test/Transforms/LoopVectorize/PowerPC/vsx-tsvc-s173.ll @@ -9,7 +9,7 @@ target triple = "powerpc64-unknown-linux-gnu" define signext i32 @s173() #0 { entry: - %0 = load i32* @ntimes, align 4 + %0 = load i32, i32* @ntimes, align 4 %cmp21 = icmp sgt i32 %0, 0 br i1 %cmp21, label %for.cond1.preheader, label %for.end12 @@ -19,13 +19,13 @@ for.cond1.preheader: ; preds = %for.end, %entry for.body3: ; preds = %for.body3, %for.cond1.preheader %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] - %arrayidx = getelementptr inbounds %struct.GlobalData* @global_data, i64 0, i32 0, i64 %indvars.iv - %1 = load float* %arrayidx, align 4 - %arrayidx5 = getelementptr inbounds %struct.GlobalData* @global_data, i64 0, i32 3, i64 %indvars.iv - %2 = load float* %arrayidx5, align 4 + %arrayidx = getelementptr inbounds %struct.GlobalData, %struct.GlobalData* @global_data, i64 0, i32 0, i64 %indvars.iv + %1 = load float, float* %arrayidx, align 4 + %arrayidx5 = getelementptr inbounds %struct.GlobalData, %struct.GlobalData* @global_data, i64 0, i32 3, i64 %indvars.iv + %2 = load float, float* %arrayidx5, align 4 %add = fadd float %1, %2 %3 = add nsw i64 %indvars.iv, 16000 - %arrayidx8 = getelementptr inbounds %struct.GlobalData* @global_data, i64 0, i32 0, i64 %3 + %arrayidx8 = getelementptr inbounds %struct.GlobalData, %struct.GlobalData* @global_data, i64 0, i32 0, i64 %3 store float %add, float* %arrayidx8, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 16000 @@ -33,7 +33,7 @@ for.body3: ; preds = %for.body3, %for.con for.end: ; preds = %for.body3 %inc11 = add nsw i32 %nl.022, 1 - %4 = load i32* @ntimes, align 4 + %4 = load i32, i32* @ntimes, align 4 %mul = mul nsw i32 %4, 10 %cmp = icmp slt i32 %inc11, %mul br i1 %cmp, label %for.cond1.preheader, label %for.end12 @@ -42,7 +42,7 @@ for.end12: ; preds = %for.end, %entry ret i32 0 ; CHECK-LABEL: @s173 -; CHECK: load <4 x float>* +; CHECK: load <4 x float>, <4 x float>* ; CHECK: add i64 %index, 16000 ; CHECK: ret i32 0 } diff --git a/test/Transforms/LoopVectorize/X86/already-vectorized.ll b/test/Transforms/LoopVectorize/X86/already-vectorized.ll index 29d74a0..c400c76 100644 --- a/test/Transforms/LoopVectorize/X86/already-vectorized.ll +++ b/test/Transforms/LoopVectorize/X86/already-vectorized.ll @@ -21,8 +21,8 @@ for.body: ; preds = %for.body, %entry ; CHECK: LV: We can vectorize this loop! %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %red.05 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds [255 x i32]* @a, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [255 x i32], [255 x i32]* @a, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %red.05 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 255 @@ -42,5 +42,6 @@ for.end: ; preds = %for.body ; CHECK: [[vect]] = distinct !{[[vect]], [[width:![0-9]+]], [[unroll:![0-9]+]]} ; CHECK: [[width]] = !{!"llvm.loop.vectorize.width", i32 1} ; CHECK: [[unroll]] = !{!"llvm.loop.interleave.count", i32 1} -; CHECK: [[scalar]] = distinct !{[[scalar]], [[width]], [[unroll]]} +; CHECK: [[scalar]] = distinct !{[[scalar]], [[runtime_unroll:![0-9]+]], [[width]], [[unroll]]} +; CHECK: [[runtime_unroll]] = !{!"llvm.loop.unroll.runtime.disable"} diff --git a/test/Transforms/LoopVectorize/X86/assume.ll b/test/Transforms/LoopVectorize/X86/assume.ll index a94e24d..4fd378d 100644 --- a/test/Transforms/LoopVectorize/X86/assume.ll +++ b/test/Transforms/LoopVectorize/X86/assume.ll @@ -22,12 +22,12 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp1 = fcmp ogt float %0, 1.000000e+02 tail call void @llvm.assume(i1 %cmp1) %add = fadd float %0, 1.000000e+00 - %arrayidx5 = getelementptr inbounds float* %a, i64 %indvars.iv + %arrayidx5 = getelementptr inbounds float, float* %a, i64 %indvars.iv store float %add, float* %arrayidx5, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv, 1599 @@ -48,13 +48,13 @@ attributes #1 = { nounwind } ; Function Attrs: nounwind uwtable define void @test2(%struct.data* nocapture readonly %d) #0 { entry: - %b = getelementptr inbounds %struct.data* %d, i64 0, i32 1 - %0 = load float** %b, align 8 + %b = getelementptr inbounds %struct.data, %struct.data* %d, i64 0, i32 1 + %0 = load float*, float** %b, align 8 %ptrint = ptrtoint float* %0 to i64 %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 - %a = getelementptr inbounds %struct.data* %d, i64 0, i32 0 - %1 = load float** %a, align 8 + %a = getelementptr inbounds %struct.data, %struct.data* %d, i64 0, i32 0 + %1 = load float*, float** %a, align 8 %ptrint2 = ptrtoint float* %1 to i64 %maskedptr3 = and i64 %ptrint2, 31 %maskcond4 = icmp eq i64 %maskedptr3, 0 @@ -84,11 +84,11 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] tail call void @llvm.assume(i1 %maskcond) - %arrayidx = getelementptr inbounds float* %0, i64 %indvars.iv - %2 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %0, i64 %indvars.iv + %2 = load float, float* %arrayidx, align 4 %add = fadd float %2, 1.000000e+00 tail call void @llvm.assume(i1 %maskcond4) - %arrayidx5 = getelementptr inbounds float* %1, i64 %indvars.iv + %arrayidx5 = getelementptr inbounds float, float* %1, i64 %indvars.iv store float %add, float* %arrayidx5, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv, 1599 diff --git a/test/Transforms/LoopVectorize/X86/avx1.ll b/test/Transforms/LoopVectorize/X86/avx1.ll index 01c9125..37977c4 100644 --- a/test/Transforms/LoopVectorize/X86/avx1.ll +++ b/test/Transforms/LoopVectorize/X86/avx1.ll @@ -12,8 +12,8 @@ define i32 @read_mod_write_single_ptr(float* nocapture %a, i32 %n) nounwind uwta .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds float* %a, i64 %indvars.iv - %3 = load float* %2, align 4 + %2 = getelementptr inbounds float, float* %a, i64 %indvars.iv + %3 = load float, float* %2, align 4 %4 = fmul float %3, 3.000000e+00 store float %4, float* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -35,8 +35,8 @@ define i32 @read_mod_i64(i64* nocapture %a, i32 %n) nounwind uwtable ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i64* %a, i64 %indvars.iv - %3 = load i64* %2, align 4 + %2 = getelementptr inbounds i64, i64* %a, i64 %indvars.iv + %3 = load i64, i64* %2, align 4 %4 = add i64 %3, 3 store i64 %4, i64* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/X86/avx512.ll b/test/Transforms/LoopVectorize/X86/avx512.ll index a220866..754e859 100644 --- a/test/Transforms/LoopVectorize/X86/avx512.ll +++ b/test/Transforms/LoopVectorize/X86/avx512.ll @@ -20,7 +20,7 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %n, i32* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/constant-vector-operand.ll b/test/Transforms/LoopVectorize/X86/constant-vector-operand.ll index f4c07b4..d75b1d9 100644 --- a/test/Transforms/LoopVectorize/X86/constant-vector-operand.ll +++ b/test/Transforms/LoopVectorize/X86/constant-vector-operand.ll @@ -15,10 +15,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @B, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %shl = ashr i32 %0, 3 - %arrayidx2 = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv store i32 %shl, i32* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/conversion-cost.ll b/test/Transforms/LoopVectorize/X86/conversion-cost.ll index 0af562d..eb2a2a5 100644 --- a/test/Transforms/LoopVectorize/X86/conversion-cost.ll +++ b/test/Transforms/LoopVectorize/X86/conversion-cost.ll @@ -13,7 +13,7 @@ define i32 @conversion_cost1(i32 %n, i8* nocapture %A, float* nocapture %B) noun .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 3, %0 ] %2 = trunc i64 %indvars.iv to i8 - %3 = getelementptr inbounds i8* %A, i64 %indvars.iv + %3 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv store i8 %2, i8* %3, align 1 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -35,7 +35,7 @@ define i32 @conversion_cost2(i32 %n, i8* nocapture %A, float* nocapture %B) noun %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 9, %0 ] %add = add nsw i64 %indvars.iv, 3 %tofp = sitofp i64 %add to float - %gep = getelementptr inbounds float* %B, i64 %indvars.iv + %gep = getelementptr inbounds float, float* %B, i64 %indvars.iv store float %tofp, float* %gep, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/cost-model.ll b/test/Transforms/LoopVectorize/X86/cost-model.ll index 98718e1..0136571 100644 --- a/test/Transforms/LoopVectorize/X86/cost-model.ll +++ b/test/Transforms/LoopVectorize/X86/cost-model.ll @@ -21,15 +21,15 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %0 = shl nsw i64 %indvars.iv, 1 - %arrayidx = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %0 - %1 = load i32* %arrayidx, align 8 + %arrayidx = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %0 + %1 = load i32, i32* %arrayidx, align 8 %idxprom1 = sext i32 %1 to i64 - %arrayidx2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %idxprom1 - %2 = load i32* %arrayidx2, align 4 - %arrayidx4 = getelementptr inbounds [2048 x i32]* @d, i64 0, i64 %indvars.iv - %3 = load i32* %arrayidx4, align 4 + %arrayidx2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %idxprom1 + %2 = load i32, i32* %arrayidx2, align 4 + %arrayidx4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @d, i64 0, i64 %indvars.iv + %3 = load i32, i32* %arrayidx4, align 4 %idxprom5 = sext i32 %3 to i64 - %arrayidx6 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %idxprom5 + %arrayidx6 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %idxprom5 store i32 %2, i32* %arrayidx6, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/fp32_to_uint32-cost-model.ll b/test/Transforms/LoopVectorize/X86/fp32_to_uint32-cost-model.ll index 529ed88..4a56d6b 100644 --- a/test/Transforms/LoopVectorize/X86/fp32_to_uint32-cost-model.ll +++ b/test/Transforms/LoopVectorize/X86/fp32_to_uint32-cost-model.ll @@ -20,10 +20,10 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds [10000 x float]* @float_array, i64 0, i64 %indvars.iv - %1 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [10000 x float], [10000 x float]* @float_array, i64 0, i64 %indvars.iv + %1 = load float, float* %arrayidx, align 4 %conv = fptoui float %1 to i32 - %arrayidx2 = getelementptr inbounds [10000 x i32]* @unsigned_array, i64 0, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds [10000 x i32], [10000 x i32]* @unsigned_array, i64 0, i64 %indvars.iv store i32 %conv, i32* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/fp64_to_uint32-cost-model.ll b/test/Transforms/LoopVectorize/X86/fp64_to_uint32-cost-model.ll index ef3e3be..c066afc 100644 --- a/test/Transforms/LoopVectorize/X86/fp64_to_uint32-cost-model.ll +++ b/test/Transforms/LoopVectorize/X86/fp64_to_uint32-cost-model.ll @@ -13,7 +13,7 @@ target triple = "x86_64-apple-macosx" define void @convert() { entry: - %0 = load i32* @n, align 4 + %0 = load i32, i32* @n, align 4 %cmp4 = icmp eq i32 %0, 0 br i1 %cmp4, label %for.end, label %for.body.preheader @@ -22,10 +22,10 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds [10000 x double]* @double_array, i64 0, i64 %indvars.iv - %1 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds [10000 x double], [10000 x double]* @double_array, i64 0, i64 %indvars.iv + %1 = load double, double* %arrayidx, align 8 %conv = fptoui double %1 to i32 - %arrayidx2 = getelementptr inbounds [10000 x i32]* @unsigned_array, i64 0, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds [10000 x i32], [10000 x i32]* @unsigned_array, i64 0, i64 %indvars.iv store i32 %conv, i32* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll b/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll index 23e6227..b3a0710 100644 --- a/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll +++ b/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll @@ -11,10 +11,10 @@ entry: br label %for.body for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv - %tmp = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %tmp = load float, float* %arrayidx, align 4 %conv = fptosi float %tmp to i8 - %arrayidx2 = getelementptr inbounds i8* %a, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds i8, i8* %a, i64 %indvars.iv store i8 %conv, i8* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 256 diff --git a/test/Transforms/LoopVectorize/X86/gather-cost.ll b/test/Transforms/LoopVectorize/X86/gather-cost.ll index 09363d6..f0e6c8f 100644 --- a/test/Transforms/LoopVectorize/X86/gather-cost.ll +++ b/test/Transforms/LoopVectorize/X86/gather-cost.ll @@ -31,32 +31,32 @@ for.body: %b.054 = phi float [ 0.000000e+00, %for.body.lr.ph ], [ %add30, %for.body ] %add = add i64 %v.055, %offset %mul = mul i64 %add, 3 - %arrayidx = getelementptr inbounds [1536 x float]* @src_data, i64 0, i64 %mul - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds [512 x float]* @kernel, i64 0, i64 %v.055 - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i64 0, i64 %mul + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds [512 x float], [512 x float]* @kernel, i64 0, i64 %v.055 + %1 = load float, float* %arrayidx2, align 4 %mul3 = fmul fast float %0, %1 - %arrayidx4 = getelementptr inbounds [512 x float]* @kernel2, i64 0, i64 %v.055 - %2 = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds [512 x float], [512 x float]* @kernel2, i64 0, i64 %v.055 + %2 = load float, float* %arrayidx4, align 4 %mul5 = fmul fast float %mul3, %2 - %arrayidx6 = getelementptr inbounds [512 x float]* @kernel3, i64 0, i64 %v.055 - %3 = load float* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds [512 x float], [512 x float]* @kernel3, i64 0, i64 %v.055 + %3 = load float, float* %arrayidx6, align 4 %mul7 = fmul fast float %mul5, %3 - %arrayidx8 = getelementptr inbounds [512 x float]* @kernel4, i64 0, i64 %v.055 - %4 = load float* %arrayidx8, align 4 + %arrayidx8 = getelementptr inbounds [512 x float], [512 x float]* @kernel4, i64 0, i64 %v.055 + %4 = load float, float* %arrayidx8, align 4 %mul9 = fmul fast float %mul7, %4 %add10 = fadd fast float %r.057, %mul9 %arrayidx.sum = add i64 %mul, 1 - %arrayidx11 = getelementptr inbounds [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum - %5 = load float* %arrayidx11, align 4 + %arrayidx11 = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum + %5 = load float, float* %arrayidx11, align 4 %mul13 = fmul fast float %1, %5 %mul15 = fmul fast float %2, %mul13 %mul17 = fmul fast float %3, %mul15 %mul19 = fmul fast float %4, %mul17 %add20 = fadd fast float %g.056, %mul19 %arrayidx.sum52 = add i64 %mul, 2 - %arrayidx21 = getelementptr inbounds [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum52 - %6 = load float* %arrayidx21, align 4 + %arrayidx21 = getelementptr inbounds [1536 x float], [1536 x float]* @src_data, i64 0, i64 %arrayidx.sum52 + %6 = load float, float* %arrayidx21, align 4 %mul23 = fmul fast float %1, %6 %mul25 = fmul fast float %2, %mul23 %mul27 = fmul fast float %3, %mul25 diff --git a/test/Transforms/LoopVectorize/X86/gcc-examples.ll b/test/Transforms/LoopVectorize/X86/gcc-examples.ll index 05403cd..c581f4b 100644 --- a/test/Transforms/LoopVectorize/X86/gcc-examples.ll +++ b/test/Transforms/LoopVectorize/X86/gcc-examples.ll @@ -28,12 +28,12 @@ define void @example1() nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %6, i32* %7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -61,10 +61,10 @@ define void @example10b(i16* noalias nocapture %sa, i16* noalias nocapture %sb, ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds i16* %sb, i64 %indvars.iv - %3 = load i16* %2, align 2 + %2 = getelementptr inbounds i16, i16* %sb, i64 %indvars.iv + %3 = load i16, i16* %2, align 2 %4 = sext i16 %3 to i32 - %5 = getelementptr inbounds i32* %ia, i64 %indvars.iv + %5 = getelementptr inbounds i32, i32* %ia, i64 %indvars.iv store i32 %4, i32* %5, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/illegal-parallel-loop-uniform-write.ll b/test/Transforms/LoopVectorize/X86/illegal-parallel-loop-uniform-write.ll index 46efaf0..cbba530 100644 --- a/test/Transforms/LoopVectorize/X86/illegal-parallel-loop-uniform-write.ll +++ b/test/Transforms/LoopVectorize/X86/illegal-parallel-loop-uniform-write.ll @@ -14,8 +14,8 @@ entry: br i1 %cmp27, label %for.body3.lr.ph.us, label %for.end15 for.end.us: ; preds = %for.body3.us - %arrayidx9.us = getelementptr inbounds i32* %b, i64 %indvars.iv33 - %0 = load i32* %arrayidx9.us, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx9.us = getelementptr inbounds i32, i32* %b, i64 %indvars.iv33 + %0 = load i32, i32* %arrayidx9.us, align 4, !llvm.mem.parallel_loop_access !3 %add10.us = add nsw i32 %0, 3 store i32 %add10.us, i32* %arrayidx9.us, align 4, !llvm.mem.parallel_loop_access !3 %indvars.iv.next34 = add i64 %indvars.iv33, 1 @@ -28,8 +28,8 @@ for.body3.us: ; preds = %for.body3.us, %for. %1 = trunc i64 %indvars.iv29 to i32 %add4.us = add i32 %add.us, %1 %idxprom.us = sext i32 %add4.us to i64 - %arrayidx.us = getelementptr inbounds i32* %a, i64 %idxprom.us - %2 = load i32* %arrayidx.us, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx.us = getelementptr inbounds i32, i32* %a, i64 %idxprom.us + %2 = load i32, i32* %arrayidx.us, align 4, !llvm.mem.parallel_loop_access !3 %add5.us = add nsw i32 %2, 1 store i32 %add5.us, i32* %arrayidx7.us, align 4, !llvm.mem.parallel_loop_access !3 %indvars.iv.next30 = add i64 %indvars.iv29, 1 @@ -41,7 +41,7 @@ for.body3.lr.ph.us: ; preds = %for.end.us, %entry %indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.end.us ], [ 0, %entry ] %3 = trunc i64 %indvars.iv33 to i32 %add.us = add i32 %3, %k - %arrayidx7.us = getelementptr inbounds i32* %a, i64 %indvars.iv33 + %arrayidx7.us = getelementptr inbounds i32, i32* %a, i64 %indvars.iv33 br label %for.body3.us for.end15: ; preds = %for.end.us, %entry diff --git a/test/Transforms/LoopVectorize/X86/masked_load_store.ll b/test/Transforms/LoopVectorize/X86/masked_load_store.ll index 9e2de80..8c375cc 100644 --- a/test/Transforms/LoopVectorize/X86/masked_load_store.ll +++ b/test/Transforms/LoopVectorize/X86/masked_load_store.ll @@ -46,35 +46,35 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 10000 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %idxprom = sext i32 %1 to i64 - %2 = load i32** %trigger.addr, align 8 - %arrayidx = getelementptr inbounds i32* %2, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %2 = load i32*, i32** %trigger.addr, align 8 + %arrayidx = getelementptr inbounds i32, i32* %2, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp slt i32 %3, 100 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %for.body - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %idxprom2 = sext i32 %4 to i64 - %5 = load i32** %B.addr, align 8 - %arrayidx3 = getelementptr inbounds i32* %5, i64 %idxprom2 - %6 = load i32* %arrayidx3, align 4 - %7 = load i32* %i, align 4 + %5 = load i32*, i32** %B.addr, align 8 + %arrayidx3 = getelementptr inbounds i32, i32* %5, i64 %idxprom2 + %6 = load i32, i32* %arrayidx3, align 4 + %7 = load i32, i32* %i, align 4 %idxprom4 = sext i32 %7 to i64 - %8 = load i32** %trigger.addr, align 8 - %arrayidx5 = getelementptr inbounds i32* %8, i64 %idxprom4 - %9 = load i32* %arrayidx5, align 4 + %8 = load i32*, i32** %trigger.addr, align 8 + %arrayidx5 = getelementptr inbounds i32, i32* %8, i64 %idxprom4 + %9 = load i32, i32* %arrayidx5, align 4 %add = add nsw i32 %6, %9 - %10 = load i32* %i, align 4 + %10 = load i32, i32* %i, align 4 %idxprom6 = sext i32 %10 to i64 - %11 = load i32** %A.addr, align 8 - %arrayidx7 = getelementptr inbounds i32* %11, i64 %idxprom6 + %11 = load i32*, i32** %A.addr, align 8 + %arrayidx7 = getelementptr inbounds i32, i32* %11, i64 %idxprom6 store i32 %add, i32* %arrayidx7, align 4 br label %if.end @@ -82,7 +82,7 @@ if.end: ; preds = %if.then, %for.body br label %for.inc for.inc: ; preds = %if.end - %12 = load i32* %i, align 4 + %12 = load i32, i32* %i, align 4 %inc = add nsw i32 %12, 1 store i32 %inc, i32* %i, align 4 br label %for.cond @@ -130,36 +130,36 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 10000 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %idxprom = sext i32 %1 to i64 - %2 = load i32** %trigger.addr, align 8 - %arrayidx = getelementptr inbounds i32* %2, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %2 = load i32*, i32** %trigger.addr, align 8 + %arrayidx = getelementptr inbounds i32, i32* %2, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp slt i32 %3, 100 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %for.body - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %idxprom2 = sext i32 %4 to i64 - %5 = load float** %B.addr, align 8 - %arrayidx3 = getelementptr inbounds float* %5, i64 %idxprom2 - %6 = load float* %arrayidx3, align 4 - %7 = load i32* %i, align 4 + %5 = load float*, float** %B.addr, align 8 + %arrayidx3 = getelementptr inbounds float, float* %5, i64 %idxprom2 + %6 = load float, float* %arrayidx3, align 4 + %7 = load i32, i32* %i, align 4 %idxprom4 = sext i32 %7 to i64 - %8 = load i32** %trigger.addr, align 8 - %arrayidx5 = getelementptr inbounds i32* %8, i64 %idxprom4 - %9 = load i32* %arrayidx5, align 4 + %8 = load i32*, i32** %trigger.addr, align 8 + %arrayidx5 = getelementptr inbounds i32, i32* %8, i64 %idxprom4 + %9 = load i32, i32* %arrayidx5, align 4 %conv = sitofp i32 %9 to float %add = fadd float %6, %conv - %10 = load i32* %i, align 4 + %10 = load i32, i32* %i, align 4 %idxprom6 = sext i32 %10 to i64 - %11 = load float** %A.addr, align 8 - %arrayidx7 = getelementptr inbounds float* %11, i64 %idxprom6 + %11 = load float*, float** %A.addr, align 8 + %arrayidx7 = getelementptr inbounds float, float* %11, i64 %idxprom6 store float %add, float* %arrayidx7, align 4 br label %if.end @@ -167,7 +167,7 @@ if.end: ; preds = %if.then, %for.body br label %for.inc for.inc: ; preds = %if.end - %12 = load i32* %i, align 4 + %12 = load i32, i32* %i, align 4 %inc = add nsw i32 %12, 1 store i32 %inc, i32* %i, align 4 br label %for.cond @@ -218,36 +218,36 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 10000 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %idxprom = sext i32 %1 to i64 - %2 = load i32** %trigger.addr, align 8 - %arrayidx = getelementptr inbounds i32* %2, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %2 = load i32*, i32** %trigger.addr, align 8 + %arrayidx = getelementptr inbounds i32, i32* %2, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp slt i32 %3, 100 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %for.body - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %idxprom2 = sext i32 %4 to i64 - %5 = load double** %B.addr, align 8 - %arrayidx3 = getelementptr inbounds double* %5, i64 %idxprom2 - %6 = load double* %arrayidx3, align 8 - %7 = load i32* %i, align 4 + %5 = load double*, double** %B.addr, align 8 + %arrayidx3 = getelementptr inbounds double, double* %5, i64 %idxprom2 + %6 = load double, double* %arrayidx3, align 8 + %7 = load i32, i32* %i, align 4 %idxprom4 = sext i32 %7 to i64 - %8 = load i32** %trigger.addr, align 8 - %arrayidx5 = getelementptr inbounds i32* %8, i64 %idxprom4 - %9 = load i32* %arrayidx5, align 4 + %8 = load i32*, i32** %trigger.addr, align 8 + %arrayidx5 = getelementptr inbounds i32, i32* %8, i64 %idxprom4 + %9 = load i32, i32* %arrayidx5, align 4 %conv = sitofp i32 %9 to double %add = fadd double %6, %conv - %10 = load i32* %i, align 4 + %10 = load i32, i32* %i, align 4 %idxprom6 = sext i32 %10 to i64 - %11 = load double** %A.addr, align 8 - %arrayidx7 = getelementptr inbounds double* %11, i64 %idxprom6 + %11 = load double*, double** %A.addr, align 8 + %arrayidx7 = getelementptr inbounds double, double* %11, i64 %idxprom6 store double %add, double* %arrayidx7, align 8 br label %if.end @@ -255,7 +255,7 @@ if.end: ; preds = %if.then, %for.body br label %for.inc for.inc: ; preds = %if.end - %12 = load i32* %i, align 4 + %12 = load i32, i32* %i, align 4 %inc = add nsw i32 %12, 1 store i32 %inc, i32* %i, align 4 br label %for.cond @@ -297,37 +297,37 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 10000 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %idxprom = sext i32 %1 to i64 - %2 = load i32** %trigger.addr, align 8 - %arrayidx = getelementptr inbounds i32* %2, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %2 = load i32*, i32** %trigger.addr, align 8 + %arrayidx = getelementptr inbounds i32, i32* %2, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp slt i32 %3, 100 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %for.body - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %mul = mul nsw i32 %4, 2 %idxprom2 = sext i32 %mul to i64 - %5 = load double** %B.addr, align 8 - %arrayidx3 = getelementptr inbounds double* %5, i64 %idxprom2 - %6 = load double* %arrayidx3, align 8 - %7 = load i32* %i, align 4 + %5 = load double*, double** %B.addr, align 8 + %arrayidx3 = getelementptr inbounds double, double* %5, i64 %idxprom2 + %6 = load double, double* %arrayidx3, align 8 + %7 = load i32, i32* %i, align 4 %idxprom4 = sext i32 %7 to i64 - %8 = load i32** %trigger.addr, align 8 - %arrayidx5 = getelementptr inbounds i32* %8, i64 %idxprom4 - %9 = load i32* %arrayidx5, align 4 + %8 = load i32*, i32** %trigger.addr, align 8 + %arrayidx5 = getelementptr inbounds i32, i32* %8, i64 %idxprom4 + %9 = load i32, i32* %arrayidx5, align 4 %conv = sitofp i32 %9 to double %add = fadd double %6, %conv - %10 = load i32* %i, align 4 + %10 = load i32, i32* %i, align 4 %idxprom6 = sext i32 %10 to i64 - %11 = load double** %A.addr, align 8 - %arrayidx7 = getelementptr inbounds double* %11, i64 %idxprom6 + %11 = load double*, double** %A.addr, align 8 + %arrayidx7 = getelementptr inbounds double, double* %11, i64 %idxprom6 store double %add, double* %arrayidx7, align 8 br label %if.end @@ -335,7 +335,7 @@ if.end: ; preds = %if.then, %for.body br label %for.inc for.inc: ; preds = %if.end - %12 = load i32* %i, align 4 + %12 = load i32, i32* %i, align 4 %inc = add nsw i32 %12, 1 store i32 %inc, i32* %i, align 4 br label %for.cond @@ -373,43 +373,43 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 10000 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %idxprom = sext i32 %1 to i64 - %2 = load i32** %trigger.addr, align 8 - %arrayidx = getelementptr inbounds i32* %2, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %2 = load i32*, i32** %trigger.addr, align 8 + %arrayidx = getelementptr inbounds i32, i32* %2, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp slt i32 %3, 100 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %for.body - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %idxprom2 = sext i32 %4 to i64 - %5 = load i32** %B.addr, align 8 - %arrayidx3 = getelementptr inbounds i32* %5, i64 %idxprom2 - %6 = load i32* %arrayidx3, align 4 - %7 = load i32* %i, align 4 + %5 = load i32*, i32** %B.addr, align 8 + %arrayidx3 = getelementptr inbounds i32, i32* %5, i64 %idxprom2 + %6 = load i32, i32* %arrayidx3, align 4 + %7 = load i32, i32* %i, align 4 %idxprom4 = sext i32 %7 to i64 - %8 = load i32** %trigger.addr, align 8 - %arrayidx5 = getelementptr inbounds i32* %8, i64 %idxprom4 - %9 = load i32* %arrayidx5, align 4 + %8 = load i32*, i32** %trigger.addr, align 8 + %arrayidx5 = getelementptr inbounds i32, i32* %8, i64 %idxprom4 + %9 = load i32, i32* %arrayidx5, align 4 %add = add nsw i32 %6, %9 - %10 = load i32* %i, align 4 + %10 = load i32, i32* %i, align 4 %idxprom6 = sext i32 %10 to i64 - %11 = load i32** %A.addr, align 8 - %arrayidx7 = getelementptr inbounds i32* %11, i64 %idxprom6 - store i32 sdiv (i32 1, i32 zext (i1 icmp eq (i32** getelementptr inbounds ([1 x i32*]* @a, i64 0, i64 1), i32** @c) to i32)), i32* %arrayidx7, align 4 + %11 = load i32*, i32** %A.addr, align 8 + %arrayidx7 = getelementptr inbounds i32, i32* %11, i64 %idxprom6 + store i32 sdiv (i32 1, i32 zext (i1 icmp eq (i32** getelementptr inbounds ([1 x i32*], [1 x i32*]* @a, i64 0, i64 1), i32** @c) to i32)), i32* %arrayidx7, align 4 br label %if.end if.end: ; preds = %if.then, %for.body br label %for.inc for.inc: ; preds = %if.end - %12 = load i32* %i, align 4 + %12 = load i32, i32* %i, align 4 %inc = add nsw i32 %12, 1 store i32 %inc, i32* %i, align 4 br label %for.cond @@ -459,30 +459,30 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp sge i32 %0, 0 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %idxprom = sext i32 %1 to i64 - %2 = load i32** %trigger.addr, align 8 - %arrayidx = getelementptr inbounds i32* %2, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %2 = load i32*, i32** %trigger.addr, align 8 + %arrayidx = getelementptr inbounds i32, i32* %2, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %3, 0 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %for.body - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %idxprom2 = sext i32 %4 to i64 - %5 = load double** %in.addr, align 8 - %arrayidx3 = getelementptr inbounds double* %5, i64 %idxprom2 - %6 = load double* %arrayidx3, align 8 + %5 = load double*, double** %in.addr, align 8 + %arrayidx3 = getelementptr inbounds double, double* %5, i64 %idxprom2 + %6 = load double, double* %arrayidx3, align 8 %add = fadd double %6, 5.000000e-01 - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %idxprom4 = sext i32 %7 to i64 - %8 = load double** %out.addr, align 8 - %arrayidx5 = getelementptr inbounds double* %8, i64 %idxprom4 + %8 = load double*, double** %out.addr, align 8 + %arrayidx5 = getelementptr inbounds double, double* %8, i64 %idxprom4 store double %add, double* %arrayidx5, align 8 br label %if.end @@ -490,7 +490,7 @@ if.end: ; preds = %if.then, %for.body br label %for.inc for.inc: ; preds = %if.end - %9 = load i32* %i, align 4 + %9 = load i32, i32* %i, align 4 %dec = add nsw i32 %9, -1 store i32 %dec, i32* %i, align 4 br label %for.cond diff --git a/test/Transforms/LoopVectorize/X86/metadata-enable.ll b/test/Transforms/LoopVectorize/X86/metadata-enable.ll index 7feb66c..ba8e11e 100644 --- a/test/Transforms/LoopVectorize/X86/metadata-enable.ll +++ b/test/Transforms/LoopVectorize/X86/metadata-enable.ll @@ -54,17 +54,17 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %N - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %add, i32* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 32 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0 for.end: ; preds = %for.body - %1 = load i32* %a, align 4 + %1 = load i32, i32* %a, align 4 ret i32 %1 } @@ -105,17 +105,17 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %N - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %add, i32* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 32 br i1 %exitcond, label %for.end, label %for.body for.end: ; preds = %for.body - %1 = load i32* %a, align 4 + %1 = load i32, i32* %a, align 4 ret i32 %1 } @@ -156,17 +156,17 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %N - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %add, i32* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 32 br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !2 for.end: ; preds = %for.body - %1 = load i32* %a, align 4 + %1 = load i32, i32* %a, align 4 ret i32 %1 } diff --git a/test/Transforms/LoopVectorize/X86/min-trip-count-switch.ll b/test/Transforms/LoopVectorize/X86/min-trip-count-switch.ll index fd69dc4..bb972c4 100644 --- a/test/Transforms/LoopVectorize/X86/min-trip-count-switch.ll +++ b/test/Transforms/LoopVectorize/X86/min-trip-count-switch.ll @@ -10,8 +10,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %a, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %add = fadd float %0, 1.000000e+00 store float %add, float* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/X86/no-vector.ll b/test/Transforms/LoopVectorize/X86/no-vector.ll index 692eec9..4b464b0 100644 --- a/test/Transforms/LoopVectorize/X86/no-vector.ll +++ b/test/Transforms/LoopVectorize/X86/no-vector.ll @@ -8,8 +8,8 @@ entry: for.body: ; preds = %entry, %for.body %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %r.05 = phi i32 [ %xor, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i8* %s, i32 %i.06 - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %s, i32 %i.06 + %0 = load i8, i8* %arrayidx, align 1 %conv = sext i8 %0 to i32 %xor = xor i32 %conv, %r.05 %inc = add nsw i32 %i.06, 1 diff --git a/test/Transforms/LoopVectorize/X86/parallel-loops-after-reg2mem.ll b/test/Transforms/LoopVectorize/X86/parallel-loops-after-reg2mem.ll index ad01044..631361c 100644 --- a/test/Transforms/LoopVectorize/X86/parallel-loops-after-reg2mem.ll +++ b/test/Transforms/LoopVectorize/X86/parallel-loops-after-reg2mem.ll @@ -17,28 +17,28 @@ entry: br label %for.body for.body: ; preds = %for.body.for.body_crit_edge, %entry - %indvars.iv.reload = load i64* %indvars.iv.reg2mem - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv.reload - %0 = load i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv.reload - %1 = load i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 + %indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv.reload + %0 = load i32, i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv.reload + %1 = load i32, i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 %idxprom3 = sext i32 %1 to i64 - %arrayidx4 = getelementptr inbounds i32* %a, i64 %idxprom3 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i64 %idxprom3 store i32 %0, i32* %arrayidx4, align 4, !llvm.mem.parallel_loop_access !3 %indvars.iv.next = add i64 %indvars.iv.reload, 1 ; A new store without the parallel metadata here: store i64 %indvars.iv.next, i64* %indvars.iv.next.reg2mem - %indvars.iv.next.reload1 = load i64* %indvars.iv.next.reg2mem - %arrayidx6 = getelementptr inbounds i32* %b, i64 %indvars.iv.next.reload1 - %2 = load i32* %arrayidx6, align 4, !llvm.mem.parallel_loop_access !3 + %indvars.iv.next.reload1 = load i64, i64* %indvars.iv.next.reg2mem + %arrayidx6 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv.next.reload1 + %2 = load i32, i32* %arrayidx6, align 4, !llvm.mem.parallel_loop_access !3 store i32 %2, i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 - %indvars.iv.next.reload = load i64* %indvars.iv.next.reg2mem + %indvars.iv.next.reload = load i64, i64* %indvars.iv.next.reg2mem %lftr.wideiv = trunc i64 %indvars.iv.next.reload to i32 %exitcond = icmp eq i32 %lftr.wideiv, 512 br i1 %exitcond, label %for.end, label %for.body.for.body_crit_edge, !llvm.loop !3 for.body.for.body_crit_edge: ; preds = %for.body - %indvars.iv.next.reload2 = load i64* %indvars.iv.next.reg2mem + %indvars.iv.next.reload2 = load i64, i64* %indvars.iv.next.reg2mem store i64 %indvars.iv.next.reload2, i64* %indvars.iv.reg2mem br label %for.body diff --git a/test/Transforms/LoopVectorize/X86/parallel-loops.ll b/test/Transforms/LoopVectorize/X86/parallel-loops.ll index 22ab521..53061ed 100644 --- a/test/Transforms/LoopVectorize/X86/parallel-loops.ll +++ b/test/Transforms/LoopVectorize/X86/parallel-loops.ll @@ -20,16 +20,16 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %idxprom3 = sext i32 %1 to i64 - %arrayidx4 = getelementptr inbounds i32* %a, i64 %idxprom3 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i64 %idxprom3 store i32 %0, i32* %arrayidx4, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 - %arrayidx6 = getelementptr inbounds i32* %b, i64 %indvars.iv.next - %2 = load i32* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv.next + %2 = load i32, i32* %arrayidx6, align 4 store i32 %2, i32* %arrayidx2, align 4 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp eq i32 %lftr.wideiv, 512 @@ -50,18 +50,18 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 %idxprom3 = sext i32 %1 to i64 - %arrayidx4 = getelementptr inbounds i32* %a, i64 %idxprom3 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i64 %idxprom3 ; This store might have originated from inlining a function with a parallel ; loop. Refers to a list with the "original loop reference" (!4) also included. store i32 %0, i32* %arrayidx4, align 4, !llvm.mem.parallel_loop_access !5 %indvars.iv.next = add i64 %indvars.iv, 1 - %arrayidx6 = getelementptr inbounds i32* %b, i64 %indvars.iv.next - %2 = load i32* %arrayidx6, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx6 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv.next + %2 = load i32, i32* %arrayidx6, align 4, !llvm.mem.parallel_loop_access !3 store i32 %2, i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp eq i32 %lftr.wideiv, 512 @@ -83,18 +83,18 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !6 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !6 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4, !llvm.mem.parallel_loop_access !6 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !6 %idxprom3 = sext i32 %1 to i64 - %arrayidx4 = getelementptr inbounds i32* %a, i64 %idxprom3 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i64 %idxprom3 ; This refers to the loop marked with !7 which we are not in at the moment. ; It should prevent detecting as a parallel loop. store i32 %0, i32* %arrayidx4, align 4, !llvm.mem.parallel_loop_access !7 %indvars.iv.next = add i64 %indvars.iv, 1 - %arrayidx6 = getelementptr inbounds i32* %b, i64 %indvars.iv.next - %2 = load i32* %arrayidx6, align 4, !llvm.mem.parallel_loop_access !6 + %arrayidx6 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv.next + %2 = load i32, i32* %arrayidx6, align 4, !llvm.mem.parallel_loop_access !6 store i32 %2, i32* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !6 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp eq i32 %lftr.wideiv, 512 diff --git a/test/Transforms/LoopVectorize/X86/powof2div.ll b/test/Transforms/LoopVectorize/X86/powof2div.ll index 054da8e..6bc738a 100644 --- a/test/Transforms/LoopVectorize/X86/powof2div.ll +++ b/test/Transforms/LoopVectorize/X86/powof2div.ll @@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu" @Foo = common global %struct.anon zeroinitializer, align 4 ;CHECK-LABEL: @foo( -;CHECK: load <4 x i32>* +;CHECK: load <4 x i32>, <4 x i32>* ;CHECK: sdiv <4 x i32> ;CHECK: store <4 x i32> @@ -17,10 +17,10 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds %struct.anon* @Foo, i64 0, i32 2, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds %struct.anon, %struct.anon* @Foo, i64 0, i32 2, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %div = sdiv i32 %0, 2 - %arrayidx2 = getelementptr inbounds %struct.anon* @Foo, i64 0, i32 0, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds %struct.anon, %struct.anon* @Foo, i64 0, i32 0, i64 %indvars.iv store i32 %div, i32* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 100 diff --git a/test/Transforms/LoopVectorize/X86/reduction-crash.ll b/test/Transforms/LoopVectorize/X86/reduction-crash.ll index 3957a55..3741b95 100644 --- a/test/Transforms/LoopVectorize/X86/reduction-crash.ll +++ b/test/Transforms/LoopVectorize/X86/reduction-crash.ll @@ -14,17 +14,17 @@ bb: br label %bb2 bb2: ; preds = %bb - %tmp = load double* null, align 8 + %tmp = load double, double* null, align 8 br i1 undef, label %bb3, label %bb12 bb3: ; preds = %bb3, %bb2 %tmp4 = phi double [ %tmp9, %bb3 ], [ %tmp, %bb2 ] %tmp5 = phi i32 [ %tmp8, %bb3 ], [ 0, %bb2 ] - %tmp6 = getelementptr inbounds [16 x double]* undef, i32 0, i32 %tmp5 - %tmp7 = load double* %tmp6, align 4 + %tmp6 = getelementptr inbounds [16 x double], [16 x double]* undef, i32 0, i32 %tmp5 + %tmp7 = load double, double* %tmp6, align 4 %tmp8 = add nsw i32 %tmp5, 1 %tmp9 = fadd fast double %tmp4, undef - %tmp10 = getelementptr inbounds float* %arg, i32 %tmp5 + %tmp10 = getelementptr inbounds float, float* %arg, i32 %tmp5 store float undef, float* %tmp10, align 4 %tmp11 = icmp eq i32 %tmp8, %arg1 br i1 %tmp11, label %bb12, label %bb3 diff --git a/test/Transforms/LoopVectorize/X86/small-size.ll b/test/Transforms/LoopVectorize/X86/small-size.ll index 8c7a881..47c262b 100644 --- a/test/Transforms/LoopVectorize/X86/small-size.ll +++ b/test/Transforms/LoopVectorize/X86/small-size.ll @@ -30,12 +30,12 @@ define void @example1() optsize { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %6, i32* %7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -65,7 +65,7 @@ define void @example2(i32 %n, i32 %x) optsize { .lr.ph5: ; preds = %0, %.lr.ph5 %indvars.iv6 = phi i64 [ %indvars.iv.next7, %.lr.ph5 ], [ 0, %0 ] - %3 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv6 + %3 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv6 store i32 %x, i32* %3, align 4 %indvars.iv.next7 = add i64 %indvars.iv6, 1 %lftr.wideiv = trunc i64 %indvars.iv.next7 to i32 @@ -76,12 +76,12 @@ define void @example2(i32 %n, i32 %x) optsize { %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %i.0.lcssa, %.preheader ] %.02 = phi i32 [ %4, %.lr.ph ], [ %n, %.preheader ] %4 = add nsw i32 %.02, -1 - %5 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %6 = load i32* %5, align 4 - %7 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %8 = load i32* %7, align 4 + %5 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %6 = load i32, i32* %5, align 4 + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %8 = load i32, i32* %7, align 4 %9 = and i32 %8, %6 - %10 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %10 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %9, i32* %10, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %11 = icmp eq i32 %4, 0 @@ -104,9 +104,9 @@ define void @example3(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture %.014 = phi i32* [ %5, %.lr.ph ], [ %p, %0 ] %.023 = phi i32* [ %3, %.lr.ph ], [ %q, %0 ] %2 = add nsw i32 %.05, -1 - %3 = getelementptr inbounds i32* %.023, i64 1 - %4 = load i32* %.023, align 16 - %5 = getelementptr inbounds i32* %.014, i64 1 + %3 = getelementptr inbounds i32, i32* %.023, i64 1 + %4 = load i32, i32* %.023, align 16 + %5 = getelementptr inbounds i32, i32* %.014, i64 1 store i32 %4, i32* %.014, align 16 %6 = icmp eq i32 %2, 0 br i1 %6, label %._crit_edge, label %.lr.ph @@ -128,9 +128,9 @@ define void @example4(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture %.014 = phi i32* [ %5, %.lr.ph ], [ %p, %0 ] %.023 = phi i32* [ %3, %.lr.ph ], [ %q, %0 ] %2 = add nsw i32 %.05, -1 - %3 = getelementptr inbounds i32* %.023, i64 1 - %4 = load i32* %.023, align 16 - %5 = getelementptr inbounds i32* %.014, i64 1 + %3 = getelementptr inbounds i32, i32* %.023, i64 1 + %4 = load i32, i32* %.023, align 16 + %5 = getelementptr inbounds i32, i32* %.014, i64 1 store i32 %4, i32* %.014, align 16 %6 = icmp eq i32 %2, 0 br i1 %6, label %._crit_edge, label %.lr.ph @@ -152,11 +152,11 @@ define void @example23(i16* nocapture %src, i32* nocapture %dst) optsize { %.04 = phi i16* [ %src, %0 ], [ %2, %1 ] %.013 = phi i32* [ %dst, %0 ], [ %6, %1 ] %i.02 = phi i32 [ 0, %0 ], [ %7, %1 ] - %2 = getelementptr inbounds i16* %.04, i64 1 - %3 = load i16* %.04, align 2 + %2 = getelementptr inbounds i16, i16* %.04, i64 1 + %3 = load i16, i16* %.04, align 2 %4 = zext i16 %3 to i32 %5 = shl nuw nsw i32 %4, 7 - %6 = getelementptr inbounds i32* %.013, i64 1 + %6 = getelementptr inbounds i32, i32* %.013, i64 1 store i32 %5, i32* %.013, align 4 %7 = add nsw i32 %i.02, 1 %exitcond = icmp eq i32 %7, 256 @@ -178,11 +178,11 @@ define void @example23b(i16* noalias nocapture %src, i32* noalias nocapture %dst %.04 = phi i16* [ %src, %0 ], [ %2, %1 ] %.013 = phi i32* [ %dst, %0 ], [ %6, %1 ] %i.02 = phi i32 [ 0, %0 ], [ %7, %1 ] - %2 = getelementptr inbounds i16* %.04, i64 1 - %3 = load i16* %.04, align 2 + %2 = getelementptr inbounds i16, i16* %.04, i64 1 + %3 = load i16, i16* %.04, align 2 %4 = zext i16 %3 to i32 %5 = shl nuw nsw i32 %4, 7 - %6 = getelementptr inbounds i32* %.013, i64 1 + %6 = getelementptr inbounds i32, i32* %.013, i64 1 store i32 %5, i32* %.013, align 4 %7 = add nsw i32 %i.02, 1 %exitcond = icmp eq i32 %7, 256 diff --git a/test/Transforms/LoopVectorize/X86/struct-store.ll b/test/Transforms/LoopVectorize/X86/struct-store.ll index a995e43..4ff3b0e 100644 --- a/test/Transforms/LoopVectorize/X86/struct-store.ll +++ b/test/Transforms/LoopVectorize/X86/struct-store.ll @@ -15,7 +15,7 @@ entry: loop: %indvars.iv = phi i64 [ %indvars.iv.next, %loop ], [ 0, %entry ] - %tmp = getelementptr inbounds [16 x { i64, i64 }]* @glbl, i64 0, i64 %indvars.iv + %tmp = getelementptr inbounds [16 x { i64, i64 }], [16 x { i64, i64 }]* @glbl, i64 0, i64 %indvars.iv store { i64, i64 } { i64 ptrtoint (void ()* @fn to i64), i64 0 }, { i64, i64 }* %tmp, align 16 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/X86/tripcount.ll b/test/Transforms/LoopVectorize/X86/tripcount.ll index a4ec694..c0bbb92 100644 --- a/test/Transforms/LoopVectorize/X86/tripcount.ll +++ b/test/Transforms/LoopVectorize/X86/tripcount.ll @@ -22,8 +22,8 @@ for.body.preheader: for.body: %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds [0 x i32]* @big, i32 0, i32 %i.07 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [0 x i32], [0 x i32]* @big, i32 0, i32 %i.07 + %0 = load i32, i32* %arrayidx, align 4 %neg = xor i32 %0, -1 store i32 %neg, i32* %arrayidx, align 4 %inc = add nsw i32 %i.07, 1 diff --git a/test/Transforms/LoopVectorize/X86/uint64_to_fp64-cost-model.ll b/test/Transforms/LoopVectorize/X86/uint64_to_fp64-cost-model.ll index 86c32b2..38af11c 100644 --- a/test/Transforms/LoopVectorize/X86/uint64_to_fp64-cost-model.ll +++ b/test/Transforms/LoopVectorize/X86/uint64_to_fp64-cost-model.ll @@ -12,10 +12,10 @@ entry: br label %for.body for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i64* %a, i64 %indvars.iv - %tmp = load i64* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i64, i64* %a, i64 %indvars.iv + %tmp = load i64, i64* %arrayidx, align 4 %conv = uitofp i64 %tmp to double - %arrayidx2 = getelementptr inbounds double* %b, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %b, i64 %indvars.iv store double %conv, double* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 256 diff --git a/test/Transforms/LoopVectorize/X86/unroll-pm.ll b/test/Transforms/LoopVectorize/X86/unroll-pm.ll index 5064fec..52914b6 100644 --- a/test/Transforms/LoopVectorize/X86/unroll-pm.ll +++ b/test/Transforms/LoopVectorize/X86/unroll-pm.ll @@ -17,8 +17,8 @@ define i32 @bar(i32* nocapture %A, i32 %n) nounwind uwtable ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = add nsw i32 %3, 6 store i32 %4, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll b/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll index 716dc08..4411da3 100644 --- a/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll +++ b/test/Transforms/LoopVectorize/X86/unroll-small-loops.ll @@ -16,8 +16,8 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK-VECTOR: ret ; ; CHECK-SCALAR-LABEL: @foo( -; CHECK-SCALAR: load i32* -; CHECK-SCALAR-NOT: load i32* +; CHECK-SCALAR: load i32, i32* +; CHECK-SCALAR-NOT: load i32, i32* ; CHECK-SCALAR: store i32 ; CHECK-SCALAR-NOT: store i32 ; CHECK-SCALAR: ret @@ -26,8 +26,8 @@ define i32 @foo(i32* nocapture %A) nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = add nsw i32 %3, 6 store i32 %4, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -57,8 +57,8 @@ define i32 @bar(i32* nocapture %A, i32 %n) nounwind uwtable ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = add nsw i32 %3, 6 store i32 %4, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -86,10 +86,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %B, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %mul = fmul float %0, %N - %arrayidx2 = getelementptr inbounds float* %A, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %indvars.iv store float %mul, float* %arrayidx2, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 256 diff --git a/test/Transforms/LoopVectorize/X86/unroll_selection.ll b/test/Transforms/LoopVectorize/X86/unroll_selection.ll index c684b4e..71b8290 100644 --- a/test/Transforms/LoopVectorize/X86/unroll_selection.ll +++ b/test/Transforms/LoopVectorize/X86/unroll_selection.ll @@ -16,8 +16,8 @@ define void @reg_pressure(double* nocapture %A, i32 %n) nounwind uwtable ssp { ; <label>:2 ; preds = %2, %0 %indvars.iv = phi i64 [ %indvars.iv.next, %2 ], [ %1, %0 ] - %3 = getelementptr inbounds double* %A, i64 %indvars.iv - %4 = load double* %3, align 8 + %3 = getelementptr inbounds double, double* %A, i64 %indvars.iv + %4 = load double, double* %3, align 8 %5 = fadd double %4, 3.000000e+00 %6 = fmul double %4, 2.000000e+00 %7 = fadd double %5, %6 @@ -58,8 +58,8 @@ define void @small_loop(i16* nocapture %A, i64 %n) nounwind uwtable ssp { .lr.ph: ; preds = %0, %.lr.ph %i.01 = phi i64 [ %5, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i16* %A, i64 %i.01 - %3 = load i16* %2, align 2 + %2 = getelementptr inbounds i16, i16* %A, i64 %i.01 + %3 = load i16, i16* %2, align 2 %4 = xor i16 %3, 3 store i16 %4, i16* %2, align 2 %5 = add i64 %i.01, 1 diff --git a/test/Transforms/LoopVectorize/X86/veclib-calls.ll b/test/Transforms/LoopVectorize/X86/veclib-calls.ll new file mode 100644 index 0000000..62e0a44 --- /dev/null +++ b/test/Transforms/LoopVectorize/X86/veclib-calls.ll @@ -0,0 +1,182 @@ +; RUN: opt < %s -vector-library=Accelerate -loop-vectorize -S | FileCheck %s + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +;CHECK-LABEL: @sqrt_f32( +;CHECK: vsqrtf{{.*}}<4 x float> +;CHECK: ret void +declare float @sqrtf(float) nounwind readnone +define void @sqrt_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable { +entry: + %cmp6 = icmp sgt i32 %n, 0 + br i1 %cmp6, label %for.body, label %for.end + +for.body: ; preds = %entry, %for.body + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %call = tail call float @sqrtf(float %0) nounwind readnone + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv + store float %call, float* %arrayidx2, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +;CHECK-LABEL: @exp_f32( +;CHECK: vexpf{{.*}}<4 x float> +;CHECK: ret void +declare float @expf(float) nounwind readnone +define void @exp_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable { +entry: + %cmp6 = icmp sgt i32 %n, 0 + br i1 %cmp6, label %for.body, label %for.end + +for.body: ; preds = %entry, %for.body + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %call = tail call float @expf(float %0) nounwind readnone + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv + store float %call, float* %arrayidx2, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +;CHECK-LABEL: @log_f32( +;CHECK: vlogf{{.*}}<4 x float> +;CHECK: ret void +declare float @logf(float) nounwind readnone +define void @log_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable { +entry: + %cmp6 = icmp sgt i32 %n, 0 + br i1 %cmp6, label %for.body, label %for.end + +for.body: ; preds = %entry, %for.body + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %call = tail call float @logf(float %0) nounwind readnone + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv + store float %call, float* %arrayidx2, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +; For abs instruction we'll generate vector intrinsic, as it's cheaper than a lib call. +;CHECK-LABEL: @fabs_f32( +;CHECK: fabs{{.*}}<4 x float> +;CHECK: ret void +declare float @fabsf(float) nounwind readnone +define void @fabs_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable { +entry: + %cmp6 = icmp sgt i32 %n, 0 + br i1 %cmp6, label %for.body, label %for.end + +for.body: ; preds = %entry, %for.body + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %call = tail call float @fabsf(float %0) nounwind readnone + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv + store float %call, float* %arrayidx2, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +; Test that we can vectorize an intrinsic into a vector call. +;CHECK-LABEL: @exp_f32_intrin( +;CHECK: vexpf{{.*}}<4 x float> +;CHECK: ret void +declare float @llvm.exp.f32(float) nounwind readnone +define void @exp_f32_intrin(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable { +entry: + %cmp6 = icmp sgt i32 %n, 0 + br i1 %cmp6, label %for.body, label %for.end + +for.body: ; preds = %entry, %for.body + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %call = tail call float @llvm.exp.f32(float %0) nounwind readnone + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv + store float %call, float* %arrayidx2, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +; Test that we don't vectorize arbitrary functions. +;CHECK-LABEL: @foo_f32( +;CHECK-NOT: foo{{.*}}<4 x float> +;CHECK: ret void +declare float @foo(float) nounwind readnone +define void @foo_f32(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable { +entry: + %cmp6 = icmp sgt i32 %n, 0 + br i1 %cmp6, label %for.body, label %for.end + +for.body: ; preds = %entry, %for.body + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %call = tail call float @foo(float %0) nounwind readnone + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv + store float %call, float* %arrayidx2, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +; Test that we don't vectorize calls with nobuiltin attribute. +;CHECK-LABEL: @sqrt_f32_nobuiltin( +;CHECK-NOT: vsqrtf{{.*}}<4 x float> +;CHECK: ret void +define void @sqrt_f32_nobuiltin(i32 %n, float* noalias %y, float* noalias %x) nounwind uwtable { +entry: + %cmp6 = icmp sgt i32 %n, 0 + br i1 %cmp6, label %for.body, label %for.end + +for.body: ; preds = %entry, %for.body + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %call = tail call float @sqrtf(float %0) nounwind readnone nobuiltin + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv + store float %call, float* %arrayidx2, align 4 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, %n + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} diff --git a/test/Transforms/LoopVectorize/X86/vect.omp.force.ll b/test/Transforms/LoopVectorize/X86/vect.omp.force.ll index a781fbe..c2a0fed 100644 --- a/test/Transforms/LoopVectorize/X86/vect.omp.force.ll +++ b/test/Transforms/LoopVectorize/X86/vect.omp.force.ll @@ -15,9 +15,9 @@ target triple = "x86_64-apple-macosx10.8.0" ; The source code for the test: ; ; #include <math.h> -; void foo(float* restrict A, float * restrict B, int size) +; void foo(float* restrict A, float * restrict B) ; { -; for (int i = 0; i < size; ++i) A[i] = sinf(B[i]); +; for (int i = 0; i < 1000; i+=2) A[i] = sinf(B[i]); ; } ; @@ -25,24 +25,20 @@ target triple = "x86_64-apple-macosx10.8.0" ; This loop will be vectorized, although the scalar cost is lower than any of vector costs, but vectorization is explicitly forced in metadata. ; -define void @vectorized(float* noalias nocapture %A, float* noalias nocapture %B, i32 %size) { +define void @vectorized(float* noalias nocapture %A, float* noalias nocapture %B) { entry: - %cmp6 = icmp sgt i32 %size, 0 - br i1 %cmp6, label %for.body.preheader, label %for.end - -for.body.preheader: br label %for.body for.body: - %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv - %0 = load float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !1 + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %B, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !1 %call = tail call float @llvm.sin.f32(float %0) - %arrayidx2 = getelementptr inbounds float* %A, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %indvars.iv store float %call, float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !1 - %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 - %exitcond = icmp eq i32 %lftr.wideiv, %size + %exitcond = icmp eq i32 %lftr.wideiv, 1000 br i1 %exitcond, label %for.end.loopexit, label %for.body, !llvm.loop !1 for.end.loopexit: @@ -59,24 +55,20 @@ for.end: ; This method will not be vectorized, as scalar cost is lower than any of vector costs. ; -define void @not_vectorized(float* noalias nocapture %A, float* noalias nocapture %B, i32 %size) { +define void @not_vectorized(float* noalias nocapture %A, float* noalias nocapture %B) { entry: - %cmp6 = icmp sgt i32 %size, 0 - br i1 %cmp6, label %for.body.preheader, label %for.end - -for.body.preheader: br label %for.body for.body: - %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv - %0 = load float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 + %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] + %arrayidx = getelementptr inbounds float, float* %B, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 %call = tail call float @llvm.sin.f32(float %0) - %arrayidx2 = getelementptr inbounds float* %A, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %indvars.iv store float %call, float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 - %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 - %exitcond = icmp eq i32 %lftr.wideiv, %size + %exitcond = icmp eq i32 %lftr.wideiv, 1000 br i1 %exitcond, label %for.end.loopexit, label %for.body, !llvm.loop !3 for.end.loopexit: diff --git a/test/Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll b/test/Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll index e39e6b5..8d139ac 100644 --- a/test/Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll +++ b/test/Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll @@ -29,10 +29,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv - %0 = load float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !1 - %arrayidx2 = getelementptr inbounds float* %A, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !1 + %arrayidx = getelementptr inbounds float, float* %B, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !1 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !1 %add = fadd fast float %0, %1 store float %add, float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -55,10 +55,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv - %0 = load float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 - %arrayidx2 = getelementptr inbounds float* %A, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx = getelementptr inbounds float, float* %B, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !3 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 %add = fadd fast float %0, %1 store float %add, float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/X86/vector-scalar-select-cost.ll b/test/Transforms/LoopVectorize/X86/vector-scalar-select-cost.ll index ece9895..5efabe1 100644 --- a/test/Transforms/LoopVectorize/X86/vector-scalar-select-cost.ll +++ b/test/Transforms/LoopVectorize/X86/vector-scalar-select-cost.ll @@ -15,12 +15,12 @@ define void @scalarselect(i1 %cond) { ; <label>:1 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv ; A scalar select has a cost of 1 on core2 ; CHECK: cost of 1 for VF 2 {{.*}} select i1 %cond, i32 %6, i32 0 @@ -42,12 +42,12 @@ define void @vectorselect(i1 %cond) { ; <label>:1 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv %8 = icmp ult i64 %indvars.iv, 8 ; A vector select has a cost of 1 on core2 diff --git a/test/Transforms/LoopVectorize/X86/vector_ptr_load_store.ll b/test/Transforms/LoopVectorize/X86/vector_ptr_load_store.ll index e57cfef..6cd3c9c 100644 --- a/test/Transforms/LoopVectorize/X86/vector_ptr_load_store.ll +++ b/test/Transforms/LoopVectorize/X86/vector_ptr_load_store.ll @@ -19,7 +19,7 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK: test_consecutive_store ; CHECK: The Widest type: 64 bits define void @test_consecutive_store(%0**, %0**, %0** nocapture) nounwind ssp uwtable align 2 { - %4 = load %0** %2, align 8 + %4 = load %0*, %0** %2, align 8 %5 = icmp eq %0** %0, %1 br i1 %5, label %12, label %6 @@ -29,7 +29,7 @@ define void @test_consecutive_store(%0**, %0**, %0** nocapture) nounwind ssp uwt ; <label>:7 ; preds = %7, %6 %8 = phi %0** [ %0, %6 ], [ %9, %7 ] store %0* %4, %0** %8, align 8 - %9 = getelementptr inbounds %0** %8, i64 1 + %9 = getelementptr inbounds %0*, %0** %8, i64 1 %10 = icmp eq %0** %9, %1 br i1 %10, label %11, label %7 @@ -61,12 +61,12 @@ define void @test_nonconsecutive_store() nounwind ssp uwtable { ; <label>:3 ; preds = %3, %1 %4 = phi i64 [ 0, %1 ], [ %11, %3 ] - %5 = getelementptr inbounds [2048 x i16]* @q, i64 0, i64 %4 - %6 = load i16* %5, align 2 + %5 = getelementptr inbounds [2048 x i16], [2048 x i16]* @q, i64 0, i64 %4 + %6 = load i16, i16* %5, align 2 %7 = sext i16 %6 to i64 %8 = add i64 %7, 1 %9 = inttoptr i64 %8 to i32* - %10 = getelementptr inbounds [2048 x [8 x i32*]]* @p, i64 0, i64 %4, i64 %2 + %10 = getelementptr inbounds [2048 x [8 x i32*]], [2048 x [8 x i32*]]* @p, i64 0, i64 %4, i64 %2 store i32* %9, i32** %10, align 8 %11 = add i64 %4, 1 %12 = trunc i64 %11 to i32 @@ -100,8 +100,8 @@ define i8 @test_consecutive_ptr_load() nounwind readonly ssp uwtable { ; <label>:1 ; preds = %1, %0 %2 = phi i64 [ 0, %0 ], [ %10, %1 ] %3 = phi i8 [ 0, %0 ], [ %9, %1 ] - %4 = getelementptr inbounds [1024 x i32*]* @ia, i32 0, i64 %2 - %5 = load i32** %4, align 4 + %4 = getelementptr inbounds [1024 x i32*], [1024 x i32*]* @ia, i32 0, i64 %2 + %5 = load i32*, i32** %4, align 4 %6 = ptrtoint i32* %5 to i64 %7 = trunc i64 %6 to i8 %8 = add i8 %3, 1 @@ -127,9 +127,9 @@ define void @test_nonconsecutive_ptr_load() nounwind ssp uwtable { ; <label>:3 ; preds = %3, %1 %4 = phi i64 [ 0, %1 ], [ %10, %3 ] - %5 = getelementptr inbounds [2048 x [8 x i32*]]* @p2, i64 0, i64 %4, i64 %2 - %6 = getelementptr inbounds [2048 x i16]* @q2, i64 0, i64 %4 - %7 = load i32** %5, align 2 + %5 = getelementptr inbounds [2048 x [8 x i32*]], [2048 x [8 x i32*]]* @p2, i64 0, i64 %4, i64 %2 + %6 = getelementptr inbounds [2048 x i16], [2048 x i16]* @q2, i64 0, i64 %4 + %7 = load i32*, i32** %5, align 2 %8 = ptrtoint i32* %7 to i64 %9 = trunc i64 %8 to i16 store i16 %9, i16* %6, align 8 diff --git a/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll b/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll index 011ce8e..60ad3c6 100644 --- a/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll +++ b/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll @@ -52,7 +52,7 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv, !dbg !16 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv, !dbg !16 %0 = trunc i64 %indvars.iv to i32, !dbg !16 store i32 %0, i32* %arrayidx, align 4, !dbg !16, !tbaa !18 %cmp3 = icmp sle i32 %0, %Length, !dbg !22 @@ -74,7 +74,7 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv, !dbg !30 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv, !dbg !30 %0 = trunc i64 %indvars.iv to i32, !dbg !30 store i32 %0, i32* %arrayidx, align 4, !dbg !30, !tbaa !18 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !25 @@ -97,12 +97,12 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds i32* %B, i64 %indvars.iv, !dbg !35 - %0 = load i32* %arrayidx, align 4, !dbg !35, !tbaa !18 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv, !dbg !35 + %0 = load i32, i32* %arrayidx, align 4, !dbg !35, !tbaa !18 %idxprom1 = sext i32 %0 to i64, !dbg !35 - %arrayidx2 = getelementptr inbounds i32* %A, i64 %idxprom1, !dbg !35 - %1 = load i32* %arrayidx2, align 4, !dbg !35, !tbaa !18 - %arrayidx4 = getelementptr inbounds i32* %A, i64 %indvars.iv, !dbg !35 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1, !dbg !35 + %1 = load i32, i32* %arrayidx2, align 4, !dbg !35, !tbaa !18 + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv, !dbg !35 store i32 %1, i32* %arrayidx4, align 4, !dbg !35, !tbaa !18 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !32 %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !32 @@ -122,40 +122,40 @@ attributes #0 = { nounwind } !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !{!"0x11\004\00clang version 3.5.0\001\00\006\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./source.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"source.cpp", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0", isOptimized: true, runtimeVersion: 6, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "source.cpp", directory: ".") !2 = !{} !3 = !{!4, !7, !8} -!4 = !{!"0x2e\00test\00test\00\001\000\001\000\006\00256\001\001", !1, !5, !6, null, void (i32*, i32)* @_Z4testPii, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [test] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./source.cpp] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!7 = !{!"0x2e\00test_disabled\00test_disabled\00\0010\000\001\000\006\00256\001\0010", !1, !5, !6, null, void (i32*, i32)* @_Z13test_disabledPii, null, null, !2} ; [ DW_TAG_subprogram ] [line 10] [def] [test_disabled] -!8 = !{!"0x2e\00test_array_bounds\00test_array_bounds\00\0016\000\001\000\006\00256\001\0016", !1, !5, !6, null, void (i32*, i32*, i32)* @_Z17test_array_boundsPiS_i, null, null, !2} ; [ DW_TAG_subprogram ] [line 16] [def] [test_array_bounds] +!4 = !MDSubprogram(name: "test", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32*, i32)* @_Z4testPii, variables: !2) +!5 = !MDFile(filename: "source.cpp", directory: ".") +!6 = !MDSubroutineType(types: !2) +!7 = !MDSubprogram(name: "test_disabled", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !1, scope: !5, type: !6, function: void (i32*, i32)* @_Z13test_disabledPii, variables: !2) +!8 = !MDSubprogram(name: "test_array_bounds", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 16, file: !1, scope: !5, type: !6, function: void (i32*, i32*, i32)* @_Z17test_array_boundsPiS_i, variables: !2) !9 = !{i32 2, !"Dwarf Version", i32 2} -!10 = !{i32 2, !"Debug Info Version", i32 2} +!10 = !{i32 2, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5.0"} !12 = !MDLocation(line: 3, column: 8, scope: !13) -!13 = !{!"0xb\003\003\000", !1, !4} ; [ DW_TAG_lexical_block ] +!13 = distinct !MDLexicalBlock(line: 3, column: 3, file: !1, scope: !4) !14 = !{!14, !15, !15} !15 = !{!"llvm.loop.vectorize.enable", i1 true} !16 = !MDLocation(line: 4, column: 5, scope: !17) -!17 = !{!"0xb\003\0036\000", !1, !13} ; [ DW_TAG_lexical_block ] +!17 = distinct !MDLexicalBlock(line: 3, column: 36, file: !1, scope: !13) !18 = !{!19, !19, i64 0} !19 = !{!"int", !20, i64 0} !20 = !{!"omnipotent char", !21, i64 0} !21 = !{!"Simple C/C++ TBAA"} !22 = !MDLocation(line: 5, column: 9, scope: !23) -!23 = !{!"0xb\005\009\000", !1, !17} ; [ DW_TAG_lexical_block ] +!23 = distinct !MDLexicalBlock(line: 5, column: 9, file: !1, scope: !17) !24 = !MDLocation(line: 8, column: 1, scope: !4) !25 = !MDLocation(line: 12, column: 8, scope: !26) -!26 = !{!"0xb\0012\003\000", !1, !7} ; [ DW_TAG_lexical_block ] +!26 = distinct !MDLexicalBlock(line: 12, column: 3, file: !1, scope: !7) !27 = !{!27, !28, !29} !28 = !{!"llvm.loop.interleave.count", i32 1} !29 = !{!"llvm.loop.vectorize.width", i32 1} !30 = !MDLocation(line: 13, column: 5, scope: !26) !31 = !MDLocation(line: 14, column: 1, scope: !7) !32 = !MDLocation(line: 18, column: 8, scope: !33) -!33 = !{!"0xb\0018\003\000", !1, !8} ; [ DW_TAG_lexical_block ] +!33 = distinct !MDLexicalBlock(line: 18, column: 3, file: !1, scope: !8) !34 = !{!34, !15} !35 = !MDLocation(line: 19, column: 5, scope: !33) !36 = !MDLocation(line: 20, column: 1, scope: !8) diff --git a/test/Transforms/LoopVectorize/X86/vectorization-remarks.ll b/test/Transforms/LoopVectorize/X86/vectorization-remarks.ll index 16fe370..a4e895a 100644 --- a/test/Transforms/LoopVectorize/X86/vectorization-remarks.ll +++ b/test/Transforms/LoopVectorize/X86/vectorization-remarks.ll @@ -26,11 +26,11 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %add8 = phi i32 [ 0, %entry ], [ %add, %for.body ], !dbg !19 - %arrayidx = getelementptr inbounds [16 x i8]* %cb, i64 0, i64 %indvars.iv, !dbg !19 - %0 = load i8* %arrayidx, align 1, !dbg !19, !tbaa !21 + %arrayidx = getelementptr inbounds [16 x i8], [16 x i8]* %cb, i64 0, i64 %indvars.iv, !dbg !19 + %0 = load i8, i8* %arrayidx, align 1, !dbg !19, !tbaa !21 %conv = sext i8 %0 to i32, !dbg !19 - %arrayidx2 = getelementptr inbounds [16 x i8]* %cc, i64 0, i64 %indvars.iv, !dbg !19 - %1 = load i8* %arrayidx2, align 1, !dbg !19, !tbaa !21 + %arrayidx2 = getelementptr inbounds [16 x i8], [16 x i8]* %cc, i64 0, i64 %indvars.iv, !dbg !19 + %1 = load i8, i8* %arrayidx2, align 1, !dbg !19, !tbaa !21 %conv3 = sext i8 %1 to i32, !dbg !19 %sub = sub i32 %conv, %conv3, !dbg !19 %add = add nsw i32 %sub, %add8, !dbg !19 @@ -49,14 +49,14 @@ declare void @ibar(i32*) #1 !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!1 = !{!"vectorization-remarks.c", !"."} +!1 = !MDFile(filename: "vectorization-remarks.c", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\005\000\001\000\006\00256\001\006", !1, !5, !6, null, i32 (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 5] [def] [scope 6] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./vectorization-remarks.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!5 = !MDFile(filename: "vectorization-remarks.c", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 4} -!8 = !{i32 1, !"Debug Info Version", i32 2} +!8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5.0 "} !10 = !MDLocation(line: 8, column: 3, scope: !4) !11 = !{!12, !12, i64 0} @@ -64,11 +64,11 @@ declare void @ibar(i32*) #1 !13 = !{!"omnipotent char", !14, i64 0} !14 = !{!"Simple C/C++ TBAA"} !15 = !MDLocation(line: 17, column: 8, scope: !16) -!16 = !{!"0xb\0017\008\002", !1, !17} ; [ DW_TAG_lexical_block ] [./vectorization-remarks.c] -!17 = !{!"0xb\0017\008\001", !1, !18} ; [ DW_TAG_lexical_block ] [./vectorization-remarks.c] -!18 = !{!"0xb\0017\003\000", !1, !4} ; [ DW_TAG_lexical_block ] [./vectorization-remarks.c] +!16 = distinct !MDLexicalBlock(line: 17, column: 8, file: !1, scope: !17) +!17 = distinct !MDLexicalBlock(line: 17, column: 8, file: !1, scope: !18) +!18 = distinct !MDLexicalBlock(line: 17, column: 3, file: !1, scope: !4) !19 = !MDLocation(line: 18, column: 5, scope: !20) -!20 = !{!"0xb\0017\0027\000", !1, !18} ; [ DW_TAG_lexical_block ] [./vectorization-remarks.c] +!20 = distinct !MDLexicalBlock(line: 17, column: 27, file: !1, scope: !18) !21 = !{!13, !13, i64 0} !22 = !MDLocation(line: 20, column: 3, scope: !4) !23 = !MDLocation(line: 21, column: 3, scope: !4) diff --git a/test/Transforms/LoopVectorize/X86/x86_fp80-vector-store.ll b/test/Transforms/LoopVectorize/X86/x86_fp80-vector-store.ll index d8e5403..0debb33 100644 --- a/test/Transforms/LoopVectorize/X86/x86_fp80-vector-store.ll +++ b/test/Transforms/LoopVectorize/X86/x86_fp80-vector-store.ll @@ -17,7 +17,7 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %conv = sitofp i32 1 to x86_fp80 - %arrayidx = getelementptr inbounds [1024 x x86_fp80]* @x, i64 0, i64 %indvars.iv + %arrayidx = getelementptr inbounds [1024 x x86_fp80], [1024 x x86_fp80]* @x, i64 0, i64 %indvars.iv store x86_fp80 %conv, x86_fp80* %arrayidx, align 16 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/XCore/no-vector-registers.ll b/test/Transforms/LoopVectorize/XCore/no-vector-registers.ll index cab333d..afb3322 100644 --- a/test/Transforms/LoopVectorize/XCore/no-vector-registers.ll +++ b/test/Transforms/LoopVectorize/XCore/no-vector-registers.ll @@ -13,7 +13,7 @@ entry: do.body: %ptr.addr.0 = phi i8* [ %ptr, %entry ], [ %incdec.ptr, %do.body ] %len.addr.0 = phi i32 [ %len, %entry ], [ %dec, %do.body ] - %incdec.ptr = getelementptr inbounds i8* %ptr.addr.0, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8* %ptr.addr.0, i32 1 store i8 0, i8* %ptr.addr.0, align 1 %dec = add nsw i32 %len.addr.0, -1 %tobool = icmp eq i32 %len.addr.0, 0 diff --git a/test/Transforms/LoopVectorize/align.ll b/test/Transforms/LoopVectorize/align.ll index f2fb8b9..7ee401d 100644 --- a/test/Transforms/LoopVectorize/align.ll +++ b/test/Transforms/LoopVectorize/align.ll @@ -6,8 +6,8 @@ target triple = "x86_64-apple-macosx10.8.0" ; Make sure we output the abi alignment if no alignment is specified. ;CHECK-LABEL: @align -;CHECK: load <4 x i32>* {{.*}} align 4 -;CHECK: load <4 x i32>* {{.*}} align 4 +;CHECK: load <4 x i32>, <4 x i32>* {{.*}} align 4 +;CHECK: load <4 x i32>, <4 x i32>* {{.*}} align 4 ;CHECK: store <4 x i32> {{.*}} align 4 define void @align(i32* %a, i32* %b, i32* %c) nounwind uwtable ssp { @@ -15,12 +15,12 @@ define void @align(i32* %a, i32* %b, i32* %c) nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds i32* %b, i64 %indvars.iv - %3 = load i32* %2 - %4 = getelementptr inbounds i32* %c, i64 %indvars.iv - %5 = load i32* %4 + %2 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %3 = load i32, i32* %2 + %4 = getelementptr inbounds i32, i32* %c, i64 %indvars.iv + %5 = load i32, i32* %4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds i32* %a, i64 %indvars.iv + %7 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %6, i32* %7 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/bsd_regex.ll b/test/Transforms/LoopVectorize/bsd_regex.ll index 7a3e798..ddb00ba 100644 --- a/test/Transforms/LoopVectorize/bsd_regex.ll +++ b/test/Transforms/LoopVectorize/bsd_regex.ll @@ -24,7 +24,7 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %0 = shl nsw i64 %indvars.iv, 2 - %arrayidx = getelementptr inbounds i32* %A, i64 %0 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %0 store i32 4, i32* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/bzip_reverse_loops.ll b/test/Transforms/LoopVectorize/bzip_reverse_loops.ll index d7cbad0..f1efb25 100644 --- a/test/Transforms/LoopVectorize/bzip_reverse_loops.ll +++ b/test/Transforms/LoopVectorize/bzip_reverse_loops.ll @@ -16,8 +16,8 @@ entry: do.body: ; preds = %cond.end, %entry %n.addr.0 = phi i32 [ %n, %entry ], [ %dec, %cond.end ] %p.addr.0 = phi i16* [ %p, %entry ], [ %incdec.ptr, %cond.end ] - %incdec.ptr = getelementptr inbounds i16* %p.addr.0, i64 -1 - %0 = load i16* %incdec.ptr, align 2 + %incdec.ptr = getelementptr inbounds i16, i16* %p.addr.0, i64 -1 + %0 = load i16, i16* %incdec.ptr, align 2 %conv = zext i16 %0 to i32 %cmp = icmp ult i32 %conv, %size br i1 %cmp, label %cond.end, label %cond.true @@ -51,8 +51,8 @@ entry: do.body: ; preds = %do.body, %entry %n.addr.0 = phi i32 [ %n, %entry ], [ %dec, %do.body ] %p.0 = phi i32* [ %a, %entry ], [ %incdec.ptr, %do.body ] - %incdec.ptr = getelementptr inbounds i32* %p.0, i64 -1 - %0 = load i32* %incdec.ptr, align 4 + %incdec.ptr = getelementptr inbounds i32, i32* %p.0, i64 -1 + %0 = load i32, i32* %incdec.ptr, align 4 %cmp = icmp slt i32 %0, %wsize %sub = sub nsw i32 %0, %wsize %cond = select i1 %cmp, i32 0, i32 %sub diff --git a/test/Transforms/LoopVectorize/calloc.ll b/test/Transforms/LoopVectorize/calloc.ll index 5f441f3..a41e517 100644 --- a/test/Transforms/LoopVectorize/calloc.ll +++ b/test/Transforms/LoopVectorize/calloc.ll @@ -22,8 +22,8 @@ for.body.lr.ph: ; preds = %entry for.body: ; preds = %for.body, %for.body.lr.ph %i.030 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %shr = lshr i64 %i.030, 1 - %arrayidx = getelementptr inbounds i8* %bytes, i64 %shr - %1 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %bytes, i64 %shr + %1 = load i8, i8* %arrayidx, align 1 %conv = zext i8 %1 to i32 %and = shl i64 %i.030, 2 %neg = and i64 %and, 4 @@ -37,7 +37,7 @@ for.body: ; preds = %for.body, %for.body %cond = select i1 %cmp15, i32 87, i32 48 %add17 = add nsw i32 %cond, %shr11 %conv18 = trunc i32 %add17 to i8 - %arrayidx19 = getelementptr inbounds i8* %call, i64 %i.030 + %arrayidx19 = getelementptr inbounds i8, i8* %call, i64 %i.030 store i8 %conv18, i8* %arrayidx19, align 1 %inc = add i64 %i.030, 1 %exitcond = icmp eq i64 %inc, %0 diff --git a/test/Transforms/LoopVectorize/cast-induction.ll b/test/Transforms/LoopVectorize/cast-induction.ll index 4f92d33..fae8997 100644 --- a/test/Transforms/LoopVectorize/cast-induction.ll +++ b/test/Transforms/LoopVectorize/cast-induction.ll @@ -16,7 +16,7 @@ define void @example12() nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv %3 = trunc i64 %indvars.iv to i32 store i32 %3, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/conditional-assignment.ll b/test/Transforms/LoopVectorize/conditional-assignment.ll index 38e9c4f..178a0e5 100644 --- a/test/Transforms/LoopVectorize/conditional-assignment.ll +++ b/test/Transforms/LoopVectorize/conditional-assignment.ll @@ -12,8 +12,8 @@ entry: for.body: ; preds = %for.inc, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] - %arrayidx = getelementptr inbounds i32* %indices, i64 %indvars.iv, !dbg !12 - %0 = load i32* %arrayidx, align 4, !dbg !12, !tbaa !14 + %arrayidx = getelementptr inbounds i32, i32* %indices, i64 %indvars.iv, !dbg !12 + %0 = load i32, i32* %arrayidx, align 4, !dbg !12, !tbaa !14 %cmp1 = icmp eq i32 %0, 1024, !dbg !12 br i1 %cmp1, label %if.then, label %for.inc, !dbg !12 @@ -36,20 +36,20 @@ attributes #0 = { nounwind } !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\0012\00clang version 3.6.0\001\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] -!1 = !{!"source.c", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "source.c", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00conditional_store\00conditional_store\00\001\000\001\000\006\00256\001\001", !1, !5, !6, null, void (i32*)* @conditional_store, null, null, !2} ; [ DW_TAG_subprogram ] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] +!4 = !MDSubprogram(name: "conditional_store", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32*)* @conditional_store, variables: !2) +!5 = !MDFile(filename: "source.c", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 2} -!8 = !{i32 2, !"Debug Info Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.6.0"} !10 = !MDLocation(line: 2, column: 8, scope: !11) -!11 = !{!"0xb\002\003\000", !1, !4} ; [ DW_TAG_lexical_block ] +!11 = distinct !MDLexicalBlock(line: 2, column: 3, file: !1, scope: !4) !12 = !MDLocation(line: 3, column: 9, scope: !13) -!13 = !{!"0xb\003\009\000", !1, !11} ; [ DW_TAG_lexical_block ] +!13 = distinct !MDLexicalBlock(line: 3, column: 9, file: !1, scope: !11) !14 = !{!15, !15, i64 0} !15 = !{!"int", !16, i64 0} !16 = !{!"omnipotent char", !17, i64 0} diff --git a/test/Transforms/LoopVectorize/control-flow.ll b/test/Transforms/LoopVectorize/control-flow.ll index 1882c3f..ae0e6c6 100644 --- a/test/Transforms/LoopVectorize/control-flow.ll +++ b/test/Transforms/LoopVectorize/control-flow.ll @@ -30,8 +30,8 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %if.else %indvars.iv = phi i64 [ %indvars.iv.next, %if.else ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv, !dbg !12 - %0 = load i32* %arrayidx, align 4, !dbg !12, !tbaa !15 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv, !dbg !12 + %0 = load i32, i32* %arrayidx, align 4, !dbg !12, !tbaa !15 %cmp1 = icmp sgt i32 %0, 10, !dbg !12 br i1 %cmp1, label %end.loopexit, label %if.else, !dbg !12 @@ -55,21 +55,21 @@ attributes #0 = { nounwind } !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\004\00clang version 3.5.0\001\00\006\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./source.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"source.cpp", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0", isOptimized: true, runtimeVersion: 6, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "source.cpp", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00test\00test\00\001\000\001\000\006\00256\001\002", !1, !5, !6, null, i32 (i32*, i32)* @_Z4testPii, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [scope 2] [test] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./source.cpp] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "test", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 (i32*, i32)* @_Z4testPii, variables: !2) +!5 = !MDFile(filename: "source.cpp", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 2} -!8 = !{i32 2, !"Debug Info Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5.0"} !10 = !MDLocation(line: 3, column: 8, scope: !11) -!11 = !{!"0xb\003\003\000", !1, !4} ; [ DW_TAG_lexical_block ] +!11 = distinct !MDLexicalBlock(line: 3, column: 3, file: !1, scope: !4) !12 = !MDLocation(line: 5, column: 9, scope: !13) -!13 = !{!"0xb\005\009\000", !1, !14} ; [ DW_TAG_lexical_block ] -!14 = !{!"0xb\004\003\000", !1, !11} ; [ DW_TAG_lexical_block ] +!13 = distinct !MDLexicalBlock(line: 5, column: 9, file: !1, scope: !14) +!14 = distinct !MDLexicalBlock(line: 4, column: 3, file: !1, scope: !11) !15 = !{!16, !16, i64 0} !16 = !{!"int", !17, i64 0} !17 = !{!"omnipotent char", !18, i64 0} diff --git a/test/Transforms/LoopVectorize/cpp-new-array.ll b/test/Transforms/LoopVectorize/cpp-new-array.ll index f32f610..22896d3 100644 --- a/test/Transforms/LoopVectorize/cpp-new-array.ll +++ b/test/Transforms/LoopVectorize/cpp-new-array.ll @@ -24,21 +24,21 @@ entry: for.body: ; preds = %entry, %for.body %i.01 = phi i32 [ 0, %entry ], [ %inc, %for.body ] %idxprom = sext i32 %i.01 to i64 - %arrayidx = getelementptr inbounds float* %0, i64 %idxprom - %3 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %0, i64 %idxprom + %3 = load float, float* %arrayidx, align 4 %idxprom5 = sext i32 %i.01 to i64 - %arrayidx6 = getelementptr inbounds float* %1, i64 %idxprom5 - %4 = load float* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds float, float* %1, i64 %idxprom5 + %4 = load float, float* %arrayidx6, align 4 %add = fadd float %3, %4 %idxprom7 = sext i32 %i.01 to i64 - %arrayidx8 = getelementptr inbounds float* %2, i64 %idxprom7 + %arrayidx8 = getelementptr inbounds float, float* %2, i64 %idxprom7 store float %add, float* %arrayidx8, align 4 %inc = add nsw i32 %i.01, 1 %cmp = icmp slt i32 %inc, 1000 br i1 %cmp, label %for.body, label %for.end for.end: ; preds = %for.body - %5 = load float* %2, align 4 + %5 = load float, float* %2, align 4 %conv10 = fptosi float %5 to i32 ret i32 %conv10 } diff --git a/test/Transforms/LoopVectorize/dbg.value.ll b/test/Transforms/LoopVectorize/dbg.value.ll index 92d3154..f942ecc 100644 --- a/test/Transforms/LoopVectorize/dbg.value.ll +++ b/test/Transforms/LoopVectorize/dbg.value.ll @@ -11,21 +11,21 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK-LABEL: @test( define i32 @test() #0 { entry: - tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !9, metadata !{}), !dbg !18 + tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !9, metadata !MDExpression()), !dbg !18 br label %for.body, !dbg !18 for.body: ;CHECK: load <4 x i32> %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @B, i64 0, i64 %indvars.iv, !dbg !19 - %0 = load i32* %arrayidx, align 4, !dbg !19 - %arrayidx2 = getelementptr inbounds [1024 x i32]* @C, i64 0, i64 %indvars.iv, !dbg !19 - %1 = load i32* %arrayidx2, align 4, !dbg !19 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvars.iv, !dbg !19 + %0 = load i32, i32* %arrayidx, align 4, !dbg !19 + %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32]* @C, i64 0, i64 %indvars.iv, !dbg !19 + %1 = load i32, i32* %arrayidx2, align 4, !dbg !19 %add = add nsw i32 %1, %0, !dbg !19 - %arrayidx4 = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv, !dbg !19 + %arrayidx4 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv, !dbg !19 store i32 %add, i32* %arrayidx4, align 4, !dbg !19 %indvars.iv.next = add i64 %indvars.iv, 1, !dbg !18 - tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !9, metadata !{}), !dbg !18 + tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !9, metadata !MDExpression()), !dbg !18 %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !18 %exitcond = icmp ne i32 %lftr.wideiv, 1024, !dbg !18 br i1 %exitcond, label %for.body, label %for.end, !dbg !18 @@ -44,27 +44,27 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!26} -!0 = !{!"0x11\004\00clang\001\00\000\00\000", !25, !1, !1, !2, !11, null} ; [ DW_TAG_compile_unit ] +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang", isOptimized: true, emissionKind: 0, file: !25, enums: !1, retainedTypes: !1, subprograms: !2, globals: !11) !1 = !{i32 0} !2 = !{!3} -!3 = !{!"0x2e\00test\00test\00test\005\000\001\000\006\00256\001\005", !25, !4, !5, null, i32 ()* @test, null, null, !8} ; [ DW_TAG_subprogram ] -!4 = !{!"0x29", !25} ; [ DW_TAG_file_type ] -!5 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !6, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!3 = !MDSubprogram(name: "test", linkageName: "test", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !25, scope: !4, type: !5, function: i32 ()* @test, variables: !8) +!4 = !MDFile(filename: "test", directory: "/path/to/somewhere") +!5 = !MDSubroutineType(types: !6) !6 = !{!7} -!7 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] +!7 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !{!9} -!9 = !{!"0x100\00i\006\000", !10, !4, !7} ; [ DW_TAG_auto_variable ] -!10 = !{!"0xb\006\000\000", !25, !3} ; [ DW_TAG_lexical_block ] +!9 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 6, scope: !10, file: !4, type: !7) +!10 = distinct !MDLexicalBlock(line: 6, column: 0, file: !25, scope: !3) !11 = !{!12, !16, !17} -!12 = !{!"0x34\00A\00A\00\001\000\001", null, !4, !13, [1024 x i32]* @A, null} ; [ DW_TAG_variable ] -!13 = !{!"0x1\00\000\0032768\0032\000\000", null, null, !7, !14, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 32768, align 32, offset 0] [from int] +!12 = !MDGlobalVariable(name: "A", line: 1, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13, variable: [1024 x i32]* @A) +!13 = !MDCompositeType(tag: DW_TAG_array_type, size: 32768, align: 32, baseType: !7, elements: !14) !14 = !{!15} !15 = !{i32 786465, i64 0, i64 1024} -!16 = !{!"0x34\00B\00B\00\002\000\001", null, !4, !13, [1024 x i32]* @B, null} ; [ DW_TAG_variable ] -!17 = !{!"0x34\00C\00C\00\003\000\001", null, !4, !13, [1024 x i32]* @C, null} ; [ DW_TAG_variable ] +!16 = !MDGlobalVariable(name: "B", line: 2, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13, variable: [1024 x i32]* @B) +!17 = !MDGlobalVariable(name: "C", line: 3, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13, variable: [1024 x i32]* @C) !18 = !MDLocation(line: 6, scope: !10) !19 = !MDLocation(line: 7, scope: !20) -!20 = !{!"0xb\006\000\001", !25, !10} ; [ DW_TAG_lexical_block ] +!20 = distinct !MDLexicalBlock(line: 6, column: 0, file: !25, scope: !10) !24 = !MDLocation(line: 9, scope: !3) -!25 = !{!"test", !"/path/to/somewhere"} -!26 = !{i32 1, !"Debug Info Version", i32 2} +!25 = !MDFile(filename: "test", directory: "/path/to/somewhere") +!26 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/LoopVectorize/debugloc.ll b/test/Transforms/LoopVectorize/debugloc.ll index 634bf79..97d9da0 100644 --- a/test/Transforms/LoopVectorize/debugloc.ll +++ b/test/Transforms/LoopVectorize/debugloc.ll @@ -8,8 +8,8 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 ; CHECK: cmp.zero = icmp eq i64 {{.*}}, 0, !dbg ![[LOC:[0-9]+]] ; CHECK: vector.body ; CHECK: index {{.*}}, !dbg ![[LOC]] -; CHECK: getelementptr inbounds i32* %a, {{.*}}, !dbg ![[LOC2:[0-9]+]] -; CHECK: load <2 x i32>* {{.*}}, !dbg ![[LOC2]] +; CHECK: getelementptr inbounds i32, i32* %a, {{.*}}, !dbg ![[LOC2:[0-9]+]] +; CHECK: load <2 x i32>, <2 x i32>* {{.*}}, !dbg ![[LOC2]] ; CHECK: add <2 x i32> {{.*}}, !dbg ![[LOC2]] ; CHECK: add i64 %index, 2, !dbg ![[LOC]] ; CHECK: icmp eq i64 %index.next, %end.idx.rnd.down, !dbg ![[LOC]] @@ -19,10 +19,10 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define i32 @f(i32* nocapture %a, i32 %size) #0 { entry: - tail call void @llvm.dbg.value(metadata i32* %a, i64 0, metadata !13, metadata !{}), !dbg !19 - tail call void @llvm.dbg.value(metadata i32 %size, i64 0, metadata !14, metadata !{}), !dbg !19 - tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !15, metadata !{}), !dbg !20 - tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !{}), !dbg !21 + tail call void @llvm.dbg.value(metadata i32* %a, i64 0, metadata !13, metadata !MDExpression()), !dbg !19 + tail call void @llvm.dbg.value(metadata i32 %size, i64 0, metadata !14, metadata !MDExpression()), !dbg !19 + tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !15, metadata !MDExpression()), !dbg !20 + tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !MDExpression()), !dbg !21 %cmp4 = icmp eq i32 %size, 0, !dbg !21 br i1 %cmp4, label %for.end, label %for.body.lr.ph, !dbg !21 @@ -32,12 +32,12 @@ for.body.lr.ph: ; preds = %entry for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %sum.05 = phi i32 [ 0, %for.body.lr.ph ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv, !dbg !22 - %0 = load i32* %arrayidx, align 4, !dbg !22 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv, !dbg !22 + %0 = load i32, i32* %arrayidx, align 4, !dbg !22 %add = add i32 %0, %sum.05, !dbg !22 - tail call void @llvm.dbg.value(metadata i32 %add.lcssa, i64 0, metadata !15, metadata !{}), !dbg !22 + tail call void @llvm.dbg.value(metadata i32 %add.lcssa, i64 0, metadata !15, metadata !MDExpression()), !dbg !22 %indvars.iv.next = add i64 %indvars.iv, 1, !dbg !21 - tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !16, metadata !{}), !dbg !21 + tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !16, metadata !MDExpression()), !dbg !21 %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !21 %exitcond = icmp ne i32 %lftr.wideiv, %size, !dbg !21 br i1 %exitcond, label %for.body, label %for.cond.for.end_crit_edge, !dbg !21 @@ -63,28 +63,28 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!18, !27} -!0 = !{!"0x11\0012\00clang version 3.4 (trunk 185038) (llvm/trunk 185097)\001\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/Volumes/Data/backedup/dev/os/llvm/debug/-] [DW_LANG_C99] -!1 = !{!"-", !"/Volumes/Data/backedup/dev/os/llvm/debug"} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 185038) (llvm/trunk 185097)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "-", directory: "/Volumes/Data/backedup/dev/os/llvm/debug") !2 = !{i32 0} !3 = !{!4} -!4 = !{!"0x2e\00f\00f\00\003\000\001\000\006\00256\001\003", !5, !6, !7, null, i32 (i32*, i32)* @f, null, null, !12} ; [ DW_TAG_subprogram ] [line 3] [def] [f] -!5 = !{!"<stdin>", !"/Volumes/Data/backedup/dev/os/llvm/debug"} -!6 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [/Volumes/Data/backedup/dev/os/llvm/debug/<stdin>] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, function: i32 (i32*, i32)* @f, variables: !12) +!5 = !MDFile(filename: "<stdin>", directory: "/Volumes/Data/backedup/dev/os/llvm/debug") +!6 = !MDFile(filename: "<stdin>", directory: "/Volumes/Data/backedup/dev/os/llvm/debug") +!7 = !MDSubroutineType(types: !8) !8 = !{!9, !10, !11} -!9 = !{!"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] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !9} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from int] -!11 = !{!"0x24\00unsigned int\000\0032\0032\000\000\007", null, null} ; [ DW_TAG_base_type ] [unsigned int] [line 0, size 32, align 32, offset 0, enc DW_ATE_unsigned] +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9) +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) !12 = !{!13, !14, !15, !16} -!13 = !{!"0x101\00a\0016777219\000", !4, !6, !10} ; [ DW_TAG_arg_variable ] [a] [line 3] -!14 = !{!"0x101\00size\0033554435\000", !4, !6, !11} ; [ DW_TAG_arg_variable ] [size] [line 3] -!15 = !{!"0x100\00sum\004\000", !4, !6, !11} ; [ DW_TAG_auto_variable ] [sum] [line 4] -!16 = !{!"0x100\00i\005\000", !17, !6, !11} ; [ DW_TAG_auto_variable ] [i] [line 5] -!17 = !{!"0xb\005\000\000", !5, !4} ; [ DW_TAG_lexical_block ] [/Volumes/Data/backedup/dev/os/llvm/debug/<stdin>] +!13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !4, file: !6, type: !10) +!14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "size", line: 3, arg: 2, scope: !4, file: !6, type: !11) +!15 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "sum", line: 4, scope: !4, file: !6, type: !11) +!16 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 5, scope: !17, file: !6, type: !11) +!17 = distinct !MDLexicalBlock(line: 5, column: 0, file: !5, scope: !4) !18 = !{i32 2, !"Dwarf Version", i32 3} !19 = !MDLocation(line: 3, scope: !4) !20 = !MDLocation(line: 4, scope: !4) !21 = !MDLocation(line: 5, scope: !17) !22 = !MDLocation(line: 6, scope: !17) !26 = !MDLocation(line: 7, scope: !4) -!27 = !{i32 1, !"Debug Info Version", i32 2} +!27 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/LoopVectorize/duplicated-metadata.ll b/test/Transforms/LoopVectorize/duplicated-metadata.ll index bf2f899..9f7cdef 100644 --- a/test/Transforms/LoopVectorize/duplicated-metadata.ll +++ b/test/Transforms/LoopVectorize/duplicated-metadata.ll @@ -12,8 +12,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %a, i64 %indvars.iv - %p = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 %indvars.iv + %p = load float, float* %arrayidx, align 4 %mul = fmul float %p, 2.000000e+00 store float %mul, float* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/ee-crash.ll b/test/Transforms/LoopVectorize/ee-crash.ll index a3c0bb8..0c38734 100644 --- a/test/Transforms/LoopVectorize/ee-crash.ll +++ b/test/Transforms/LoopVectorize/ee-crash.ll @@ -11,18 +11,18 @@ target triple = "x86_64-apple-macosx10.8.0" define i32 @_Z4foo1Pii(i32* %A, i32 %n, <2 x i32> %q) #0 { entry: %idx.ext = sext i32 %n to i64 - %add.ptr = getelementptr inbounds i32* %A, i64 %idx.ext + %add.ptr = getelementptr inbounds i32, i32* %A, i64 %idx.ext %cmp3.i = icmp eq i32 %n, 0 br i1 %cmp3.i, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %for.body.i for.body.i: ; preds = %entry, %for.body.i %__init.addr.05.i = phi i32 [ %add.i, %for.body.i ], [ 0, %entry ] %__first.addr.04.i = phi i32* [ %incdec.ptr.i, %for.body.i ], [ %A, %entry ] - %0 = load i32* %__first.addr.04.i, align 4 + %0 = load i32, i32* %__first.addr.04.i, align 4 %q1 = extractelement <2 x i32> %q, i32 %n %q2 = add nsw i32 %0, %q1 %add.i = add nsw i32 %q2, %__init.addr.05.i - %incdec.ptr.i = getelementptr inbounds i32* %__first.addr.04.i, i64 1 + %incdec.ptr.i = getelementptr inbounds i32, i32* %__first.addr.04.i, i64 1 %cmp.i = icmp eq i32* %incdec.ptr.i, %add.ptr br i1 %cmp.i, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %for.body.i diff --git a/test/Transforms/LoopVectorize/exact.ll b/test/Transforms/LoopVectorize/exact.ll index 0a8fbf3..0a4e0dc 100644 --- a/test/Transforms/LoopVectorize/exact.ll +++ b/test/Transforms/LoopVectorize/exact.ll @@ -11,8 +11,8 @@ entry: for.body: %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %x, i64 %iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %x, i64 %iv + %0 = load i32, i32* %arrayidx, align 4 %conv1 = lshr exact i32 %0, 1 store i32 %conv1, i32* %arrayidx, align 4 %iv.next = add nuw nsw i64 %iv, 1 diff --git a/test/Transforms/LoopVectorize/flags.ll b/test/Transforms/LoopVectorize/flags.ll index 0fc55c8..fcbc874 100644 --- a/test/Transforms/LoopVectorize/flags.ll +++ b/test/Transforms/LoopVectorize/flags.ll @@ -14,8 +14,8 @@ define i32 @flags1(i32 %n, i32* nocapture %A) nounwind uwtable ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 9, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = mul nsw i32 %3, 3 store i32 %4, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -39,8 +39,8 @@ define i32 @flags2(i32 %n, i32* nocapture %A) nounwind uwtable ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 9, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = mul i32 %3, 3 store i32 %4, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -66,8 +66,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %q.04 = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds float* %s, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %s, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %add = fadd fast float %q.04, %0 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 256 diff --git a/test/Transforms/LoopVectorize/float-reduction.ll b/test/Transforms/LoopVectorize/float-reduction.ll index 0f064ee..1310b27 100644 --- a/test/Transforms/LoopVectorize/float-reduction.ll +++ b/test/Transforms/LoopVectorize/float-reduction.ll @@ -12,8 +12,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %sum.04 = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds float* %A, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %add = fadd fast float %sum.04, %0 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -34,8 +34,8 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %sum.04 = phi float [ 0.000000e+00, %entry ], [ %sub, %for.body ] - %arrayidx = getelementptr inbounds float* %A, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %sub = fsub fast float %sum.04, %0 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/funcall.ll b/test/Transforms/LoopVectorize/funcall.ll index e03534f..35c2dfc 100644 --- a/test/Transforms/LoopVectorize/funcall.ll +++ b/test/Transforms/LoopVectorize/funcall.ll @@ -16,8 +16,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds double* %d, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %d, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %1 = tail call double @llvm.pow.f64(double %0, double %t) store double %1, double* %arrayidx, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/gcc-examples.ll b/test/Transforms/LoopVectorize/gcc-examples.ll index 6a2c2c6..1880901 100644 --- a/test/Transforms/LoopVectorize/gcc-examples.ll +++ b/test/Transforms/LoopVectorize/gcc-examples.ll @@ -44,12 +44,12 @@ define void @example1() nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %6, i32* %7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -84,7 +84,7 @@ define void @example2(i32 %n, i32 %x) nounwind uwtable ssp { .lr.ph5: ; preds = %0, %.lr.ph5 %indvars.iv6 = phi i64 [ %indvars.iv.next7, %.lr.ph5 ], [ 0, %0 ] - %3 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv6 + %3 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv6 store i32 %x, i32* %3, align 4 %indvars.iv.next7 = add i64 %indvars.iv6, 1 %lftr.wideiv = trunc i64 %indvars.iv.next7 to i32 @@ -95,12 +95,12 @@ define void @example2(i32 %n, i32 %x) nounwind uwtable ssp { %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %i.0.lcssa, %.preheader ] %.02 = phi i32 [ %4, %.lr.ph ], [ %n, %.preheader ] %4 = add nsw i32 %.02, -1 - %5 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %6 = load i32* %5, align 4 - %7 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %8 = load i32* %7, align 4 + %5 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %6 = load i32, i32* %5, align 4 + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %8 = load i32, i32* %7, align 4 %9 = and i32 %8, %6 - %10 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %10 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %9, i32* %10, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %11 = icmp eq i32 %4, 0 @@ -128,9 +128,9 @@ define void @example3(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture %.014 = phi i32* [ %5, %.lr.ph ], [ %p, %0 ] %.023 = phi i32* [ %3, %.lr.ph ], [ %q, %0 ] %2 = add nsw i32 %.05, -1 - %3 = getelementptr inbounds i32* %.023, i64 1 - %4 = load i32* %.023, align 16 - %5 = getelementptr inbounds i32* %.014, i64 1 + %3 = getelementptr inbounds i32, i32* %.023, i64 1 + %4 = load i32, i32* %.023, align 16 + %5 = getelementptr inbounds i32, i32* %.014, i64 1 store i32 %4, i32* %.014, align 16 %6 = icmp eq i32 %2, 0 br i1 %6, label %._crit_edge, label %.lr.ph @@ -161,10 +161,10 @@ define void @example4(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture %4 = phi i32 [ %9, %.lr.ph10 ], [ %1, %0 ] %.018 = phi i32* [ %8, %.lr.ph10 ], [ %p, %0 ] %.027 = phi i32* [ %5, %.lr.ph10 ], [ %q, %0 ] - %5 = getelementptr inbounds i32* %.027, i64 1 - %6 = load i32* %.027, align 16 + %5 = getelementptr inbounds i32, i32* %.027, i64 1 + %6 = load i32, i32* %.027, align 16 %7 = add nsw i32 %6, 5 - %8 = getelementptr inbounds i32* %.018, i64 1 + %8 = getelementptr inbounds i32, i32* %.018, i64 1 store i32 %7, i32* %.018, align 16 %9 = add nsw i32 %4, -1 %10 = icmp eq i32 %4, 0 @@ -176,13 +176,13 @@ define void @example4(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture .lr.ph6: ; preds = %.preheader4, %.lr.ph6 %indvars.iv11 = phi i64 [ %indvars.iv.next12, %.lr.ph6 ], [ 0, %.preheader4 ] %indvars.iv.next12 = add i64 %indvars.iv11, 1 - %11 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv.next12 - %12 = load i32* %11, align 4 + %11 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv.next12 + %12 = load i32, i32* %11, align 4 %13 = add nsw i64 %indvars.iv11, 3 - %14 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %13 - %15 = load i32* %14, align 4 + %14 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %13 + %15 = load i32, i32* %14, align 4 %16 = add nsw i32 %15, %12 - %17 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv11 + %17 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv11 store i32 %16, i32* %17, align 4 %lftr.wideiv13 = trunc i64 %indvars.iv.next12 to i32 %exitcond14 = icmp eq i32 %lftr.wideiv13, %1 @@ -190,11 +190,11 @@ define void @example4(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture .lr.ph: ; preds = %.preheader, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ] - %18 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv - %19 = load i32* %18, align 4 + %18 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv + %19 = load i32, i32* %18, align 4 %20 = icmp sgt i32 %19, 4 %21 = select i1 %20, i32 4, i32 0 - %22 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv + %22 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv store i32 %21, i32* %22, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -223,7 +223,7 @@ define void @example8(i32 %x) nounwind uwtable ssp { ; <label>:1 ; preds = %1, %.preheader %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [32 x [1024 x i32]]* @G, i64 0, i64 %indvars.iv3, i64 %indvars.iv + %2 = getelementptr inbounds [32 x [1024 x i32]], [32 x [1024 x i32]]* @G, i64 0, i64 %indvars.iv3, i64 %indvars.iv store i32 %x, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -249,10 +249,10 @@ define i32 @example9() nounwind uwtable readonly ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] %diff.01 = phi i32 [ 0, %0 ], [ %7, %1 ] - %2 = getelementptr inbounds [1024 x i32]* @ub, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [1024 x i32]* @uc, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [1024 x i32], [1024 x i32]* @ub, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [1024 x i32], [1024 x i32]* @uc, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add i32 %3, %diff.01 %7 = sub i32 %6, %5 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -276,19 +276,19 @@ define void @example10a(i16* noalias nocapture %sa, i16* noalias nocapture %sb, ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds i32* %ib, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds i32* %ic, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds i32, i32* %ib, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds i32, i32* %ic, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds i32* %ia, i64 %indvars.iv + %7 = getelementptr inbounds i32, i32* %ia, i64 %indvars.iv store i32 %6, i32* %7, align 4 - %8 = getelementptr inbounds i16* %sb, i64 %indvars.iv - %9 = load i16* %8, align 2 - %10 = getelementptr inbounds i16* %sc, i64 %indvars.iv - %11 = load i16* %10, align 2 + %8 = getelementptr inbounds i16, i16* %sb, i64 %indvars.iv + %9 = load i16, i16* %8, align 2 + %10 = getelementptr inbounds i16, i16* %sc, i64 %indvars.iv + %11 = load i16, i16* %10, align 2 %12 = add i16 %11, %9 - %13 = getelementptr inbounds i16* %sa, i64 %indvars.iv + %13 = getelementptr inbounds i16, i16* %sa, i64 %indvars.iv store i16 %12, i16* %13, align 2 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -309,10 +309,10 @@ define void @example10b(i16* noalias nocapture %sa, i16* noalias nocapture %sb, ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds i16* %sb, i64 %indvars.iv - %3 = load i16* %2, align 2 + %2 = getelementptr inbounds i16, i16* %sb, i64 %indvars.iv + %3 = load i16, i16* %2, align 2 %4 = sext i16 %3 to i32 - %5 = getelementptr inbounds i32* %ia, i64 %indvars.iv + %5 = getelementptr inbounds i32, i32* %ia, i64 %indvars.iv store i32 %4, i32* %5, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -340,23 +340,23 @@ define void @example11() nounwind uwtable ssp { %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] %2 = shl nsw i64 %indvars.iv, 1 %3 = or i64 %2, 1 - %4 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %3 - %5 = load i32* %4, align 4 - %6 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %3 - %7 = load i32* %6, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %3 + %5 = load i32, i32* %4, align 4 + %6 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %3 + %7 = load i32, i32* %6, align 4 %8 = mul nsw i32 %7, %5 - %9 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %2 - %10 = load i32* %9, align 8 - %11 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %2 - %12 = load i32* %11, align 8 + %9 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %2 + %10 = load i32, i32* %9, align 8 + %11 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %2 + %12 = load i32, i32* %11, align 8 %13 = mul nsw i32 %12, %10 %14 = sub nsw i32 %8, %13 - %15 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %15 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %14, i32* %15, align 4 %16 = mul nsw i32 %7, %10 %17 = mul nsw i32 %12, %5 %18 = add nsw i32 %17, %16 - %19 = getelementptr inbounds [2048 x i32]* @d, i64 0, i64 %indvars.iv + %19 = getelementptr inbounds [2048 x i32], [2048 x i32]* @d, i64 0, i64 %indvars.iv store i32 %18, i32* %19, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -376,7 +376,7 @@ define void @example12() nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv %3 = trunc i64 %indvars.iv to i32 store i32 %3, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -396,19 +396,19 @@ define void @example13(i32** nocapture %A, i32** nocapture %B, i32* nocapture %o .preheader: ; preds = %14, %0 %indvars.iv4 = phi i64 [ 0, %0 ], [ %indvars.iv.next5, %14 ] - %1 = getelementptr inbounds i32** %A, i64 %indvars.iv4 - %2 = load i32** %1, align 8 - %3 = getelementptr inbounds i32** %B, i64 %indvars.iv4 - %4 = load i32** %3, align 8 + %1 = getelementptr inbounds i32*, i32** %A, i64 %indvars.iv4 + %2 = load i32*, i32** %1, align 8 + %3 = getelementptr inbounds i32*, i32** %B, i64 %indvars.iv4 + %4 = load i32*, i32** %3, align 8 br label %5 ; <label>:5 ; preds = %.preheader, %5 %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %5 ] %diff.02 = phi i32 [ 0, %.preheader ], [ %11, %5 ] - %6 = getelementptr inbounds i32* %2, i64 %indvars.iv - %7 = load i32* %6, align 4 - %8 = getelementptr inbounds i32* %4, i64 %indvars.iv - %9 = load i32* %8, align 4 + %6 = getelementptr inbounds i32, i32* %2, i64 %indvars.iv + %7 = load i32, i32* %6, align 4 + %8 = getelementptr inbounds i32, i32* %4, i64 %indvars.iv + %9 = load i32, i32* %8, align 4 %10 = add i32 %7, %diff.02 %11 = sub i32 %10, %9 %indvars.iv.next = add i64 %indvars.iv, 8 @@ -417,7 +417,7 @@ define void @example13(i32** nocapture %A, i32** nocapture %B, i32* nocapture %o br i1 %13, label %5, label %14 ; <label>:14 ; preds = %5 - %15 = getelementptr inbounds i32* %out, i64 %indvars.iv4 + %15 = getelementptr inbounds i32, i32* %out, i64 %indvars.iv4 store i32 %11, i32* %15, align 4 %indvars.iv.next5 = add i64 %indvars.iv4, 1 %lftr.wideiv = trunc i64 %indvars.iv.next5 to i32 @@ -444,14 +444,14 @@ define void @example14(i32** nocapture %in, i32** nocapture %coeff, i32* nocaptu ; <label>:0 ; preds = %0, %.preheader %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %0 ] %sum.12 = phi i32 [ %sum.05, %.preheader ], [ %10, %0 ] - %1 = getelementptr inbounds i32** %in, i64 %indvars.iv - %2 = load i32** %1, align 8 - %3 = getelementptr inbounds i32* %2, i64 %indvars.iv7 - %4 = load i32* %3, align 4 - %5 = getelementptr inbounds i32** %coeff, i64 %indvars.iv - %6 = load i32** %5, align 8 - %7 = getelementptr inbounds i32* %6, i64 %indvars.iv7 - %8 = load i32* %7, align 4 + %1 = getelementptr inbounds i32*, i32** %in, i64 %indvars.iv + %2 = load i32*, i32** %1, align 8 + %3 = getelementptr inbounds i32, i32* %2, i64 %indvars.iv7 + %4 = load i32, i32* %3, align 4 + %5 = getelementptr inbounds i32*, i32** %coeff, i64 %indvars.iv + %6 = load i32*, i32** %5, align 8 + %7 = getelementptr inbounds i32, i32* %6, i64 %indvars.iv7 + %8 = load i32, i32* %7, align 4 %9 = mul nsw i32 %8, %4 %10 = add nsw i32 %9, %sum.12 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -478,14 +478,14 @@ define void @example14(i32** nocapture %in, i32** nocapture %coeff, i32* nocaptu %indvars.iv.1 = phi i64 [ 0, %.preheader.1 ], [ %13, %12 ] %sum.12.1 = phi i32 [ %sum.05.1, %.preheader.1 ], [ %23, %12 ] %13 = add nsw i64 %indvars.iv.1, 1 - %14 = getelementptr inbounds i32** %in, i64 %13 - %15 = load i32** %14, align 8 - %16 = getelementptr inbounds i32* %15, i64 %indvars.iv7.1 - %17 = load i32* %16, align 4 - %18 = getelementptr inbounds i32** %coeff, i64 %indvars.iv.1 - %19 = load i32** %18, align 8 - %20 = getelementptr inbounds i32* %19, i64 %indvars.iv7.1 - %21 = load i32* %20, align 4 + %14 = getelementptr inbounds i32*, i32** %in, i64 %13 + %15 = load i32*, i32** %14, align 8 + %16 = getelementptr inbounds i32, i32* %15, i64 %indvars.iv7.1 + %17 = load i32, i32* %16, align 4 + %18 = getelementptr inbounds i32*, i32** %coeff, i64 %indvars.iv.1 + %19 = load i32*, i32** %18, align 8 + %20 = getelementptr inbounds i32, i32* %19, i64 %indvars.iv7.1 + %21 = load i32, i32* %20, align 4 %22 = mul nsw i32 %21, %17 %23 = add nsw i32 %22, %sum.12.1 %lftr.wideiv.1 = trunc i64 %13 to i32 @@ -499,7 +499,7 @@ define void @example14(i32** nocapture %in, i32** nocapture %coeff, i32* nocaptu br i1 %exitcond10.1, label %.preheader3.2, label %.preheader.1 .preheader3.2: ; preds = %24 - %25 = getelementptr inbounds i32* %out, i64 1 + %25 = getelementptr inbounds i32, i32* %out, i64 1 store i32 %23, i32* %25, align 4 br label %.preheader.2 @@ -512,14 +512,14 @@ define void @example14(i32** nocapture %in, i32** nocapture %coeff, i32* nocaptu %indvars.iv.2 = phi i64 [ 0, %.preheader.2 ], [ %indvars.iv.next.2, %26 ] %sum.12.2 = phi i32 [ %sum.05.2, %.preheader.2 ], [ %37, %26 ] %27 = add nsw i64 %indvars.iv.2, 2 - %28 = getelementptr inbounds i32** %in, i64 %27 - %29 = load i32** %28, align 8 - %30 = getelementptr inbounds i32* %29, i64 %indvars.iv7.2 - %31 = load i32* %30, align 4 - %32 = getelementptr inbounds i32** %coeff, i64 %indvars.iv.2 - %33 = load i32** %32, align 8 - %34 = getelementptr inbounds i32* %33, i64 %indvars.iv7.2 - %35 = load i32* %34, align 4 + %28 = getelementptr inbounds i32*, i32** %in, i64 %27 + %29 = load i32*, i32** %28, align 8 + %30 = getelementptr inbounds i32, i32* %29, i64 %indvars.iv7.2 + %31 = load i32, i32* %30, align 4 + %32 = getelementptr inbounds i32*, i32** %coeff, i64 %indvars.iv.2 + %33 = load i32*, i32** %32, align 8 + %34 = getelementptr inbounds i32, i32* %33, i64 %indvars.iv7.2 + %35 = load i32, i32* %34, align 4 %36 = mul nsw i32 %35, %31 %37 = add nsw i32 %36, %sum.12.2 %indvars.iv.next.2 = add i64 %indvars.iv.2, 1 @@ -534,7 +534,7 @@ define void @example14(i32** nocapture %in, i32** nocapture %coeff, i32* nocaptu br i1 %exitcond10.2, label %.preheader3.3, label %.preheader.2 .preheader3.3: ; preds = %38 - %39 = getelementptr inbounds i32* %out, i64 2 + %39 = getelementptr inbounds i32, i32* %out, i64 2 store i32 %37, i32* %39, align 4 br label %.preheader.3 @@ -547,14 +547,14 @@ define void @example14(i32** nocapture %in, i32** nocapture %coeff, i32* nocaptu %indvars.iv.3 = phi i64 [ 0, %.preheader.3 ], [ %indvars.iv.next.3, %40 ] %sum.12.3 = phi i32 [ %sum.05.3, %.preheader.3 ], [ %51, %40 ] %41 = add nsw i64 %indvars.iv.3, 3 - %42 = getelementptr inbounds i32** %in, i64 %41 - %43 = load i32** %42, align 8 - %44 = getelementptr inbounds i32* %43, i64 %indvars.iv7.3 - %45 = load i32* %44, align 4 - %46 = getelementptr inbounds i32** %coeff, i64 %indvars.iv.3 - %47 = load i32** %46, align 8 - %48 = getelementptr inbounds i32* %47, i64 %indvars.iv7.3 - %49 = load i32* %48, align 4 + %42 = getelementptr inbounds i32*, i32** %in, i64 %41 + %43 = load i32*, i32** %42, align 8 + %44 = getelementptr inbounds i32, i32* %43, i64 %indvars.iv7.3 + %45 = load i32, i32* %44, align 4 + %46 = getelementptr inbounds i32*, i32** %coeff, i64 %indvars.iv.3 + %47 = load i32*, i32** %46, align 8 + %48 = getelementptr inbounds i32, i32* %47, i64 %indvars.iv7.3 + %49 = load i32, i32* %48, align 4 %50 = mul nsw i32 %49, %45 %51 = add nsw i32 %50, %sum.12.3 %indvars.iv.next.3 = add i64 %indvars.iv.3, 1 @@ -569,7 +569,7 @@ define void @example14(i32** nocapture %in, i32** nocapture %coeff, i32* nocaptu br i1 %exitcond10.3, label %53, label %.preheader.3 ; <label>:53 ; preds = %52 - %54 = getelementptr inbounds i32* %out, i64 3 + %54 = getelementptr inbounds i32, i32* %out, i64 3 store i32 %51, i32* %54, align 4 ret void } @@ -590,8 +590,8 @@ define i32 @example21(i32* nocapture %b, i32 %n) nounwind uwtable readonly ssp { %indvars.iv = phi i64 [ %2, %.lr.ph ], [ %indvars.iv.next, %3 ] %a.02 = phi i32 [ 0, %.lr.ph ], [ %6, %3 ] %indvars.iv.next = add i64 %indvars.iv, -1 - %4 = getelementptr inbounds i32* %b, i64 %indvars.iv.next - %5 = load i32* %4, align 4 + %4 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv.next + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %a.02 %7 = trunc i64 %indvars.iv.next to i32 %8 = icmp sgt i32 %7, 0 @@ -612,11 +612,11 @@ define void @example23(i16* nocapture %src, i32* nocapture %dst) nounwind uwtabl %.04 = phi i16* [ %src, %0 ], [ %2, %1 ] %.013 = phi i32* [ %dst, %0 ], [ %6, %1 ] %i.02 = phi i32 [ 0, %0 ], [ %7, %1 ] - %2 = getelementptr inbounds i16* %.04, i64 1 - %3 = load i16* %.04, align 2 + %2 = getelementptr inbounds i16, i16* %.04, i64 1 + %3 = load i16, i16* %.04, align 2 %4 = zext i16 %3 to i32 %5 = shl nuw nsw i32 %4, 7 - %6 = getelementptr inbounds i32* %.013, i64 1 + %6 = getelementptr inbounds i32, i32* %.013, i64 1 store i32 %5, i32* %.013, align 4 %7 = add nsw i32 %i.02, 1 %exitcond = icmp eq i32 %7, 256 @@ -634,14 +634,14 @@ define void @example24(i16 signext %x, i16 signext %y) nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [1024 x float]* @fa, i64 0, i64 %indvars.iv - %3 = load float* %2, align 4 - %4 = getelementptr inbounds [1024 x float]* @fb, i64 0, i64 %indvars.iv - %5 = load float* %4, align 4 + %2 = getelementptr inbounds [1024 x float], [1024 x float]* @fa, i64 0, i64 %indvars.iv + %3 = load float, float* %2, align 4 + %4 = getelementptr inbounds [1024 x float], [1024 x float]* @fb, i64 0, i64 %indvars.iv + %5 = load float, float* %4, align 4 %6 = fcmp olt float %3, %5 %x.y = select i1 %6, i16 %x, i16 %y %7 = sext i16 %x.y to i32 - %8 = getelementptr inbounds [1024 x i32]* @ic, i64 0, i64 %indvars.iv + %8 = getelementptr inbounds [1024 x i32], [1024 x i32]* @ic, i64 0, i64 %indvars.iv store i32 %7, i32* %8, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -661,19 +661,19 @@ define void @example25() nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [1024 x float]* @da, i64 0, i64 %indvars.iv - %3 = load float* %2, align 4 - %4 = getelementptr inbounds [1024 x float]* @db, i64 0, i64 %indvars.iv - %5 = load float* %4, align 4 + %2 = getelementptr inbounds [1024 x float], [1024 x float]* @da, i64 0, i64 %indvars.iv + %3 = load float, float* %2, align 4 + %4 = getelementptr inbounds [1024 x float], [1024 x float]* @db, i64 0, i64 %indvars.iv + %5 = load float, float* %4, align 4 %6 = fcmp olt float %3, %5 - %7 = getelementptr inbounds [1024 x float]* @dc, i64 0, i64 %indvars.iv - %8 = load float* %7, align 4 - %9 = getelementptr inbounds [1024 x float]* @dd, i64 0, i64 %indvars.iv - %10 = load float* %9, align 4 + %7 = getelementptr inbounds [1024 x float], [1024 x float]* @dc, i64 0, i64 %indvars.iv + %8 = load float, float* %7, align 4 + %9 = getelementptr inbounds [1024 x float], [1024 x float]* @dd, i64 0, i64 %indvars.iv + %10 = load float, float* %9, align 4 %11 = fcmp olt float %8, %10 %12 = and i1 %6, %11 %13 = zext i1 %12 to i32 - %14 = getelementptr inbounds [1024 x i32]* @dj, i64 0, i64 %indvars.iv + %14 = getelementptr inbounds [1024 x i32], [1024 x i32]* @dj, i64 0, i64 %indvars.iv store i32 %13, i32* %14, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/global_alias.ll b/test/Transforms/LoopVectorize/global_alias.ll index 3f11ce8..84fa48c 100644 --- a/test/Transforms/LoopVectorize/global_alias.ll +++ b/test/Transforms/LoopVectorize/global_alias.ll @@ -35,31 +35,31 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %1 = load i32, i32* %i, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 - %arrayidx1 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 + %4 = load i32, i32* %i, align 4 + %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 store i32 %add, i32* %arrayidx1, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx2, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx2, align 4 ret i32 %7 } @@ -83,32 +83,32 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 90 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %add = add nsw i32 %1, 10 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %add - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %add + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add1 = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 - %arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 + %4 = load i32, i32* %i, align 4 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 store i32 %add1, i32* %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx3, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx3, align 4 ret i32 %7 } @@ -132,32 +132,32 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %1 = load i32, i32* %i, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %add1 = add nsw i32 %4, 10 - %arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add1 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add1 store i32 %add, i32* %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx3, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx3, align 4 ret i32 %7 } @@ -184,34 +184,34 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32** @PB, align 4 - %2 = load i32* %i, align 4 - %add.ptr = getelementptr inbounds i32* %1, i32 %2 - %3 = load i32* %add.ptr, align 4 - %4 = load i32* %a.addr, align 4 + %1 = load i32*, i32** @PB, align 4 + %2 = load i32, i32* %i, align 4 + %add.ptr = getelementptr inbounds i32, i32* %1, i32 %2 + %3 = load i32, i32* %add.ptr, align 4 + %4 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %3, %4 - %5 = load i32** @PA, align 4 - %6 = load i32* %i, align 4 - %add.ptr1 = getelementptr inbounds i32* %5, i32 %6 + %5 = load i32*, i32** @PA, align 4 + %6 = load i32, i32* %i, align 4 + %add.ptr1 = getelementptr inbounds i32, i32* %5, i32 %6 store i32 %add, i32* %add.ptr1, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32** @PA, align 4 - %9 = load i32* %a.addr, align 4 - %add.ptr2 = getelementptr inbounds i32* %8, i32 %9 - %10 = load i32* %add.ptr2, align 4 + %8 = load i32*, i32** @PA, align 4 + %9 = load i32, i32* %a.addr, align 4 + %add.ptr2 = getelementptr inbounds i32, i32* %8, i32 %9 + %10 = load i32, i32* %add.ptr2, align 4 ret i32 %10 } @@ -237,37 +237,37 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 - %2 = load i32* %N, align 4 - %arrayidx = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 2), i32 0, i32 %2 - %arrayidx1 = getelementptr inbounds [100 x i32]* %arrayidx, i32 0, i32 %1 - %3 = load i32* %arrayidx1, align 4 - %4 = load i32* %a.addr, align 4 + %1 = load i32, i32* %i, align 4 + %2 = load i32, i32* %N, align 4 + %arrayidx = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 2), i32 0, i32 %2 + %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx, i32 0, i32 %1 + %3 = load i32, i32* %arrayidx1, align 4 + %4 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %3, %4 - %5 = load i32* %i, align 4 - %6 = load i32* %N, align 4 - %arrayidx2 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 - %arrayidx3 = getelementptr inbounds [100 x i32]* %arrayidx2, i32 0, i32 %5 + %5 = load i32, i32* %i, align 4 + %6 = load i32, i32* %N, align 4 + %arrayidx2 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx2, i32 0, i32 %5 store i32 %add, i32* %arrayidx3, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32* %a.addr, align 4 - %9 = load i32* %N, align 4 - %arrayidx4 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 - %arrayidx5 = getelementptr inbounds [100 x i32]* %arrayidx4, i32 0, i32 %8 - %10 = load i32* %arrayidx5, align 4 + %8 = load i32, i32* %a.addr, align 4 + %9 = load i32, i32* %N, align 4 + %arrayidx4 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 + %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx4, i32 0, i32 %8 + %10 = load i32, i32* %arrayidx5, align 4 ret i32 %10 } @@ -293,38 +293,38 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 - %2 = load i32* %N, align 4 + %1 = load i32, i32* %i, align 4 + %2 = load i32, i32* %N, align 4 %add = add nsw i32 %2, 1 - %arrayidx = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %add - %arrayidx1 = getelementptr inbounds [100 x i32]* %arrayidx, i32 0, i32 %1 - %3 = load i32* %arrayidx1, align 4 - %4 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %add + %arrayidx1 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx, i32 0, i32 %1 + %3 = load i32, i32* %arrayidx1, align 4 + %4 = load i32, i32* %a.addr, align 4 %add2 = add nsw i32 %3, %4 - %5 = load i32* %i, align 4 - %6 = load i32* %N, align 4 - %arrayidx3 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 - %arrayidx4 = getelementptr inbounds [100 x i32]* %arrayidx3, i32 0, i32 %5 + %5 = load i32, i32* %i, align 4 + %6 = load i32, i32* %N, align 4 + %arrayidx3 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 + %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx3, i32 0, i32 %5 store i32 %add2, i32* %arrayidx4, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32* %a.addr, align 4 - %9 = load i32* %N, align 4 - %arrayidx5 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 - %arrayidx6 = getelementptr inbounds [100 x i32]* %arrayidx5, i32 0, i32 %8 - %10 = load i32* %arrayidx6, align 4 + %8 = load i32, i32* %a.addr, align 4 + %9 = load i32, i32* %N, align 4 + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 + %arrayidx6 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx5, i32 0, i32 %8 + %10 = load i32, i32* %arrayidx6, align 4 ret i32 %10 } @@ -347,35 +347,35 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 1 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %sub2 = sub nsw i32 100, %4 %sub3 = sub nsw i32 %sub2, 1 - %arrayidx4 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 + %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 store i32 %add, i32* %arrayidx4, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx5 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx5, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx5, align 4 ret i32 %7 } @@ -399,35 +399,35 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 90 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 10 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %sub2 = sub nsw i32 100, %4 %sub3 = sub nsw i32 %sub2, 1 - %arrayidx4 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 + %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 store i32 %add, i32* %arrayidx4, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx5 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx5, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx5, align 4 ret i32 %7 } @@ -451,35 +451,35 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 1 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %sub2 = sub nsw i32 100, %4 %sub3 = sub nsw i32 %sub2, 10 - %arrayidx4 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 + %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 store i32 %add, i32* %arrayidx4, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx5 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx5, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx5, align 4 ret i32 %7 } @@ -506,40 +506,40 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32** @PB, align 4 - %add.ptr = getelementptr inbounds i32* %1, i32 100 - %2 = load i32* %i, align 4 + %1 = load i32*, i32** @PB, align 4 + %add.ptr = getelementptr inbounds i32, i32* %1, i32 100 + %2 = load i32, i32* %i, align 4 %idx.neg = sub i32 0, %2 - %add.ptr1 = getelementptr inbounds i32* %add.ptr, i32 %idx.neg - %add.ptr2 = getelementptr inbounds i32* %add.ptr1, i32 -1 - %3 = load i32* %add.ptr2, align 4 - %4 = load i32* %a.addr, align 4 + %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 %idx.neg + %add.ptr2 = getelementptr inbounds i32, i32* %add.ptr1, i32 -1 + %3 = load i32, i32* %add.ptr2, align 4 + %4 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %3, %4 - %5 = load i32** @PA, align 4 - %add.ptr3 = getelementptr inbounds i32* %5, i32 100 - %6 = load i32* %i, align 4 + %5 = load i32*, i32** @PA, align 4 + %add.ptr3 = getelementptr inbounds i32, i32* %5, i32 100 + %6 = load i32, i32* %i, align 4 %idx.neg4 = sub i32 0, %6 - %add.ptr5 = getelementptr inbounds i32* %add.ptr3, i32 %idx.neg4 - %add.ptr6 = getelementptr inbounds i32* %add.ptr5, i32 -1 + %add.ptr5 = getelementptr inbounds i32, i32* %add.ptr3, i32 %idx.neg4 + %add.ptr6 = getelementptr inbounds i32, i32* %add.ptr5, i32 -1 store i32 %add, i32* %add.ptr6, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32** @PA, align 4 - %9 = load i32* %a.addr, align 4 - %add.ptr7 = getelementptr inbounds i32* %8, i32 %9 - %10 = load i32* %add.ptr7, align 4 + %8 = load i32*, i32** @PA, align 4 + %9 = load i32, i32* %a.addr, align 4 + %add.ptr7 = getelementptr inbounds i32, i32* %8, i32 %9 + %10 = load i32, i32* %add.ptr7, align 4 ret i32 %10 } @@ -565,41 +565,41 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 1 - %2 = load i32* %N, align 4 - %arrayidx = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 2), i32 0, i32 %2 - %arrayidx2 = getelementptr inbounds [100 x i32]* %arrayidx, i32 0, i32 %sub1 - %3 = load i32* %arrayidx2, align 4 - %4 = load i32* %a.addr, align 4 + %2 = load i32, i32* %N, align 4 + %arrayidx = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 2), i32 0, i32 %2 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx, i32 0, i32 %sub1 + %3 = load i32, i32* %arrayidx2, align 4 + %4 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %3, %4 - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %sub3 = sub nsw i32 100, %5 %sub4 = sub nsw i32 %sub3, 1 - %6 = load i32* %N, align 4 - %arrayidx5 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 - %arrayidx6 = getelementptr inbounds [100 x i32]* %arrayidx5, i32 0, i32 %sub4 + %6 = load i32, i32* %N, align 4 + %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 + %arrayidx6 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx5, i32 0, i32 %sub4 store i32 %add, i32* %arrayidx6, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32* %a.addr, align 4 - %9 = load i32* %N, align 4 - %arrayidx7 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 - %arrayidx8 = getelementptr inbounds [100 x i32]* %arrayidx7, i32 0, i32 %8 - %10 = load i32* %arrayidx8, align 4 + %8 = load i32, i32* %a.addr, align 4 + %9 = load i32, i32* %N, align 4 + %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 + %arrayidx8 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx7, i32 0, i32 %8 + %10 = load i32, i32* %arrayidx8, align 4 ret i32 %10 } @@ -625,42 +625,42 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 1 - %2 = load i32* %N, align 4 + %2 = load i32, i32* %N, align 4 %add = add nsw i32 %2, 1 - %arrayidx = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %add - %arrayidx2 = getelementptr inbounds [100 x i32]* %arrayidx, i32 0, i32 %sub1 - %3 = load i32* %arrayidx2, align 4 - %4 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %add + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx, i32 0, i32 %sub1 + %3 = load i32, i32* %arrayidx2, align 4 + %4 = load i32, i32* %a.addr, align 4 %add3 = add nsw i32 %3, %4 - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %sub4 = sub nsw i32 100, %5 %sub5 = sub nsw i32 %sub4, 1 - %6 = load i32* %N, align 4 - %arrayidx6 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 - %arrayidx7 = getelementptr inbounds [100 x i32]* %arrayidx6, i32 0, i32 %sub5 + %6 = load i32, i32* %N, align 4 + %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %6 + %arrayidx7 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx6, i32 0, i32 %sub5 store i32 %add3, i32* %arrayidx7, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32* %a.addr, align 4 - %9 = load i32* %N, align 4 - %arrayidx8 = getelementptr inbounds [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 - %arrayidx9 = getelementptr inbounds [100 x i32]* %arrayidx8, i32 0, i32 %8 - %10 = load i32* %arrayidx9, align 4 + %8 = load i32, i32* %a.addr, align 4 + %9 = load i32, i32* %N, align 4 + %arrayidx8 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* getelementptr inbounds (%struct.anon.0, %struct.anon.0* @Bar, i32 0, i32 0), i32 0, i32 %9 + %arrayidx9 = getelementptr inbounds [100 x i32], [100 x i32]* %arrayidx8, i32 0, i32 %8 + %10 = load i32, i32* %arrayidx9, align 4 ret i32 %10 } @@ -684,32 +684,32 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %add = add nsw i32 %1, 4 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add1 = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 - %arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 + %4 = load i32, i32* %i, align 4 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 store i32 %add1, i32* %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx3, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx3, align 4 ret i32 %7 } @@ -733,35 +733,35 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 5 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %sub2 = sub nsw i32 100, %4 %sub3 = sub nsw i32 %sub2, 1 - %arrayidx4 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 + %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub3 store i32 %add, i32* %arrayidx4, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx5 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx5, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx5, align 4 ret i32 %7 } @@ -789,33 +789,33 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 1 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 - %arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 + %4 = load i32, i32* %i, align 4 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 store i32 %add, i32* %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx3, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx3, align 4 ret i32 %7 } @@ -839,33 +839,33 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %1 = load i32, i32* %i, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %4 %sub1 = sub nsw i32 %sub, 1 - %arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub1 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %sub1 store i32 %add, i32* %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx3, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx3, align 4 ret i32 %7 } @@ -889,37 +889,37 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32** @PB, align 4 - %add.ptr = getelementptr inbounds i32* %1, i32 100 - %2 = load i32* %i, align 4 + %1 = load i32*, i32** @PB, align 4 + %add.ptr = getelementptr inbounds i32, i32* %1, i32 100 + %2 = load i32, i32* %i, align 4 %idx.neg = sub i32 0, %2 - %add.ptr1 = getelementptr inbounds i32* %add.ptr, i32 %idx.neg - %add.ptr2 = getelementptr inbounds i32* %add.ptr1, i32 -1 - %3 = load i32* %add.ptr2, align 4 - %4 = load i32* %a.addr, align 4 + %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 %idx.neg + %add.ptr2 = getelementptr inbounds i32, i32* %add.ptr1, i32 -1 + %3 = load i32, i32* %add.ptr2, align 4 + %4 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %3, %4 - %5 = load i32** @PA, align 4 - %6 = load i32* %i, align 4 - %add.ptr3 = getelementptr inbounds i32* %5, i32 %6 + %5 = load i32*, i32** @PA, align 4 + %6 = load i32, i32* %i, align 4 + %add.ptr3 = getelementptr inbounds i32, i32* %5, i32 %6 store i32 %add, i32* %add.ptr3, align 4 br label %for.inc for.inc: ; preds = %for.body - %7 = load i32* %i, align 4 + %7 = load i32, i32* %i, align 4 %inc = add nsw i32 %7, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %8 = load i32** @PA, align 4 - %9 = load i32* %a.addr, align 4 - %add.ptr4 = getelementptr inbounds i32* %8, i32 %9 - %10 = load i32* %add.ptr4, align 4 + %8 = load i32*, i32** @PA, align 4 + %9 = load i32, i32* %a.addr, align 4 + %add.ptr4 = getelementptr inbounds i32, i32* %8, i32 %9 + %10 = load i32, i32* %add.ptr4, align 4 ret i32 %10 } @@ -946,34 +946,34 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 1 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %add2 = add nsw i32 %4, 10 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add2 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add2 store i32 %add, i32* %arrayidx3, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx4 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx4, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx4, align 4 ret i32 %7 } @@ -996,33 +996,33 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 10 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 - %arrayidx2 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 + %4 = load i32, i32* %i, align 4 + %arrayidx2 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %4 store i32 %add, i32* %arrayidx2, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx3, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx3, align 4 ret i32 %7 } @@ -1045,33 +1045,33 @@ entry: br label %for.cond for.cond: ; preds = %for.inc, %entry - %0 = load i32* %i, align 4 + %0 = load i32, i32* %i, align 4 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %for.body, label %for.end for.body: ; preds = %for.cond - %1 = load i32* %i, align 4 + %1 = load i32, i32* %i, align 4 %sub = sub nsw i32 100, %1 %sub1 = sub nsw i32 %sub, 10 - %arrayidx = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 - %2 = load i32* %arrayidx, align 4 - %3 = load i32* %a.addr, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 2), i32 0, i32 %sub1 + %2 = load i32, i32* %arrayidx, align 4 + %3 = load i32, i32* %a.addr, align 4 %add = add nsw i32 %2, %3 - %4 = load i32* %i, align 4 + %4 = load i32, i32* %i, align 4 %add2 = add nsw i32 %4, 10 - %arrayidx3 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add2 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %add2 store i32 %add, i32* %arrayidx3, align 4 br label %for.inc for.inc: ; preds = %for.body - %5 = load i32* %i, align 4 + %5 = load i32, i32* %i, align 4 %inc = add nsw i32 %5, 1 store i32 %inc, i32* %i, align 4 br label %for.cond for.end: ; preds = %for.cond - %6 = load i32* %a.addr, align 4 - %arrayidx4 = getelementptr inbounds [100 x i32]* getelementptr inbounds (%struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 - %7 = load i32* %arrayidx4, align 4 + %6 = load i32, i32* %a.addr, align 4 + %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* getelementptr inbounds (%struct.anon, %struct.anon* @Foo, i32 0, i32 0), i32 0, i32 %6 + %7 = load i32, i32* %arrayidx4, align 4 ret i32 %7 } diff --git a/test/Transforms/LoopVectorize/hoist-loads.ll b/test/Transforms/LoopVectorize/hoist-loads.ll index d0b27f1..a20b0f6 100644 --- a/test/Transforms/LoopVectorize/hoist-loads.ll +++ b/test/Transforms/LoopVectorize/hoist-loads.ll @@ -14,14 +14,14 @@ entry: br label %for.body for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %if.end9 ] - %arrayidx = getelementptr inbounds [1024 x float]* @A, i64 0, i64 %indvars.iv - %arrayidx2 = getelementptr inbounds [1024 x float]* @B, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @A, i64 0, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds [1024 x float], [1024 x float]* @B, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx2, align 4 %cmp3 = fcmp oeq float %0, 0.000000e+00 br i1 %cmp3, label %if.end9, label %if.else if.else: - %1 = load float* %arrayidx, align 4 + %1 = load float, float* %arrayidx, align 4 br label %if.end9 if.end9: @@ -46,14 +46,14 @@ entry: br label %for.body for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %if.end9 ] - %arrayidx = getelementptr inbounds [1024 x float]* @A, i64 0, i64 %indvars.iv - %arrayidx2 = getelementptr inbounds [1024 x float]* @B, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @A, i64 0, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds [1024 x float], [1024 x float]* @B, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx2, align 4 %cmp3 = fcmp oeq float %0, 0.000000e+00 br i1 %cmp3, label %if.end9, label %if.else if.else: - %1 = load float* %arrayidx, align 4 + %1 = load float, float* %arrayidx, align 4 br label %if.end9 if.end9: diff --git a/test/Transforms/LoopVectorize/i8-induction.ll b/test/Transforms/LoopVectorize/i8-induction.ll index 90e3ec0..d9e8a43 100644 --- a/test/Transforms/LoopVectorize/i8-induction.ll +++ b/test/Transforms/LoopVectorize/i8-induction.ll @@ -9,7 +9,7 @@ target triple = "x86_64-apple-macosx10.8.0" define void @f() nounwind uwtable ssp { scalar.ph: store i8 0, i8* inttoptr (i64 1 to i8*), align 1 - %0 = load i8* @a, align 1 + %0 = load i8, i8* @a, align 1 br label %for.body for.body: diff --git a/test/Transforms/LoopVectorize/if-conversion-edgemasks.ll b/test/Transforms/LoopVectorize/if-conversion-edgemasks.ll index 8b8408b..8d435f5 100644 --- a/test/Transforms/LoopVectorize/if-conversion-edgemasks.ll +++ b/test/Transforms/LoopVectorize/if-conversion-edgemasks.ll @@ -20,15 +20,15 @@ entry: br i1 %cmp88, label %for.body.lr.ph, label %for.end for.body.lr.ph: - %0 = load i32** @b, align 8 - %1 = load i32** @a, align 8 - %2 = load i32** @c, align 8 + %0 = load i32*, i32** @b, align 8 + %1 = load i32*, i32** @a, align 8 + %2 = load i32*, i32** @c, align 8 br label %for.body for.body: %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %_ZL3fn3ii.exit58 ] - %arrayidx = getelementptr inbounds i32* %0, i64 %indvars.iv - %3 = load i32* %arrayidx, align 4 %4 = trunc i64 %indvars.iv to i32 + %arrayidx = getelementptr inbounds i32, i32* %0, i64 %indvars.iv + %3 = load i32, i32* %arrayidx, align 4 %4 = trunc i64 %indvars.iv to i32 %and.i = and i32 %4, 1 %tobool.i.i = icmp eq i32 %and.i, 0 br i1 %tobool.i.i, label %if.end.i, label %if.then.i @@ -134,9 +134,9 @@ if.then.i15.i: _ZL3fn3ii.exit: %p1.addr.0.i16.i = phi i32 [ %or.i14.i, %if.then.i15.i ], [ %p1.addr.3.i.i, %_Z3fn2iii.exit.i ] - %arrayidx2 = getelementptr inbounds i32* %1, i64 %indvars.iv - store i32 %p1.addr.0.i16.i, i32* %arrayidx2, align 4 %arrayidx4 = getelementptr inbounds i32* %0, i64 %indvars.iv - %10 = load i32* %arrayidx4, align 4 br i1 %tobool.i.i, label %_Z3fn1ii.exit.i26, label %if.then.i.i21 + %arrayidx2 = getelementptr inbounds i32, i32* %1, i64 %indvars.iv + store i32 %p1.addr.0.i16.i, i32* %arrayidx2, align 4 %arrayidx4 = getelementptr inbounds i32, i32* %0, i64 %indvars.iv + %10 = load i32, i32* %arrayidx4, align 4 br i1 %tobool.i.i, label %_Z3fn1ii.exit.i26, label %if.then.i.i21 if.then.i.i21: %and.i.i18 = lshr i32 %10, 2 @@ -232,7 +232,7 @@ if.then.i15.i56: _ZL3fn3ii.exit58: %p1.addr.0.i16.i57 = phi i32 [ %or.i14.i55, %if.then.i15.i56 ], [ %p1.addr.3.i.i50, %_Z3fn2iii.exit.i52 ] - %arrayidx7 = getelementptr inbounds i32* %2, i64 %indvars.iv + %arrayidx7 = getelementptr inbounds i32, i32* %2, i64 %indvars.iv store i32 %p1.addr.0.i16.i57, i32* %arrayidx7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp ne i32 %lftr.wideiv, %p1 diff --git a/test/Transforms/LoopVectorize/if-conversion-nest.ll b/test/Transforms/LoopVectorize/if-conversion-nest.ll index b5ac8fc..3a581eb 100644 --- a/test/Transforms/LoopVectorize/if-conversion-nest.ll +++ b/test/Transforms/LoopVectorize/if-conversion-nest.ll @@ -19,10 +19,10 @@ entry: for.body: %indvars.iv = phi i64 [ %indvars.iv.next, %if.end14 ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %B, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %cmp3 = icmp sgt i32 %0, %1 br i1 %cmp3, label %if.then, label %if.end14 diff --git a/test/Transforms/LoopVectorize/if-conversion-reduction.ll b/test/Transforms/LoopVectorize/if-conversion-reduction.ll index 455699c..20333b9 100644 --- a/test/Transforms/LoopVectorize/if-conversion-reduction.ll +++ b/test/Transforms/LoopVectorize/if-conversion-reduction.ll @@ -14,8 +14,8 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %sum.011 = phi i32 [ %sum.1, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 30 br i1 %cmp1, label %if.then, label %for.inc diff --git a/test/Transforms/LoopVectorize/if-conversion.ll b/test/Transforms/LoopVectorize/if-conversion.ll index a220203..fb54169 100644 --- a/test/Transforms/LoopVectorize/if-conversion.ll +++ b/test/Transforms/LoopVectorize/if-conversion.ll @@ -35,10 +35,10 @@ for.body.lr.ph: for.body: %indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %1 = load i32* %arrayidx, align 4 - %arrayidx4 = getelementptr inbounds i32* %b, i64 %indvars.iv - %2 = load i32* %arrayidx4, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %1 = load i32, i32* %arrayidx, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv + %2 = load i32, i32* %arrayidx4, align 4 %cmp5 = icmp sgt i32 %1, %2 br i1 %cmp5, label %if.then, label %if.end @@ -84,8 +84,8 @@ entry: for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %sum.011 = phi i32 [ %sum.1, %for.inc ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 30 br i1 %cmp1, label %if.then, label %for.inc @@ -123,13 +123,13 @@ entry: for.body: %inc3 = phi i32 [ 0, %entry ], [ %inc, %cond.end ] %or2 = phi i32 [ 0, %entry ], [ %or, %cond.end ] - br i1 icmp eq (i32** getelementptr inbounds ([1 x i32*]* @a, i64 0, i64 0), i32** @c), label %cond.false, label %cond.end + br i1 icmp eq (i32** getelementptr inbounds ([1 x i32*], [1 x i32*]* @a, i64 0, i64 0), i32** @c), label %cond.false, label %cond.end cond.false: br label %cond.end cond.end: - %cond = phi i32 [ sdiv (i32 1, i32 zext (i1 icmp eq (i32** getelementptr inbounds ([1 x i32*]* @a, i64 0, i64 0), i32** @c) to i32)), %cond.false ], [ 0, %for.body ] + %cond = phi i32 [ sdiv (i32 1, i32 zext (i1 icmp eq (i32** getelementptr inbounds ([1 x i32*], [1 x i32*]* @a, i64 0, i64 0), i32** @c) to i32)), %cond.false ], [ 0, %for.body ] %or = or i32 %or2, %cond %inc = add nsw i32 %inc3, 1 %cmp = icmp slt i32 %inc, 128 @@ -153,10 +153,10 @@ entry: for.body: %inc3 = phi i32 [ 0, %entry ], [ %inc, %cond.end ] %or2 = phi i32 [ 0, %entry ], [ %or, %cond.end ] - br i1 icmp eq (i32** getelementptr inbounds ([1 x i32*]* @a, i64 0, i64 0), i32** @c), label %cond.false, label %cond.end + br i1 icmp eq (i32** getelementptr inbounds ([1 x i32*], [1 x i32*]* @a, i64 0, i64 0), i32** @c), label %cond.false, label %cond.end cond.false: - %cond.1 = or i32 %inc3, sdiv (i32 1, i32 zext (i1 icmp eq (i32** getelementptr inbounds ([1 x i32*]* @a, i64 0, i64 1), i32** @c) to i32)) + %cond.1 = or i32 %inc3, sdiv (i32 1, i32 zext (i1 icmp eq (i32** getelementptr inbounds ([1 x i32*], [1 x i32*]* @a, i64 0, i64 1), i32** @c) to i32)) br label %cond.end cond.end: diff --git a/test/Transforms/LoopVectorize/if-pred-stores.ll b/test/Transforms/LoopVectorize/if-pred-stores.ll index c6067e0..991d027 100644 --- a/test/Transforms/LoopVectorize/if-pred-stores.ll +++ b/test/Transforms/LoopVectorize/if-pred-stores.ll @@ -39,10 +39,10 @@ entry: ; UNROLL: vector.body: ; UNROLL: %[[IND:[a-zA-Z0-9]+]] = add i64 %{{.*}}, 0 ; UNROLL: %[[IND1:[a-zA-Z0-9]+]] = add i64 %{{.*}}, 1 -; UNROLL: %[[v0:[a-zA-Z0-9]+]] = getelementptr inbounds i32* %f, i64 %[[IND]] -; UNROLL: %[[v1:[a-zA-Z0-9]+]] = getelementptr inbounds i32* %f, i64 %[[IND1]] -; UNROLL: %[[v2:[a-zA-Z0-9]+]] = load i32* %[[v0]], align 4 -; UNROLL: %[[v3:[a-zA-Z0-9]+]] = load i32* %[[v1]], align 4 +; UNROLL: %[[v0:[a-zA-Z0-9]+]] = getelementptr inbounds i32, i32* %f, i64 %[[IND]] +; UNROLL: %[[v1:[a-zA-Z0-9]+]] = getelementptr inbounds i32, i32* %f, i64 %[[IND1]] +; UNROLL: %[[v2:[a-zA-Z0-9]+]] = load i32, i32* %[[v0]], align 4 +; UNROLL: %[[v3:[a-zA-Z0-9]+]] = load i32, i32* %[[v1]], align 4 ; UNROLL: %[[v4:[a-zA-Z0-9]+]] = icmp sgt i32 %[[v2]], 100 ; UNROLL: %[[v5:[a-zA-Z0-9]+]] = icmp sgt i32 %[[v3]], 100 ; UNROLL: %[[v6:[a-zA-Z0-9]+]] = add nsw i32 %[[v2]], 20 @@ -66,8 +66,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] - %arrayidx = getelementptr inbounds i32* %f, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %f, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp1 = icmp sgt i32 %0, 100 br i1 %cmp1, label %if.then, label %for.inc @@ -104,8 +104,8 @@ for.body9: for.body14: %indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc23 ], [ undef, %for.body9 ] %iNewChunks.120 = phi i32 [ %iNewChunks.2, %for.inc23 ], [ undef, %for.body9 ] - %arrayidx16 = getelementptr inbounds [768 x i32]* undef, i64 0, i64 %indvars.iv3 - %tmp = load i32* %arrayidx16, align 4 + %arrayidx16 = getelementptr inbounds [768 x i32], [768 x i32]* undef, i64 0, i64 %indvars.iv3 + %tmp = load i32, i32* %arrayidx16, align 4 br i1 undef, label %if.then18, label %for.inc23 if.then18: diff --git a/test/Transforms/LoopVectorize/incorrect-dom-info.ll b/test/Transforms/LoopVectorize/incorrect-dom-info.ll index b8624fd..798793a 100644 --- a/test/Transforms/LoopVectorize/incorrect-dom-info.ll +++ b/test/Transforms/LoopVectorize/incorrect-dom-info.ll @@ -45,7 +45,7 @@ thread-pre-split.preheader: ; preds = %9 .thread-pre-split.loopexit_crit_edge: ; preds = %19 %scevgep.sum = xor i64 %umax, -1 - %scevgep45 = getelementptr i8* %d.020, i64 %scevgep.sum + %scevgep45 = getelementptr i8, i8* %d.020, i64 %scevgep.sum br label %thread-pre-split.loopexit thread-pre-split.loopexit: ; preds = %11, %.thread-pre-split.loopexit_crit_edge @@ -58,8 +58,8 @@ thread-pre-split.loopexit: ; preds = %11, %.thread-pre-sp br i1 undef, label %11, label %22 ; <label>:11 ; preds = %.lr.ph21 - %12 = getelementptr inbounds [0 x i8]* @PL_utf8skip, i64 0, i64 undef - %13 = load i8* %12, align 1 + %12 = getelementptr inbounds [0 x i8], [0 x i8]* @PL_utf8skip, i64 0, i64 undef + %13 = load i8, i8* %12, align 1 %14 = zext i8 %13 to i64 %15 = icmp ugt i64 %14, %10 %. = select i1 %15, i64 %10, i64 %14 @@ -91,7 +91,7 @@ thread-pre-split.loopexit: ; preds = %11, %.thread-pre-sp br label %26 ; <label>:26 ; preds = %25, %24, %23, %22 - %27 = load i64* %len, align 8 + %27 = load i64, i64* %len, align 8 %28 = add i64 %27, -1 br i1 undef, label %thread-pre-split._crit_edge, label %.lr.ph21 diff --git a/test/Transforms/LoopVectorize/increment.ll b/test/Transforms/LoopVectorize/increment.ll index 067a76b..d0b2509 100644 --- a/test/Transforms/LoopVectorize/increment.ll +++ b/test/Transforms/LoopVectorize/increment.ll @@ -20,8 +20,8 @@ define void @inc(i32 %n) nounwind uwtable noinline ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = trunc i64 %indvars.iv to i32 %5 = add nsw i32 %3, %4 store i32 %5, i32* %2, align 4 @@ -49,11 +49,11 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %B, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %idxprom1 = sext i32 %0 to i64 - %arrayidx2 = getelementptr inbounds i32* %A, i64 %idxprom1 - %1 = load i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1 + %1 = load i32, i32* %arrayidx2, align 4 %inc = add nsw i32 %1, 1 store i32 %inc, i32* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/induction.ll b/test/Transforms/LoopVectorize/induction.ll index 3f34918..2fbb2de 100644 --- a/test/Transforms/LoopVectorize/induction.ll +++ b/test/Transforms/LoopVectorize/induction.ll @@ -16,7 +16,7 @@ for.body.lr.ph: for.body: %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %count.09 = phi i32 [ 190, %for.body.lr.ph ], [ %inc, %for.body ] - %arrayidx2 = getelementptr inbounds i32* %A, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv store i32 %count.09, i32* %arrayidx2, align 4 %inc = add nsw i32 %count.09, 1 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -51,11 +51,11 @@ entry: for.body: %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] %ind.sum = add i64 %iv, %offset - %arr.idx = getelementptr inbounds float* %a, i64 %ind.sum - %l1 = load float* %arr.idx, align 4 + %arr.idx = getelementptr inbounds float, float* %a, i64 %ind.sum + %l1 = load float, float* %arr.idx, align 4 %ind.sum2 = add i64 %iv, %offset2 - %arr.idx2 = getelementptr inbounds float* %a, i64 %ind.sum2 - %l2 = load float* %arr.idx2, align 4 + %arr.idx2 = getelementptr inbounds float, float* %a, i64 %ind.sum2 + %l2 = load float, float* %arr.idx2, align 4 %m = fmul fast float %b, %l2 %ad = fadd fast float %l1, %m store float %ad, float* %arr.idx, align 4 @@ -153,9 +153,9 @@ define i32 @max_i32_backedgetaken() nounwind readnone ssp uwtable { @c = common global i32 0, align 4 define i32 @testoverflowcheck() { entry: - %.pr.i = load i8* @e, align 1 - %0 = load i32* @d, align 4 - %c.promoted.i = load i32* @c, align 4 + %.pr.i = load i8, i8* @e, align 1 + %0 = load i32, i32* @d, align 4 + %c.promoted.i = load i32, i32* @c, align 4 br label %cond.end.i cond.end.i: diff --git a/test/Transforms/LoopVectorize/induction_plus.ll b/test/Transforms/LoopVectorize/induction_plus.ll index ce64c5b..7c4c8f2 100644 --- a/test/Transforms/LoopVectorize/induction_plus.ll +++ b/test/Transforms/LoopVectorize/induction_plus.ll @@ -16,7 +16,7 @@ define i32 @array_at_plus_one(i32 %n) nounwind uwtable ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %2 = add nsw i64 %indvars.iv, 12 - %3 = getelementptr inbounds [1024 x i32]* @array, i64 0, i64 %2 + %3 = getelementptr inbounds [1024 x i32], [1024 x i32]* @array, i64 0, i64 %2 %4 = trunc i64 %indvars.iv to i32 store i32 %4, i32* %3, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/intrinsic.ll b/test/Transforms/LoopVectorize/intrinsic.ll index d48731a..fae6a8c 100644 --- a/test/Transforms/LoopVectorize/intrinsic.ll +++ b/test/Transforms/LoopVectorize/intrinsic.ll @@ -13,10 +13,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.sqrt.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -39,10 +39,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.sqrt.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -65,10 +65,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.sin.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -91,10 +91,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.sin.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -117,10 +117,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.cos.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -143,10 +143,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.cos.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -169,10 +169,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.exp.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -195,10 +195,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.exp.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -221,10 +221,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.exp2.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -247,10 +247,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.exp2.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -273,10 +273,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.log.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -299,10 +299,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.log.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -325,10 +325,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.log10.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -351,10 +351,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.log10.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -377,10 +377,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.log2.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -403,10 +403,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.log2.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -429,10 +429,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.fabs.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -452,10 +452,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.fabs(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -478,12 +478,12 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds float* %z, i64 %indvars.iv - %1 = load float* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds float, float* %z, i64 %indvars.iv + %1 = load float, float* %arrayidx1, align 4 %call = tail call float @llvm.copysign.f32(float %0, float %1) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -503,12 +503,12 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 - %arrayidx1 = getelementptr inbounds double* %z, i64 %indvars.iv - %1 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 + %arrayidx1 = getelementptr inbounds double, double* %z, i64 %indvars.iv + %1 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.copysign(double %0, double %1) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -531,10 +531,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.floor.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -557,10 +557,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.floor.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -583,10 +583,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.ceil.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -609,10 +609,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.ceil.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -635,10 +635,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.trunc.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -661,10 +661,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.trunc.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -687,10 +687,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.rint.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -713,10 +713,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.rint.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -739,10 +739,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.nearbyint.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -765,10 +765,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.nearbyint.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -791,10 +791,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @llvm.round.f32(float %0) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -817,10 +817,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.round.f64(double %0) nounwind readnone - %arrayidx2 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx2, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -843,14 +843,14 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds float* %w, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 - %arrayidx4 = getelementptr inbounds float* %z, i64 %indvars.iv - %2 = load float* %arrayidx4, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float, float* %w, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 + %arrayidx4 = getelementptr inbounds float, float* %z, i64 %indvars.iv + %2 = load float, float* %arrayidx4, align 4 %3 = tail call float @llvm.fma.f32(float %0, float %2, float %1) - %arrayidx6 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx6 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %3, float* %arrayidx6, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -873,14 +873,14 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 - %arrayidx2 = getelementptr inbounds double* %w, i64 %indvars.iv - %1 = load double* %arrayidx2, align 8 - %arrayidx4 = getelementptr inbounds double* %z, i64 %indvars.iv - %2 = load double* %arrayidx4, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 + %arrayidx2 = getelementptr inbounds double, double* %w, i64 %indvars.iv + %1 = load double, double* %arrayidx2, align 8 + %arrayidx4 = getelementptr inbounds double, double* %z, i64 %indvars.iv + %2 = load double, double* %arrayidx4, align 8 %3 = tail call double @llvm.fma.f64(double %0, double %2, double %1) - %arrayidx6 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx6 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %3, double* %arrayidx6, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -903,14 +903,14 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds float* %w, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 - %arrayidx4 = getelementptr inbounds float* %z, i64 %indvars.iv - %2 = load float* %arrayidx4, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float, float* %w, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 + %arrayidx4 = getelementptr inbounds float, float* %z, i64 %indvars.iv + %2 = load float, float* %arrayidx4, align 4 %3 = tail call float @llvm.fmuladd.f32(float %0, float %2, float %1) - %arrayidx6 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx6 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %3, float* %arrayidx6, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -933,14 +933,14 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 - %arrayidx2 = getelementptr inbounds double* %w, i64 %indvars.iv - %1 = load double* %arrayidx2, align 8 - %arrayidx4 = getelementptr inbounds double* %z, i64 %indvars.iv - %2 = load double* %arrayidx4, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 + %arrayidx2 = getelementptr inbounds double, double* %w, i64 %indvars.iv + %1 = load double, double* %arrayidx2, align 8 + %arrayidx4 = getelementptr inbounds double, double* %z, i64 %indvars.iv + %2 = load double, double* %arrayidx4, align 8 %3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %1) - %arrayidx6 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx6 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %3, double* %arrayidx6, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -963,12 +963,12 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds float* %z, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 %call = tail call float @llvm.pow.f32(float %0, float %1) nounwind readnone - %arrayidx4 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx4, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -991,12 +991,12 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 - %arrayidx2 = getelementptr inbounds double* %z, i64 %indvars.iv - %1 = load double* %arrayidx2, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 + %arrayidx2 = getelementptr inbounds double, double* %z, i64 %indvars.iv + %1 = load double, double* %arrayidx2, align 8 %call = tail call double @llvm.pow.f64(double %0, double %1) nounwind readnone - %arrayidx4 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx4, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -1016,8 +1016,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %x, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %x, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @fabsf(float %0) nounwind readnone store float %call, float* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -1050,8 +1050,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %x, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %x, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %call = tail call float @roundf(float %0) nounwind readnone store float %call, float* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -1077,8 +1077,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds double* %x, i64 %indvars.iv - %0 = load double* %arrayidx, align 4 + %arrayidx = getelementptr inbounds double, double* %x, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 4 store double %0, double* %arrayidx, align 4 tail call void @round(double %0) nounwind readnone %indvars.iv.next = add i64 %indvars.iv, 1 @@ -1102,10 +1102,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %call = tail call double @llvm.powi.f64(double %0, i32 %P) nounwind readnone - %arrayidx4 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx4, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -1126,11 +1126,11 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds double* %y, i64 %indvars.iv - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 8 %1 = trunc i64 %indvars.iv to i32 %call = tail call double @llvm.powi.f64(double %0, i32 %1) nounwind readnone - %arrayidx4 = getelementptr inbounds double* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds double, double* %x, i64 %indvars.iv store double %call, double* %arrayidx4, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -1153,10 +1153,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i64* %y, i64 %indvars.iv - %0 = load i64* %arrayidx, align 8 + %arrayidx = getelementptr inbounds i64, i64* %y, i64 %indvars.iv + %0 = load i64, i64* %arrayidx, align 8 %call = tail call i64 @llvm.cttz.i64(i64 %0, i1 true) nounwind readnone - %arrayidx4 = getelementptr inbounds i64* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds i64, i64* %x, i64 %indvars.iv store i64 %call, i64* %arrayidx4, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -1179,10 +1179,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i64* %y, i64 %indvars.iv - %0 = load i64* %arrayidx, align 8 + %arrayidx = getelementptr inbounds i64, i64* %y, i64 %indvars.iv + %0 = load i64, i64* %arrayidx, align 8 %call = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true) nounwind readnone - %arrayidx4 = getelementptr inbounds i64* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds i64, i64* %x, i64 %indvars.iv store i64 %call, i64* %arrayidx4, align 8 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -1205,12 +1205,12 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds float* %z, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 %call = tail call float @llvm.minnum.f32(float %0, float %1) nounwind readnone - %arrayidx4 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx4, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -1233,12 +1233,12 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %y, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds float* %z, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds float, float* %y, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float, float* %z, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 %call = tail call float @llvm.maxnum.f32(float %0, float %1) nounwind readnone - %arrayidx4 = getelementptr inbounds float* %x, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds float, float* %x, i64 %indvars.iv store float %call, float* %arrayidx4, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/lifetime.ll b/test/Transforms/LoopVectorize/lifetime.ll index ba36cc4..6e525ca 100644 --- a/test/Transforms/LoopVectorize/lifetime.ll +++ b/test/Transforms/LoopVectorize/lifetime.ll @@ -19,8 +19,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] call void @llvm.lifetime.end(i64 4096, i8* %0) #1 - %arrayidx = getelementptr inbounds i32* %d, i64 %indvars.iv - %1 = load i32* %arrayidx, align 8 + %arrayidx = getelementptr inbounds i32, i32* %d, i64 %indvars.iv + %1 = load i32, i32* %arrayidx, align 8 store i32 100, i32* %arrayidx, align 8 call void @llvm.lifetime.start(i64 4096, i8* %0) #1 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -49,8 +49,8 @@ for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %1 = bitcast [1024 x i32]* %arr to i8* call void @llvm.lifetime.end(i64 4096, i8* %1) #1 - %arrayidx = getelementptr inbounds i32* %d, i64 %indvars.iv - %2 = load i32* %arrayidx, align 8 + %arrayidx = getelementptr inbounds i32, i32* %d, i64 %indvars.iv + %2 = load i32, i32* %arrayidx, align 8 store i32 100, i32* %arrayidx, align 8 call void @llvm.lifetime.start(i64 4096, i8* %1) #1 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -75,11 +75,11 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %0 = getelementptr [1024 x i32]* %arr, i32 0, i64 %indvars.iv + %0 = getelementptr [1024 x i32], [1024 x i32]* %arr, i32 0, i64 %indvars.iv %1 = bitcast [1024 x i32]* %arr to i8* call void @llvm.lifetime.end(i64 4096, i8* %1) #1 - %arrayidx = getelementptr inbounds i32* %d, i64 %indvars.iv - %2 = load i32* %arrayidx, align 8 + %arrayidx = getelementptr inbounds i32, i32* %d, i64 %indvars.iv + %2 = load i32, i32* %arrayidx, align 8 store i32 100, i32* %arrayidx, align 8 call void @llvm.lifetime.start(i64 4096, i8* %1) #1 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/loop-form.ll b/test/Transforms/LoopVectorize/loop-form.ll index 138df1d..3bbe810 100644 --- a/test/Transforms/LoopVectorize/loop-form.ll +++ b/test/Transforms/LoopVectorize/loop-form.ll @@ -21,7 +21,7 @@ for.cond: for.body: %iprom = sext i32 %i to i64 - %b = getelementptr inbounds %struct.X* undef, i64 %iprom, i32 1 + %b = getelementptr inbounds %struct.X, %struct.X* undef, i64 %iprom, i32 1 store i16 0, i16* %b, align 4 %inc = add nsw i32 %i, 1 br label %for.cond diff --git a/test/Transforms/LoopVectorize/loop-vect-memdep.ll b/test/Transforms/LoopVectorize/loop-vect-memdep.ll index e2c7524..d9efaa5 100644 --- a/test/Transforms/LoopVectorize/loop-vect-memdep.ll +++ b/test/Transforms/LoopVectorize/loop-vect-memdep.ll @@ -6,16 +6,16 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define void @test_loop_novect(double** %arr, i64 %n) { for.body.lr.ph: - %t = load double** %arr, align 8 + %t = load double*, double** %arr, align 8 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph %i = phi i64 [ 0, %for.body.lr.ph ], [ %i.next, %for.body ] - %a = getelementptr inbounds double* %t, i64 %i + %a = getelementptr inbounds double, double* %t, i64 %i %i.next = add nuw nsw i64 %i, 1 - %a.next = getelementptr inbounds double* %t, i64 %i.next - %t1 = load double* %a, align 8 - %t2 = load double* %a.next, align 8 + %a.next = getelementptr inbounds double, double* %t, i64 %i.next + %t1 = load double, double* %a, align 8 + %t2 = load double, double* %a.next, align 8 store double %t1, double* %a.next, align 8 store double %t2, double* %a, align 8 %c = icmp eq i64 %i, %n diff --git a/test/Transforms/LoopVectorize/memdep.ll b/test/Transforms/LoopVectorize/memdep.ll index f857e80..fb60883 100644 --- a/test/Transforms/LoopVectorize/memdep.ll +++ b/test/Transforms/LoopVectorize/memdep.ll @@ -19,10 +19,10 @@ entry: for.body: %indvars.iv = phi i32 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %indvars.iv.next = add i32 %indvars.iv, 1 - %arrayidx = getelementptr inbounds i32* %A, i32 %indvars.iv.next - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i32 %indvars.iv.next + %0 = load i32, i32* %arrayidx, align 4 %add1 = add nsw i32 %0, 1 - %arrayidx3 = getelementptr inbounds i32* %A, i32 %indvars.iv + %arrayidx3 = getelementptr inbounds i32, i32* %A, i32 %indvars.iv store i32 %add1, i32* %arrayidx3, align 4 %exitcond = icmp ne i32 %indvars.iv.next, 1024 br i1 %exitcond, label %for.body, label %for.end @@ -44,11 +44,11 @@ entry: for.body: %indvars.iv = phi i32 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %A, i32 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i32 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, 1 %indvars.iv.next = add i32 %indvars.iv, 1 - %arrayidx3 = getelementptr inbounds i32* %A, i32 %indvars.iv.next + %arrayidx3 = getelementptr inbounds i32, i32* %A, i32 %indvars.iv.next store i32 %add, i32* %arrayidx3, align 4 %exitcond = icmp ne i32 %indvars.iv.next, 1024 br i1 %exitcond, label %for.body, label %for.end @@ -74,12 +74,12 @@ entry: for.body: %i.01 = phi i32 [ 0, %entry ], [ %inc, %for.body ] %idxprom = sext i32 %i.01 to i64 - %arrayidx = getelementptr inbounds i32* %A, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, 1 %add1 = add nsw i32 %i.01, 2 %idxprom2 = sext i32 %add1 to i64 - %arrayidx3 = getelementptr inbounds i32* %A, i64 %idxprom2 + %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %idxprom2 store i32 %add, i32* %arrayidx3, align 4 %inc = add nsw i32 %i.01, 1 %cmp = icmp slt i32 %inc, 1024 @@ -105,13 +105,13 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %B, i64 %indvars.iv + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv store i32 %0, i32* %arrayidx2, align 4 %indvars.iv.next = add nsw i64 %indvars.iv, 1 - %arrayidx4 = getelementptr inbounds i32* %B, i64 %indvars.iv.next - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv.next + %1 = load i32, i32* %arrayidx4, align 4 store i32 %1, i32* %arrayidx, align 4 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp ne i32 %lftr.wideiv, 1024 @@ -138,10 +138,10 @@ for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %tmp.addr.08 = phi i32 [ %tmp, %entry ], [ %0, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv.next + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv.next store i32 %tmp.addr.08, i32* %arrayidx, align 4 - %arrayidx3 = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx3, align 4 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp ne i32 %lftr.wideiv, 1024 br i1 %exitcond, label %for.body, label %for.end @@ -169,13 +169,13 @@ entry: for.body: %indvars.iv = phi i64 [ 16, %entry ], [ %indvars.iv.next, %for.body ] %0 = add nsw i64 %indvars.iv, -3 - %arrayidx = getelementptr inbounds i32* %A, i64 %0 - %1 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %0 + %1 = load i32, i32* %arrayidx, align 4 %2 = add nsw i64 %indvars.iv, 4 - %arrayidx2 = getelementptr inbounds i32* %A, i64 %2 - %3 = load i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %2 + %3 = load i32, i32* %arrayidx2, align 4 %add3 = add nsw i32 %3, %1 - %arrayidx5 = getelementptr inbounds i32* %A, i64 %indvars.iv + %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv store i32 %add3, i32* %arrayidx5, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -203,14 +203,14 @@ entry: for.body: %indvars.iv = phi i64 [ 16, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %B, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %A, i64 %indvars.iv + %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv store i32 %0, i32* %arrayidx2, align 4 %1 = add nsw i64 %indvars.iv, -3 - %arrayidx4 = getelementptr inbounds i32* %A, i64 %1 - %2 = load i32* %arrayidx4, align 4 - %arrayidx6 = getelementptr inbounds i32* %C, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %1 + %2 = load i32, i32* %arrayidx4, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %C, i64 %indvars.iv store i32 %2, i32* %arrayidx6, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/metadata-unroll.ll b/test/Transforms/LoopVectorize/metadata-unroll.ll index 36a2314..3c80ae0 100644 --- a/test/Transforms/LoopVectorize/metadata-unroll.ll +++ b/test/Transforms/LoopVectorize/metadata-unroll.ll @@ -23,8 +23,8 @@ define void @inc(i32 %n) nounwind uwtable noinline ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = trunc i64 %indvars.iv to i32 %5 = add nsw i32 %3, %4 store i32 %5, i32* %2, align 4 diff --git a/test/Transforms/LoopVectorize/metadata-width.ll b/test/Transforms/LoopVectorize/metadata-width.ll index dee4fee..69d902f 100644 --- a/test/Transforms/LoopVectorize/metadata-width.ll +++ b/test/Transforms/LoopVectorize/metadata-width.ll @@ -13,7 +13,7 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv %0 = trunc i64 %indvars.iv to i32 store i32 %0, i32* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/metadata.ll b/test/Transforms/LoopVectorize/metadata.ll index a258f7c..9a791ae 100644 --- a/test/Transforms/LoopVectorize/metadata.ll +++ b/test/Transforms/LoopVectorize/metadata.ll @@ -9,10 +9,10 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv - %0 = load float* %arrayidx, align 4, !tbaa !0 + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4, !tbaa !0 %conv = fptosi float %0 to i32 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %conv, i32* %arrayidx2, align 4, !tbaa !4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 1600 @@ -23,7 +23,7 @@ for.end: ; preds = %for.body } ; CHECK-LABEL: @test1 -; CHECK: load <4 x float>* %{{.*}}, align 4, !tbaa ![[TFLT:[0-9]+]] +; CHECK: load <4 x float>, <4 x float>* %{{.*}}, align 4, !tbaa ![[TFLT:[0-9]+]] ; CHECK: store <4 x i32> %{{.*}}, <4 x i32>* %{{.*}}, align 4, !tbaa ![[TINT:[0-9]+]] ; CHECK: ret i32 0 diff --git a/test/Transforms/LoopVectorize/minmax_reduction.ll b/test/Transforms/LoopVectorize/minmax_reduction.ll index 1984cdd..5a0356f 100644 --- a/test/Transforms/LoopVectorize/minmax_reduction.ll +++ b/test/Transforms/LoopVectorize/minmax_reduction.ll @@ -26,8 +26,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp sgt i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -55,8 +55,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp slt i32 %max.red.08, %0 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -83,8 +83,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp slt i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -112,8 +112,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp sgt i32 %max.red.08, %0 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -142,8 +142,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp ugt i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -171,8 +171,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp ult i32 %max.red.08, %0 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -199,8 +199,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp ult i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -228,8 +228,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp ugt i32 %max.red.08, %0 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -257,8 +257,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp sge i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %max.red.08, i32 %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -286,8 +286,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp sle i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %max.red.08, i32 %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -315,8 +315,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp uge i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %max.red.08, i32 %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -344,8 +344,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %cmp3 = icmp ule i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %max.red.08, i32 %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -367,10 +367,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %arrayidx1 = getelementptr inbounds [1024 x i32]* @A, i64 1, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %1 = load i32* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %arrayidx1 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 1, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %1 = load i32, i32* %arrayidx1, align 4 %cmp3 = icmp sgt i32 %0, %1 %max.red.0 = select i1 %cmp3, i32 %0, i32 %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -391,10 +391,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi i32 [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv - %arrayidx1 = getelementptr inbounds [1024 x i32]* @A, i64 1, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %1 = load i32* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv + %arrayidx1 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 1, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %1 = load i32, i32* %arrayidx1, align 4 %cmp3 = icmp sgt i32 %0, %max.red.08 %max.red.0 = select i1 %cmp3, i32 %0, i32 %1 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -425,8 +425,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ogt float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %0, float %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -451,8 +451,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp oge float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %0, float %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -477,8 +477,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp olt float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %max.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -503,8 +503,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ole float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %max.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -529,8 +529,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ugt float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %0, float %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -555,8 +555,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp uge float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %0, float %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -581,8 +581,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ult float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %max.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -607,8 +607,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ule float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %max.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -636,8 +636,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp olt float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %0, float %min.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -662,8 +662,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ole float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %0, float %min.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -688,8 +688,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ogt float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %min.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -714,8 +714,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp oge float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %min.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -740,8 +740,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ult float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %0, float %min.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -766,8 +766,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ule float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %0, float %min.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -792,8 +792,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ugt float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %min.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -818,8 +818,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi float [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp uge float %0, %min.red.08 %min.red.0 = select i1 %cmp3, float %min.red.08, float %0 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -845,8 +845,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %min.red.08 = phi double [ %min, %entry ], [ %min.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x double]* @dA, i64 0, i64 %indvars.iv - %0 = load double* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x double], [1024 x double]* @dA, i64 0, i64 %indvars.iv + %0 = load double, double* %arrayidx, align 4 %cmp3 = fcmp olt double %0, %min.red.08 %min.red.0 = select i1 %cmp3, double %0, double %min.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -869,8 +869,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %max.red.08 = phi float [ %max, %entry ], [ %max.red.0, %for.body ] - %arrayidx = getelementptr inbounds [1024 x float]* @fA, i64 0, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x float], [1024 x float]* @fA, i64 0, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %cmp3 = fcmp ogt float %0, %max.red.08 %max.red.0 = select i1 %cmp3, float %0, float %max.red.08 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/multi-use-reduction-bug.ll b/test/Transforms/LoopVectorize/multi-use-reduction-bug.ll index cd022ad..9f7fb39 100644 --- a/test/Transforms/LoopVectorize/multi-use-reduction-bug.ll +++ b/test/Transforms/LoopVectorize/multi-use-reduction-bug.ll @@ -16,10 +16,10 @@ entry: %n = alloca i32, align 4 %k7 = alloca i32, align 4 %nf = alloca i32, align 4 - %0 = load i32* %k7, align 4 + %0 = load i32, i32* %k7, align 4 %.neg1 = sub i32 0, %0 - %n.promoted = load i32* %n, align 4 - %nf.promoted = load i32* %nf, align 4 + %n.promoted = load i32, i32* %n, align 4 + %nf.promoted = load i32, i32* %nf, align 4 br label %for.body for.body: diff --git a/test/Transforms/LoopVectorize/multiple-address-spaces.ll b/test/Transforms/LoopVectorize/multiple-address-spaces.ll index bb2af1e..e79c931 100644 --- a/test/Transforms/LoopVectorize/multiple-address-spaces.ll +++ b/test/Transforms/LoopVectorize/multiple-address-spaces.ll @@ -27,10 +27,10 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds [40000 x i8] addrspace(1)* @Y, i64 0, i64 %indvars.iv - %0 = load i8 addrspace(1)* %arrayidx, align 1 + %arrayidx = getelementptr inbounds [40000 x i8], [40000 x i8] addrspace(1)* @Y, i64 0, i64 %indvars.iv + %0 = load i8, i8 addrspace(1)* %arrayidx, align 1 %add = add i8 %0, 1 - %arrayidx3 = getelementptr inbounds [40000 x i8]* @X, i64 0, i64 %indvars.iv + %arrayidx3 = getelementptr inbounds [40000 x i8], [40000 x i8]* @X, i64 0, i64 %indvars.iv store i8 %add, i8* %arrayidx3, align 1 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/no_array_bounds.ll b/test/Transforms/LoopVectorize/no_array_bounds.ll index d3bd755..1a2fda1 100644 --- a/test/Transforms/LoopVectorize/no_array_bounds.ll +++ b/test/Transforms/LoopVectorize/no_array_bounds.ll @@ -33,11 +33,11 @@ for.body7.preheader: ; preds = %for.cond5.preheader for.body: ; preds = %for.body.preheader, %for.body %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds i32* %B, i64 %indvars.iv27, !dbg !14 - %0 = load i32* %arrayidx, align 4, !dbg !14, !tbaa !22 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv27, !dbg !14 + %0 = load i32, i32* %arrayidx, align 4, !dbg !14, !tbaa !22 %idxprom1 = sext i32 %0 to i64, !dbg !14 - %arrayidx2 = getelementptr inbounds i32* %A, i64 %idxprom1, !dbg !14 - %1 = load i32* %arrayidx2, align 4, !dbg !14, !tbaa !22 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 %idxprom1, !dbg !14 + %1 = load i32, i32* %arrayidx2, align 4, !dbg !14, !tbaa !22 %inc = add nsw i32 %1, 1, !dbg !14 store i32 %inc, i32* %arrayidx2, align 4, !dbg !14, !tbaa !22 %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1, !dbg !10 @@ -47,11 +47,11 @@ for.body: ; preds = %for.body.preheader, for.body7: ; preds = %for.body7.preheader, %for.body7 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 0, %for.body7.preheader ] - %arrayidx9 = getelementptr inbounds i32* %A, i64 %indvars.iv, !dbg !20 - %2 = load i32* %arrayidx9, align 4, !dbg !20, !tbaa !22 + %arrayidx9 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv, !dbg !20 + %2 = load i32, i32* %arrayidx9, align 4, !dbg !20, !tbaa !22 %idxprom10 = sext i32 %2 to i64, !dbg !20 - %arrayidx11 = getelementptr inbounds i32* %B, i64 %idxprom10, !dbg !20 - %3 = load i32* %arrayidx11, align 4, !dbg !20, !tbaa !22 + %arrayidx11 = getelementptr inbounds i32, i32* %B, i64 %idxprom10, !dbg !20 + %3 = load i32, i32* %arrayidx11, align 4, !dbg !20, !tbaa !22 %inc12 = add nsw i32 %3, 1, !dbg !20 store i32 %inc12, i32* %arrayidx11, align 4, !dbg !20, !tbaa !22 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1, !dbg !16 @@ -72,28 +72,28 @@ attributes #0 = { nounwind } !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\004\00clang version 3.5.0\001\00\000\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] -!1 = !{!"no_array_bounds.cpp", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "no_array_bounds.cpp", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00test\00test\00\001\000\001\000\006\00256\001\002", !1, !5, !6, null, void (i32*, i32*, i32)* @_Z4testPiS_i, null, null, !2} ; [ DW_TAG_subprogram ] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] +!4 = !MDSubprogram(name: "test", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, function: void (i32*, i32*, i32)* @_Z4testPiS_i, variables: !2) +!5 = !MDFile(filename: "no_array_bounds.cpp", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 2} -!8 = !{i32 2, !"Debug Info Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5.0"} !10 = !MDLocation(line: 4, column: 8, scope: !11) -!11 = !{!"0xb\004\003\000", !1, !4} ; [ DW_TAG_lexical_block ] +!11 = distinct !MDLexicalBlock(line: 4, column: 3, file: !1, scope: !4) !12 = !{!12, !13} !13 = !{!"llvm.loop.vectorize.enable", i1 true} !14 = !MDLocation(line: 5, column: 5, scope: !15) -!15 = !{!"0xb\004\0036\000", !1, !11} ; [ DW_TAG_lexical_block ] +!15 = distinct !MDLexicalBlock(line: 4, column: 36, file: !1, scope: !11) !16 = !MDLocation(line: 9, column: 8, scope: !17) -!17 = !{!"0xb\009\003\000", !1, !4} ; [ DW_TAG_lexical_block ] +!17 = distinct !MDLexicalBlock(line: 9, column: 3, file: !1, scope: !4) !18 = !{!18, !13, !19} !19 = !{!"llvm.loop.vectorize.width", i32 1} !20 = !MDLocation(line: 10, column: 5, scope: !21) -!21 = !{!"0xb\009\0036\000", !1, !17} ; [ DW_TAG_lexical_block ] +!21 = distinct !MDLexicalBlock(line: 9, column: 36, file: !1, scope: !17) !22 = !{!23, !23, i64 0} !23 = !{!"int", !24, i64 0} !24 = !{!"omnipotent char", !25, i64 0} diff --git a/test/Transforms/LoopVectorize/no_idiv_reduction.ll b/test/Transforms/LoopVectorize/no_idiv_reduction.ll index 5c721a680..bfa48a2 100644 --- a/test/Transforms/LoopVectorize/no_idiv_reduction.ll +++ b/test/Transforms/LoopVectorize/no_idiv_reduction.ll @@ -11,8 +11,8 @@ for.body: ; CHECK-NOT: sdiv <2 x i32> %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %r.05 = phi i32 [ 80, %entry ], [ %div, %for.body ] - %arrayidx = getelementptr inbounds [128 x i32]* @a, i64 0, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [128 x i32], [128 x i32]* @a, i64 0, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %div = sdiv i32 %r.05, %0 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/no_int_induction.ll b/test/Transforms/LoopVectorize/no_int_induction.ll index 1275915..7e6b26c 100644 --- a/test/Transforms/LoopVectorize/no_int_induction.ll +++ b/test/Transforms/LoopVectorize/no_int_induction.ll @@ -14,16 +14,16 @@ target datalayout = "e-p:64:64:64-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32- ;CHECK: ret i32 define i32 @sum_array(i32* %A, i32 %n) nounwind uwtable readonly noinline ssp { %1 = sext i32 %n to i64 - %2 = getelementptr inbounds i32* %A, i64 %1 + %2 = getelementptr inbounds i32, i32* %A, i64 %1 %3 = icmp eq i32 %n, 0 br i1 %3, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %.lr.ph.i .lr.ph.i: ; preds = %0, %.lr.ph.i %.03.i = phi i32* [ %6, %.lr.ph.i ], [ %A, %0 ] %.012.i = phi i32 [ %5, %.lr.ph.i ], [ 0, %0 ] - %4 = load i32* %.03.i, align 4 + %4 = load i32, i32* %.03.i, align 4 %5 = add nsw i32 %4, %.012.i - %6 = getelementptr inbounds i32* %.03.i, i64 1 + %6 = getelementptr inbounds i32, i32* %.03.i, i64 1 %7 = icmp eq i32* %6, %2 br i1 %7, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %.lr.ph.i @@ -41,16 +41,16 @@ _ZSt10accumulateIPiiET0_T_S2_S1_.exit: ; preds = %.lr.ph.i, %0 ;CHECK: ret i32 define i32 @sum_array_as1(i32 addrspace(1)* %A, i32 %n) nounwind uwtable readonly noinline ssp { %1 = sext i32 %n to i64 - %2 = getelementptr inbounds i32 addrspace(1)* %A, i64 %1 + %2 = getelementptr inbounds i32, i32 addrspace(1)* %A, i64 %1 %3 = icmp eq i32 %n, 0 br i1 %3, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %.lr.ph.i .lr.ph.i: ; preds = %0, %.lr.ph.i %.03.i = phi i32 addrspace(1)* [ %6, %.lr.ph.i ], [ %A, %0 ] %.012.i = phi i32 [ %5, %.lr.ph.i ], [ 0, %0 ] - %4 = load i32 addrspace(1)* %.03.i, align 4 + %4 = load i32, i32 addrspace(1)* %.03.i, align 4 %5 = add nsw i32 %4, %.012.i - %6 = getelementptr inbounds i32 addrspace(1)* %.03.i, i64 1 + %6 = getelementptr inbounds i32, i32 addrspace(1)* %.03.i, i64 1 %7 = icmp eq i32 addrspace(1)* %6, %2 br i1 %7, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %.lr.ph.i diff --git a/test/Transforms/LoopVectorize/no_outside_user.ll b/test/Transforms/LoopVectorize/no_outside_user.ll index bcd29c1..7030b6b 100644 --- a/test/Transforms/LoopVectorize/no_outside_user.ll +++ b/test/Transforms/LoopVectorize/no_outside_user.ll @@ -20,7 +20,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i32 @main() { bb: - %b.promoted = load i32* @b, align 4 + %b.promoted = load i32, i32* @b, align 4 br label %.lr.ph.i .lr.ph.i: @@ -56,7 +56,7 @@ f1.exit.loopexit: define i32 @test2() { entry: store i32 0, i32* @x1, align 4 - %0 = load i32* @x0, align 4 + %0 = load i32, i32* @x0, align 4 br label %for.cond1.preheader for.cond1.preheader: diff --git a/test/Transforms/LoopVectorize/no_switch.ll b/test/Transforms/LoopVectorize/no_switch.ll index 64aab37..14d2fab 100644 --- a/test/Transforms/LoopVectorize/no_switch.ll +++ b/test/Transforms/LoopVectorize/no_switch.ll @@ -21,8 +21,8 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body.preheader ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv, !dbg !14 - %0 = load i32* %arrayidx, align 4, !dbg !14, !tbaa !16 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv, !dbg !14 + %0 = load i32, i32* %arrayidx, align 4, !dbg !14, !tbaa !16 switch i32 %0, label %for.inc [ i32 0, label %sw.bb i32 1, label %sw.bb3 @@ -59,28 +59,28 @@ attributes #0 = { nounwind } !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\004\00clang version 3.5.0\001\00\006\00\002", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./source.cpp] [DW_LANG_C_plus_plus] -!1 = !{!"source.cpp", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0", isOptimized: true, runtimeVersion: 6, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "source.cpp", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00test_switch\00test_switch\00\001\000\001\000\006\00256\001\001", !1, !5, !6, null, void (i32*, i32)* @_Z11test_switchPii, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [test_switch] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./source.cpp] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "test_switch", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32*, i32)* @_Z11test_switchPii, variables: !2) +!5 = !MDFile(filename: "source.cpp", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 2} -!8 = !{i32 2, !"Debug Info Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5.0"} !10 = !MDLocation(line: 3, column: 8, scope: !11) -!11 = !{!"0xb\003\003\000", !1, !4} ; [ DW_TAG_lexical_block ] +!11 = distinct !MDLexicalBlock(line: 3, column: 3, file: !1, scope: !4) !12 = !{!12, !13, !13} !13 = !{!"llvm.loop.vectorize.enable", i1 true} !14 = !MDLocation(line: 4, column: 5, scope: !15) -!15 = !{!"0xb\003\0036\000", !1, !11} ; [ DW_TAG_lexical_block ] +!15 = distinct !MDLexicalBlock(line: 3, column: 36, file: !1, scope: !11) !16 = !{!17, !17, i64 0} !17 = !{!"int", !18, i64 0} !18 = !{!"omnipotent char", !19, i64 0} !19 = !{!"Simple C/C++ TBAA"} !20 = !MDLocation(line: 6, column: 7, scope: !21) -!21 = !{!"0xb\004\0018\000", !1, !15} ; [ DW_TAG_lexical_block ] +!21 = distinct !MDLexicalBlock(line: 4, column: 18, file: !1, scope: !15) !22 = !MDLocation(line: 7, column: 5, scope: !21) !23 = !MDLocation(line: 9, column: 7, scope: !21) !24 = !MDLocation(line: 14, column: 1, scope: !4) diff --git a/test/Transforms/LoopVectorize/nofloat.ll b/test/Transforms/LoopVectorize/nofloat.ll index e9f4c5f..6956bd9 100644 --- a/test/Transforms/LoopVectorize/nofloat.ll +++ b/test/Transforms/LoopVectorize/nofloat.ll @@ -15,7 +15,7 @@ define void @example12() noimplicitfloat { ; <--------- "noimplicitflo ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv %3 = trunc i64 %indvars.iv to i32 store i32 %3, i32* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/non-const-n.ll b/test/Transforms/LoopVectorize/non-const-n.ll index b03d4f0..9007b1b 100644 --- a/test/Transforms/LoopVectorize/non-const-n.ll +++ b/test/Transforms/LoopVectorize/non-const-n.ll @@ -20,12 +20,12 @@ define void @example1(i32 %n) nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %6, i32* %7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/nsw-crash.ll b/test/Transforms/LoopVectorize/nsw-crash.ll index 68d9933..3631f0b 100644 --- a/test/Transforms/LoopVectorize/nsw-crash.ll +++ b/test/Transforms/LoopVectorize/nsw-crash.ll @@ -13,7 +13,7 @@ while.body.lr.ph: while.body: %it.sroa.0.091 = phi i32* [ undef, %while.body.lr.ph ], [ %incdec.ptr.i, %while.body ] - %incdec.ptr.i = getelementptr inbounds i32* %it.sroa.0.091, i64 1 + %incdec.ptr.i = getelementptr inbounds i32, i32* %it.sroa.0.091, i64 1 %inc32 = add i32 undef, 1 ; <------------- Make sure we don't set NSW flags to the undef. %cmp.i11 = icmp eq i32* %incdec.ptr.i, undef br i1 %cmp.i11, label %while.end, label %while.body diff --git a/test/Transforms/LoopVectorize/opt.ll b/test/Transforms/LoopVectorize/opt.ll index a9be80f..71b7e1f 100644 --- a/test/Transforms/LoopVectorize/opt.ll +++ b/test/Transforms/LoopVectorize/opt.ll @@ -16,8 +16,8 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %red.05 = phi i32 [ 0, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %red.05 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 255 diff --git a/test/Transforms/LoopVectorize/ptr_loops.ll b/test/Transforms/LoopVectorize/ptr_loops.ll index 3fb38fe..bc80413 100644 --- a/test/Transforms/LoopVectorize/ptr_loops.ll +++ b/test/Transforms/LoopVectorize/ptr_loops.ll @@ -15,14 +15,14 @@ define i32 @_Z5test1v() nounwind uwtable ssp { br label %1 ; <label>:1 ; preds = %0, %1 - %p.02 = phi i32* [ getelementptr inbounds ([36 x i32]* @A, i64 0, i64 18), %0 ], [ %4, %1 ] - %b.01 = phi i32* [ getelementptr inbounds ([36 x i32]* @B, i64 0, i64 0), %0 ], [ %5, %1 ] - %2 = load i32* %b.01, align 4 + %p.02 = phi i32* [ getelementptr inbounds ([36 x i32], [36 x i32]* @A, i64 0, i64 18), %0 ], [ %4, %1 ] + %b.01 = phi i32* [ getelementptr inbounds ([36 x i32], [36 x i32]* @B, i64 0, i64 0), %0 ], [ %5, %1 ] + %2 = load i32, i32* %b.01, align 4 %3 = shl nsw i32 %2, 1 store i32 %3, i32* %p.02, align 4 - %4 = getelementptr inbounds i32* %p.02, i64 -1 - %5 = getelementptr inbounds i32* %b.01, i64 1 - %6 = icmp eq i32* %4, getelementptr ([36 x i32]* @A, i64 128102389400760775, i64 3) + %4 = getelementptr inbounds i32, i32* %p.02, i64 -1 + %5 = getelementptr inbounds i32, i32* %b.01, i64 1 + %6 = icmp eq i32* %4, getelementptr ([36 x i32], [36 x i32]* @A, i64 128102389400760775, i64 3) br i1 %6, label %7, label %1 ; <label>:7 ; preds = %1 @@ -38,13 +38,13 @@ define i32 @_Z5test2v() nounwind uwtable ssp { br label %1 ; <label>:1 ; preds = %0, %1 - %p.02 = phi i32* [ getelementptr inbounds ([36 x i32]* @A, i64 0, i64 25), %0 ], [ %3, %1 ] - %b.01 = phi i32* [ getelementptr inbounds ([36 x i32]* @B, i64 0, i64 2), %0 ], [ %4, %1 ] - %2 = load i32* %b.01, align 4 + %p.02 = phi i32* [ getelementptr inbounds ([36 x i32], [36 x i32]* @A, i64 0, i64 25), %0 ], [ %3, %1 ] + %b.01 = phi i32* [ getelementptr inbounds ([36 x i32], [36 x i32]* @B, i64 0, i64 2), %0 ], [ %4, %1 ] + %2 = load i32, i32* %b.01, align 4 store i32 %2, i32* %p.02, align 4 - %3 = getelementptr inbounds i32* %p.02, i64 -1 - %4 = getelementptr inbounds i32* %b.01, i64 1 - %5 = icmp eq i32* %4, getelementptr inbounds ([36 x i32]* @A, i64 0, i64 18) + %3 = getelementptr inbounds i32, i32* %p.02, i64 -1 + %4 = getelementptr inbounds i32, i32* %b.01, i64 1 + %5 = icmp eq i32* %4, getelementptr inbounds ([36 x i32], [36 x i32]* @A, i64 0, i64 18) br i1 %5, label %6, label %1 ; <label>:6 ; preds = %1 @@ -60,13 +60,13 @@ define i32 @_Z5test3v() nounwind uwtable ssp { br label %1 ; <label>:1 ; preds = %0, %1 - %p.02 = phi i32* [ getelementptr inbounds ([36 x i32]* @A, i64 0, i64 29), %0 ], [ %3, %1 ] - %b.01 = phi i32* [ getelementptr inbounds ([36 x i32]* @B, i64 0, i64 5), %0 ], [ %4, %1 ] - %2 = load i32* %b.01, align 4 + %p.02 = phi i32* [ getelementptr inbounds ([36 x i32], [36 x i32]* @A, i64 0, i64 29), %0 ], [ %3, %1 ] + %b.01 = phi i32* [ getelementptr inbounds ([36 x i32], [36 x i32]* @B, i64 0, i64 5), %0 ], [ %4, %1 ] + %2 = load i32, i32* %b.01, align 4 store i32 %2, i32* %p.02, align 4 - %3 = getelementptr inbounds i32* %p.02, i64 -1 - %4 = getelementptr inbounds i32* %b.01, i64 1 - %5 = icmp eq i32* %3, getelementptr ([36 x i32]* @A, i64 128102389400760775, i64 3) + %3 = getelementptr inbounds i32, i32* %p.02, i64 -1 + %4 = getelementptr inbounds i32, i32* %b.01, i64 1 + %5 = icmp eq i32* %3, getelementptr ([36 x i32], [36 x i32]* @A, i64 128102389400760775, i64 3) br i1 %5, label %6, label %1 ; <label>:6 ; preds = %1 diff --git a/test/Transforms/LoopVectorize/read-only.ll b/test/Transforms/LoopVectorize/read-only.ll index 2f7a96a..f81afd6 100644 --- a/test/Transforms/LoopVectorize/read-only.ll +++ b/test/Transforms/LoopVectorize/read-only.ll @@ -13,11 +13,11 @@ define i32 @read_only_func(i32* nocapture %A, i32* nocapture %B, i32 %n) nounwin .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %sum.02 = phi i32 [ %9, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = add nsw i64 %indvars.iv, 13 - %5 = getelementptr inbounds i32* %B, i64 %4 - %6 = load i32* %5, align 4 + %5 = getelementptr inbounds i32, i32* %B, i64 %4 + %6 = load i32, i32* %5, align 4 %7 = shl i32 %6, 1 %8 = add i32 %3, %sum.02 %9 = add i32 %8, %7 diff --git a/test/Transforms/LoopVectorize/reduction.ll b/test/Transforms/LoopVectorize/reduction.ll index 5e6b7fa..647e58a 100644 --- a/test/Transforms/LoopVectorize/reduction.ll +++ b/test/Transforms/LoopVectorize/reduction.ll @@ -20,10 +20,10 @@ define i32 @reduction_sum(i32 %n, i32* noalias nocapture %A, i32* noalias nocapt .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %sum.02 = phi i32 [ %9, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds i32* %B, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = trunc i64 %indvars.iv to i32 %7 = add i32 %sum.02, %6 %8 = add i32 %7, %3 @@ -55,10 +55,10 @@ define i32 @reduction_prod(i32 %n, i32* noalias nocapture %A, i32* noalias nocap .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %prod.02 = phi i32 [ %9, %.lr.ph ], [ 1, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds i32* %B, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = trunc i64 %indvars.iv to i32 %7 = mul i32 %prod.02, %6 %8 = mul i32 %7, %3 @@ -90,10 +90,10 @@ define i32 @reduction_mix(i32 %n, i32* noalias nocapture %A, i32* noalias nocapt .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %sum.02 = phi i32 [ %9, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds i32* %B, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = mul nsw i32 %5, %3 %7 = trunc i64 %indvars.iv to i32 %8 = add i32 %sum.02, %7 @@ -123,10 +123,10 @@ define i32 @reduction_mul(i32 %n, i32* noalias nocapture %A, i32* noalias nocapt .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] %sum.02 = phi i32 [ %9, %.lr.ph ], [ 19, %0 ] - %2 = getelementptr inbounds i32* %A, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds i32* %B, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = trunc i64 %indvars.iv to i32 %7 = add i32 %3, %6 %8 = add i32 %7, %5 @@ -158,10 +158,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.09 = phi i32 [ %add, %for.body ], [ 120, %entry ] - %arrayidx = getelementptr inbounds i32* %in, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %coeff, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %in, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %coeff, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %mul = mul nsw i32 %1, %0 %add = add nsw i32 %mul, %sum.09 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -191,10 +191,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %result.08 = phi i32 [ %and, %for.body ], [ -1, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %B, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %add = add nsw i32 %1, %0 %and = and i32 %add, %result.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -223,10 +223,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %result.08 = phi i32 [ %or, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %B, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %add = add nsw i32 %1, %0 %or = or i32 %add, %result.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -255,10 +255,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %result.08 = phi i32 [ %xor, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %B, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %add = add nsw i32 %1, %0 %xor = xor i32 %add, %result.08 %indvars.iv.next = add i64 %indvars.iv, 1 @@ -284,8 +284,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %x.05 = phi i32 [ %sub, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %sub = sub nsw i32 %0, %x.05 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -311,8 +311,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %x.05 = phi i32 [ %sub, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %sub = sub nsw i32 %x.05, %0 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -335,10 +335,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] %sum.033 = phi float [ %S, %entry ], [ %sum.1, %for.inc ] - %arrayidx = getelementptr inbounds float* %A, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds float* %B, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float, float* %B, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 %cmp3 = fcmp ogt float %0, %1 br i1 %cmp3, label %if.then, label %for.inc @@ -380,10 +380,10 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] %sum.033 = phi float [ %S, %entry ], [ %sum.1, %for.inc ] - %arrayidx = getelementptr inbounds float* %A, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds float* %B, i64 %indvars.iv - %1 = load float* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds float, float* %B, i64 %indvars.iv + %1 = load float, float* %arrayidx2, align 4 %cmp3 = fcmp ogt float %0, %1 br i1 %cmp3, label %if.then, label %for.inc @@ -427,8 +427,8 @@ for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %sum2.09 = phi float [ 0.000000e+00, %entry ], [ %add1, %for.body ] %sum.08 = phi float [ %S, %entry ], [ %add, %for.body ] - %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %B, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %add = fadd fast float %sum.08, %0 %add1 = fadd fast float %sum2.09, %add %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/reverse_induction.ll b/test/Transforms/LoopVectorize/reverse_induction.ll index d379606..6b63a0d 100644 --- a/test/Transforms/LoopVectorize/reverse_induction.ll +++ b/test/Transforms/LoopVectorize/reverse_induction.ll @@ -18,8 +18,8 @@ for.body: %i.06 = phi i32 [ 0, %entry ], [ %inc4, %for.body ] %redux5 = phi i32 [ 0, %entry ], [ %inc.redux, %for.body ] %add.i = add i64 %add.i7, -1 - %kind_.i = getelementptr inbounds i32* %ptr, i64 %add.i - %tmp.i1 = load i32* %kind_.i, align 4 + %kind_.i = getelementptr inbounds i32, i32* %ptr, i64 %add.i + %tmp.i1 = load i32, i32* %kind_.i, align 4 %inc.redux = add i32 %tmp.i1, %redux5 %inc4 = add i32 %i.06, 1 %exitcond = icmp ne i32 %inc4, 1024 @@ -41,8 +41,8 @@ for.body: %i.06 = phi i32 [ 0, %entry ], [ %inc4, %for.body ] %redux5 = phi i32 [ 0, %entry ], [ %inc.redux, %for.body ] %add.i = add i128 %add.i7, -1 - %kind_.i = getelementptr inbounds i32* %ptr, i128 %add.i - %tmp.i1 = load i32* %kind_.i, align 4 + %kind_.i = getelementptr inbounds i32, i32* %ptr, i128 %add.i + %tmp.i1 = load i32, i32* %kind_.i, align 4 %inc.redux = add i32 %tmp.i1, %redux5 %inc4 = add i32 %i.06, 1 %exitcond = icmp ne i32 %inc4, 1024 @@ -65,8 +65,8 @@ for.body: %i.06 = phi i32 [ 0, %entry ], [ %inc4, %for.body ] %redux5 = phi i32 [ 0, %entry ], [ %inc.redux, %for.body ] %add.i = add i16 %add.i7, -1 - %kind_.i = getelementptr inbounds i32* %ptr, i16 %add.i - %tmp.i1 = load i32* %kind_.i, align 4 + %kind_.i = getelementptr inbounds i32, i32* %ptr, i16 %add.i + %tmp.i1 = load i32, i32* %kind_.i, align 4 %inc.redux = add i32 %tmp.i1, %redux5 %inc4 = add i32 %i.06, 1 %exitcond = icmp ne i32 %inc4, 1024 @@ -109,7 +109,7 @@ while.body: %forward_induction.05 = phi i8 [ 0, %entry ], [ %inc, %while.body ] %inc = add i8 %forward_induction.05, 1 %conv = zext i8 %inc to i32 - %arrayidx = getelementptr inbounds [1024 x i32]* @a, i64 0, i64 %indvars.iv + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @a, i64 0, i64 %indvars.iv store i32 %conv, i32* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, -1 %0 = trunc i64 %indvars.iv to i32 @@ -136,7 +136,7 @@ while.body: %forward_induction.05 = phi i8 [ -127, %entry ], [ %inc, %while.body ] %inc = add i8 %forward_induction.05, 1 %conv = sext i8 %inc to i32 - %arrayidx = getelementptr inbounds [1024 x i32]* @a, i64 0, i64 %indvars.iv + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @a, i64 0, i64 %indvars.iv store i32 %conv, i32* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, -1 %0 = trunc i64 %indvars.iv to i32 diff --git a/test/Transforms/LoopVectorize/reverse_iter.ll b/test/Transforms/LoopVectorize/reverse_iter.ll index 13172bb..5bbc769 100644 --- a/test/Transforms/LoopVectorize/reverse_iter.ll +++ b/test/Transforms/LoopVectorize/reverse_iter.ll @@ -30,8 +30,8 @@ define i32 @foo(i32 %n, i32* nocapture %A) { %4 = trunc i64 %indvars.iv to i32 %5 = shl nsw i32 %4, 1 %6 = sext i32 %5 to i64 - %7 = getelementptr inbounds i32* %A, i64 %6 - %8 = load i32* %7, align 4 + %7 = getelementptr inbounds i32, i32* %A, i64 %6 + %8 = load i32, i32* %7, align 4 %9 = add nsw i32 %8, %sum.01 %indvars.iv.next = add i64 %indvars.iv, -1 %10 = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/runtime-check-address-space.ll b/test/Transforms/LoopVectorize/runtime-check-address-space.ll index ec56f80..8e7ac1f 100644 --- a/test/Transforms/LoopVectorize/runtime-check-address-space.ll +++ b/test/Transforms/LoopVectorize/runtime-check-address-space.ll @@ -37,11 +37,11 @@ entry: for.body: ; preds = %entry, %for.body %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %i.02 to i64 - %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %idxprom - %0 = load i32 addrspace(1)* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %idxprom + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 %mul = mul nsw i32 %0, 3 %idxprom1 = sext i32 %i.02 to i64 - %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %a, i64 %idxprom1 store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4 %inc = add nsw i32 %i.02, 1 %cmp = icmp slt i32 %inc, %n @@ -64,11 +64,11 @@ entry: for.body: ; preds = %entry, %for.body %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %i.02 to i64 - %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %idxprom - %0 = load i32 addrspace(1)* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %idxprom + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 %mul = mul nsw i32 %0, 3 %idxprom1 = sext i32 %i.02 to i64 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %idxprom1 store i32 %mul, i32* %arrayidx2, align 4 %inc = add nsw i32 %i.02, 1 %cmp = icmp slt i32 %inc, %n @@ -91,11 +91,11 @@ entry: for.body: ; preds = %entry, %for.body %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %i.02 to i64 - %arrayidx = getelementptr inbounds i32* %b, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %mul = mul nsw i32 %0, 3 %idxprom1 = sext i32 %i.02 to i64 - %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %a, i64 %idxprom1 store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4 %inc = add nsw i32 %i.02, 1 %cmp = icmp slt i32 %inc, %n @@ -119,11 +119,11 @@ entry: for.body: ; preds = %entry, %for.body %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %i.02 to i64 - %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %idxprom - %0 = load i32 addrspace(1)* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %idxprom + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 %mul = mul nsw i32 %0, 3 %idxprom1 = sext i32 %i.02 to i64 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %idxprom1 store i32 %mul, i32* %arrayidx2, align 4 %inc = add nsw i32 %i.02, 1 %cmp = icmp slt i32 %inc, %n @@ -147,11 +147,11 @@ entry: for.body: ; preds = %entry, %for.body %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %i.02 to i64 - %arrayidx = getelementptr inbounds i32* %b, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %mul = mul nsw i32 %0, 3 %idxprom1 = sext i32 %i.02 to i64 - %arrayidx2 = getelementptr inbounds [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom1 store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4 %inc = add nsw i32 %i.02, 1 %cmp = icmp slt i32 %inc, %n @@ -176,11 +176,11 @@ entry: for.body: ; preds = %entry, %for.body %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %i.02 to i64 - %arrayidx = getelementptr inbounds [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom - %0 = load i32 addrspace(1)* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 %mul = mul nsw i32 %0, 3 %idxprom1 = sext i32 %i.02 to i64 - %arrayidx2 = getelementptr inbounds i32* %b, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds i32, i32* %b, i64 %idxprom1 store i32 %mul, i32* %arrayidx2, align 4 %inc = add nsw i32 %i.02, 1 %cmp = icmp slt i32 %inc, %n @@ -204,11 +204,11 @@ entry: for.body: ; preds = %entry, %for.body %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %i.02 to i64 - %arrayidx = getelementptr inbounds [1024 x i32] addrspace(2)* @q_as2, i64 0, i64 %idxprom - %0 = load i32 addrspace(2)* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32] addrspace(2)* @q_as2, i64 0, i64 %idxprom + %0 = load i32, i32 addrspace(2)* %arrayidx, align 4 %mul = mul nsw i32 %0, 3 %idxprom1 = sext i32 %i.02 to i64 - %arrayidx2 = getelementptr inbounds [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom1 + %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32] addrspace(1)* @g_as1, i64 0, i64 %idxprom1 store i32 %mul, i32 addrspace(1)* %arrayidx2, align 4 %inc = add nsw i32 %i.02, 1 %cmp = icmp slt i32 %inc, %n diff --git a/test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll b/test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll index 12ba3ce..6ee983d 100644 --- a/test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll +++ b/test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll @@ -14,12 +14,12 @@ entry: for.body: ; preds = %entry, %for.body %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01 - %0 = load i32 addrspace(1)* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32 addrspace(1)* %c, i64 %i.01 - %1 = load i32 addrspace(1)* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %i.01 + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %c, i64 %i.01 + %1 = load i32, i32 addrspace(1)* %arrayidx1, align 4 %add = add nsw i32 %0, %1 - %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %i.01 + %arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %a, i64 %i.01 store i32 %add, i32 addrspace(1)* %arrayidx2, align 4 %inc = add i64 %i.01, 1 %cmp = icmp ult i64 %inc, 200 @@ -39,12 +39,12 @@ entry: for.body: ; preds = %entry, %for.body %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx = getelementptr inbounds i32* %b, i64 %i.01 - %0 = load i32* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32* %c, i64 %i.01 - %1 = load i32* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, i32* %b, i64 %i.01 + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, i32* %c, i64 %i.01 + %1 = load i32, i32* %arrayidx1, align 4 %add = add nsw i32 %0, %1 - %arrayidx2 = getelementptr inbounds i32 addrspace(1)* %a, i64 %i.01 + %arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %a, i64 %i.01 store i32 %add, i32 addrspace(1)* %arrayidx2, align 4 %inc = add i64 %i.01, 1 %cmp = icmp ult i64 %inc, 200 @@ -64,12 +64,12 @@ entry: for.body: ; preds = %entry, %for.body %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01 - %0 = load i32 addrspace(1)* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32* %c, i64 %i.01 - %1 = load i32* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %i.01 + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, i32* %c, i64 %i.01 + %1 = load i32, i32* %arrayidx1, align 4 %add = add nsw i32 %0, %1 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.01 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %i.01 store i32 %add, i32* %arrayidx2, align 4 %inc = add i64 %i.01, 1 %cmp = icmp ult i64 %inc, 200 @@ -89,12 +89,12 @@ entry: for.body: ; preds = %entry, %for.body %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01 - %0 = load i32 addrspace(1)* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32 addrspace(1)* %c, i64 %i.01 - %1 = load i32 addrspace(1)* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %i.01 + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %c, i64 %i.01 + %1 = load i32, i32 addrspace(1)* %arrayidx1, align 4 %add = add nsw i32 %0, %1 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.01 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %i.01 store i32 %add, i32* %arrayidx2, align 4 %inc = add i64 %i.01, 1 %cmp = icmp ult i64 %inc, 200 @@ -114,12 +114,12 @@ entry: for.body: ; preds = %entry, %for.body %i.01 = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx = getelementptr inbounds i32 addrspace(1)* %b, i64 %i.01 - %0 = load i32 addrspace(1)* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32 addrspace(2)* %c, i64 %i.01 - %1 = load i32 addrspace(2)* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %b, i64 %i.01 + %0 = load i32, i32 addrspace(1)* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, i32 addrspace(2)* %c, i64 %i.01 + %1 = load i32, i32 addrspace(2)* %arrayidx1, align 4 %add = add nsw i32 %0, %1 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %i.01 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %i.01 store i32 %add, i32* %arrayidx2, align 4 %inc = add i64 %i.01, 1 %cmp = icmp ult i64 %inc, 200 diff --git a/test/Transforms/LoopVectorize/runtime-check-readonly.ll b/test/Transforms/LoopVectorize/runtime-check-readonly.ll index 9d02a6a..a3b5a59 100644 --- a/test/Transforms/LoopVectorize/runtime-check-readonly.ll +++ b/test/Transforms/LoopVectorize/runtime-check-readonly.ll @@ -22,12 +22,12 @@ entry: for.body: %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %B, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 - %arrayidx2 = getelementptr inbounds i32* %C, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %C, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4 %add = add nsw i32 %1, %0 - %arrayidx4 = getelementptr inbounds i32* %A, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv store i32 %add, i32* %arrayidx4, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/runtime-check.ll b/test/Transforms/LoopVectorize/runtime-check.ll index 1edafb4..b1c5d40 100644 --- a/test/Transforms/LoopVectorize/runtime-check.ll +++ b/test/Transforms/LoopVectorize/runtime-check.ll @@ -21,10 +21,10 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %mul = fmul float %0, 3.000000e+00 - %arrayidx2 = getelementptr inbounds float* %a, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %a, i64 %indvars.iv store float %mul, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -47,11 +47,11 @@ entry: for.body: %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] %ind.sum = add i64 %iv, %offset - %arr.idx = getelementptr inbounds float* %a, i64 %ind.sum - %l1 = load float* %arr.idx, align 4 + %arr.idx = getelementptr inbounds float, float* %a, i64 %ind.sum + %l1 = load float, float* %arr.idx, align 4 %ind.sum2 = add i64 %iv, %offset2 - %arr.idx2 = getelementptr inbounds float* %a, i64 %ind.sum2 - %l2 = load float* %arr.idx2, align 4 + %arr.idx2 = getelementptr inbounds float, float* %a, i64 %ind.sum2 + %l2 = load float, float* %arr.idx2, align 4 %m = fmul fast float %b, %l2 %ad = fadd fast float %l1, %m store float %ad, float* %arr.idx, align 4 diff --git a/test/Transforms/LoopVectorize/runtime-limit.ll b/test/Transforms/LoopVectorize/runtime-limit.ll index 324949d..6bc71e1 100644 --- a/test/Transforms/LoopVectorize/runtime-limit.ll +++ b/test/Transforms/LoopVectorize/runtime-limit.ll @@ -13,21 +13,21 @@ entry: for.body: ; preds = %for.body, %entry %i.016 = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx = getelementptr inbounds i32* %A, i64 %i.016 - %0 = load i32* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32* %B, i64 %i.016 - %1 = load i32* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %i.016 + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 %i.016 + %1 = load i32, i32* %arrayidx1, align 4 %add = add nsw i32 %1, %0 - %arrayidx2 = getelementptr inbounds i32* %C, i64 %i.016 - %2 = load i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %C, i64 %i.016 + %2 = load i32, i32* %arrayidx2, align 4 %add3 = add nsw i32 %add, %2 - %arrayidx4 = getelementptr inbounds i32* %E, i64 %i.016 - %3 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %E, i64 %i.016 + %3 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %add3, %3 - %arrayidx6 = getelementptr inbounds i32* %F, i64 %i.016 - %4 = load i32* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %F, i64 %i.016 + %4 = load i32, i32* %arrayidx6, align 4 %add7 = add nsw i32 %add5, %4 - %arrayidx8 = getelementptr inbounds i32* %out, i64 %i.016 + %arrayidx8 = getelementptr inbounds i32, i32* %out, i64 %i.016 store i32 %add7, i32* %arrayidx8, align 4 %inc = add i64 %i.016, 1 %exitcond = icmp eq i64 %inc, 256 @@ -47,32 +47,32 @@ entry: for.body: ; preds = %for.body, %entry %i.037 = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx = getelementptr inbounds i32* %A, i64 %i.037 - %0 = load i32* %arrayidx, align 4 - %arrayidx1 = getelementptr inbounds i32* %B, i64 %i.037 - %1 = load i32* %arrayidx1, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %i.037 + %0 = load i32, i32* %arrayidx, align 4 + %arrayidx1 = getelementptr inbounds i32, i32* %B, i64 %i.037 + %1 = load i32, i32* %arrayidx1, align 4 %add = add nsw i32 %1, %0 - %arrayidx2 = getelementptr inbounds i32* %C, i64 %i.037 - %2 = load i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %C, i64 %i.037 + %2 = load i32, i32* %arrayidx2, align 4 %add3 = add nsw i32 %add, %2 - %arrayidx4 = getelementptr inbounds i32* %E, i64 %i.037 - %3 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %E, i64 %i.037 + %3 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %add3, %3 - %arrayidx6 = getelementptr inbounds i32* %F, i64 %i.037 - %4 = load i32* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %F, i64 %i.037 + %4 = load i32, i32* %arrayidx6, align 4 %add7 = add nsw i32 %add5, %4 - %arrayidx8 = getelementptr inbounds i32* %out, i64 %i.037 + %arrayidx8 = getelementptr inbounds i32, i32* %out, i64 %i.037 store i32 %add7, i32* %arrayidx8, align 4 - %5 = load i32* %arrayidx, align 4 - %6 = load i32* %arrayidx1, align 4 + %5 = load i32, i32* %arrayidx, align 4 + %6 = load i32, i32* %arrayidx1, align 4 %add11 = add nsw i32 %6, %5 - %7 = load i32* %arrayidx2, align 4 + %7 = load i32, i32* %arrayidx2, align 4 %add13 = add nsw i32 %add11, %7 - %8 = load i32* %arrayidx4, align 4 + %8 = load i32, i32* %arrayidx4, align 4 %add15 = add nsw i32 %add13, %8 - %9 = load i32* %arrayidx6, align 4 + %9 = load i32, i32* %arrayidx6, align 4 %add17 = add nsw i32 %add15, %9 - %arrayidx18 = getelementptr inbounds i32* %out2, i64 %i.037 + %arrayidx18 = getelementptr inbounds i32, i32* %out2, i64 %i.037 store i32 %add17, i32* %arrayidx18, align 4 %inc = add i64 %i.037, 1 %exitcond = icmp eq i64 %inc, 256 diff --git a/test/Transforms/LoopVectorize/safegep.ll b/test/Transforms/LoopVectorize/safegep.ll index f853afd..ecef813 100644 --- a/test/Transforms/LoopVectorize/safegep.ll +++ b/test/Transforms/LoopVectorize/safegep.ll @@ -17,10 +17,10 @@ entry: "<bb 3>": %i_15 = phi i32 [ 0, %entry ], [ %i_19, %"<bb 3>" ] - %pp3 = getelementptr float* %A, i32 %i_15 - %D.1396_10 = load float* %pp3, align 4 - %pp24 = getelementptr float* %B, i32 %i_15 - %D.1398_15 = load float* %pp24, align 4 + %pp3 = getelementptr float, float* %A, i32 %i_15 + %D.1396_10 = load float, float* %pp3, align 4 + %pp24 = getelementptr float, float* %B, i32 %i_15 + %D.1398_15 = load float, float* %pp24, align 4 %D.1399_17 = fadd float %D.1398_15, %K %D.1400_18 = fmul float %D.1396_10, %D.1399_17 store float %D.1400_18, float* %pp3, align 4 @@ -43,10 +43,10 @@ entry: "<bb 3>": %i_15 = phi i32 [ 0, %entry ], [ %i_19, %"<bb 3>" ] - %pp3 = getelementptr float addrspace(5) * %A, i32 %i_15 - %D.1396_10 = load float addrspace(5) * %pp3, align 4 - %pp24 = getelementptr float* %B, i32 %i_15 - %D.1398_15 = load float* %pp24, align 4 + %pp3 = getelementptr float, float addrspace(5) * %A, i32 %i_15 + %D.1396_10 = load float, float addrspace(5) * %pp3, align 4 + %pp24 = getelementptr float, float* %B, i32 %i_15 + %D.1398_15 = load float, float* %pp24, align 4 %D.1399_17 = fadd float %D.1398_15, %K %D.1400_18 = fmul float %D.1396_10, %D.1399_17 store float %D.1400_18, float addrspace(5) * %pp3, align 4 diff --git a/test/Transforms/LoopVectorize/same-base-access.ll b/test/Transforms/LoopVectorize/same-base-access.ll index d19458f..31cff0e 100644 --- a/test/Transforms/LoopVectorize/same-base-access.ll +++ b/test/Transforms/LoopVectorize/same-base-access.ll @@ -26,33 +26,33 @@ define i32 @kernel11(double* %x, double* %y, i32 %n) nounwind uwtable ssp { br label %4 ; <label>:4 ; preds = %25, %0 - %5 = load i32* %k, align 4 - %6 = load i32* %3, align 4 + %5 = load i32, i32* %k, align 4 + %6 = load i32, i32* %3, align 4 %7 = icmp slt i32 %5, %6 br i1 %7, label %8, label %28 ; <label>:8 ; preds = %4 - %9 = load i32* %k, align 4 + %9 = load i32, i32* %k, align 4 %10 = sub nsw i32 %9, 1 %11 = sext i32 %10 to i64 - %12 = load double** %1, align 8 - %13 = getelementptr inbounds double* %12, i64 %11 - %14 = load double* %13, align 8 - %15 = load i32* %k, align 4 + %12 = load double*, double** %1, align 8 + %13 = getelementptr inbounds double, double* %12, i64 %11 + %14 = load double, double* %13, align 8 + %15 = load i32, i32* %k, align 4 %16 = sext i32 %15 to i64 - %17 = load double** %2, align 8 - %18 = getelementptr inbounds double* %17, i64 %16 - %19 = load double* %18, align 8 + %17 = load double*, double** %2, align 8 + %18 = getelementptr inbounds double, double* %17, i64 %16 + %19 = load double, double* %18, align 8 %20 = fadd double %14, %19 - %21 = load i32* %k, align 4 + %21 = load i32, i32* %k, align 4 %22 = sext i32 %21 to i64 - %23 = load double** %1, align 8 - %24 = getelementptr inbounds double* %23, i64 %22 + %23 = load double*, double** %1, align 8 + %24 = getelementptr inbounds double, double* %23, i64 %22 store double %20, double* %24, align 8 br label %25 ; <label>:25 ; preds = %8 - %26 = load i32* %k, align 4 + %26 = load i32, i32* %k, align 4 %27 = add nsw i32 %26, 1 store i32 %27, i32* %k, align 4 br label %4 @@ -86,8 +86,8 @@ define i32 @func2(i32* nocapture %a) nounwind uwtable ssp { ; <label>:1 ; preds = %7, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %7 ] %2 = mul nsw i64 %indvars.iv, 7 - %3 = getelementptr inbounds i32* %a, i64 %2 - %4 = load i32* %3, align 4 + %3 = getelementptr inbounds i32, i32* %a, i64 %2 + %4 = load i32, i32* %3, align 4 %5 = icmp sgt i32 %4, 3 br i1 %5, label %6, label %7 diff --git a/test/Transforms/LoopVectorize/scalar-select.ll b/test/Transforms/LoopVectorize/scalar-select.ll index 6b37cc2..b17b202 100644 --- a/test/Transforms/LoopVectorize/scalar-select.ll +++ b/test/Transforms/LoopVectorize/scalar-select.ll @@ -18,12 +18,12 @@ define void @example1(i1 %cond) nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv %sel = select i1 %cond, i32 %6, i32 zeroinitializer store i32 %sel, i32* %7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/scev-exitlim-crash.ll b/test/Transforms/LoopVectorize/scev-exitlim-crash.ll index 5154771..cfc1d6d 100644 --- a/test/Transforms/LoopVectorize/scev-exitlim-crash.ll +++ b/test/Transforms/LoopVectorize/scev-exitlim-crash.ll @@ -29,14 +29,14 @@ for.cond4.preheader: ; preds = %for.cond br i1 %cmp514, label %for.cond7.preheader.lr.ph, label %for.end26 for.cond7.preheader.lr.ph: ; preds = %for.cond4.preheader - %0 = load i32** @e, align 8, !tbaa !4 + %0 = load i32*, i32** @e, align 8, !tbaa !4 br label %for.cond7.preheader for.cond7.preheader: ; preds = %for.cond7.preheader.lr.ph, %for.inc23 %y.017 = phi i32 [ 0, %for.cond7.preheader.lr.ph ], [ %inc24, %for.inc23 ] %i.116 = phi i32 [ 0, %for.cond7.preheader.lr.ph ], [ %i.2.lcssa, %for.inc23 ] %n.015 = phi i32 [ undef, %for.cond7.preheader.lr.ph ], [ %inc25, %for.inc23 ] - %1 = load i32* @b, align 4, !tbaa !5 + %1 = load i32, i32* @b, align 4, !tbaa !5 %tobool11 = icmp eq i32 %1, 0 br i1 %tobool11, label %for.inc23, label %for.body8.lr.ph @@ -51,7 +51,7 @@ for.body8: ; preds = %for.body8.lr.ph, %f %add10 = add i32 %add9, %2 store i32 %add10, i32* @f, align 4, !tbaa !5 %idx.ext = sext i32 %add10 to i64 - %add.ptr = getelementptr inbounds i32* @a, i64 %idx.ext + %add.ptr = getelementptr inbounds i32, i32* @a, i64 %idx.ext %tobool129 = icmp eq i32 %i.213, 0 br i1 %tobool129, label %for.inc19, label %for.body13.lr.ph @@ -62,9 +62,9 @@ for.body13.lr.ph: ; preds = %for.body8 for.body13: ; preds = %for.body13.lr.ph, %for.body13 %indvars.iv = phi i64 [ %3, %for.body13.lr.ph ], [ %indvars.iv.next, %for.body13 ] %add.ptr.sum = add i64 %idx.ext, %indvars.iv - %arrayidx = getelementptr inbounds i32* @a, i64 %add.ptr.sum - %4 = load i32* %arrayidx, align 4, !tbaa !5 - %arrayidx15 = getelementptr inbounds i32* %0, i64 %indvars.iv + %arrayidx = getelementptr inbounds i32, i32* @a, i64 %add.ptr.sum + %4 = load i32, i32* %arrayidx, align 4, !tbaa !5 + %arrayidx15 = getelementptr inbounds i32, i32* %0, i64 %indvars.iv store i32 %4, i32* %arrayidx15, align 4, !tbaa !5 %indvars.iv.next = add i64 %indvars.iv, 1 %5 = trunc i64 %indvars.iv.next to i32 @@ -75,11 +75,11 @@ for.cond11.for.inc19_crit_edge: ; preds = %for.body13 br label %for.inc19 for.inc19: ; preds = %for.cond11.for.inc19_crit_edge, %for.body8 - %6 = load i32* @c, align 4, !tbaa !5 + %6 = load i32, i32* @c, align 4, !tbaa !5 %inc20 = add nsw i32 %6, 1 store i32 %inc20, i32* @c, align 4, !tbaa !5 %indvars.iv.next20 = add i64 %indvars.iv19, 1 - %7 = load i32* @b, align 4, !tbaa !5 + %7 = load i32, i32* @b, align 4, !tbaa !5 %tobool = icmp eq i32 %7, 0 br i1 %tobool, label %for.cond7.for.inc23_crit_edge, label %for.body8 diff --git a/test/Transforms/LoopVectorize/simple-unroll.ll b/test/Transforms/LoopVectorize/simple-unroll.ll index 8bf680a..fc996ed 100644 --- a/test/Transforms/LoopVectorize/simple-unroll.ll +++ b/test/Transforms/LoopVectorize/simple-unroll.ll @@ -23,8 +23,8 @@ define void @inc(i32 %n) nounwind uwtable noinline ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = trunc i64 %indvars.iv to i32 %5 = add nsw i32 %3, %4 store i32 %5, i32* %2, align 4 diff --git a/test/Transforms/LoopVectorize/small-loop.ll b/test/Transforms/LoopVectorize/small-loop.ll index 1d30102..ce606d1 100644 --- a/test/Transforms/LoopVectorize/small-loop.ll +++ b/test/Transforms/LoopVectorize/small-loop.ll @@ -15,12 +15,12 @@ define void @example1() nounwind uwtable ssp { ; <label>:1 ; preds = %1, %0 %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %1 ] - %2 = getelementptr inbounds [2048 x i32]* @b, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 - %4 = getelementptr inbounds [2048 x i32]* @c, i64 0, i64 %indvars.iv - %5 = load i32* %4, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @b, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds [2048 x i32], [2048 x i32]* @c, i64 0, i64 %indvars.iv + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %5, %3 - %7 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv + %7 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv store i32 %6, i32* %7, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/start-non-zero.ll b/test/Transforms/LoopVectorize/start-non-zero.ll index cc47494..b444a69 100644 --- a/test/Transforms/LoopVectorize/start-non-zero.ll +++ b/test/Transforms/LoopVectorize/start-non-zero.ll @@ -17,8 +17,8 @@ for.body.lr.ph: ; preds = %entry for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv - %1 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %1 = load i32, i32* %arrayidx, align 4 %mul = mul nuw i32 %1, 333 store i32 %mul, i32* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/store-shuffle-bug.ll b/test/Transforms/LoopVectorize/store-shuffle-bug.ll index 6d3d113..4d62df1 100644 --- a/test/Transforms/LoopVectorize/store-shuffle-bug.ll +++ b/test/Transforms/LoopVectorize/store-shuffle-bug.ll @@ -30,14 +30,14 @@ entry: for.body: %indvars.iv = phi i64 [ 93, %entry ], [ %indvars.iv.next, %for.body ] %0 = add i64 %indvars.iv, 1 - %arrayidx = getelementptr inbounds [100 x i32]* @uf, i64 0, i64 %0 - %arrayidx3 = getelementptr inbounds [100 x i32]* @xi, i64 0, i64 %0 - %1 = load i32* %arrayidx3, align 4 - %2 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* @uf, i64 0, i64 %0 + %arrayidx3 = getelementptr inbounds [100 x i32], [100 x i32]* @xi, i64 0, i64 %0 + %1 = load i32, i32* %arrayidx3, align 4 + %2 = load i32, i32* %arrayidx, align 4 %add4 = add nsw i32 %2, %1 store i32 %add4, i32* %arrayidx, align 4 - %arrayidx7 = getelementptr inbounds [100 x i32]* @q, i64 0, i64 %0 - %3 = load i32* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds [100 x i32], [100 x i32]* @q, i64 0, i64 %0 + %3 = load i32, i32* %arrayidx7, align 4 %add8 = add nsw i32 %add4, %3 store i32 %add8, i32* %arrayidx, align 4 %indvars.iv.next = add i64 %indvars.iv, -1 diff --git a/test/Transforms/LoopVectorize/struct_access.ll b/test/Transforms/LoopVectorize/struct_access.ll index cf6f325..1e4019a 100644 --- a/test/Transforms/LoopVectorize/struct_access.ll +++ b/test/Transforms/LoopVectorize/struct_access.ll @@ -32,8 +32,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.05 = phi i32 [ %add, %for.body ], [ 0, %entry ] - %x = getelementptr inbounds %struct.coordinate* %A, i64 %indvars.iv, i32 0 - %0 = load i32* %x, align 4 + %x = getelementptr inbounds %struct.coordinate, %struct.coordinate* %A, i64 %indvars.iv, i32 0 + %0 = load i32, i32* %x, align 4 %add = add nsw i32 %0, %sum.05 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -74,8 +74,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.05 = phi i32 [ %add, %for.body ], [ 0, %entry ] - %x = getelementptr inbounds %struct.lit* %A, i64 %indvars.iv, i32 0 - %0 = load i32* %x, align 4 + %x = getelementptr inbounds %struct.lit, %struct.lit* %A, i64 %indvars.iv, i32 0 + %0 = load i32, i32* %x, align 4 %add = add nsw i32 %0, %sum.05 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/tbaa-nodep.ll b/test/Transforms/LoopVectorize/tbaa-nodep.ll index be3e74f..06d0002 100644 --- a/test/Transforms/LoopVectorize/tbaa-nodep.ll +++ b/test/Transforms/LoopVectorize/tbaa-nodep.ll @@ -10,10 +10,10 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv - %0 = load float* %arrayidx, align 4, !tbaa !0 + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4, !tbaa !0 %conv = fptosi float %0 to i32 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv store i32 %conv, i32* %arrayidx2, align 4, !tbaa !4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 1600 @@ -30,7 +30,7 @@ for.end: ; preds = %for.body ; CHECK-NEXT: br label %vector.body ; CHECK: vector.body: -; CHECK: load <4 x float>* %{{.*}}, align 4, !tbaa +; CHECK: load <4 x float>, <4 x float>* %{{.*}}, align 4, !tbaa ; CHECK: store <4 x i32> %{{.*}}, <4 x i32>* %{{.*}}, align 4, !tbaa ; CHECK: ret i32 0 @@ -38,7 +38,7 @@ for.end: ; preds = %for.body ; CHECK-NOTBAA-LABEL: @test1 ; CHECK-NOTBAA: icmp uge i32* -; CHECK-NOTBAA: load <4 x float>* %{{.*}}, align 4, !tbaa +; CHECK-NOTBAA: load <4 x float>, <4 x float>* %{{.*}}, align 4, !tbaa ; CHECK-NOTBAA: store <4 x i32> %{{.*}}, <4 x i32>* %{{.*}}, align 4, !tbaa ; CHECK-NOTBAA: ret i32 0 @@ -51,13 +51,13 @@ entry: for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] - %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv - %0 = load float* %arrayidx, align 4, !tbaa !0 - %arrayidx2 = getelementptr inbounds i32* %a, i64 %indvars.iv - %1 = load i32* %arrayidx2, align 4, !tbaa !4 + %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4, !tbaa !0 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv + %1 = load i32, i32* %arrayidx2, align 4, !tbaa !4 %conv = sitofp i32 %1 to float %mul = fmul float %0, %conv - %arrayidx4 = getelementptr inbounds float* %c, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds float, float* %c, i64 %indvars.iv store float %mul, float* %arrayidx4, align 4, !tbaa !0 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 1600 @@ -74,7 +74,7 @@ for.end: ; preds = %for.body ; CHECK: icmp uge float* ; CHECK-NOT: icmp uge i32* -; CHECK: load <4 x float>* %{{.*}}, align 4, !tbaa +; CHECK: load <4 x float>, <4 x float>* %{{.*}}, align 4, !tbaa ; CHECK: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 4, !tbaa ; CHECK: ret i32 0 @@ -85,7 +85,7 @@ for.end: ; preds = %for.body ; CHECK-NOTBAA-DAG: icmp uge float* ; CHECK-NOTBAA-DAG: icmp uge i32* -; CHECK-NOTBAA: load <4 x float>* %{{.*}}, align 4, !tbaa +; CHECK-NOTBAA: load <4 x float>, <4 x float>* %{{.*}}, align 4, !tbaa ; CHECK-NOTBAA: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 4, !tbaa ; CHECK-NOTBAA: ret i32 0 diff --git a/test/Transforms/LoopVectorize/undef-inst-bug.ll b/test/Transforms/LoopVectorize/undef-inst-bug.ll index 0444fe8..e9d053c 100644 --- a/test/Transforms/LoopVectorize/undef-inst-bug.ll +++ b/test/Transforms/LoopVectorize/undef-inst-bug.ll @@ -24,7 +24,7 @@ for.body: ; Loop invariant anchored in loop. %idxprom21 = zext i32 undef to i64 - %arrayidx23 = getelementptr inbounds [100 x [100 x i32]]* undef, i64 0, i64 %idxprom21, i64 %indvars.iv17 + %arrayidx23 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* undef, i64 0, i64 %idxprom21, i64 %indvars.iv17 store i32 undef, i32* %arrayidx23, align 4 %indvars.next= add i64 %indvars.iv17, -1 %0 = trunc i64 %indvars.next to i32 diff --git a/test/Transforms/LoopVectorize/unroll_novec.ll b/test/Transforms/LoopVectorize/unroll_novec.ll index 257b4e6..c23ad77 100644 --- a/test/Transforms/LoopVectorize/unroll_novec.ll +++ b/test/Transforms/LoopVectorize/unroll_novec.ll @@ -10,11 +10,11 @@ target triple = "x86_64-apple-macosx10.8.0" ; a[i] += i; ; } ;CHECK-LABEL: @inc( -;CHECK: load i32* -;CHECK: load i32* -;CHECK: load i32* -;CHECK: load i32* -;CHECK-NOT: load i32* +;CHECK: load i32, i32* +;CHECK: load i32, i32* +;CHECK: load i32, i32* +;CHECK: load i32, i32* +;CHECK-NOT: load i32, i32* ;CHECK: add nsw i32 ;CHECK: add nsw i32 ;CHECK: add nsw i32 @@ -33,8 +33,8 @@ define void @inc(i32 %n) nounwind uwtable noinline ssp { .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds [2048 x i32]* @a, i64 0, i64 %indvars.iv - %3 = load i32* %2, align 4 + %2 = getelementptr inbounds [2048 x i32], [2048 x i32]* @a, i64 0, i64 %indvars.iv + %3 = load i32, i32* %2, align 4 %4 = trunc i64 %indvars.iv to i32 %5 = add nsw i32 %3, %4 store i32 %5, i32* %2, align 4 diff --git a/test/Transforms/LoopVectorize/unsized-pointee-crash.ll b/test/Transforms/LoopVectorize/unsized-pointee-crash.ll index 5cc9837..7763c9c 100644 --- a/test/Transforms/LoopVectorize/unsized-pointee-crash.ll +++ b/test/Transforms/LoopVectorize/unsized-pointee-crash.ll @@ -11,10 +11,10 @@ for.body: %b.05 = phi i32 (...)* [ undef, %entry ], [ %1, %for.body ] %a.04 = phi i32 [ 0, %entry ], [ %inc, %for.body ] %0 = bitcast i32 (...)* %b.05 to i8* - %add.ptr = getelementptr i8* %0, i64 1 + %add.ptr = getelementptr i8, i8* %0, i64 1 %1 = bitcast i8* %add.ptr to i32 (...)* ; CHECK: %[[cst:.*]] = bitcast i32 (...)* {{.*}} to i8* -; CHECK-NEXT: %[[gep:.*]] = getelementptr i8* %[[cst]], i64 1 +; CHECK-NEXT: %[[gep:.*]] = getelementptr i8, i8* %[[cst]], i64 1 %inc = add nsw i32 %a.04, 1 %exitcond = icmp eq i32 %a.04, 63 br i1 %exitcond, label %for.end, label %for.body diff --git a/test/Transforms/LoopVectorize/value-ptr-bug.ll b/test/Transforms/LoopVectorize/value-ptr-bug.ll index 7fb9095..ce4601f 100644 --- a/test/Transforms/LoopVectorize/value-ptr-bug.ll +++ b/test/Transforms/LoopVectorize/value-ptr-bug.ll @@ -19,8 +19,8 @@ entry: loop: %inc = phi i32 [ %sub267, %entry ], [ %add, %loop] %ext.inc = sext i32 %inc to i64 - %add.ptr265 = getelementptr inbounds i32* %ptr265, i64 %ext.inc - %add.ptr266 = getelementptr inbounds i32* %ptr266, i64 %ext.inc + %add.ptr265 = getelementptr inbounds i32, i32* %ptr265, i64 %ext.inc + %add.ptr266 = getelementptr inbounds i32, i32* %ptr266, i64 %ext.inc %add = add i32 %inc, 9 %cmp = icmp slt i32 %add, 140 br i1 %cmp, label %block1, label %loop @@ -37,9 +37,9 @@ do.body272: %row_width.5 = phi i32 [ %sub267.lcssa, %block1 ], [ %dec, %do.body272 ] %sp.4 = phi i8* [ %tmp30, %block1 ], [ %incdec.ptr273, %do.body272 ] %dp.addr.4 = phi i8* [ %tmp29, %block1 ], [ %incdec.ptr274, %do.body272 ] - %incdec.ptr273 = getelementptr inbounds i8* %sp.4, i64 1 - %tmp31 = load i8* %sp.4, align 1 - %incdec.ptr274 = getelementptr inbounds i8* %dp.addr.4, i64 1 + %incdec.ptr273 = getelementptr inbounds i8, i8* %sp.4, i64 1 + %tmp31 = load i8, i8* %sp.4, align 1 + %incdec.ptr274 = getelementptr inbounds i8, i8* %dp.addr.4, i64 1 store i8 %tmp31, i8* %dp.addr.4, align 1 %dec = add i32 %row_width.5, -1 %cmp276 = icmp eq i32 %dec, 0 diff --git a/test/Transforms/LoopVectorize/vect.omp.persistence.ll b/test/Transforms/LoopVectorize/vect.omp.persistence.ll index ea7be9c..0d7f8b9 100644 --- a/test/Transforms/LoopVectorize/vect.omp.persistence.ll +++ b/test/Transforms/LoopVectorize/vect.omp.persistence.ll @@ -45,13 +45,13 @@ for.header: for.body: %0 = add nsw i64 %indvars.iv, -5 - %arrayidx = getelementptr inbounds float* %a, i64 %0 - %1 = load float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !1 + %arrayidx = getelementptr inbounds float, float* %a, i64 %0 + %1 = load float, float* %arrayidx, align 4, !llvm.mem.parallel_loop_access !1 %2 = add nsw i64 %indvars.iv, 2 - %arrayidx2 = getelementptr inbounds float* %a, i64 %2 - %3 = load float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !1 + %arrayidx2 = getelementptr inbounds float, float* %a, i64 %2 + %3 = load float, float* %arrayidx2, align 4, !llvm.mem.parallel_loop_access !1 %mul = fmul float %1, %3 - %arrayidx4 = getelementptr inbounds float* %a, i64 %indvars.iv + %arrayidx4 = getelementptr inbounds float, float* %a, i64 %indvars.iv store float %mul, float* %arrayidx4, align 4, !llvm.mem.parallel_loop_access !1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 diff --git a/test/Transforms/LoopVectorize/vect.stats.ll b/test/Transforms/LoopVectorize/vect.stats.ll index c5b6e64..7bf5a60 100644 --- a/test/Transforms/LoopVectorize/vect.stats.ll +++ b/test/Transforms/LoopVectorize/vect.stats.ll @@ -20,8 +20,8 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv2 = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds float* %a, i64 %indvars.iv2 - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 %indvars.iv2 + %0 = load float, float* %arrayidx, align 4 %mul = fmul float %0, %0 store float %mul, float* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv2, 1 @@ -42,13 +42,13 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv2 = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %0 = add nsw i64 %indvars.iv2, -5 - %arrayidx = getelementptr inbounds float* %a, i64 %0 - %1 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %a, i64 %0 + %1 = load float, float* %arrayidx, align 4 %2 = add nsw i64 %indvars.iv2, 2 - %arrayidx2 = getelementptr inbounds float* %a, i64 %2 - %3 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %a, i64 %2 + %3 = load float, float* %arrayidx2, align 4 %mul = fmul float %1, %3 - %arrayidx4 = getelementptr inbounds float* %a, i64 %indvars.iv2 + %arrayidx4 = getelementptr inbounds float, float* %a, i64 %indvars.iv2 store float %mul, float* %arrayidx4, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv2, 1 %cmp2 = icmp sgt i64 %indvars.iv.next, %size diff --git a/test/Transforms/LoopVectorize/vectorize-once.ll b/test/Transforms/LoopVectorize/vectorize-once.ll index a9b2a53..9a91250 100644 --- a/test/Transforms/LoopVectorize/vectorize-once.ll +++ b/test/Transforms/LoopVectorize/vectorize-once.ll @@ -22,16 +22,16 @@ target triple = "x86_64-apple-macosx10.8.0" define i32 @_Z4foo1Pii(i32* %A, i32 %n) #0 { entry: %idx.ext = sext i32 %n to i64 - %add.ptr = getelementptr inbounds i32* %A, i64 %idx.ext + %add.ptr = getelementptr inbounds i32, i32* %A, i64 %idx.ext %cmp3.i = icmp eq i32 %n, 0 br i1 %cmp3.i, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %for.body.i for.body.i: ; preds = %entry, %for.body.i %__init.addr.05.i = phi i32 [ %add.i, %for.body.i ], [ 0, %entry ] %__first.addr.04.i = phi i32* [ %incdec.ptr.i, %for.body.i ], [ %A, %entry ] - %0 = load i32* %__first.addr.04.i, align 4 + %0 = load i32, i32* %__first.addr.04.i, align 4 %add.i = add nsw i32 %0, %__init.addr.05.i - %incdec.ptr.i = getelementptr inbounds i32* %__first.addr.04.i, i64 1 + %incdec.ptr.i = getelementptr inbounds i32, i32* %__first.addr.04.i, i64 1 %cmp.i = icmp eq i32* %incdec.ptr.i, %add.ptr br i1 %cmp.i, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %for.body.i @@ -48,16 +48,16 @@ _ZSt10accumulateIPiiET0_T_S2_S1_.exit: ; preds = %for.body.i, %entry define i32 @_Z4foo2Pii(i32* %A, i32 %n) #0 { entry: %idx.ext = sext i32 %n to i64 - %add.ptr = getelementptr inbounds i32* %A, i64 %idx.ext + %add.ptr = getelementptr inbounds i32, i32* %A, i64 %idx.ext %cmp3.i = icmp eq i32 %n, 0 br i1 %cmp3.i, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %for.body.i for.body.i: ; preds = %entry, %for.body.i %__init.addr.05.i = phi i32 [ %add.i, %for.body.i ], [ 0, %entry ] %__first.addr.04.i = phi i32* [ %incdec.ptr.i, %for.body.i ], [ %A, %entry ] - %0 = load i32* %__first.addr.04.i, align 4 + %0 = load i32, i32* %__first.addr.04.i, align 4 %add.i = add nsw i32 %0, %__init.addr.05.i - %incdec.ptr.i = getelementptr inbounds i32* %__first.addr.04.i, i64 1 + %incdec.ptr.i = getelementptr inbounds i32, i32* %__first.addr.04.i, i64 1 %cmp.i = icmp eq i32* %incdec.ptr.i, %add.ptr br i1 %cmp.i, label %_ZSt10accumulateIPiiET0_T_S2_S1_.exit, label %for.body.i, !llvm.loop !0 @@ -71,7 +71,8 @@ attributes #0 = { nounwind readonly ssp uwtable "fp-contract-model"="standard" " ; CHECK: !0 = distinct !{!0, !1, !2} ; CHECK: !1 = !{!"llvm.loop.vectorize.width", i32 1} ; CHECK: !2 = !{!"llvm.loop.interleave.count", i32 1} -; CHECK: !3 = distinct !{!3, !1, !2} +; CHECK: !3 = distinct !{!3, !4, !1, !2} +; CHECK: !4 = !{!"llvm.loop.unroll.runtime.disable"} !0 = !{!0, !1} !1 = !{!"llvm.loop.vectorize.width", i32 1} diff --git a/test/Transforms/LoopVectorize/version-mem-access.ll b/test/Transforms/LoopVectorize/version-mem-access.ll index 37145aa..a9d319e 100644 --- a/test/Transforms/LoopVectorize/version-mem-access.ll +++ b/test/Transforms/LoopVectorize/version-mem-access.ll @@ -34,14 +34,14 @@ for.body: %iv.trunc = trunc i64 %indvars.iv to i32 %mul = mul i32 %iv.trunc, %BStride %mul64 = zext i32 %mul to i64 - %arrayidx = getelementptr inbounds i32* %B, i64 %mul64 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 %mul64 + %0 = load i32, i32* %arrayidx, align 4 %mul2 = mul nsw i64 %indvars.iv, %CStride - %arrayidx3 = getelementptr inbounds i32* %C, i64 %mul2 - %1 = load i32* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %C, i64 %mul2 + %1 = load i32, i32* %arrayidx3, align 4 %mul4 = mul nsw i32 %1, %0 %mul3 = mul nsw i64 %indvars.iv, %AStride - %arrayidx7 = getelementptr inbounds i32* %A, i64 %mul3 + %arrayidx7 = getelementptr inbounds i32, i32* %A, i64 %mul3 store i32 %mul4, i32* %arrayidx7, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 @@ -76,9 +76,9 @@ for.body: %0 = trunc i64 %indvars.iv to i32 %mul = mul nsw i32 %0, %conv %idxprom = sext i32 %mul to i64 - %arrayidx = getelementptr inbounds double* %x, i64 %idxprom - %1 = load double* %arrayidx, align 8 - %arrayidx3 = getelementptr inbounds double* %c, i64 %indvars.iv + %arrayidx = getelementptr inbounds double, double* %x, i64 %idxprom + %1 = load double, double* %arrayidx, align 8 + %arrayidx3 = getelementptr inbounds double, double* %c, i64 %indvars.iv store double %1, double* %arrayidx3, align 8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 diff --git a/test/Transforms/LoopVectorize/write-only.ll b/test/Transforms/LoopVectorize/write-only.ll index 2f100de..b2bc045 100644 --- a/test/Transforms/LoopVectorize/write-only.ll +++ b/test/Transforms/LoopVectorize/write-only.ll @@ -12,8 +12,8 @@ define i32 @read_mod_write_single_ptr(float* nocapture %a, i32 %n) nounwind uwta .lr.ph: ; preds = %0, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ] - %2 = getelementptr inbounds float* %a, i64 %indvars.iv - %3 = load float* %2, align 4 + %2 = getelementptr inbounds float, float* %a, i64 %indvars.iv + %3 = load float, float* %2, align 4 %4 = fmul float %3, 3.000000e+00 store float %4, float* %2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/LowerAtomic/atomic-swap.ll b/test/Transforms/LowerAtomic/atomic-swap.ll index cb11241..7700052 100644 --- a/test/Transforms/LowerAtomic/atomic-swap.ll +++ b/test/Transforms/LowerAtomic/atomic-swap.ll @@ -5,7 +5,7 @@ define i8 @cmpswap() { %i = alloca i8 %pair = cmpxchg i8* %i, i8 0, i8 42 monotonic monotonic %j = extractvalue { i8, i1 } %pair, 0 -; CHECK: [[OLDVAL:%[a-z0-9]+]] = load i8* [[ADDR:%[a-z0-9]+]] +; CHECK: [[OLDVAL:%[a-z0-9]+]] = load i8, i8* [[ADDR:%[a-z0-9]+]] ; CHECK-NEXT: [[SAME:%[a-z0-9]+]] = icmp eq i8 [[OLDVAL]], 0 ; CHECK-NEXT: [[TO_STORE:%[a-z0-9]+]] = select i1 [[SAME]], i8 42, i8 [[OLDVAL]] ; CHECK-NEXT: store i8 [[TO_STORE]], i8* [[ADDR]] diff --git a/test/Transforms/LowerBitSets/constant.ll b/test/Transforms/LowerBitSets/constant.ll index 230c57c..99c9259 100644 --- a/test/Transforms/LowerBitSets/constant.ll +++ b/test/Transforms/LowerBitSets/constant.ll @@ -22,13 +22,13 @@ define i1 @foo() { ; CHECK: @bar( define i1 @bar() { ; CHECK: ret i1 true - %x = call i1 @llvm.bitset.test(i8* bitcast (i32* getelementptr ([2 x i32]* @b, i32 0, i32 1) to i8*), metadata !"bitset1") + %x = call i1 @llvm.bitset.test(i8* bitcast (i32* getelementptr ([2 x i32], [2 x i32]* @b, i32 0, i32 1) to i8*), metadata !"bitset1") ret i1 %x } ; CHECK: @baz( define i1 @baz() { ; CHECK-NOT: ret i1 true - %x = call i1 @llvm.bitset.test(i8* bitcast (i32* getelementptr ([2 x i32]* @b, i32 0, i32 0) to i8*), metadata !"bitset1") + %x = call i1 @llvm.bitset.test(i8* bitcast (i32* getelementptr ([2 x i32], [2 x i32]* @b, i32 0, i32 0) to i8*), metadata !"bitset1") ret i1 %x } diff --git a/test/Transforms/LowerBitSets/simple.ll b/test/Transforms/LowerBitSets/simple.ll index 0928524..8694d67 100644 --- a/test/Transforms/LowerBitSets/simple.ll +++ b/test/Transforms/LowerBitSets/simple.ll @@ -1,4 +1,5 @@ ; RUN: opt -S -lowerbitsets < %s | FileCheck %s +; RUN: opt -S -lowerbitsets -mtriple=x86_64-apple-macosx10.8.0 < %s | FileCheck -check-prefix=CHECK-DARWIN %s ; RUN: opt -S -O3 < %s | FileCheck -check-prefix=CHECK-NODISCARD %s target datalayout = "e-p:32:32" @@ -9,8 +10,9 @@ target datalayout = "e-p:32:32" @c = constant i32 3 @d = constant [2 x i32] [i32 4, i32 5] +; CHECK: [[BA:@[^ ]*]] = private constant [68 x i8] c"\03\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\01" + ; Offset 0, 4 byte alignment -; CHECK: @bitset1.bits = private constant [9 x i8] c"\03\00\00\00\00\00\00\00\08" !0 = !{!"bitset1", i32* @a, i32 0} ; CHECK-NODISCARD-DAG: !{!"bitset1", i32* @a, i32 0} !1 = !{!"bitset1", [63 x i32]* @b, i32 0} @@ -19,14 +21,12 @@ target datalayout = "e-p:32:32" ; CHECK-NODISCARD-DAG: !{!"bitset1", [2 x i32]* @d, i32 4} ; Offset 4, 256 byte alignment -; CHECK: @bitset2.bits = private constant [1 x i8] c"\03" !3 = !{!"bitset2", [63 x i32]* @b, i32 0} ; CHECK-NODISCARD-DAG: !{!"bitset2", [63 x i32]* @b, i32 0} !4 = !{!"bitset2", i32* @c, i32 0} ; CHECK-NODISCARD-DAG: !{!"bitset2", i32* @c, i32 0} ; Offset 0, 4 byte alignment -; CHECK: @bitset3.bits = private constant [9 x i8] c"\01\00\00\00\00\00\00\00\02" !5 = !{!"bitset3", i32* @a, i32 0} ; CHECK-NODISCARD-DAG: !{!"bitset3", i32* @a, i32 0} !6 = !{!"bitset3", i32* @c, i32 0} @@ -38,10 +38,31 @@ target datalayout = "e-p:32:32" !llvm.bitsets = !{ !0, !1, !2, !3, !4, !5, !6, !7 } -; CHECK: @a = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 0) -; CHECK: @b = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 2) -; CHECK: @c = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 4) -; CHECK: @d = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 6) +; CHECK: @bits_use{{[0-9]*}} = private alias i8* @bits{{[0-9]*}} +; CHECK: @bits_use{{[0-9]*}} = private alias i8* @bits{{[0-9]*}} +; CHECK: @bits_use{{[0-9]*}} = private alias i8* @bits{{[0-9]*}} + +; CHECK: @a = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 0) +; CHECK: @b = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 2) +; CHECK: @c = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 4) +; CHECK: @d = alias getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 6) + +; CHECK-DARWIN: @aptr = constant i32* getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G:@[^ ]*]], i32 0, i32 0) +@aptr = constant i32* @a + +; CHECK-DARWIN: @bptr = constant [63 x i32]* getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 2) +@bptr = constant [63 x i32]* @b + +; CHECK-DARWIN: @cptr = constant i32* getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 4) +@cptr = constant i32* @c + +; CHECK-DARWIN: @dptr = constant [2 x i32]* getelementptr inbounds ({ i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }, { i32, [0 x i8], [63 x i32], [4 x i8], i32, [0 x i8], [2 x i32] }* [[G]], i32 0, i32 6) +@dptr = constant [2 x i32]* @d + +; CHECK-DARWIN: [[G]] = private constant + +; CHECK: @bits{{[0-9]*}} = private alias getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0) +; CHECK: @bits{{[0-9]*}} = private alias getelementptr inbounds ([68 x i8], [68 x i8]* [[BA]], i32 0, i32 0) declare i1 @llvm.bitset.test(i8* %ptr, metadata %bitset) nounwind readnone @@ -59,15 +80,12 @@ define i1 @foo(i32* %p) { ; CHECK: [[R6:%[^ ]*]] = icmp ult i32 [[R5]], 68 ; CHECK: br i1 [[R6]] - ; CHECK: [[R8:%[^ ]*]] = lshr i32 [[R5]], 5 - ; CHECK: [[R9:%[^ ]*]] = getelementptr i32* bitcast ([9 x i8]* @bitset1.bits to i32*), i32 [[R8]] - ; CHECK: [[R10:%[^ ]*]] = load i32* [[R9]] - ; CHECK: [[R11:%[^ ]*]] = and i32 [[R5]], 31 - ; CHECK: [[R12:%[^ ]*]] = shl i32 1, [[R11]] - ; CHECK: [[R13:%[^ ]*]] = and i32 [[R10]], [[R12]] - ; CHECK: [[R14:%[^ ]*]] = icmp ne i32 [[R13]], 0 + ; CHECK: [[R8:%[^ ]*]] = getelementptr i8, i8* @bits_use{{[0-9]*}}, i32 [[R5]] + ; CHECK: [[R9:%[^ ]*]] = load i8, i8* [[R8]] + ; CHECK: [[R10:%[^ ]*]] = and i8 [[R9]], 1 + ; CHECK: [[R11:%[^ ]*]] = icmp ne i8 [[R10]], 0 - ; CHECK: [[R16:%[^ ]*]] = phi i1 [ false, {{%[^ ]*}} ], [ [[R14]], {{%[^ ]*}} ] + ; CHECK: [[R16:%[^ ]*]] = phi i1 [ false, {{%[^ ]*}} ], [ [[R11]], {{%[^ ]*}} ] %x = call i1 @llvm.bitset.test(i8* %pi8, metadata !"bitset1") ; CHECK-NOT: llvm.bitset.test @@ -105,15 +123,12 @@ define i1 @baz(i32* %p) { ; CHECK: [[T6:%[^ ]*]] = icmp ult i32 [[T5]], 66 ; CHECK: br i1 [[T6]] - ; CHECK: [[T8:%[^ ]*]] = lshr i32 [[T5]], 5 - ; CHECK: [[T9:%[^ ]*]] = getelementptr i32* bitcast ([9 x i8]* @bitset3.bits to i32*), i32 [[T8]] - ; CHECK: [[T10:%[^ ]*]] = load i32* [[T9]] - ; CHECK: [[T11:%[^ ]*]] = and i32 [[T5]], 31 - ; CHECK: [[T12:%[^ ]*]] = shl i32 1, [[T11]] - ; CHECK: [[T13:%[^ ]*]] = and i32 [[T10]], [[T12]] - ; CHECK: [[T14:%[^ ]*]] = icmp ne i32 [[T13]], 0 + ; CHECK: [[T8:%[^ ]*]] = getelementptr i8, i8* @bits_use{{[0-9]*}}, i32 [[T5]] + ; CHECK: [[T9:%[^ ]*]] = load i8, i8* [[T8]] + ; CHECK: [[T10:%[^ ]*]] = and i8 [[T9]], 2 + ; CHECK: [[T11:%[^ ]*]] = icmp ne i8 [[T10]], 0 - ; CHECK: [[T16:%[^ ]*]] = phi i1 [ false, {{%[^ ]*}} ], [ [[T14]], {{%[^ ]*}} ] + ; CHECK: [[T16:%[^ ]*]] = phi i1 [ false, {{%[^ ]*}} ], [ [[T11]], {{%[^ ]*}} ] %x = call i1 @llvm.bitset.test(i8* %pi8, metadata !"bitset3") ; CHECK: ret i1 [[T16]] ret i1 %x diff --git a/test/Transforms/LowerExpectIntrinsic/basic.ll b/test/Transforms/LowerExpectIntrinsic/basic.ll index f4326c8..5d72371 100644 --- a/test/Transforms/LowerExpectIntrinsic/basic.ll +++ b/test/Transforms/LowerExpectIntrinsic/basic.ll @@ -7,7 +7,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %cmp = icmp sgt i32 %tmp, 1 %conv = zext i1 %cmp to i32 %conv1 = sext i32 %conv to i64 @@ -27,7 +27,7 @@ if.end: ; preds = %entry br label %return return: ; preds = %if.end, %if.then - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -41,7 +41,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %conv = sext i32 %tmp to i64 %expval = call i64 @llvm.expect.i64(i64 %conv, i64 1) %tobool = icmp ne i64 %expval, 0 @@ -59,7 +59,7 @@ if.end: ; preds = %entry br label %return return: ; preds = %if.end, %if.then - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -69,7 +69,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %tobool = icmp ne i32 %tmp, 0 %lnot = xor i1 %tobool, true %lnot.ext = zext i1 %lnot to i32 @@ -90,7 +90,7 @@ if.end: ; preds = %entry br label %return return: ; preds = %if.end, %if.then - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -100,7 +100,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %tobool = icmp ne i32 %tmp, 0 %lnot = xor i1 %tobool, true %lnot1 = xor i1 %lnot, true @@ -122,7 +122,7 @@ if.end: ; preds = %entry br label %return return: ; preds = %if.end, %if.then - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -132,7 +132,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %cmp = icmp slt i32 %tmp, 0 %conv = zext i1 %cmp to i32 %conv1 = sext i32 %conv to i64 @@ -152,7 +152,7 @@ if.end: ; preds = %entry br label %return return: ; preds = %if.end, %if.then - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -162,7 +162,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %conv = sext i32 %tmp to i64 %expval = call i64 @llvm.expect.i64(i64 %conv, i64 1) ; CHECK: !prof !2 @@ -181,7 +181,7 @@ sw.epilog: ; preds = %entry br label %return return: ; preds = %sw.epilog, %sw.bb - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -191,7 +191,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %conv = sext i32 %tmp to i64 %expval = call i64 @llvm.expect.i64(i64 %conv, i64 1) ; CHECK: !prof !3 @@ -202,7 +202,7 @@ entry: ] sw.bb: ; preds = %entry, %entry - %tmp1 = load i32* %x.addr, align 4 + %tmp1 = load i32, i32* %x.addr, align 4 store i32 %tmp1, i32* %retval br label %return @@ -211,7 +211,7 @@ sw.epilog: ; preds = %entry br label %return return: ; preds = %sw.epilog, %sw.bb - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -221,7 +221,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %cmp = icmp sgt i32 %tmp, 1 %conv = zext i1 %cmp to i32 %expval = call i32 @llvm.expect.i32(i32 %conv, i32 1) @@ -240,7 +240,7 @@ if.end: ; preds = %entry br label %return return: ; preds = %if.end, %if.then - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -252,7 +252,7 @@ entry: %retval = alloca i32, align 4 %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 - %tmp = load i32* %x.addr, align 4 + %tmp = load i32, i32* %x.addr, align 4 %cmp = icmp sgt i32 %tmp, 1 %expval = call i1 @llvm.expect.i1(i1 %cmp, i1 1) ; CHECK: !prof !0 @@ -269,7 +269,7 @@ if.end: ; preds = %entry br label %return return: ; preds = %if.end, %if.then - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } diff --git a/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll b/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll index 3673c04..22173b4 100644 --- a/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll +++ b/test/Transforms/LowerSwitch/2014-06-10-SwitchContiguousOpt.ll @@ -6,7 +6,7 @@ entry: %retval = alloca i32, align 4 %a.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 - %0 = load i32* %a.addr, align 4 + %0 = load i32, i32* %a.addr, align 4 switch i32 %0, label %sw.default [ i32 0, label %sw.bb i32 1, label %sw.bb1 diff --git a/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll b/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll index ecdd767..2652a6c 100644 --- a/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll +++ b/test/Transforms/LowerSwitch/2014-06-11-SwitchDefaultUnreachableOpt.ll @@ -21,7 +21,7 @@ define i32 @foo(i32 %a) { %1 = alloca i32, align 4 %2 = alloca i32, align 4 store i32 %a, i32* %2, align 4 - %3 = load i32* %2, align 4 + %3 = load i32, i32* %2, align 4 switch i32 %3, label %6 [ i32 0, label %4 i32 1, label %5 @@ -39,6 +39,6 @@ define i32 @foo(i32 %a) { unreachable ; <label>:7 - %8 = load i32* %1 + %8 = load i32, i32* %1 ret i32 %8 } diff --git a/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll b/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll index 777f375..49b5605 100644 --- a/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll +++ b/test/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll @@ -6,6 +6,6 @@ define i32 @test() { ; To be promoted %X = alloca i32 ; <i32*> [#uses=1] - %Y = load i32* %X ; <i32> [#uses=1] + %Y = load i32, i32* %X ; <i32> [#uses=1] ret i32 %Y } diff --git a/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll b/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll index f5f1ee3..a013ff4 100644 --- a/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll +++ b/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll @@ -10,7 +10,7 @@ B2: ; preds = %0 store i32 2, i32* %X br i1 %c2, label %Exit, label %Exit Exit: ; preds = %B2, %B2, %0 - %Y = load i32* %X ; <i32> [#uses=1] + %Y = load i32, i32* %X ; <i32> [#uses=1] ret i32 %Y } diff --git a/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll b/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll index e82caa9..de7280e 100644 --- a/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll +++ b/test/Transforms/Mem2Reg/2003-06-26-IterativePromote.ll @@ -7,10 +7,10 @@ define i32 @test2() { %p = alloca i32* ; <i32**> [#uses=2] store i32 0, i32* %a store i32* %a, i32** %p - %tmp.0 = load i32** %p ; <i32*> [#uses=1] - %tmp.1 = load i32* %tmp.0 ; <i32> [#uses=1] + %tmp.0 = load i32*, i32** %p ; <i32*> [#uses=1] + %tmp.1 = load i32, i32* %tmp.0 ; <i32> [#uses=1] store i32 %tmp.1, i32* %result - %tmp.2 = load i32* %result ; <i32> [#uses=1] + %tmp.2 = load i32, i32* %result ; <i32> [#uses=1] ret i32 %tmp.2 } diff --git a/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll b/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll index 1d38efc..8d55a1d 100644 --- a/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll +++ b/test/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll @@ -9,11 +9,11 @@ define void @test(i32 %B, i1 %C) { br i1 %C, label %L1, label %L2 L1: ; preds = %0 store i32 %B, i32* %A - %D = load i32* %A ; <i32> [#uses=1] + %D = load i32, i32* %A ; <i32> [#uses=1] call void @test( i32 %D, i1 false ) br label %L3 L2: ; preds = %0 - %E = load i32* %A ; <i32> [#uses=1] + %E = load i32, i32* %A ; <i32> [#uses=1] call void @test( i32 %E, i1 true ) br label %L3 L3: ; preds = %L2, %L1 diff --git a/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll b/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll index 7435596..f0f1fdc 100644 --- a/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll +++ b/test/Transforms/Mem2Reg/2005-06-30-ReadBeforeWrite.ll @@ -14,31 +14,31 @@ entry: store i32 0, i32* %i br label %loopentry loopentry: ; preds = %endif, %entry - %tmp.0 = load i32* %n_addr ; <i32> [#uses=1] + %tmp.0 = load i32, i32* %n_addr ; <i32> [#uses=1] %tmp.1 = add i32 %tmp.0, 1 ; <i32> [#uses=1] - %tmp.2 = load i32* %i ; <i32> [#uses=1] + %tmp.2 = load i32, i32* %i ; <i32> [#uses=1] %tmp.3 = icmp sgt i32 %tmp.1, %tmp.2 ; <i1> [#uses=2] %tmp.4 = zext i1 %tmp.3 to i32 ; <i32> [#uses=0] br i1 %tmp.3, label %no_exit, label %return no_exit: ; preds = %loopentry - %tmp.5 = load i32* %undef ; <i32> [#uses=1] + %tmp.5 = load i32, i32* %undef ; <i32> [#uses=1] store i32 %tmp.5, i32* %out store i32 0, i32* %undef - %tmp.6 = load i32* %i ; <i32> [#uses=1] + %tmp.6 = load i32, i32* %i ; <i32> [#uses=1] %tmp.7 = icmp sgt i32 %tmp.6, 0 ; <i1> [#uses=2] %tmp.8 = zext i1 %tmp.7 to i32 ; <i32> [#uses=0] br i1 %tmp.7, label %then, label %endif then: ; preds = %no_exit - %tmp.9 = load i8** %p_addr ; <i8*> [#uses=1] - %tmp.10 = load i32* %i ; <i32> [#uses=1] + %tmp.9 = load i8*, i8** %p_addr ; <i8*> [#uses=1] + %tmp.10 = load i32, i32* %i ; <i32> [#uses=1] %tmp.11 = sub i32 %tmp.10, 1 ; <i32> [#uses=1] - %tmp.12 = getelementptr i8* %tmp.9, i32 %tmp.11 ; <i8*> [#uses=1] - %tmp.13 = load i32* %out ; <i32> [#uses=1] + %tmp.12 = getelementptr i8, i8* %tmp.9, i32 %tmp.11 ; <i8*> [#uses=1] + %tmp.13 = load i32, i32* %out ; <i32> [#uses=1] %tmp.14 = trunc i32 %tmp.13 to i8 ; <i8> [#uses=1] store i8 %tmp.14, i8* %tmp.12 br label %endif endif: ; preds = %then, %no_exit - %tmp.15 = load i32* %i ; <i32> [#uses=1] + %tmp.15 = load i32, i32* %i ; <i32> [#uses=1] %inc = add i32 %tmp.15, 1 ; <i32> [#uses=1] store i32 %inc, i32* %i br label %loopentry diff --git a/test/Transforms/Mem2Reg/2005-11-28-Crash.ll b/test/Transforms/Mem2Reg/2005-11-28-Crash.ll index 8fd3351..4b1d7f6 100644 --- a/test/Transforms/Mem2Reg/2005-11-28-Crash.ll +++ b/test/Transforms/Mem2Reg/2005-11-28-Crash.ll @@ -41,7 +41,7 @@ endif.3: ; preds = %then.3, %endif.1 loopexit: ; preds = %loopentry br label %endif.4 then.4: ; No predecessors! - %tmp.61 = load i32* %flags ; <i32> [#uses=0] + %tmp.61 = load i32, i32* %flags ; <i32> [#uses=0] br label %out dead_block_after_goto: ; No predecessors! br label %endif.4 diff --git a/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll b/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll index ea581d1..891af98 100644 --- a/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll +++ b/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll @@ -15,14 +15,14 @@ entry: %tmp = alloca i32, align 4 ; <i32*> [#uses=3] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store volatile i32 0, i32* %v, align 4 - %tmp1 = call i32 @_setjmp( %struct.__jmp_buf_tag* getelementptr ([1 x %struct.__jmp_buf_tag]* @j, i32 0, i32 0) ) ; <i32> [#uses=1] + %tmp1 = call i32 @_setjmp( %struct.__jmp_buf_tag* getelementptr ([1 x %struct.__jmp_buf_tag], [1 x %struct.__jmp_buf_tag]* @j, i32 0, i32 0) ) ; <i32> [#uses=1] %tmp2 = icmp ne i32 %tmp1, 0 ; <i1> [#uses=1] %tmp23 = zext i1 %tmp2 to i8 ; <i8> [#uses=1] %toBool = icmp ne i8 %tmp23, 0 ; <i1> [#uses=1] br i1 %toBool, label %bb, label %bb5 bb: ; preds = %entry - %tmp4 = load volatile i32* %v, align 4 ; <i32> [#uses=1] + %tmp4 = load volatile i32, i32* %v, align 4 ; <i32> [#uses=1] store i32 %tmp4, i32* %tmp, align 4 br label %bb6 @@ -33,12 +33,12 @@ bb5: ; preds = %entry br label %bb6 bb6: ; preds = %bb5, %bb - %tmp7 = load i32* %tmp, align 4 ; <i32> [#uses=1] + %tmp7 = load i32, i32* %tmp, align 4 ; <i32> [#uses=1] store i32 %tmp7, i32* %retval, align 4 br label %return return: ; preds = %bb6 - %retval8 = load i32* %retval ; <i32> [#uses=1] + %retval8 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval8 } diff --git a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll index a7369c0..2a009ab 100644 --- a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll +++ b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll @@ -7,26 +7,26 @@ entry: %retval = alloca double ; <double*> [#uses=2] %0 = alloca double ; <double*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - call void @llvm.dbg.declare(metadata i32* %i_addr, metadata !0, metadata !{}), !dbg !8 + call void @llvm.dbg.declare(metadata i32* %i_addr, metadata !0, metadata !MDExpression()), !dbg !8 ; CHECK: call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata ![[IVAR:[0-9]*]], metadata {{.*}}) ; CHECK: call void @llvm.dbg.value(metadata double %j, i64 0, metadata ![[JVAR:[0-9]*]], metadata {{.*}}) -; CHECK: ![[IVAR]] = {{.*}} ; [ DW_TAG_arg_variable ] [i] -; CHECK: ![[JVAR]] = {{.*}} ; [ DW_TAG_arg_variable ] [j] +; CHECK: ![[IVAR]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i" +; CHECK: ![[JVAR]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "j" store i32 %i, i32* %i_addr - call void @llvm.dbg.declare(metadata double* %j_addr, metadata !9, metadata !{}), !dbg !8 + call void @llvm.dbg.declare(metadata double* %j_addr, metadata !9, metadata !MDExpression()), !dbg !8 store double %j, double* %j_addr - %1 = load i32* %i_addr, align 4, !dbg !10 ; <i32> [#uses=1] + %1 = load i32, i32* %i_addr, align 4, !dbg !10 ; <i32> [#uses=1] %2 = add nsw i32 %1, 1, !dbg !10 ; <i32> [#uses=1] %3 = sitofp i32 %2 to double, !dbg !10 ; <double> [#uses=1] - %4 = load double* %j_addr, align 8, !dbg !10 ; <double> [#uses=1] + %4 = load double, double* %j_addr, align 8, !dbg !10 ; <double> [#uses=1] %5 = fadd double %3, %4, !dbg !10 ; <double> [#uses=1] store double %5, double* %0, align 8, !dbg !10 - %6 = load double* %0, align 8, !dbg !10 ; <double> [#uses=1] + %6 = load double, double* %0, align 8, !dbg !10 ; <double> [#uses=1] store double %6, double* %retval, align 8, !dbg !10 br label %return, !dbg !10 return: ; preds = %entry - %retval1 = load double* %retval, !dbg !10 ; <double> [#uses=1] + %retval1 = load double, double* %retval, !dbg !10 ; <double> [#uses=1] ret double %retval1, !dbg !10 } @@ -35,18 +35,18 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!14} -!0 = !{!"0x101\00i\002\000", !1, !2, !7} ; [ DW_TAG_arg_variable ] -!1 = !{!"0x2e\00testfunc\00testfunc\00testfunc\002\000\001\000\006\000\000\002", !12, !2, !4, null, double (i32, double)* @testfunc, null, null, null} ; [ DW_TAG_subprogram ] -!2 = !{!"0x29", !12} ; [ DW_TAG_file_type ] -!3 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\001\00\000\00\000", !12, !13, !13, null, null, null} ; [ DW_TAG_compile_unit ] -!4 = !{!"0x15\00\000\000\000\000\000\000", !12, !2, null, !5, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 2, arg: 0, scope: !1, file: !2, type: !7) +!1 = !MDSubprogram(name: "testfunc", linkageName: "testfunc", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !12, scope: !2, type: !4, function: double (i32, double)* @testfunc) +!2 = !MDFile(filename: "testfunc.c", directory: "/tmp") +!3 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !12, enums: !13, retainedTypes: !13) +!4 = !MDSubroutineType(types: !5) !5 = !{!6, !7, !6} -!6 = !{!"0x24\00double\000\0064\0064\000\000\004", !12, !2} ; [ DW_TAG_base_type ] -!7 = !{!"0x24\00int\000\0032\0032\000\000\005", !12, !2} ; [ DW_TAG_base_type ] +!6 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) +!7 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !MDLocation(line: 2, scope: !1) -!9 = !{!"0x101\00j\002\000", !1, !2, !6} ; [ DW_TAG_arg_variable ] +!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 2, arg: 0, scope: !1, file: !2, type: !6) !10 = !MDLocation(line: 3, scope: !11) -!11 = !{!"0xb\002\000\000", !12, !1} ; [ DW_TAG_lexical_block ] -!12 = !{!"testfunc.c", !"/tmp"} +!11 = distinct !MDLexicalBlock(line: 2, column: 0, file: !12, scope: !1) +!12 = !MDFile(filename: "testfunc.c", directory: "/tmp") !13 = !{i32 0} -!14 = !{i32 1, !"Debug Info Version", i32 2} +!14 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll b/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll index 76d2a1a..0d9e3de 100644 --- a/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll +++ b/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll @@ -11,18 +11,18 @@ entry: %z_addr.i = alloca i8* ; <i8**> [#uses=2] %a_addr = alloca i32 ; <i32*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - call void @llvm.dbg.declare(metadata i32* %a_addr, metadata !0, metadata !{}), !dbg !7 + call void @llvm.dbg.declare(metadata i32* %a_addr, metadata !0, metadata !MDExpression()), !dbg !7 store i32 %a, i32* %a_addr - %0 = load i32* %a_addr, align 4, !dbg !8 ; <i32> [#uses=1] - call void @llvm.dbg.declare(metadata i32* %x_addr.i, metadata !9, metadata !{}) nounwind, !dbg !15 + %0 = load i32, i32* %a_addr, align 4, !dbg !8 ; <i32> [#uses=1] + call void @llvm.dbg.declare(metadata i32* %x_addr.i, metadata !9, metadata !MDExpression()) nounwind, !dbg !15 store i32 %0, i32* %x_addr.i - call void @llvm.dbg.declare(metadata i64* %y_addr.i, metadata !16, metadata !{}) nounwind, !dbg !15 + call void @llvm.dbg.declare(metadata i64* %y_addr.i, metadata !16, metadata !MDExpression()) nounwind, !dbg !15 store i64 55, i64* %y_addr.i - call void @llvm.dbg.declare(metadata i8** %z_addr.i, metadata !17, metadata !{}) nounwind, !dbg !15 + call void @llvm.dbg.declare(metadata i8** %z_addr.i, metadata !17, metadata !MDExpression()) nounwind, !dbg !15 store i8* bitcast (void (i32)* @baz to i8*), i8** %z_addr.i - %1 = load i32* %x_addr.i, align 4, !dbg !18 ; <i32> [#uses=1] - %2 = load i64* %y_addr.i, align 8, !dbg !18 ; <i64> [#uses=1] - %3 = load i8** %z_addr.i, align 8, !dbg !18 ; <i8*> [#uses=1] + %1 = load i32, i32* %x_addr.i, align 4, !dbg !18 ; <i32> [#uses=1] + %2 = load i64, i64* %y_addr.i, align 8, !dbg !18 ; <i64> [#uses=1] + %3 = load i8*, i8** %z_addr.i, align 8, !dbg !18 ; <i8*> [#uses=1] call void @foo(i32 %1, i64 %2, i8* %3) nounwind, !dbg !18 br label %return, !dbg !19 @@ -32,26 +32,26 @@ return: ; preds = %entry !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!22} -!0 = !{!"0x101\00a\008\000", !1, !2, !6} ; [ DW_TAG_arg_variable ] -!1 = !{!"0x2e\00baz\00baz\00baz\008\000\001\000\006\000\000\008", !20, !2, !4, null, void (i32)* @baz, null, null, null} ; [ DW_TAG_subprogram ] -!2 = !{!"0x29", !20} ; [ DW_TAG_file_type ] -!3 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\001\00\000\00\000", !20, !21, !21, null, null, null} ; [ DW_TAG_compile_unit ] -!4 = !{!"0x15\00\000\000\000\000\000\000", !20, !2, null, !5, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 8, arg: 0, scope: !1, file: !2, type: !6) +!1 = !MDSubprogram(name: "baz", linkageName: "baz", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 8, file: !20, scope: !2, type: !4, function: void (i32)* @baz) +!2 = !MDFile(filename: "bar.c", directory: "/tmp/") +!3 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !20, enums: !21, retainedTypes: !21) +!4 = !MDSubroutineType(types: !5) !5 = !{null, !6} -!6 = !{!"0x24\00int\000\0032\0032\000\000\005", !20, !2} ; [ DW_TAG_base_type ] +!6 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !7 = !MDLocation(line: 8, scope: !1) !8 = !MDLocation(line: 9, scope: !1) -!9 = !{!"0x101\00x\004\000", !10, !2, !6} ; [ DW_TAG_arg_variable ] -!10 = !{!"0x2e\00bar\00bar\00bar\004\001\001\000\006\000\000\004", !20, !2, !11, null, null, null, null, null} ; [ DW_TAG_subprogram ] -!11 = !{!"0x15\00\000\000\000\000\000\000", !20, !2, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 4, arg: 0, scope: !10, file: !2, type: !6) +!10 = !MDSubprogram(name: "bar", linkageName: "bar", line: 4, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !20, scope: !2, type: !11) +!11 = !MDSubroutineType(types: !12) !12 = !{null, !6, !13, !14} -!13 = !{!"0x24\00long int\000\0064\0064\000\000\005", !20, !2} ; [ DW_TAG_base_type ] -!14 = !{!"0xf\00\000\0064\0064\000\000", !20, !2, null} ; [ DW_TAG_pointer_type ] +!13 = !MDBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed) +!14 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !20, scope: !2, baseType: null) !15 = !MDLocation(line: 4, scope: !10, inlinedAt: !8) -!16 = !{!"0x101\00y\004\000", !10, !2, !13} ; [ DW_TAG_arg_variable ] -!17 = !{!"0x101\00z\004\000", !10, !2, !14} ; [ DW_TAG_arg_variable ] +!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 4, arg: 0, scope: !10, file: !2, type: !13) +!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "z", line: 4, arg: 0, scope: !10, file: !2, type: !14) !18 = !MDLocation(line: 5, scope: !10, inlinedAt: !8) !19 = !MDLocation(line: 10, scope: !1) -!20 = !{!"bar.c", !"/tmp/"} +!20 = !MDFile(filename: "bar.c", directory: "/tmp/") !21 = !{i32 0} -!22 = !{i32 1, !"Debug Info Version", i32 2} +!22 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/Mem2Reg/PromoteMemToRegister.ll b/test/Transforms/Mem2Reg/PromoteMemToRegister.ll index 1be6b03..b7f3994 100644 --- a/test/Transforms/Mem2Reg/PromoteMemToRegister.ll +++ b/test/Transforms/Mem2Reg/PromoteMemToRegister.ll @@ -6,12 +6,12 @@ define double @testfunc(i32 %i, double %j) { %J = alloca double ; <double*> [#uses=2] store i32 %i, i32* %I store double %j, double* %J - %t1 = load i32* %I ; <i32> [#uses=1] + %t1 = load i32, i32* %I ; <i32> [#uses=1] %t2 = add i32 %t1, 1 ; <i32> [#uses=1] store i32 %t2, i32* %I - %t3 = load i32* %I ; <i32> [#uses=1] + %t3 = load i32, i32* %I ; <i32> [#uses=1] %t4 = sitofp i32 %t3 to double ; <double> [#uses=1] - %t5 = load double* %J ; <double> [#uses=1] + %t5 = load double, double* %J ; <double> [#uses=1] %t6 = fmul double %t4, %t5 ; <double> [#uses=1] ret double %t6 } diff --git a/test/Transforms/Mem2Reg/UndefValuesMerge.ll b/test/Transforms/Mem2Reg/UndefValuesMerge.ll index 5013229..eeeb72f 100644 --- a/test/Transforms/Mem2Reg/UndefValuesMerge.ll +++ b/test/Transforms/Mem2Reg/UndefValuesMerge.ll @@ -7,7 +7,7 @@ T: ; preds = %0 store i32 %i, i32* %I br label %Cont Cont: ; preds = %T, %0 - %Y = load i32* %I ; <i32> [#uses=1] + %Y = load i32, i32* %I ; <i32> [#uses=1] ret i32 %Y } diff --git a/test/Transforms/Mem2Reg/atomic.ll b/test/Transforms/Mem2Reg/atomic.ll index 5bc9e92..f20043d 100644 --- a/test/Transforms/Mem2Reg/atomic.ll +++ b/test/Transforms/Mem2Reg/atomic.ll @@ -7,6 +7,6 @@ define i32 @test1(i32 %x) { ; CHECK: ret i32 %x %a = alloca i32 store atomic i32 %x, i32* %a seq_cst, align 4 - %r = load atomic i32* %a seq_cst, align 4 + %r = load atomic i32, i32* %a seq_cst, align 4 ret i32 %r } diff --git a/test/Transforms/Mem2Reg/crash.ll b/test/Transforms/Mem2Reg/crash.ll index 59e2c0b..a4a31b1 100644 --- a/test/Transforms/Mem2Reg/crash.ll +++ b/test/Transforms/Mem2Reg/crash.ll @@ -14,7 +14,7 @@ invcont2: br label %bb15 bb15: - %B = load i32* %whichFlag + %B = load i32, i32* %whichFlag ret i32 %B lpad86: @@ -33,11 +33,11 @@ entry: br label %bb15 bb15: - %B = load i32* %whichFlag + %B = load i32, i32* %whichFlag ret i32 %B invcont2: - %C = load i32* %whichFlag + %C = load i32, i32* %whichFlag store i32 %C, i32* %whichFlag br label %bb15 } diff --git a/test/Transforms/Mem2Reg/ignore-lifetime.ll b/test/Transforms/Mem2Reg/ignore-lifetime.ll index 5e4f9bf..12adaff 100644 --- a/test/Transforms/Mem2Reg/ignore-lifetime.ll +++ b/test/Transforms/Mem2Reg/ignore-lifetime.ll @@ -18,7 +18,7 @@ define void @test2() { ; CHECK: test2 ; CHECK-NOT: alloca %A = alloca {i8, i16} - %B = getelementptr {i8, i16}* %A, i32 0, i32 0 + %B = getelementptr {i8, i16}, {i8, i16}* %A, i32 0, i32 0 call void @llvm.lifetime.start(i64 2, i8* %B) store {i8, i16} zeroinitializer, {i8, i16}* %A call void @llvm.lifetime.end(i64 2, i8* %B) diff --git a/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll b/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll index 00ac34d..f73addd 100644 --- a/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll +++ b/test/Transforms/MemCpyOpt/2008-02-24-MultipleUseofSRet.ll @@ -8,9 +8,9 @@ target triple = "i386-pc-linux-gnu" define internal fastcc void @initialize(%0* noalias nocapture sret %agg.result) nounwind { entry: - %agg.result.03 = getelementptr %0* %agg.result, i32 0, i32 0 + %agg.result.03 = getelementptr %0, %0* %agg.result, i32 0, i32 0 store x86_fp80 0xK00000000000000000000, x86_fp80* %agg.result.03 - %agg.result.15 = getelementptr %0* %agg.result, i32 0, i32 1 + %agg.result.15 = getelementptr %0, %0* %agg.result, i32 0, i32 1 store x86_fp80 0xK00000000000000000000, x86_fp80* %agg.result.15 ret void } diff --git a/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll b/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll index 6982c8b..ffbb299 100644 --- a/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll +++ b/test/Transforms/MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll @@ -14,8 +14,8 @@ entry: %a_i8 = bitcast %a* %a_var to i8* %b_i8 = bitcast %b* %b_var to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %b_i8, i8* %a_i8, i32 4, i32 1, i1 false) - %tmp1 = getelementptr %b* %b_var, i32 0, i32 0 - %tmp2 = load float* %tmp1 + %tmp1 = getelementptr %b, %b* %b_var, i32 0, i32 0 + %tmp2 = load float, float* %tmp1 ret float %tmp2 } diff --git a/test/Transforms/MemCpyOpt/2011-06-02-CallSlotOverwritten.ll b/test/Transforms/MemCpyOpt/2011-06-02-CallSlotOverwritten.ll index 132966e..8e4a023 100644 --- a/test/Transforms/MemCpyOpt/2011-06-02-CallSlotOverwritten.ll +++ b/test/Transforms/MemCpyOpt/2011-06-02-CallSlotOverwritten.ll @@ -17,20 +17,20 @@ define i32 @foo() nounwind { call void @bar(%struct1* sret %x) nounwind ; CHECK: call void @bar(%struct1* sret %x) - %gepn1 = getelementptr inbounds %struct2* %y, i32 0, i32 0, i32 0 + %gepn1 = getelementptr inbounds %struct2, %struct2* %y, i32 0, i32 0, i32 0 store i32 0, i32* %gepn1, align 8 - %gepn2 = getelementptr inbounds %struct2* %y, i32 0, i32 0, i32 1 + %gepn2 = getelementptr inbounds %struct2, %struct2* %y, i32 0, i32 0, i32 1 store i32 0, i32* %gepn2, align 4 %bit1 = bitcast %struct1* %x to i64* %bit2 = bitcast %struct2* %y to i64* - %load = load i64* %bit1, align 8 + %load = load i64, i64* %bit1, align 8 store i64 %load, i64* %bit2, align 8 -; CHECK: %load = load i64* %bit1, align 8 +; CHECK: %load = load i64, i64* %bit1, align 8 ; CHECK: store i64 %load, i64* %bit2, align 8 - %gep1 = getelementptr %struct2* %y, i32 0, i32 0, i32 0 - %ret = load i32* %gep1 + %gep1 = getelementptr %struct2, %struct2* %y, i32 0, i32 0, i32 0 + %ret = load i32, i32* %gep1 ret i32 %ret } diff --git a/test/Transforms/MemCpyOpt/align.ll b/test/Transforms/MemCpyOpt/align.ll index 5d5bfbd..9074684 100644 --- a/test/Transforms/MemCpyOpt/align.ll +++ b/test/Transforms/MemCpyOpt/align.ll @@ -10,13 +10,13 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind define void @foo(i32* %p) { ; CHECK-LABEL: @foo( ; CHECK: call void @llvm.memset.p0i8.i64(i8* {{.*}}, i8 0, i64 16, i32 4, i1 false) - %a0 = getelementptr i32* %p, i64 0 + %a0 = getelementptr i32, i32* %p, i64 0 store i32 0, i32* %a0, align 4 - %a1 = getelementptr i32* %p, i64 1 + %a1 = getelementptr i32, i32* %p, i64 1 store i32 0, i32* %a1, align 16 - %a2 = getelementptr i32* %p, i64 2 + %a2 = getelementptr i32, i32* %p, i64 2 store i32 0, i32* %a2, align 4 - %a3 = getelementptr i32* %p, i64 3 + %a3 = getelementptr i32, i32* %p, i64 3 store i32 0, i32* %a3, align 4 ret void } diff --git a/test/Transforms/MemCpyOpt/atomic.ll b/test/Transforms/MemCpyOpt/atomic.ll index f351e67..5be6b15 100644 --- a/test/Transforms/MemCpyOpt/atomic.ll +++ b/test/Transforms/MemCpyOpt/atomic.ll @@ -16,9 +16,9 @@ define void @test1() nounwind uwtable ssp { %x = alloca [101 x i32], align 16 %bc = bitcast [101 x i32]* %x to i8* call void @llvm.memset.p0i8.i64(i8* %bc, i8 0, i64 400, i32 16, i1 false) - %gep1 = getelementptr inbounds [101 x i32]* %x, i32 0, i32 100 + %gep1 = getelementptr inbounds [101 x i32], [101 x i32]* %x, i32 0, i32 100 store atomic i32 0, i32* %gep1 unordered, align 4 - %gep2 = getelementptr inbounds [101 x i32]* %x, i32 0, i32 0 + %gep2 = getelementptr inbounds [101 x i32], [101 x i32]* %x, i32 0, i32 0 call void @otherf(i32* %gep2) ret void } @@ -33,7 +33,7 @@ define void @test2() nounwind uwtable ssp { %new = alloca i32 call void @otherf(i32* nocapture %old) store atomic i32 0, i32* @x unordered, align 4 - %v = load i32* %old + %v = load i32, i32* %old store i32 %v, i32* %new call void @otherf(i32* nocapture %new) ret void diff --git a/test/Transforms/MemCpyOpt/callslot_deref.ll b/test/Transforms/MemCpyOpt/callslot_deref.ll index 4d51552..a1f5ae1 100644 --- a/test/Transforms/MemCpyOpt/callslot_deref.ll +++ b/test/Transforms/MemCpyOpt/callslot_deref.ll @@ -10,7 +10,7 @@ define void @must_remove_memcpy(i8* noalias nocapture dereferenceable(4096) %dst ; CHECK: call void @llvm.memset.p0i8.i64 ; CHECK-NOT: call void @llvm.memcpy.p0i8.p0i8.i64 %src = alloca [4096 x i8], align 1 - %p = getelementptr inbounds [4096 x i8]* %src, i64 0, i64 0 + %p = getelementptr inbounds [4096 x i8], [4096 x i8]* %src, i64 0, i64 0 call void @llvm.memset.p0i8.i64(i8* %p, i8 0, i64 4096, i32 1, i1 false) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %p, i64 4096, i32 1, i1 false) #2 ret void @@ -22,7 +22,7 @@ define void @must_not_remove_memcpy(i8* noalias nocapture dereferenceable(1024) ; CHECK: call void @llvm.memset.p0i8.i64 ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64 %src = alloca [4096 x i8], align 1 - %p = getelementptr inbounds [4096 x i8]* %src, i64 0, i64 0 + %p = getelementptr inbounds [4096 x i8], [4096 x i8]* %src, i64 0, i64 0 call void @llvm.memset.p0i8.i64(i8* %p, i8 0, i64 4096, i32 1, i1 false) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %p, i64 4096, i32 1, i1 false) #2 ret void diff --git a/test/Transforms/MemCpyOpt/crash.ll b/test/Transforms/MemCpyOpt/crash.ll index cc3a6b0..56757a6 100644 --- a/test/Transforms/MemCpyOpt/crash.ll +++ b/test/Transforms/MemCpyOpt/crash.ll @@ -9,37 +9,37 @@ target triple = "armv7-eabi" ; PR4882 define void @test1(%struct.bar* %this) { entry: - %0 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 0 + %0 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 0 store float 0.000000e+00, float* %0, align 4 - %1 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 1 + %1 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 1 store float 0.000000e+00, float* %1, align 4 - %2 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 2 + %2 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 2 store float 0.000000e+00, float* %2, align 4 - %3 = getelementptr inbounds %struct.bar* %this, i32 0, i32 0, i32 0, i32 3 + %3 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 3 store float 0.000000e+00, float* %3, align 4 - %4 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 0 + %4 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 0 store float 0.000000e+00, float* %4, align 4 - %5 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 1 + %5 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 1 store float 0.000000e+00, float* %5, align 4 - %6 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 2 + %6 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 2 store float 0.000000e+00, float* %6, align 4 - %7 = getelementptr inbounds %struct.bar* %this, i32 0, i32 1, i32 0, i32 3 + %7 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 3 store float 0.000000e+00, float* %7, align 4 - %8 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 1 + %8 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 3, i32 0, i32 1 store float 0.000000e+00, float* %8, align 4 - %9 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 2 + %9 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 3, i32 0, i32 2 store float 0.000000e+00, float* %9, align 4 - %10 = getelementptr inbounds %struct.bar* %this, i32 0, i32 3, i32 0, i32 3 + %10 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 3, i32 0, i32 3 store float 0.000000e+00, float* %10, align 4 - %11 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 0 + %11 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 0 store float 0.000000e+00, float* %11, align 4 - %12 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 1 + %12 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 1 store float 0.000000e+00, float* %12, align 4 - %13 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 2 + %13 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 2 store float 0.000000e+00, float* %13, align 4 - %14 = getelementptr inbounds %struct.bar* %this, i32 0, i32 4, i32 0, i32 3 + %14 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 3 store float 0.000000e+00, float* %14, align 4 - %15 = getelementptr inbounds %struct.bar* %this, i32 0, i32 5 + %15 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 5 store float 0.000000e+00, float* %15, align 4 unreachable } diff --git a/test/Transforms/MemCpyOpt/form-memset.ll b/test/Transforms/MemCpyOpt/form-memset.ll index 0a40943..f54406f 100644 --- a/test/Transforms/MemCpyOpt/form-memset.ll +++ b/test/Transforms/MemCpyOpt/form-memset.ll @@ -8,43 +8,43 @@ target triple = "i386-apple-darwin8" define void @test1(i8 signext %c) nounwind { entry: %x = alloca [19 x i8] ; <[19 x i8]*> [#uses=20] - %tmp = getelementptr [19 x i8]* %x, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 0 ; <i8*> [#uses=1] store i8 %c, i8* %tmp, align 1 - %tmp5 = getelementptr [19 x i8]* %x, i32 0, i32 1 ; <i8*> [#uses=1] + %tmp5 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 1 ; <i8*> [#uses=1] store i8 %c, i8* %tmp5, align 1 - %tmp9 = getelementptr [19 x i8]* %x, i32 0, i32 2 ; <i8*> [#uses=1] + %tmp9 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 2 ; <i8*> [#uses=1] store i8 %c, i8* %tmp9, align 1 - %tmp13 = getelementptr [19 x i8]* %x, i32 0, i32 3 ; <i8*> [#uses=1] + %tmp13 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 3 ; <i8*> [#uses=1] store i8 %c, i8* %tmp13, align 1 - %tmp17 = getelementptr [19 x i8]* %x, i32 0, i32 4 ; <i8*> [#uses=1] + %tmp17 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 4 ; <i8*> [#uses=1] store i8 %c, i8* %tmp17, align 1 - %tmp21 = getelementptr [19 x i8]* %x, i32 0, i32 5 ; <i8*> [#uses=1] + %tmp21 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 5 ; <i8*> [#uses=1] store i8 %c, i8* %tmp21, align 1 - %tmp25 = getelementptr [19 x i8]* %x, i32 0, i32 6 ; <i8*> [#uses=1] + %tmp25 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 6 ; <i8*> [#uses=1] store i8 %c, i8* %tmp25, align 1 - %tmp29 = getelementptr [19 x i8]* %x, i32 0, i32 7 ; <i8*> [#uses=1] + %tmp29 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 7 ; <i8*> [#uses=1] store i8 %c, i8* %tmp29, align 1 - %tmp33 = getelementptr [19 x i8]* %x, i32 0, i32 8 ; <i8*> [#uses=1] + %tmp33 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 8 ; <i8*> [#uses=1] store i8 %c, i8* %tmp33, align 1 - %tmp37 = getelementptr [19 x i8]* %x, i32 0, i32 9 ; <i8*> [#uses=1] + %tmp37 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 9 ; <i8*> [#uses=1] store i8 %c, i8* %tmp37, align 1 - %tmp41 = getelementptr [19 x i8]* %x, i32 0, i32 10 ; <i8*> [#uses=1] + %tmp41 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 10 ; <i8*> [#uses=1] store i8 %c, i8* %tmp41, align 1 - %tmp45 = getelementptr [19 x i8]* %x, i32 0, i32 11 ; <i8*> [#uses=1] + %tmp45 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 11 ; <i8*> [#uses=1] store i8 %c, i8* %tmp45, align 1 - %tmp49 = getelementptr [19 x i8]* %x, i32 0, i32 12 ; <i8*> [#uses=1] + %tmp49 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 12 ; <i8*> [#uses=1] store i8 %c, i8* %tmp49, align 1 - %tmp53 = getelementptr [19 x i8]* %x, i32 0, i32 13 ; <i8*> [#uses=1] + %tmp53 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 13 ; <i8*> [#uses=1] store i8 %c, i8* %tmp53, align 1 - %tmp57 = getelementptr [19 x i8]* %x, i32 0, i32 14 ; <i8*> [#uses=1] + %tmp57 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 14 ; <i8*> [#uses=1] store i8 %c, i8* %tmp57, align 1 - %tmp61 = getelementptr [19 x i8]* %x, i32 0, i32 15 ; <i8*> [#uses=1] + %tmp61 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 15 ; <i8*> [#uses=1] store i8 %c, i8* %tmp61, align 1 - %tmp65 = getelementptr [19 x i8]* %x, i32 0, i32 16 ; <i8*> [#uses=1] + %tmp65 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 16 ; <i8*> [#uses=1] store i8 %c, i8* %tmp65, align 1 - %tmp69 = getelementptr [19 x i8]* %x, i32 0, i32 17 ; <i8*> [#uses=1] + %tmp69 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 17 ; <i8*> [#uses=1] store i8 %c, i8* %tmp69, align 1 - %tmp73 = getelementptr [19 x i8]* %x, i32 0, i32 18 ; <i8*> [#uses=1] + %tmp73 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 18 ; <i8*> [#uses=1] store i8 %c, i8* %tmp73, align 1 %tmp76 = call i32 (...)* @bar( [19 x i8]* %x ) nounwind ret void @@ -65,88 +65,88 @@ entry: %ref_idx = alloca [8 x i8] ; <[8 x i8]*> [#uses=8] %left_mvd = alloca [8 x %struct.MV] ; <[8 x %struct.MV]*> [#uses=17] %up_mvd = alloca [8 x %struct.MV] ; <[8 x %struct.MV]*> [#uses=17] - %tmp20 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 7 ; <i8*> [#uses=1] + %tmp20 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 7 ; <i8*> [#uses=1] store i8 -1, i8* %tmp20, align 1 - %tmp23 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 6 ; <i8*> [#uses=1] + %tmp23 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 6 ; <i8*> [#uses=1] store i8 -1, i8* %tmp23, align 1 - %tmp26 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 5 ; <i8*> [#uses=1] + %tmp26 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 5 ; <i8*> [#uses=1] store i8 -1, i8* %tmp26, align 1 - %tmp29 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 4 ; <i8*> [#uses=1] + %tmp29 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 4 ; <i8*> [#uses=1] store i8 -1, i8* %tmp29, align 1 - %tmp32 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 3 ; <i8*> [#uses=1] + %tmp32 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 3 ; <i8*> [#uses=1] store i8 -1, i8* %tmp32, align 1 - %tmp35 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 2 ; <i8*> [#uses=1] + %tmp35 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 2 ; <i8*> [#uses=1] store i8 -1, i8* %tmp35, align 1 - %tmp38 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 1 ; <i8*> [#uses=1] + %tmp38 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 1 ; <i8*> [#uses=1] store i8 -1, i8* %tmp38, align 1 - %tmp41 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 0 ; <i8*> [#uses=2] + %tmp41 = getelementptr [8 x i8], [8 x i8]* %ref_idx, i32 0, i32 0 ; <i8*> [#uses=2] store i8 -1, i8* %tmp41, align 1 - %tmp43 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 7, i32 0 ; <i16*> [#uses=1] + %tmp43 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 7, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp43, align 2 - %tmp46 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 7, i32 1 ; <i16*> [#uses=1] + %tmp46 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 7, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp46, align 2 - %tmp57 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 6, i32 0 ; <i16*> [#uses=1] + %tmp57 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 6, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp57, align 2 - %tmp60 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 6, i32 1 ; <i16*> [#uses=1] + %tmp60 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 6, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp60, align 2 - %tmp71 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 5, i32 0 ; <i16*> [#uses=1] + %tmp71 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 5, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp71, align 2 - %tmp74 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 5, i32 1 ; <i16*> [#uses=1] + %tmp74 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 5, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp74, align 2 - %tmp85 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 4, i32 0 ; <i16*> [#uses=1] + %tmp85 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 4, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp85, align 2 - %tmp88 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 4, i32 1 ; <i16*> [#uses=1] + %tmp88 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 4, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp88, align 2 - %tmp99 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 3, i32 0 ; <i16*> [#uses=1] + %tmp99 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 3, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp99, align 2 - %tmp102 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 3, i32 1 ; <i16*> [#uses=1] + %tmp102 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 3, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp102, align 2 - %tmp113 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 2, i32 0 ; <i16*> [#uses=1] + %tmp113 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 2, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp113, align 2 - %tmp116 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 2, i32 1 ; <i16*> [#uses=1] + %tmp116 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 2, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp116, align 2 - %tmp127 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 1, i32 0 ; <i16*> [#uses=1] + %tmp127 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 1, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp127, align 2 - %tmp130 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 1, i32 1 ; <i16*> [#uses=1] + %tmp130 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 1, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp130, align 2 - %tmp141 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 0, i32 0 ; <i16*> [#uses=1] + %tmp141 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 0, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp141, align 8 - %tmp144 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 0, i32 1 ; <i16*> [#uses=1] + %tmp144 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 0, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp144, align 2 - %tmp148 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 7, i32 0 ; <i16*> [#uses=1] + %tmp148 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 7, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp148, align 2 - %tmp151 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 7, i32 1 ; <i16*> [#uses=1] + %tmp151 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 7, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp151, align 2 - %tmp162 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 6, i32 0 ; <i16*> [#uses=1] + %tmp162 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 6, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp162, align 2 - %tmp165 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 6, i32 1 ; <i16*> [#uses=1] + %tmp165 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 6, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp165, align 2 - %tmp176 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 5, i32 0 ; <i16*> [#uses=1] + %tmp176 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 5, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp176, align 2 - %tmp179 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 5, i32 1 ; <i16*> [#uses=1] + %tmp179 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 5, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp179, align 2 - %tmp190 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 4, i32 0 ; <i16*> [#uses=1] + %tmp190 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 4, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp190, align 2 - %tmp193 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 4, i32 1 ; <i16*> [#uses=1] + %tmp193 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 4, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp193, align 2 - %tmp204 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 3, i32 0 ; <i16*> [#uses=1] + %tmp204 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 3, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp204, align 2 - %tmp207 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 3, i32 1 ; <i16*> [#uses=1] + %tmp207 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 3, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp207, align 2 - %tmp218 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 2, i32 0 ; <i16*> [#uses=1] + %tmp218 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 2, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp218, align 2 - %tmp221 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 2, i32 1 ; <i16*> [#uses=1] + %tmp221 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 2, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp221, align 2 - %tmp232 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 1, i32 0 ; <i16*> [#uses=1] + %tmp232 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 1, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp232, align 2 - %tmp235 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 1, i32 1 ; <i16*> [#uses=1] + %tmp235 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 1, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp235, align 2 - %tmp246 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 0, i32 0 ; <i16*> [#uses=1] + %tmp246 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 0, i32 0 ; <i16*> [#uses=1] store i16 0, i16* %tmp246, align 8 - %tmp249 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 0, i32 1 ; <i16*> [#uses=1] + %tmp249 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 0, i32 1 ; <i16*> [#uses=1] store i16 0, i16* %tmp249, align 2 - %up_mvd252 = getelementptr [8 x %struct.MV]* %up_mvd, i32 0, i32 0 ; <%struct.MV*> [#uses=1] - %left_mvd253 = getelementptr [8 x %struct.MV]* %left_mvd, i32 0, i32 0 ; <%struct.MV*> [#uses=1] + %up_mvd252 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %up_mvd, i32 0, i32 0 ; <%struct.MV*> [#uses=1] + %left_mvd253 = getelementptr [8 x %struct.MV], [8 x %struct.MV]* %left_mvd, i32 0, i32 0 ; <%struct.MV*> [#uses=1] call void @foo( %struct.MV* %up_mvd252, %struct.MV* %left_mvd253, i8* %tmp41 ) nounwind ret void @@ -167,9 +167,9 @@ declare void @foo(%struct.MV*, %struct.MV*, i8*) ; Store followed by memset. define void @test3(i32* nocapture %P) nounwind ssp { entry: - %arrayidx = getelementptr inbounds i32* %P, i64 1 + %arrayidx = getelementptr inbounds i32, i32* %P, i64 1 store i32 0, i32* %arrayidx, align 4 - %add.ptr = getelementptr inbounds i32* %P, i64 2 + %add.ptr = getelementptr inbounds i32, i32* %P, i64 2 %0 = bitcast i32* %add.ptr to i8* tail call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 11, i32 1, i1 false) ret void @@ -182,7 +182,7 @@ entry: define void @test4(i32* nocapture %P) nounwind ssp { entry: store i32 0, i32* %P, align 4 - %add.ptr = getelementptr inbounds i32* %P, i64 1 + %add.ptr = getelementptr inbounds i32, i32* %P, i64 1 %0 = bitcast i32* %add.ptr to i8* tail call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 11, i32 1, i1 false) ret void @@ -196,10 +196,10 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind ; Memset followed by store. define void @test5(i32* nocapture %P) nounwind ssp { entry: - %add.ptr = getelementptr inbounds i32* %P, i64 2 + %add.ptr = getelementptr inbounds i32, i32* %P, i64 2 %0 = bitcast i32* %add.ptr to i8* tail call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 11, i32 1, i1 false) - %arrayidx = getelementptr inbounds i32* %P, i64 1 + %arrayidx = getelementptr inbounds i32, i32* %P, i64 1 store i32 0, i32* %arrayidx, align 4 ret void ; CHECK-LABEL: @test5( @@ -212,7 +212,7 @@ define void @test6(i32* nocapture %P) nounwind ssp { entry: %0 = bitcast i32* %P to i8* tail call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 12, i32 1, i1 false) - %add.ptr = getelementptr inbounds i32* %P, i64 3 + %add.ptr = getelementptr inbounds i32, i32* %P, i64 3 %1 = bitcast i32* %add.ptr to i8* tail call void @llvm.memset.p0i8.i64(i8* %1, i8 0, i64 12, i32 1, i1 false) ret void @@ -224,13 +224,13 @@ entry: ; rdar://9892684 define void @test7(i32* nocapture %c) nounwind optsize { store i32 -1, i32* %c, align 4 - %1 = getelementptr inbounds i32* %c, i32 1 + %1 = getelementptr inbounds i32, i32* %c, i32 1 store i32 -1, i32* %1, align 4 - %2 = getelementptr inbounds i32* %c, i32 2 + %2 = getelementptr inbounds i32, i32* %c, i32 2 store i32 -1, i32* %2, align 4 - %3 = getelementptr inbounds i32* %c, i32 3 + %3 = getelementptr inbounds i32, i32* %c, i32 3 store i32 -1, i32* %3, align 4 - %4 = getelementptr inbounds i32* %c, i32 4 + %4 = getelementptr inbounds i32, i32* %c, i32 4 store i32 -1, i32* %4, align 4 ; CHECK-LABEL: @test7( ; CHECK: call void @llvm.memset.p0i8.i64(i8* %5, i8 -1, i64 20, i32 4, i1 false) @@ -253,21 +253,21 @@ entry: define void @test9() nounwind { store i8 -1, i8* bitcast ([16 x i64]* @test9buf to i8*), align 16 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 1), align 1 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 2), align 2 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 3), align 1 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 4), align 4 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 5), align 1 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 6), align 2 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 7), align 1 - store i8 -1, i8* bitcast (i64* getelementptr inbounds ([16 x i64]* @test9buf, i64 0, i64 1) to i8*), align 8 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 9), align 1 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 10), align 2 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 11), align 1 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 12), align 4 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 13), align 1 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 14), align 2 - store i8 -1, i8* getelementptr (i8* bitcast ([16 x i64]* @test9buf to i8*), i64 15), align 1 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 1), align 1 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 2), align 2 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 3), align 1 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 4), align 4 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 5), align 1 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 6), align 2 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 7), align 1 + store i8 -1, i8* bitcast (i64* getelementptr inbounds ([16 x i64], [16 x i64]* @test9buf, i64 0, i64 1) to i8*), align 8 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 9), align 1 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 10), align 2 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 11), align 1 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 12), align 4 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 13), align 1 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 14), align 2 + store i8 -1, i8* getelementptr (i8, i8* bitcast ([16 x i64]* @test9buf to i8*), i64 15), align 1 ret void ; CHECK-LABEL: @test9( ; CHECK: call void @llvm.memset.p0i8.i64(i8* bitcast ([16 x i64]* @test9buf to i8*), i8 -1, i64 16, i32 16, i1 false) @@ -288,10 +288,10 @@ define void @test10(i8* nocapture %P) nounwind { ; Memset followed by odd store. define void @test11(i32* nocapture %P) nounwind ssp { entry: - %add.ptr = getelementptr inbounds i32* %P, i64 3 + %add.ptr = getelementptr inbounds i32, i32* %P, i64 3 %0 = bitcast i32* %add.ptr to i8* tail call void @llvm.memset.p0i8.i64(i8* %0, i8 1, i64 11, i32 1, i1 false) - %arrayidx = getelementptr inbounds i32* %P, i64 0 + %arrayidx = getelementptr inbounds i32, i32* %P, i64 0 %arrayidx.cast = bitcast i32* %arrayidx to i96* store i96 310698676526526814092329217, i96* %arrayidx.cast, align 4 ret void diff --git a/test/Transforms/MemCpyOpt/loadstore-sret.ll b/test/Transforms/MemCpyOpt/loadstore-sret.ll index d4a700d..55cbe59 100644 --- a/test/Transforms/MemCpyOpt/loadstore-sret.ll +++ b/test/Transforms/MemCpyOpt/loadstore-sret.ll @@ -12,10 +12,10 @@ _ZNSt8auto_ptrIiED1Ev.exit: %temp.lvalue = alloca %"class.std::auto_ptr", align 8 ; CHECK: call void @_Z3barv(%"class.std::auto_ptr"* sret %agg.result) call void @_Z3barv(%"class.std::auto_ptr"* sret %temp.lvalue) - %tmp.i.i = getelementptr inbounds %"class.std::auto_ptr"* %temp.lvalue, i64 0, i32 0 + %tmp.i.i = getelementptr inbounds %"class.std::auto_ptr", %"class.std::auto_ptr"* %temp.lvalue, i64 0, i32 0 ; CHECK-NOT: load - %tmp2.i.i = load i32** %tmp.i.i, align 8 - %tmp.i.i4 = getelementptr inbounds %"class.std::auto_ptr"* %agg.result, i64 0, i32 0 + %tmp2.i.i = load i32*, i32** %tmp.i.i, align 8 + %tmp.i.i4 = getelementptr inbounds %"class.std::auto_ptr", %"class.std::auto_ptr"* %agg.result, i64 0, i32 0 ; CHECK-NOT: store store i32* %tmp2.i.i, i32** %tmp.i.i4, align 8 ; CHECK: ret void diff --git a/test/Transforms/MemCpyOpt/memcpy-to-memset.ll b/test/Transforms/MemCpyOpt/memcpy-to-memset.ll index 8409de7..fd8b93c 100644 --- a/test/Transforms/MemCpyOpt/memcpy-to-memset.ll +++ b/test/Transforms/MemCpyOpt/memcpy-to-memset.ll @@ -9,7 +9,7 @@ define void @test1() nounwind { %arr = alloca [3 x i32], align 4 %arr_i8 = bitcast [3 x i32]* %arr to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arr_i8, i8* bitcast ([3 x i32]* @cst to i8*), i64 12, i32 4, i1 false) - %arraydecay = getelementptr inbounds [3 x i32]* %arr, i64 0, i64 0 + %arraydecay = getelementptr inbounds [3 x i32], [3 x i32]* %arr, i64 0, i64 0 call void @foo(i32* %arraydecay) nounwind ret void ; CHECK-LABEL: @test1( diff --git a/test/Transforms/MemCpyOpt/memcpy-undef.ll b/test/Transforms/MemCpyOpt/memcpy-undef.ll index 663b8dc..c75d020 100644 --- a/test/Transforms/MemCpyOpt/memcpy-undef.ll +++ b/test/Transforms/MemCpyOpt/memcpy-undef.ll @@ -7,12 +7,12 @@ target triple = "x86_64-apple-macosx10.8.0" define i32 @test1(%struct.foo* nocapture %foobie) nounwind noinline ssp uwtable { %bletch.sroa.1 = alloca [7 x i8], align 1 - %1 = getelementptr inbounds %struct.foo* %foobie, i64 0, i32 0 + %1 = getelementptr inbounds %struct.foo, %struct.foo* %foobie, i64 0, i32 0 store i8 98, i8* %1, align 4 - %2 = getelementptr inbounds %struct.foo* %foobie, i64 0, i32 1, i64 0 - %3 = getelementptr inbounds [7 x i8]* %bletch.sroa.1, i64 0, i64 0 + %2 = getelementptr inbounds %struct.foo, %struct.foo* %foobie, i64 0, i32 1, i64 0 + %3 = getelementptr inbounds [7 x i8], [7 x i8]* %bletch.sroa.1, i64 0, i64 0 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %3, i64 7, i32 1, i1 false) - %4 = getelementptr inbounds %struct.foo* %foobie, i64 0, i32 2 + %4 = getelementptr inbounds %struct.foo, %struct.foo* %foobie, i64 0, i32 2 store i32 20, i32* %4, align 4 ret i32 undef diff --git a/test/Transforms/MemCpyOpt/memcpy.ll b/test/Transforms/MemCpyOpt/memcpy.ll index ee04f19..7318474 100644 --- a/test/Transforms/MemCpyOpt/memcpy.ll +++ b/test/Transforms/MemCpyOpt/memcpy.ll @@ -93,7 +93,7 @@ entry: %y = alloca %struct.S, align 16 %tmp = bitcast %struct.S* %y to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp, i8* bitcast (%struct.S* @sS to i8*), i64 32, i32 16, i1 false) - %a = getelementptr %struct.S* %y, i64 0, i32 1, i64 0 + %a = getelementptr %struct.S, %struct.S* %y, i64 0, i32 1, i64 0 store i8 4, i8* %a call void @test5a(%struct.S* align 16 byval %y) ret i32 0 @@ -139,10 +139,10 @@ define void @test8() { ; CHECK: test8 ; CHECK-NOT: memcpy %A = tail call i8* @malloc(i32 10) - %B = getelementptr inbounds i8* %A, i64 2 - tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %B, i8* getelementptr inbounds ([7 x i8]* @test8.str, i64 0, i64 0), i32 7, i32 1, i1 false) + %B = getelementptr inbounds i8, i8* %A, i64 2 + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %B, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @test8.str, i64 0, i64 0), i32 7, i32 1, i1 false) %C = tail call i8* @malloc(i32 10) - %D = getelementptr inbounds i8* %C, i64 2 + %D = getelementptr inbounds i8, i8* %C, i64 2 tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %D, i8* %B, i32 7, i32 1, i1 false) ret void ; CHECK: ret void @@ -196,7 +196,7 @@ define void @test10(%opaque* noalias nocapture sret %x, i32 %y) { %a = alloca i32, align 4 store i32 %y, i32* %a call void @foo(i32* noalias nocapture %a) - %c = load i32* %a + %c = load i32, i32* %a %d = bitcast %opaque* %x to i32* store i32 %c, i32* %d ret void diff --git a/test/Transforms/MemCpyOpt/memmove.ll b/test/Transforms/MemCpyOpt/memmove.ll index 2057760..1af85a1 100644 --- a/test/Transforms/MemCpyOpt/memmove.ll +++ b/test/Transforms/MemCpyOpt/memmove.ll @@ -11,9 +11,9 @@ entry: ; CHECK-LABEL: @test1( ; CHECK: call void @llvm.memcpy - %malloccall = tail call i8* @malloc(i32 trunc (i64 mul nuw (i64 ptrtoint (i8* getelementptr (i8* null, i32 1) to i64), i64 13) to i32)) + %malloccall = tail call i8* @malloc(i32 trunc (i64 mul nuw (i64 ptrtoint (i8* getelementptr (i8, i8* null, i32 1) to i64), i64 13) to i32)) %call3 = bitcast i8* %malloccall to [13 x i8]* - %call3.sub = getelementptr inbounds [13 x i8]* %call3, i64 0, i64 0 + %call3.sub = getelementptr inbounds [13 x i8], [13 x i8]* %call3, i64 0, i64 0 tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %call3.sub, i8* %src, i64 13, i32 1, i1 false) ret i8* %call3.sub } @@ -24,7 +24,7 @@ define void @test2(i8* %P) nounwind { entry: ; CHECK-LABEL: @test2( ; CHECK: call void @llvm.memcpy - %add.ptr = getelementptr i8* %P, i64 16 + %add.ptr = getelementptr i8, i8* %P, i64 16 tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %P, i8* %add.ptr, i64 16, i32 1, i1 false) ret void } @@ -34,7 +34,7 @@ define void @test3(i8* %P) nounwind { entry: ; CHECK-LABEL: @test3( ; CHECK: call void @llvm.memmove - %add.ptr = getelementptr i8* %P, i64 16 + %add.ptr = getelementptr i8, i8* %P, i64 16 tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %P, i8* %add.ptr, i64 17, i32 1, i1 false) ret void } diff --git a/test/Transforms/MemCpyOpt/smaller.ll b/test/Transforms/MemCpyOpt/smaller.ll index 1d35582..8f6cafa 100644 --- a/test/Transforms/MemCpyOpt/smaller.ll +++ b/test/Transforms/MemCpyOpt/smaller.ll @@ -4,7 +4,7 @@ ; Memcpyopt shouldn't optimize the second memcpy using the first ; because the first has a smaller size. -; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* getelementptr inbounds (%struct.s* @cell, i32 0, i32 0, i32 0), i32 16, i32 4, i1 false) +; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* getelementptr inbounds (%struct.s, %struct.s* @cell, i32 0, i32 0, i32 0), i32 16, i32 4, i1 false) target datalayout = "e-p:32:32:32" @@ -19,10 +19,10 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, define void @foo() nounwind { entry: %agg.tmp = alloca %struct.s, align 4 - store i32 99, i32* getelementptr inbounds (%struct.s* @cell, i32 0, i32 1), align 4 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%struct.s* @cell, i32 0, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0), i32 11, i32 1, i1 false) - %tmp = getelementptr inbounds %struct.s* %agg.tmp, i32 0, i32 0, i32 0 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* getelementptr inbounds (%struct.s* @cell, i32 0, i32 0, i32 0), i32 16, i32 4, i1 false) + store i32 99, i32* getelementptr inbounds (%struct.s, %struct.s* @cell, i32 0, i32 1), align 4 + call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%struct.s, %struct.s* @cell, i32 0, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 11, i32 1, i1 false) + %tmp = getelementptr inbounds %struct.s, %struct.s* %agg.tmp, i32 0, i32 0, i32 0 + call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp, i8* getelementptr inbounds (%struct.s, %struct.s* @cell, i32 0, i32 0, i32 0), i32 16, i32 4, i1 false) call void @check(%struct.s* byval %agg.tmp) ret void } diff --git a/test/Transforms/MemCpyOpt/sret.ll b/test/Transforms/MemCpyOpt/sret.ll index bfe5e0f..34ba4c4 100644 --- a/test/Transforms/MemCpyOpt/sret.ll +++ b/test/Transforms/MemCpyOpt/sret.ll @@ -9,13 +9,13 @@ define void @ccosl(%0* noalias sret %agg.result, %0* byval align 8 %z) nounwind entry: %iz = alloca %0 %memtmp = alloca %0, align 16 - %tmp1 = getelementptr %0* %z, i32 0, i32 1 - %tmp2 = load x86_fp80* %tmp1, align 16 + %tmp1 = getelementptr %0, %0* %z, i32 0, i32 1 + %tmp2 = load x86_fp80, x86_fp80* %tmp1, align 16 %tmp3 = fsub x86_fp80 0xK80000000000000000000, %tmp2 - %tmp4 = getelementptr %0* %iz, i32 0, i32 1 - %real = getelementptr %0* %iz, i32 0, i32 0 - %tmp7 = getelementptr %0* %z, i32 0, i32 0 - %tmp8 = load x86_fp80* %tmp7, align 16 + %tmp4 = getelementptr %0, %0* %iz, i32 0, i32 1 + %real = getelementptr %0, %0* %iz, i32 0, i32 0 + %tmp7 = getelementptr %0, %0* %z, i32 0, i32 0 + %tmp8 = load x86_fp80, x86_fp80* %tmp7, align 16 store x86_fp80 %tmp3, x86_fp80* %real, align 16 store x86_fp80 %tmp8, x86_fp80* %tmp4, align 16 call void @ccoshl(%0* noalias sret %memtmp, %0* byval align 8 %iz) nounwind diff --git a/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll b/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll index 19cd6a5..4735ea5 100644 --- a/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll +++ b/test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll @@ -36,15 +36,15 @@ entry: store %"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_fileline_FileLine"** %this_addr store %"struct.kc::impl_casestring__Str"* %_file, %"struct.kc::impl_casestring__Str"** %_file_addr store i32 %_line, i32* %_line_addr - %0 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %1 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %0, i32 0, i32 0 + %0 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %1 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %0, i32 0, i32 0 call void @_ZN2kc13impl_filelineC2Ev() nounwind - %2 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %3 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %2, i32 0, i32 0 - %4 = getelementptr inbounds %"struct.kc::impl_fileline"* %3, i32 0, i32 0 - %5 = getelementptr inbounds %"struct.kc::impl_abstract_phylum"* %4, i32 0, i32 0 - store i32 (...)** getelementptr inbounds ([13 x i32 (...)*]* @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), i32 (...)*** %5, align 4 - %6 = load %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 + %2 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %3 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %2, i32 0, i32 0 + %4 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %3, i32 0, i32 0 + %5 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %4, i32 0, i32 0 + store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), i32 (...)*** %5, align 4 + %6 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 %7 = icmp eq %"struct.kc::impl_casestring__Str"* %6, null br i1 %7, label %bb, label %bb1 @@ -57,20 +57,20 @@ invcont: ; preds = %bb br label %bb2 bb1: ; preds = %entry - %9 = load %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 + %9 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 store %"struct.kc::impl_casestring__Str"* %9, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4 br label %bb2 bb2: ; preds = %bb1, %invcont - %10 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %11 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %10, i32 0, i32 0 - %12 = getelementptr inbounds %"struct.kc::impl_fileline"* %11, i32 0, i32 1 - %13 = load %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4 + %10 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %11 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %10, i32 0, i32 0 + %12 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %11, i32 0, i32 1 + %13 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4 store %"struct.kc::impl_casestring__Str"* %13, %"struct.kc::impl_casestring__Str"** %12, align 4 - %14 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %15 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %14, i32 0, i32 0 - %16 = getelementptr inbounds %"struct.kc::impl_fileline"* %15, i32 0, i32 2 - %17 = load i32* %_line_addr, align 4 + %14 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %15 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %14, i32 0, i32 0 + %16 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %15, i32 0, i32 2 + %17 = load i32, i32* %_line_addr, align 4 store i32 %17, i32* %16, align 4 ret void @@ -79,21 +79,21 @@ lpad: ; preds = %bb cleanup %exn = extractvalue { i8*, i32 } %eh_ptr, 0 store i8* %exn, i8** %eh_exception - %eh_ptr4 = load i8** %eh_exception + %eh_ptr4 = load i8*, i8** %eh_exception %eh_select5 = extractvalue { i8*, i32 } %eh_ptr, 1 store i32 %eh_select5, i32* %eh_selector - %eh_select = load i32* %eh_selector + %eh_select = load i32, i32* %eh_selector store i32 %eh_select, i32* %save_filt.150, align 4 - %eh_value = load i8** %eh_exception + %eh_value = load i8*, i8** %eh_exception store i8* %eh_value, i8** %save_eptr.149, align 4 - %18 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %18 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 %19 = bitcast %"struct.kc::impl_fileline_FileLine"* %18 to %"struct.kc::impl_fileline"* call void @_ZN2kc13impl_filelineD2Ev(%"struct.kc::impl_fileline"* %19) nounwind - %20 = load i8** %save_eptr.149, align 4 + %20 = load i8*, i8** %save_eptr.149, align 4 store i8* %20, i8** %eh_exception, align 4 - %21 = load i32* %save_filt.150, align 4 + %21 = load i32, i32* %save_filt.150, align 4 store i32 %21, i32* %eh_selector, align 4 - %eh_ptr6 = load i8** %eh_exception + %eh_ptr6 = load i8*, i8** %eh_exception call void @_Unwind_Resume_or_Rethrow() unreachable } @@ -105,16 +105,16 @@ entry: %this_addr = alloca %"struct.kc::impl_fileline"*, align 4 %"alloca point" = bitcast i32 0 to i32 store %"struct.kc::impl_fileline"* %this, %"struct.kc::impl_fileline"** %this_addr - %0 = load %"struct.kc::impl_fileline"** %this_addr, align 4 - %1 = getelementptr inbounds %"struct.kc::impl_fileline"* %0, i32 0, i32 0 - %2 = getelementptr inbounds %"struct.kc::impl_abstract_phylum"* %1, i32 0, i32 0 - store i32 (...)** getelementptr inbounds ([13 x i32 (...)*]* @_ZTVN2kc13impl_filelineE, i32 0, i32 2), i32 (...)*** %2, align 4 + %0 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4 + %1 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %0, i32 0, i32 0 + %2 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %1, i32 0, i32 0 + store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc13impl_filelineE, i32 0, i32 2), i32 (...)*** %2, align 4 %3 = trunc i32 0 to i8 %toBool = icmp ne i8 %3, 0 br i1 %toBool, label %bb1, label %return bb1: ; preds = %entry - %4 = load %"struct.kc::impl_fileline"** %this_addr, align 4 + %4 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4 %5 = bitcast %"struct.kc::impl_fileline"* %4 to i8* call void @_ZdlPv() nounwind br label %return @@ -130,16 +130,16 @@ entry: %this_addr = alloca %"struct.kc::impl_fileline"*, align 4 %"alloca point" = bitcast i32 0 to i32 store %"struct.kc::impl_fileline"* %this, %"struct.kc::impl_fileline"** %this_addr - %0 = load %"struct.kc::impl_fileline"** %this_addr, align 4 - %1 = getelementptr inbounds %"struct.kc::impl_fileline"* %0, i32 0, i32 0 - %2 = getelementptr inbounds %"struct.kc::impl_abstract_phylum"* %1, i32 0, i32 0 - store i32 (...)** getelementptr inbounds ([13 x i32 (...)*]* @_ZTVN2kc13impl_filelineE, i32 0, i32 2), i32 (...)*** %2, align 4 + %0 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4 + %1 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %0, i32 0, i32 0 + %2 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %1, i32 0, i32 0 + store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc13impl_filelineE, i32 0, i32 2), i32 (...)*** %2, align 4 %3 = trunc i32 0 to i8 %toBool = icmp ne i8 %3, 0 br i1 %toBool, label %bb1, label %return bb1: ; preds = %entry - %4 = load %"struct.kc::impl_fileline"** %this_addr, align 4 + %4 = load %"struct.kc::impl_fileline"*, %"struct.kc::impl_fileline"** %this_addr, align 4 %5 = bitcast %"struct.kc::impl_fileline"* %4 to i8* call void @_ZdlPv() nounwind br label %return @@ -162,15 +162,15 @@ entry: store %"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_fileline_FileLine"** %this_addr store %"struct.kc::impl_casestring__Str"* %_file, %"struct.kc::impl_casestring__Str"** %_file_addr store i32 %_line, i32* %_line_addr - %0 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %1 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %0, i32 0, i32 0 + %0 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %1 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %0, i32 0, i32 0 call void @_ZN2kc13impl_filelineC2Ev() nounwind - %2 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %3 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %2, i32 0, i32 0 - %4 = getelementptr inbounds %"struct.kc::impl_fileline"* %3, i32 0, i32 0 - %5 = getelementptr inbounds %"struct.kc::impl_abstract_phylum"* %4, i32 0, i32 0 - store i32 (...)** getelementptr inbounds ([13 x i32 (...)*]* @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), i32 (...)*** %5, align 4 - %6 = load %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 + %2 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %3 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %2, i32 0, i32 0 + %4 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %3, i32 0, i32 0 + %5 = getelementptr inbounds %"struct.kc::impl_abstract_phylum", %"struct.kc::impl_abstract_phylum"* %4, i32 0, i32 0 + store i32 (...)** getelementptr inbounds ([13 x i32 (...)*], [13 x i32 (...)*]* @_ZTVN2kc22impl_fileline_FileLineE, i32 0, i32 2), i32 (...)*** %5, align 4 + %6 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 %7 = icmp eq %"struct.kc::impl_casestring__Str"* %6, null br i1 %7, label %bb, label %bb1 @@ -183,20 +183,20 @@ invcont: ; preds = %bb br label %bb2 bb1: ; preds = %entry - %9 = load %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 + %9 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %_file_addr, align 4 store %"struct.kc::impl_casestring__Str"* %9, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4 br label %bb2 bb2: ; preds = %bb1, %invcont - %10 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %11 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %10, i32 0, i32 0 - %12 = getelementptr inbounds %"struct.kc::impl_fileline"* %11, i32 0, i32 1 - %13 = load %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4 + %10 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %11 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %10, i32 0, i32 0 + %12 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %11, i32 0, i32 1 + %13 = load %"struct.kc::impl_casestring__Str"*, %"struct.kc::impl_casestring__Str"** %iftmp.99, align 4 store %"struct.kc::impl_casestring__Str"* %13, %"struct.kc::impl_casestring__Str"** %12, align 4 - %14 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 - %15 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine"* %14, i32 0, i32 0 - %16 = getelementptr inbounds %"struct.kc::impl_fileline"* %15, i32 0, i32 2 - %17 = load i32* %_line_addr, align 4 + %14 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %15 = getelementptr inbounds %"struct.kc::impl_fileline_FileLine", %"struct.kc::impl_fileline_FileLine"* %14, i32 0, i32 0 + %16 = getelementptr inbounds %"struct.kc::impl_fileline", %"struct.kc::impl_fileline"* %15, i32 0, i32 2 + %17 = load i32, i32* %_line_addr, align 4 store i32 %17, i32* %16, align 4 ret void @@ -205,21 +205,21 @@ lpad: ; preds = %bb cleanup %exn = extractvalue { i8*, i32 } %eh_ptr, 0 store i8* %exn, i8** %eh_exception - %eh_ptr4 = load i8** %eh_exception + %eh_ptr4 = load i8*, i8** %eh_exception %eh_select5 = extractvalue { i8*, i32 } %eh_ptr, 1 store i32 %eh_select5, i32* %eh_selector - %eh_select = load i32* %eh_selector + %eh_select = load i32, i32* %eh_selector store i32 %eh_select, i32* %save_filt.148, align 4 - %eh_value = load i8** %eh_exception + %eh_value = load i8*, i8** %eh_exception store i8* %eh_value, i8** %save_eptr.147, align 4 - %18 = load %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 + %18 = load %"struct.kc::impl_fileline_FileLine"*, %"struct.kc::impl_fileline_FileLine"** %this_addr, align 4 %19 = bitcast %"struct.kc::impl_fileline_FileLine"* %18 to %"struct.kc::impl_fileline"* call void @_ZN2kc13impl_filelineD2Ev(%"struct.kc::impl_fileline"* %19) nounwind - %20 = load i8** %save_eptr.147, align 4 + %20 = load i8*, i8** %save_eptr.147, align 4 store i8* %20, i8** %eh_exception, align 4 - %21 = load i32* %save_filt.148, align 4 + %21 = load i32, i32* %save_filt.148, align 4 store i32 %21, i32* %eh_selector, align 4 - %eh_ptr6 = load i8** %eh_exception + %eh_ptr6 = load i8*, i8** %eh_exception call void @_Unwind_Resume_or_Rethrow() unreachable } diff --git a/test/Transforms/MergeFunc/address-spaces.ll b/test/Transforms/MergeFunc/address-spaces.ll index 0d66b82..1cfecae 100644 --- a/test/Transforms/MergeFunc/address-spaces.ll +++ b/test/Transforms/MergeFunc/address-spaces.ll @@ -9,8 +9,8 @@ declare void @foo(i32) nounwind define i32 @store_as0(i32* %x) { ; CHECK-LABEL: @store_as0( ; CHECK: call void @foo( - %gep = getelementptr i32* %x, i32 4 - %y = load i32* %gep + %gep = getelementptr i32, i32* %x, i32 4 + %y = load i32, i32* %gep call void @foo(i32 %y) nounwind ret i32 %y } @@ -18,8 +18,8 @@ define i32 @store_as0(i32* %x) { define i32 @store_as1(i32 addrspace(1)* %x) { ; CHECK-LABEL: @store_as1( ; CHECK: call void @foo( - %gep = getelementptr i32 addrspace(1)* %x, i32 4 - %y = load i32 addrspace(1)* %gep + %gep = getelementptr i32, i32 addrspace(1)* %x, i32 4 + %y = load i32, i32 addrspace(1)* %gep call void @foo(i32 %y) nounwind ret i32 %y } @@ -27,8 +27,8 @@ define i32 @store_as1(i32 addrspace(1)* %x) { define i32 @store_as2(i32 addrspace(2)* %x) { ; CHECK-LABEL: @store_as2( ; CHECK: call void @foo( - %gep = getelementptr i32 addrspace(2)* %x, i32 4 - %y = load i32 addrspace(2)* %gep + %gep = getelementptr i32, i32 addrspace(2)* %x, i32 4 + %y = load i32, i32 addrspace(2)* %gep call void @foo(i32 %y) nounwind ret i32 %y } diff --git a/test/Transforms/MergeFunc/crash.ll b/test/Transforms/MergeFunc/crash.ll index 3475e28..7380220 100644 --- a/test/Transforms/MergeFunc/crash.ll +++ b/test/Transforms/MergeFunc/crash.ll @@ -21,13 +21,13 @@ define internal i32 @func1(i32* %ptr, { i32, i32 }* nocapture %method) align 2 { } define internal i32 @func10(%.qux.2496* nocapture %this) align 2 { - %1 = getelementptr inbounds %.qux.2496* %this, i32 0, i32 1, i32 1 - %2 = load i32* %1, align 4 + %1 = getelementptr inbounds %.qux.2496, %.qux.2496* %this, i32 0, i32 1, i32 1 + %2 = load i32, i32* %1, align 4 ret i32 %2 } define internal i8* @func29(i32* nocapture %this) align 2 { - ret i8* getelementptr inbounds ([9 x i8]* @g2, i32 0, i32 0) + ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @g2, i32 0, i32 0) } define internal i32* @func33(%.qux.2585* nocapture %this) align 2 { @@ -35,12 +35,12 @@ define internal i32* @func33(%.qux.2585* nocapture %this) align 2 { } define internal i32* @func34(%.qux.2585* nocapture %this) align 2 { - %1 = getelementptr inbounds %.qux.2585* %this, i32 0 + %1 = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0 ret i32* undef } define internal i8* @func35(%.qux.2585* nocapture %this) align 2 { - %1 = getelementptr inbounds %.qux.2585* %this, i32 0, i32 2 - %2 = load i8** %1, align 4 + %1 = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0, i32 2 + %2 = load i8*, i8** %1, align 4 ret i8* %2 } diff --git a/test/Transforms/MergeFunc/inttoptr-address-space.ll b/test/Transforms/MergeFunc/inttoptr-address-space.ll index 2e5e2fc..5f672de 100644 --- a/test/Transforms/MergeFunc/inttoptr-address-space.ll +++ b/test/Transforms/MergeFunc/inttoptr-address-space.ll @@ -11,8 +11,8 @@ target datalayout = "e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32- define internal i32 @func10(%.qux.2496 addrspace(1)* nocapture %this) align 2 { bb: - %tmp = getelementptr inbounds %.qux.2496 addrspace(1)* %this, i32 0, i32 1, i32 1 - %tmp1 = load i32 addrspace(1)* %tmp, align 4 + %tmp = getelementptr inbounds %.qux.2496, %.qux.2496 addrspace(1)* %this, i32 0, i32 1, i32 1 + %tmp1 = load i32, i32 addrspace(1)* %tmp, align 4 ret i32 %tmp1 } @@ -23,7 +23,7 @@ bb: ; CHECK: %[[V2:.+]] = bitcast %.qux.2585 addrspace(1)* %{{.*}} to %.qux.2496 addrspace(1)* ; CHECK: %[[V3:.+]] = tail call i32 @func10(%.qux.2496 addrspace(1)* %[[V2]]) ; CHECK: %{{.*}} = inttoptr i32 %[[V3]] to i8* - %tmp = getelementptr inbounds %.qux.2585 addrspace(1)* %this, i32 0, i32 2 - %tmp1 = load i8* addrspace(1)* %tmp, align 4 + %tmp = getelementptr inbounds %.qux.2585, %.qux.2585 addrspace(1)* %this, i32 0, i32 2 + %tmp1 = load i8*, i8* addrspace(1)* %tmp, align 4 ret i8* %tmp1 } diff --git a/test/Transforms/MergeFunc/inttoptr.ll b/test/Transforms/MergeFunc/inttoptr.ll index 86c18a0..0abbf62 100644 --- a/test/Transforms/MergeFunc/inttoptr.ll +++ b/test/Transforms/MergeFunc/inttoptr.ll @@ -23,14 +23,14 @@ bb2: ; preds = %bb1 define internal i32 @func10(%.qux.2496* nocapture %this) align 2 { bb: - %tmp = getelementptr inbounds %.qux.2496* %this, i32 0, i32 1, i32 1 - %tmp1 = load i32* %tmp, align 4 + %tmp = getelementptr inbounds %.qux.2496, %.qux.2496* %this, i32 0, i32 1, i32 1 + %tmp1 = load i32, i32* %tmp, align 4 ret i32 %tmp1 } define internal i8* @func29(i32* nocapture %this) align 2 { bb: - ret i8* getelementptr inbounds ([9 x i8]* @g2, i32 0, i32 0) + ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @g2, i32 0, i32 0) } define internal i32* @func33(%.qux.2585* nocapture %this) align 2 { @@ -40,7 +40,7 @@ bb: define internal i32* @func34(%.qux.2585* nocapture %this) align 2 { bb: - %tmp = getelementptr inbounds %.qux.2585* %this, i32 0 + %tmp = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0 ret i32* undef } @@ -50,7 +50,7 @@ bb: ; CHECK: %[[V2:.+]] = bitcast %.qux.2585* %{{.*}} to %.qux.2496* ; CHECK: %[[V3:.+]] = tail call i32 @func10(%.qux.2496* %[[V2]]) ; CHECK: %{{.*}} = inttoptr i32 %[[V3]] to i8* - %tmp = getelementptr inbounds %.qux.2585* %this, i32 0, i32 2 - %tmp1 = load i8** %tmp, align 4 + %tmp = getelementptr inbounds %.qux.2585, %.qux.2585* %this, i32 0, i32 2 + %tmp1 = load i8*, i8** %tmp, align 4 ret i8* %tmp1 } diff --git a/test/Transforms/MergeFunc/mergefunc-struct-return.ll b/test/Transforms/MergeFunc/mergefunc-struct-return.ll index d2cbe43..14db399 100644 --- a/test/Transforms/MergeFunc/mergefunc-struct-return.ll +++ b/test/Transforms/MergeFunc/mergefunc-struct-return.ll @@ -13,12 +13,12 @@ declare void @noop() define %kv1 @fn1() { ; CHECK-LABEL: @fn1( %tmp = alloca %kv1 - %v1 = getelementptr %kv1* %tmp, i32 0, i32 0 + %v1 = getelementptr %kv1, %kv1* %tmp, i32 0, i32 0 store i32* null, i32** %v1 - %v2 = getelementptr %kv1* %tmp, i32 0, i32 0 + %v2 = getelementptr %kv1, %kv1* %tmp, i32 0, i32 0 store i32* null, i32** %v2 call void @noop() - %v3 = load %kv1* %tmp + %v3 = load %kv1, %kv1* %tmp ret %kv1 %v3 } @@ -29,12 +29,12 @@ define %kv2 @fn2() { ; CHECK: %3 = bitcast i32* %2 to i8* ; CHECK: %4 = insertvalue %kv2 undef, i8* %3, 0 %tmp = alloca %kv2 - %v1 = getelementptr %kv2* %tmp, i32 0, i32 0 + %v1 = getelementptr %kv2, %kv2* %tmp, i32 0, i32 0 store i8* null, i8** %v1 - %v2 = getelementptr %kv2* %tmp, i32 0, i32 0 + %v2 = getelementptr %kv2, %kv2* %tmp, i32 0, i32 0 store i8* null, i8** %v2 call void @noop() - %v3 = load %kv2* %tmp + %v3 = load %kv2, %kv2* %tmp ret %kv2 %v3 } diff --git a/test/Transforms/MergeFunc/ranges.ll b/test/Transforms/MergeFunc/ranges.ll index d3e4d94..46a0c76 100644 --- a/test/Transforms/MergeFunc/ranges.ll +++ b/test/Transforms/MergeFunc/ranges.ll @@ -1,31 +1,31 @@ ; RUN: opt -mergefunc -S < %s | FileCheck %s define i1 @cmp_with_range(i8*, i8*) { - %v1 = load i8* %0, !range !0 - %v2 = load i8* %1, !range !0 + %v1 = load i8, i8* %0, !range !0 + %v2 = load i8, i8* %1, !range !0 %out = icmp eq i8 %v1, %v2 ret i1 %out } define i1 @cmp_no_range(i8*, i8*) { ; CHECK-LABEL: @cmp_no_range -; CHECK-NEXT %v1 = load i8* %0 -; CHECK-NEXT %v2 = load i8* %1 +; CHECK-NEXT %v1 = load i8, i8* %0 +; CHECK-NEXT %v2 = load i8, i8* %1 ; CHECK-NEXT %out = icmp eq i8 %v1, %v2 ; CHECK-NEXT ret i1 %out - %v1 = load i8* %0 - %v2 = load i8* %1 + %v1 = load i8, i8* %0 + %v2 = load i8, i8* %1 %out = icmp eq i8 %v1, %v2 ret i1 %out } define i1 @cmp_different_range(i8*, i8*) { ; CHECK-LABEL: @cmp_different_range -; CHECK-NEXT: %v1 = load i8* %0, !range !1 -; CHECK-NEXT: %v2 = load i8* %1, !range !1 +; CHECK-NEXT: %v1 = load i8, i8* %0, !range !1 +; CHECK-NEXT: %v2 = load i8, i8* %1, !range !1 ; CHECK-NEXT: %out = icmp eq i8 %v1, %v2 ; CHECK-NEXT: ret i1 %out - %v1 = load i8* %0, !range !1 - %v2 = load i8* %1, !range !1 + %v1 = load i8, i8* %0, !range !1 + %v2 = load i8, i8* %1, !range !1 %out = icmp eq i8 %v1, %v2 ret i1 %out } @@ -33,8 +33,8 @@ define i1 @cmp_different_range(i8*, i8*) { define i1 @cmp_with_same_range(i8*, i8*) { ; CHECK-LABEL: @cmp_with_same_range ; CHECK: tail call i1 @cmp_with_range - %v1 = load i8* %0, !range !0 - %v2 = load i8* %1, !range !0 + %v1 = load i8, i8* %0, !range !0 + %v2 = load i8, i8* %1, !range !0 %out = icmp eq i8 %v1, %v2 ret i1 %out } diff --git a/test/Transforms/MergeFunc/vector-GEP-crash.ll b/test/Transforms/MergeFunc/vector-GEP-crash.ll index a1eefa0..d0e86eb 100644 --- a/test/Transforms/MergeFunc/vector-GEP-crash.ll +++ b/test/Transforms/MergeFunc/vector-GEP-crash.ll @@ -2,11 +2,11 @@ ; This used to cause a crash when compairing the GEPs define void @foo(<2 x i64*>) { - %tmp = getelementptr <2 x i64*> %0, <2 x i64> <i64 0, i64 0> + %tmp = getelementptr i64, <2 x i64*> %0, <2 x i64> <i64 0, i64 0> ret void } define void @bar(<2 x i64*>) { - %tmp = getelementptr <2 x i64*> %0, <2 x i64> <i64 0, i64 0> + %tmp = getelementptr i64, <2 x i64*> %0, <2 x i64> <i64 0, i64 0> ret void } diff --git a/test/Transforms/MergeFunc/vector.ll b/test/Transforms/MergeFunc/vector.ll index 56f74e6..ef13753 100644 --- a/test/Transforms/MergeFunc/vector.ll +++ b/test/Transforms/MergeFunc/vector.ll @@ -22,7 +22,7 @@ target triple = "x86_64-unknown-linux-gnu" define linkonce_odr void @_ZNSt6vectorIlSaIlEED1Ev(%"class.std::vector"* nocapture %this) unnamed_addr align 2 { entry: %tmp2.i.i = bitcast %"class.std::vector"* %this to i64** - %tmp3.i.i = load i64** %tmp2.i.i, align 8 + %tmp3.i.i = load i64*, i64** %tmp2.i.i, align 8 %tobool.i.i.i = icmp eq i64* %tmp3.i.i, null br i1 %tobool.i.i.i, label %_ZNSt6vectorIlSaIlEED2Ev.exit, label %if.then.i.i.i @@ -40,7 +40,7 @@ declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) define linkonce_odr void @_ZNSt6vectorIPvSaIS0_EED1Ev(%"class.std::vector"* nocapture %this) unnamed_addr align 2 { entry: %tmp2.i.i = bitcast %"class.std::vector"* %this to i8*** - %tmp3.i.i = load i8*** %tmp2.i.i, align 8 + %tmp3.i.i = load i8**, i8*** %tmp2.i.i, align 8 %tobool.i.i.i = icmp eq i8** %tmp3.i.i, null br i1 %tobool.i.i.i, label %_ZNSt6vectorIPvSaIS0_EED2Ev.exit, label %if.then.i.i.i diff --git a/test/Transforms/MetaRenamer/metarenamer.ll b/test/Transforms/MetaRenamer/metarenamer.ll index 4010f31..e126bed 100644 --- a/test/Transforms/MetaRenamer/metarenamer.ll +++ b/test/Transforms/MetaRenamer/metarenamer.ll @@ -24,14 +24,14 @@ define i32 @func_3_xxx() nounwind uwtable ssp { define void @func_4_xxx(%struct.foo_xxx* sret %agg.result) nounwind uwtable ssp { %1 = alloca %struct.foo_xxx, align 8 - %2 = getelementptr inbounds %struct.foo_xxx* %1, i32 0, i32 0 + %2 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 0 store i32 1, i32* %2, align 4 - %3 = getelementptr inbounds %struct.foo_xxx* %1, i32 0, i32 1 + %3 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 1 store float 2.000000e+00, float* %3, align 4 - %4 = getelementptr inbounds %struct.foo_xxx* %1, i32 0, i32 2 - %5 = getelementptr inbounds %struct.bar_xxx* %4, i32 0, i32 0 + %4 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 2 + %5 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 0 store i32 3, i32* %5, align 4 - %6 = getelementptr inbounds %struct.bar_xxx* %4, i32 0, i32 1 + %6 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 1 store double 4.000000e+00, double* %6, align 8 %7 = bitcast %struct.foo_xxx* %agg.result to i8* %8 = bitcast %struct.foo_xxx* %1 to i8* @@ -59,7 +59,7 @@ define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_ br label %5 ; <label>:5 ; preds = %9, %0 - %6 = load i32* %i, align 4 + %6 = load i32, i32* %i, align 4 %7 = icmp slt i32 %6, 10 br i1 %7, label %8, label %12 @@ -67,24 +67,24 @@ define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_ br label %9 ; <label>:9 ; preds = %8 - %10 = load i32* %i, align 4 + %10 = load i32, i32* %i, align 4 %11 = add nsw i32 %10, 1 store i32 %11, i32* %i, align 4 br label %5 ; <label>:12 ; preds = %5 - %13 = load i32* %local_1_xxx, align 4 - %14 = load i32* %1, align 4 + %13 = load i32, i32* %local_1_xxx, align 4 + %14 = load i32, i32* %1, align 4 %15 = add nsw i32 %13, %14 - %16 = load i32* %local_2_xxx, align 4 + %16 = load i32, i32* %local_2_xxx, align 4 %17 = add nsw i32 %15, %16 - %18 = load i32* %2, align 4 + %18 = load i32, i32* %2, align 4 %19 = add nsw i32 %17, %18 - %20 = load i32* @func_5_xxx.static_local_3_xxx, align 4 + %20 = load i32, i32* @func_5_xxx.static_local_3_xxx, align 4 %21 = add nsw i32 %19, %20 - %22 = load i32* %3, align 4 + %22 = load i32, i32* %3, align 4 %23 = add nsw i32 %21, %22 - %24 = load i32* %4, align 4 + %24 = load i32, i32* %4, align 4 %25 = add nsw i32 %23, %24 ret i32 %25 } diff --git a/test/Transforms/ObjCARC/allocas.ll b/test/Transforms/ObjCARC/allocas.ll index 7b671df..ac26a09 100644 --- a/test/Transforms/ObjCARC/allocas.ll +++ b/test/Transforms/ObjCARC/allocas.ll @@ -56,7 +56,7 @@ entry: tail call i8* @objc_retain(i8* %x) tail call i8* @objc_retain(i8* %x) store i8* %x, i8** %A, align 8 - %y = load i8** %A + %y = load i8*, i8** %A call void @use_alloca(i8** %A) call void @objc_release(i8* %y), !clang.imprecise_release !0 call void @use_pointer(i8* %x) @@ -74,11 +74,11 @@ entry: define void @test1b(i8* %x) { entry: %A = alloca i8* - %gep = getelementptr i8** %A, i32 0 + %gep = getelementptr i8*, i8** %A, i32 0 tail call i8* @objc_retain(i8* %x) tail call i8* @objc_retain(i8* %x) store i8* %x, i8** %gep, align 8 - %y = load i8** %A + %y = load i8*, i8** %A call void @use_alloca(i8** %A) call void @objc_release(i8* %y), !clang.imprecise_release !0 call void @use_pointer(i8* %x) @@ -97,11 +97,11 @@ entry: define void @test1c(i8* %x) { entry: %A = alloca i8*, i32 3 - %gep = getelementptr i8** %A, i32 2 + %gep = getelementptr i8*, i8** %A, i32 2 tail call i8* @objc_retain(i8* %x) tail call i8* @objc_retain(i8* %x) store i8* %x, i8** %gep, align 8 - %y = load i8** %gep + %y = load i8*, i8** %gep call void @use_alloca(i8** %A) call void @objc_release(i8* %y), !clang.imprecise_release !0 call void @use_pointer(i8* %x) @@ -131,11 +131,11 @@ use_allocaB: exit: %A = phi i8** [ %allocaA, %use_allocaA ], [ %allocaB, %use_allocaB ] - %gep = getelementptr i8** %A, i32 0 + %gep = getelementptr i8*, i8** %A, i32 0 tail call i8* @objc_retain(i8* %x) tail call i8* @objc_retain(i8* %x) store i8* %x, i8** %gep, align 8 - %y = load i8** %gep + %y = load i8*, i8** %gep call void @use_alloca(i8** %A) call void @objc_release(i8* %y), !clang.imprecise_release !0 call void @use_pointer(i8* %x) @@ -164,11 +164,11 @@ use_allocaB: exit: %A = phi i8** [ %allocaA, %use_allocaA ], [ %allocaB, %use_allocaB ] - %gep = getelementptr i8** %A, i32 2 + %gep = getelementptr i8*, i8** %A, i32 2 tail call i8* @objc_retain(i8* %x) tail call i8* @objc_retain(i8* %x) store i8* %x, i8** %gep, align 8 - %y = load i8** %gep + %y = load i8*, i8** %gep call void @use_alloca(i8** %A) call void @objc_release(i8* %y), !clang.imprecise_release !0 call void @use_pointer(i8* %x) @@ -191,7 +191,7 @@ entry: tail call i8* @objc_retain(i8* %x) tail call i8* @objc_retain(i8* %x) store i8* %x, i8** %A, align 8 - %y = load i8** %A + %y = load i8*, i8** %A call void @use_alloca(i8** %A) call void @objc_release(i8* %y), !clang.imprecise_release !0 call void @use_pointer(i8* %x) @@ -214,7 +214,7 @@ define void @test2a(i8* %x) { entry: %A = alloca i8* store i8* %x, i8** %A, align 8 - %y = load i8** %A + %y = load i8*, i8** %A br label %bb1 bb1: @@ -243,10 +243,10 @@ bb3: define void @test2b(i8* %x) { entry: %A = alloca i8* - %gep1 = getelementptr i8** %A, i32 0 + %gep1 = getelementptr i8*, i8** %A, i32 0 store i8* %x, i8** %gep1, align 8 - %gep2 = getelementptr i8** %A, i32 0 - %y = load i8** %gep2 + %gep2 = getelementptr i8*, i8** %A, i32 0 + %y = load i8*, i8** %gep2 br label %bb1 bb1: @@ -275,10 +275,10 @@ bb3: define void @test2c(i8* %x) { entry: %A = alloca i8*, i32 3 - %gep1 = getelementptr i8** %A, i32 2 + %gep1 = getelementptr i8*, i8** %A, i32 2 store i8* %x, i8** %gep1, align 8 - %gep2 = getelementptr i8** %A, i32 2 - %y = load i8** %gep2 + %gep2 = getelementptr i8*, i8** %A, i32 2 + %y = load i8*, i8** %gep2 tail call i8* @objc_retain(i8* %x) br label %bb1 @@ -311,18 +311,18 @@ entry: bb1: %Abb1 = alloca i8*, i32 3 - %gepbb11 = getelementptr i8** %Abb1, i32 2 + %gepbb11 = getelementptr i8*, i8** %Abb1, i32 2 store i8* %x, i8** %gepbb11, align 8 - %gepbb12 = getelementptr i8** %Abb1, i32 2 - %ybb1 = load i8** %gepbb12 + %gepbb12 = getelementptr i8*, i8** %Abb1, i32 2 + %ybb1 = load i8*, i8** %gepbb12 br label %bb3 bb2: %Abb2 = alloca i8*, i32 4 - %gepbb21 = getelementptr i8** %Abb2, i32 2 + %gepbb21 = getelementptr i8*, i8** %Abb2, i32 2 store i8* %x, i8** %gepbb21, align 8 - %gepbb22 = getelementptr i8** %Abb2, i32 2 - %ybb2 = load i8** %gepbb22 + %gepbb22 = getelementptr i8*, i8** %Abb2, i32 2 + %ybb2 = load i8*, i8** %gepbb22 br label %bb3 bb3: @@ -369,44 +369,44 @@ entry: %call1 = call i8* @returner() %tmp0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %call1) - %objs.begin = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0 + %objs.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0 tail call i8* @objc_retain(i8* %call1) store i8* %call1, i8** %objs.begin, align 8 - %objs.elt = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 1 + %objs.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 1 tail call i8* @objc_retain(i8* %call1) store i8* %call1, i8** %objs.elt %call2 = call i8* @returner1() %call3 = call i8* @returner2() - %keys.begin = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0 + %keys.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0 tail call i8* @objc_retain(i8* %call2) store i8* %call2, i8** %keys.begin, align 8 - %keys.elt = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 1 + %keys.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 1 tail call i8* @objc_retain(i8* %call3) store i8* %call3, i8** %keys.elt - %gep = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 2 + %gep = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 2 br label %arraydestroy.body arraydestroy.body: %arraydestroy.elementPast = phi i8** [ %gep, %entry ], [ %arraydestroy.element, %arraydestroy.body ] - %arraydestroy.element = getelementptr inbounds i8** %arraydestroy.elementPast, i64 -1 - %destroy_tmp = load i8** %arraydestroy.element, align 8 + %arraydestroy.element = getelementptr inbounds i8*, i8** %arraydestroy.elementPast, i64 -1 + %destroy_tmp = load i8*, i8** %arraydestroy.element, align 8 call void @objc_release(i8* %destroy_tmp), !clang.imprecise_release !0 - %objs_ptr = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0 + %objs_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0 %arraydestroy.cmp = icmp eq i8** %arraydestroy.element, %objs_ptr br i1 %arraydestroy.cmp, label %arraydestroy.done, label %arraydestroy.body arraydestroy.done: - %gep1 = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 2 + %gep1 = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 2 br label %arraydestroy.body1 arraydestroy.body1: %arraydestroy.elementPast1 = phi i8** [ %gep1, %arraydestroy.done ], [ %arraydestroy.element1, %arraydestroy.body1 ] - %arraydestroy.element1 = getelementptr inbounds i8** %arraydestroy.elementPast1, i64 -1 - %destroy_tmp1 = load i8** %arraydestroy.element1, align 8 + %arraydestroy.element1 = getelementptr inbounds i8*, i8** %arraydestroy.elementPast1, i64 -1 + %destroy_tmp1 = load i8*, i8** %arraydestroy.element1, align 8 call void @objc_release(i8* %destroy_tmp1), !clang.imprecise_release !0 - %keys_ptr = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0 + %keys_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0 %arraydestroy.cmp1 = icmp eq i8** %arraydestroy.element1, %keys_ptr br i1 %arraydestroy.cmp1, label %arraydestroy.done1, label %arraydestroy.body1 @@ -448,44 +448,44 @@ entry: %tmp0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %call1) %tmp1 = tail call i8* @objc_retain(i8* %call1) - %objs.begin = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0 + %objs.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0 tail call i8* @objc_retain(i8* %call1) store i8* %call1, i8** %objs.begin, align 8 - %objs.elt = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 1 + %objs.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 1 tail call i8* @objc_retain(i8* %call1) store i8* %call1, i8** %objs.elt %call2 = call i8* @returner1() %call3 = call i8* @returner2() - %keys.begin = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0 + %keys.begin = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0 tail call i8* @objc_retain(i8* %call2) store i8* %call2, i8** %keys.begin, align 8 - %keys.elt = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 1 + %keys.elt = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 1 tail call i8* @objc_retain(i8* %call3) store i8* %call3, i8** %keys.elt - %gep = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 2 + %gep = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 2 br label %arraydestroy.body arraydestroy.body: %arraydestroy.elementPast = phi i8** [ %gep, %entry ], [ %arraydestroy.element, %arraydestroy.body ] - %arraydestroy.element = getelementptr inbounds i8** %arraydestroy.elementPast, i64 -1 - %destroy_tmp = load i8** %arraydestroy.element, align 8 + %arraydestroy.element = getelementptr inbounds i8*, i8** %arraydestroy.elementPast, i64 -1 + %destroy_tmp = load i8*, i8** %arraydestroy.element, align 8 call void @objc_release(i8* %destroy_tmp), !clang.imprecise_release !0 - %objs_ptr = getelementptr inbounds [2 x i8*]* %objs, i64 0, i64 0 + %objs_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %objs, i64 0, i64 0 %arraydestroy.cmp = icmp eq i8** %arraydestroy.element, %objs_ptr br i1 %arraydestroy.cmp, label %arraydestroy.done, label %arraydestroy.body arraydestroy.done: - %gep1 = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 2 + %gep1 = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 2 br label %arraydestroy.body1 arraydestroy.body1: %arraydestroy.elementPast1 = phi i8** [ %gep1, %arraydestroy.done ], [ %arraydestroy.element1, %arraydestroy.body1 ] - %arraydestroy.element1 = getelementptr inbounds i8** %arraydestroy.elementPast1, i64 -1 - %destroy_tmp1 = load i8** %arraydestroy.element1, align 8 + %arraydestroy.element1 = getelementptr inbounds i8*, i8** %arraydestroy.elementPast1, i64 -1 + %destroy_tmp1 = load i8*, i8** %arraydestroy.element1, align 8 call void @objc_release(i8* %destroy_tmp1), !clang.imprecise_release !0 - %keys_ptr = getelementptr inbounds [2 x i8*]* %keys, i64 0, i64 0 + %keys_ptr = getelementptr inbounds [2 x i8*], [2 x i8*]* %keys, i64 0, i64 0 %arraydestroy.cmp1 = icmp eq i8** %arraydestroy.element1, %keys_ptr br i1 %arraydestroy.cmp1, label %arraydestroy.done1, label %arraydestroy.body1 diff --git a/test/Transforms/ObjCARC/arc-annotations.ll b/test/Transforms/ObjCARC/arc-annotations.ll deleted file mode 100644 index c0ce44f..0000000 --- a/test/Transforms/ObjCARC/arc-annotations.ll +++ /dev/null @@ -1,83 +0,0 @@ -; This file consists of various tests which ensure that the objc-arc-annotations -; are working correctly. In the future, I will use this in other lit tests to -; check the data flow analysis of ARC. - -; REQUIRES: asserts -; RUN: opt -S -objc-arc -enable-objc-arc-annotations < %s | FileCheck %s - -declare i8* @objc_retain(i8*) -declare i8* @objc_retainAutoreleasedReturnValue(i8*) -declare void @objc_release(i8*) -declare i8* @objc_autorelease(i8*) -declare i8* @objc_autoreleaseReturnValue(i8*) -declare void @objc_autoreleasePoolPop(i8*) -declare i8* @objc_autoreleasePoolPush() -declare i8* @objc_retainBlock(i8*) - -declare i8* @objc_retainedObject(i8*) -declare i8* @objc_unretainedObject(i8*) -declare i8* @objc_unretainedPointer(i8*) - -declare void @use_pointer(i8*) -declare void @callee() -declare void @callee_fnptr(void ()*) -declare void @invokee() -declare i8* @returner() - -; Simple retain+release pair deletion, with some intervening control -; flow and harmless instructions. - -; CHECK-LABEL: define void @test0( -; CHECK: entry: -; CHECK: call void @llvm.arc.annotation.bottomup.bbstart(i8** @x, i8** @S_None) -; CHECK: %0 = tail call i8* @objc_retain(i8* %a) #0, !llvm.arc.annotation.bottomup ![[ANN0:[0-9]+]], !llvm.arc.annotation.topdown ![[ANN1:[0-9]+]] -; CHECK: call void @llvm.arc.annotation.bottomup.bbend(i8** @x, i8** @S_Use) -; CHECK: call void @llvm.arc.annotation.topdown.bbend(i8** @x, i8** @S_Retain) -; CHECK: t: -; CHECK: call void @llvm.arc.annotation.topdown.bbstart(i8** @x, i8** @S_Retain) -; CHECK: call void @llvm.arc.annotation.bottomup.bbstart(i8** @x, i8** @S_Use) -; CHECK: store float 2.000000e+00, float* %b, !llvm.arc.annotation.bottomup ![[ANN2:[0-9]+]] -; CHECK: call void @llvm.arc.annotation.bottomup.bbend(i8** @x, i8** @S_Release) -; CHECK: call void @llvm.arc.annotation.topdown.bbend(i8** @x, i8** @S_Retain) -; CHECK: f: -; CHECK: call void @llvm.arc.annotation.topdown.bbstart(i8** @x, i8** @S_Retain) -; CHECK: call void @llvm.arc.annotation.bottomup.bbstart(i8** @x, i8** @S_Use) -; CHECK: store i32 7, i32* %x, !llvm.arc.annotation.bottomup ![[ANN2]] -; CHECK: call void @llvm.arc.annotation.bottomup.bbend(i8** @x, i8** @S_Release) -; CHECK: call void @llvm.arc.annotation.topdown.bbend(i8** @x, i8** @S_Retain) -; CHECK: return: -; CHECK: call void @llvm.arc.annotation.topdown.bbstart(i8** @x, i8** @S_Retain) -; CHECK: call void @llvm.arc.annotation.bottomup.bbstart(i8** @x, i8** @S_Release) -; CHECK: call void @objc_release(i8* %c) #0, !llvm.arc.annotation.bottomup ![[ANN3:[0-9]+]], !llvm.arc.annotation.topdown ![[ANN4:[0-9]+]] -; CHECK: call void @llvm.arc.annotation.topdown.bbend(i8** @x, i8** @S_None) -; CHECK: } -define void @test0(i32* %x, i1 %p) nounwind { -entry: - %a = bitcast i32* %x to i8* - %0 = call i8* @objc_retain(i8* %a) nounwind - br i1 %p, label %t, label %f - -t: - store i8 3, i8* %a - %b = bitcast i32* %x to float* - store float 2.0, float* %b - br label %return - -f: - store i32 7, i32* %x - br label %return - -return: - %c = bitcast i32* %x to i8* - call void @objc_release(i8* %c) nounwind - ret void -} - -!0 = !{} - -; CHECK: ![[ANN0]] = !{!"(test0,%x)", !"S_Use", !"S_None"} -; CHECK: ![[ANN1]] = !{!"(test0,%x)", !"S_None", !"S_Retain"} -; CHECK: ![[ANN2]] = !{!"(test0,%x)", !"S_Release", !"S_Use"} -; CHECK: ![[ANN3]] = !{!"(test0,%x)", !"S_None", !"S_Release"} -; CHECK: ![[ANN4]] = !{!"(test0,%x)", !"S_Retain", !"S_None"} - diff --git a/test/Transforms/ObjCARC/basic.ll b/test/Transforms/ObjCARC/basic.ll index 7bc58c4..2896fbb 100644 --- a/test/Transforms/ObjCARC/basic.ll +++ b/test/Transforms/ObjCARC/basic.ll @@ -286,7 +286,7 @@ entry: loop: %c = bitcast i32* %x to i8* call void @objc_release(i8* %c) nounwind - %j = load volatile i1* %q + %j = load volatile i1, i1* %q br i1 %j, label %loop, label %return return: @@ -306,7 +306,7 @@ entry: loop: %c = bitcast i32* %x to i8* call void @objc_release(i8* %c) nounwind, !clang.imprecise_release !0 - %j = load volatile i1* %q + %j = load volatile i1, i1* %q br i1 %j, label %loop, label %return return: @@ -330,7 +330,7 @@ entry: loop: %a = bitcast i32* %x to i8* %0 = call i8* @objc_retain(i8* %a) nounwind - %j = load volatile i1* %q + %j = load volatile i1, i1* %q br i1 %j, label %loop, label %return return: @@ -350,7 +350,7 @@ entry: loop: %a = bitcast i32* %x to i8* %0 = call i8* @objc_retain(i8* %a) nounwind - %j = load volatile i1* %q + %j = load volatile i1, i1* %q br i1 %j, label %loop, label %return return: @@ -900,13 +900,14 @@ entry: ret i8* %x } -; Trivial retain,release pair with intervening call, but it's dominated -; by another retain - delete! +; We can not delete this retain, release since we do not have a post-dominating +; use of the release. ; CHECK-LABEL: define void @test12( ; CHECK-NEXT: entry: ; CHECK-NEXT: @objc_retain(i8* %x) -; CHECK-NOT: @objc_ +; CHECK-NEXT: @objc_retain +; CHECK: @objc_release ; CHECK: } define void @test12(i8* %x, i64 %n) { entry: @@ -942,6 +943,8 @@ entry: ; CHECK-NEXT: @objc_retain(i8* %x) ; CHECK-NEXT: @use_pointer ; CHECK-NEXT: @use_pointer +; CHECK-NEXT: @use_pointer +; CHECK-NEXT: @objc_release ; CHECK-NEXT: ret void ; CHECK-NEXT: } define void @test13b(i8* %x, i64 %n) { @@ -951,6 +954,8 @@ entry: call void @use_pointer(i8* %x) call void @use_pointer(i8* %x) call void @objc_release(i8* %x) nounwind + call void @use_pointer(i8* %x) + call void @objc_release(i8* %x) nounwind ret void } @@ -984,6 +989,8 @@ entry: ; CHECK-NEXT: @objc_autoreleasePoolPush ; CHECK-NEXT: @use_pointer ; CHECK-NEXT: @use_pointer +; CHECK-NEXT: @use_pointer +; CHECK-NEXT: @objc_release ; CHECK-NEXT: ret void ; CHECK-NEXT: } define void @test13d(i8* %x, i64 %n) { @@ -994,17 +1001,22 @@ entry: call void @use_pointer(i8* %x) call void @use_pointer(i8* %x) call void @objc_release(i8* %x) nounwind + call void @use_pointer(i8* %x) + call void @objc_release(i8* %x) nounwind ret void } -; Trivial retain,release pair with intervening call, but it's post-dominated -; by another release - delete! +; Trivial retain,release pair with intervening call, and it's post-dominated by +; another release. But it is not known safe in the top down direction. We can +; not eliminate it. ; CHECK-LABEL: define void @test14( ; CHECK-NEXT: entry: +; CHECK-NEXT: @objc_retain ; CHECK-NEXT: @use_pointer ; CHECK-NEXT: @use_pointer ; CHECK-NEXT: @objc_release +; CHECK-NEXT: @objc_release ; CHECK-NEXT: ret void ; CHECK-NEXT: } define void @test14(i8* %x, i64 %n) { @@ -1073,6 +1085,9 @@ entry: ; CHECK-LABEL: define void @test16a( ; CHECK: @objc_retain(i8* %x) ; CHECK-NOT: @objc +; CHECK: purple: +; CHECK: @use_pointer +; CHECK: @objc_release ; CHECK: } define void @test16a(i1 %a, i1 %b, i8* %x) { entry: @@ -1101,12 +1116,18 @@ blue: br label %purple purple: + call void @use_pointer(i8* %x) + call void @objc_release(i8* %x) nounwind ret void } ; CHECK-LABEL: define void @test16b( ; CHECK: @objc_retain(i8* %x) ; CHECK-NOT: @objc +; CHECK: purple: +; CHECK-NEXT: @use_pointer +; CHECK-NEXT: @use_pointer +; CHECK-NEXT: @objc_release ; CHECK: } define void @test16b(i1 %a, i1 %b, i8* %x) { entry: @@ -1135,12 +1156,18 @@ blue: br label %purple purple: + call void @use_pointer(i8* %x) + call void @use_pointer(i8* %x) + call void @objc_release(i8* %x) nounwind ret void } ; CHECK-LABEL: define void @test16c( ; CHECK: @objc_retain(i8* %x) ; CHECK-NOT: @objc +; CHECK: purple: +; CHECK: @use_pointer +; CHECK: @objc_release ; CHECK: } define void @test16c(i1 %a, i1 %b, i8* %x) { entry: @@ -1169,12 +1196,14 @@ blue: br label %purple purple: + call void @use_pointer(i8* %x) + call void @objc_release(i8* %x) nounwind, !clang.imprecise_release !0 ret void } ; CHECK-LABEL: define void @test16d( ; CHECK: @objc_retain(i8* %x) -; CHECK-NOT: @objc +; CHECK: @objc ; CHECK: } define void @test16d(i1 %a, i1 %b, i8* %x) { entry: @@ -1206,44 +1235,6 @@ purple: ret void } - -; Retain+release pairs in diamonds, all post-dominated by a release. - -; CHECK-LABEL: define void @test17( -; CHECK-NOT: @objc_ -; CHECK: purple: -; CHECK: @objc_release -; CHECK: } -define void @test17(i1 %a, i1 %b, i8* %x) { -entry: - br i1 %a, label %red, label %orange - -red: - call i8* @objc_retain(i8* %x) nounwind - br label %yellow - -orange: - call i8* @objc_retain(i8* %x) nounwind - br label %yellow - -yellow: - call void @use_pointer(i8* %x) - call void @use_pointer(i8* %x) - br i1 %b, label %green, label %blue - -green: - call void @objc_release(i8* %x) nounwind - br label %purple - -blue: - call void @objc_release(i8* %x) nounwind - br label %purple - -purple: - call void @objc_release(i8* %x) nounwind - ret void -} - ; Delete no-ops. ; CHECK-LABEL: define void @test18( @@ -1366,7 +1357,7 @@ C: define void @test24(i8* %r, i8* %a) { call i8* @objc_retain(i8* %a) call void @use_pointer(i8* %r) - %q = load i8* %a + %q = load i8, i8* %a call void @objc_release(i8* %a) ret void } @@ -1659,7 +1650,7 @@ true: done: %g = bitcast i8* %p to i8* - %h = getelementptr i8* %g, i64 0 + %h = getelementptr i8, i8* %g, i64 0 call void @objc_release(i8* %g) ret void } @@ -1688,7 +1679,7 @@ true: done: %g = bitcast i8* %p to i8* - %h = getelementptr i8* %g, i64 0 + %h = getelementptr i8, i8* %g, i64 0 call void @objc_release(i8* %g) ret void } @@ -1713,7 +1704,7 @@ true: done: %g = bitcast i8* %p to i8* - %h = getelementptr i8* %g, i64 0 + %h = getelementptr i8, i8* %g, i64 0 call void @objc_release(i8* %g) ret void } @@ -1732,7 +1723,7 @@ true: done: %g = bitcast i8* %p to i8* - %h = getelementptr i8* %g, i64 0 + %h = getelementptr i8, i8* %g, i64 0 call void @objc_release(i8* %g), !clang.imprecise_release !0 ret void } @@ -1760,7 +1751,7 @@ true: done: %g = bitcast i8* %p to i8* - %h = getelementptr i8* %g, i64 0 + %h = getelementptr i8, i8* %g, i64 0 call void @objc_release(i8* %g) ret void } @@ -1780,7 +1771,7 @@ true: done: %g = bitcast i8* %p to i8* - %h = getelementptr i8* %g, i64 0 + %h = getelementptr i8, i8* %g, i64 0 call void @objc_release(i8* %g), !clang.imprecise_release !0 ret void } @@ -1936,6 +1927,9 @@ exit: ; preds = %loop ; CHECK-NEXT: call i8* @objc_autorelease(i8* %p) ; CHECK-NEXT: call void @use_pointer(i8* %p) ; CHECK-NEXT: call void @use_pointer(i8* %p) +; CHECK-NEXT: call void @use_pointer(i8* %p) +; CHECK-NEXT: call void @use_pointer(i8* %p) +; CHECK-NEXT: call void @objc_release(i8* %p) ; CHECK-NEXT: ret void ; CHECK-NEXT: } define void @test42(i8* %p) { @@ -1946,6 +1940,9 @@ entry: call void @use_pointer(i8* %p) call void @use_pointer(i8* %p) call void @objc_release(i8* %p) + call void @use_pointer(i8* %p) + call void @use_pointer(i8* %p) + call void @objc_release(i8* %p) ret void } @@ -1985,6 +1982,8 @@ entry: ; CHECK-NEXT: call void @use_pointer(i8* %p) ; CHECK-NEXT: call void @use_pointer(i8* %p) ; CHECK-NEXT: call i8* @objc_autoreleasePoolPush() +; CHECK-NEXT: call void @use_pointer(i8* %p) +; CHECK-NEXT: call void @objc_release ; CHECK-NEXT: ret void ; CHECK-NEXT: } define void @test43b(i8* %p) { @@ -1996,6 +1995,8 @@ entry: call void @use_pointer(i8* %p) call i8* @objc_autoreleasePoolPush() call void @objc_release(i8* %p) + call void @use_pointer(i8* %p) + call void @objc_release(i8* %p) ret void } @@ -2005,7 +2006,7 @@ entry: ; CHECK-NOT: objc_ ; CHECK: } define void @test44(i8** %pp) { - %p = load i8** %pp + %p = load i8*, i8** %pp %q = call i8* @objc_retain(i8* %p) call void @objc_release(i8* %q) ret void @@ -2021,8 +2022,8 @@ define void @test44(i8** %pp) { ; CHECK: call void @objc_release(i8* %p) ; CHECK: } define void @test45(i8** %pp, i8** %qq) { - %p = load i8** %pp - %q = load i8** %qq + %p = load i8*, i8** %pp + %q = load i8*, i8** %qq call i8* @objc_retain(i8* %p) call void @objc_release(i8* %q) call void @use_pointer(i8* %p) @@ -2154,10 +2155,10 @@ define void @test51b(i8* %p) { ; CHECK: ret void ; CHECK: } define void @test52a(i8** %zz, i8** %pp) { - %p = load i8** %pp + %p = load i8*, i8** %pp %1 = call i8* @objc_retain(i8* %p) call void @callee() - %z = load i8** %zz + %z = load i8*, i8** %zz call void @use_pointer(i8* %z) call void @objc_release(i8* %p) ret void @@ -2171,10 +2172,10 @@ define void @test52a(i8** %zz, i8** %pp) { ; CHECK: ret void ; CHECK: } define void @test52b(i8** %zz, i8** %pp) { - %p = load i8** %pp + %p = load i8*, i8** %pp %1 = call i8* @objc_retain(i8* %p) call void @callee() - %z = load i8** %zz + %z = load i8*, i8** %zz call void @use_pointer(i8* %z) call void @objc_release(i8* %p), !clang.imprecise_release !0 ret void @@ -2189,10 +2190,10 @@ define void @test52b(i8** %zz, i8** %pp) { ; CHECK: @objc_ ; CHECK: } define void @test53(void ()** %zz, i8** %pp) { - %p = load i8** %pp + %p = load i8*, i8** %pp %1 = call i8* @objc_retain(i8* %p) call void @callee() - %z = load void ()** %zz + %z = load void ()*, void ()** %zz call void @callee_fnptr(void ()* %z) call void @objc_release(i8* %p) ret void @@ -2260,15 +2261,16 @@ if.end: ; preds = %entry, %if.then ret void } -; When there are adjacent retain+release pairs, the first one is -; known unnecessary because the presence of the second one means that -; the first one won't be deleting the object. +; When there are adjacent retain+release pairs, the first one is known +; unnecessary because the presence of the second one means that the first one +; won't be deleting the object. ; CHECK-LABEL: define void @test57( ; CHECK-NEXT: entry: +; CHECK-NEXT: tail call i8* @objc_retain(i8* %x) [[NUW]] ; CHECK-NEXT: call void @use_pointer(i8* %x) ; CHECK-NEXT: call void @use_pointer(i8* %x) -; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %x) [[NUW]] +; CHECK-NEXT: tail call i8* @objc_retain(i8* %x) [[NUW]] ; CHECK-NEXT: call void @use_pointer(i8* %x) ; CHECK-NEXT: call void @use_pointer(i8* %x) ; CHECK-NEXT: call void @objc_release(i8* %x) [[NUW]] @@ -2277,6 +2279,7 @@ if.end: ; preds = %entry, %if.then define void @test57(i8* %x) nounwind { entry: call i8* @objc_retain(i8* %x) nounwind + call i8* @objc_retain(i8* %x) nounwind call void @use_pointer(i8* %x) call void @use_pointer(i8* %x) call void @objc_release(i8* %x) nounwind @@ -2292,6 +2295,7 @@ entry: ; CHECK-LABEL: define void @test58( ; CHECK-NEXT: entry: +; CHECK-NEXT: @objc_retain ; CHECK-NEXT: call void @use_pointer(i8* %x) ; CHECK-NEXT: call void @use_pointer(i8* %x) ; CHECK-NEXT: ret void @@ -2299,6 +2303,7 @@ entry: define void @test58(i8* %x) nounwind { entry: call i8* @objc_retain(i8* %x) nounwind + call i8* @objc_retain(i8* %x) nounwind call void @use_pointer(i8* %x) call void @use_pointer(i8* %x) call void @objc_release(i8* %x) nounwind @@ -2341,8 +2346,8 @@ entry: ; CHECK: call void @objc_release ; CHECK: } define void @test60a() { - %t = load i8** @constptr - %s = load i8** @something + %t = load i8*, i8** @constptr + %s = load i8*, i8** @something call i8* @objc_retain(i8* %s) call void @callee() call void @use_pointer(i8* %t) @@ -2353,16 +2358,16 @@ define void @test60a() { ; CHECK-LABEL: define void @test60b( ; CHECK: call i8* @objc_retain ; CHECK-NOT: call i8* @objc_retain -; CHECK-NOT: call i8* @objc_rrelease +; CHECK-NOT: call i8* @objc_release ; CHECK: } define void @test60b() { - %t = load i8** @constptr - %s = load i8** @something - call i8* @objc_retain(i8* %s) - call i8* @objc_retain(i8* %s) + %t = load i8*, i8** @constptr + %s = load i8*, i8** @something + call i8* @objc_retain(i8* %t) + call i8* @objc_retain(i8* %t) call void @callee() - call void @use_pointer(i8* %t) - call void @objc_release(i8* %s) + call void @use_pointer(i8* %s) + call void @objc_release(i8* %t) ret void } @@ -2370,12 +2375,12 @@ define void @test60b() { ; CHECK-NOT: @objc_ ; CHECK: } define void @test60c() { - %t = load i8** @constptr - %s = load i8** @something - call i8* @objc_retain(i8* %s) + %t = load i8*, i8** @constptr + %s = load i8*, i8** @something + call i8* @objc_retain(i8* %t) call void @callee() - call void @use_pointer(i8* %t) - call void @objc_release(i8* %s), !clang.imprecise_release !0 + call void @use_pointer(i8* %s) + call void @objc_release(i8* %t), !clang.imprecise_release !0 ret void } @@ -2383,8 +2388,8 @@ define void @test60c() { ; CHECK-NOT: @objc_ ; CHECK: } define void @test60d() { - %t = load i8** @constptr - %s = load i8** @something + %t = load i8*, i8** @constptr + %s = load i8*, i8** @something call i8* @objc_retain(i8* %t) call void @callee() call void @use_pointer(i8* %s) @@ -2396,8 +2401,8 @@ define void @test60d() { ; CHECK-NOT: @objc_ ; CHECK: } define void @test60e() { - %t = load i8** @constptr - %s = load i8** @something + %t = load i8*, i8** @constptr + %s = load i8*, i8** @something call i8* @objc_retain(i8* %t) call void @callee() call void @use_pointer(i8* %s) @@ -2412,7 +2417,7 @@ define void @test60e() { ; CHECK-NOT: @objc_ ; CHECK: } define void @test61() { - %t = load i8** @constptr + %t = load i8*, i8** @constptr call i8* @objc_retain(i8* %t) call void @callee() call void @use_pointer(i8* %t) @@ -2432,7 +2437,7 @@ entry: loop: call i8* @objc_retain(i8* %x) - %q = load i1* %p + %q = load i1, i1* %p br i1 %q, label %loop.more, label %exit loop.more: @@ -2459,7 +2464,7 @@ entry: loop: call i8* @objc_retain(i8* %x) - %q = load i1* %p + %q = load i1, i1* %p br i1 %q, label %loop.more, label %exit loop.more: @@ -2485,7 +2490,7 @@ entry: loop: call i8* @objc_retain(i8* %x) - %q = load i1* %p + %q = load i1, i1* %p br i1 %q, label %loop.more, label %exit loop.more: @@ -2679,33 +2684,33 @@ define {<2 x float>, <2 x float>} @"\01-[A z]"({}* %self, i8* nocapture %_cmd) n invoke.cont: %0 = bitcast {}* %self to i8* %1 = tail call i8* @objc_retain(i8* %0) nounwind - tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !0, metadata !{}) - tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !0, metadata !{}) - %ivar = load i64* @"OBJC_IVAR_$_A.myZ", align 8 - %add.ptr = getelementptr i8* %0, i64 %ivar + tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression()) + tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression()) + %ivar = load i64, i64* @"OBJC_IVAR_$_A.myZ", align 8 + %add.ptr = getelementptr i8, i8* %0, i64 %ivar %tmp1 = bitcast i8* %add.ptr to float* - %tmp2 = load float* %tmp1, align 4 + %tmp2 = load float, float* %tmp1, align 4 %conv = fpext float %tmp2 to double %add.ptr.sum = add i64 %ivar, 4 - %tmp6 = getelementptr inbounds i8* %0, i64 %add.ptr.sum + %tmp6 = getelementptr inbounds i8, i8* %0, i64 %add.ptr.sum %2 = bitcast i8* %tmp6 to float* - %tmp7 = load float* %2, align 4 + %tmp7 = load float, float* %2, align 4 %conv8 = fpext float %tmp7 to double %add.ptr.sum36 = add i64 %ivar, 8 - %tmp12 = getelementptr inbounds i8* %0, i64 %add.ptr.sum36 + %tmp12 = getelementptr inbounds i8, i8* %0, i64 %add.ptr.sum36 %arrayidx = bitcast i8* %tmp12 to float* - %tmp13 = load float* %arrayidx, align 4 + %tmp13 = load float, float* %arrayidx, align 4 %conv14 = fpext float %tmp13 to double %tmp12.sum = add i64 %ivar, 12 - %arrayidx19 = getelementptr inbounds i8* %0, i64 %tmp12.sum + %arrayidx19 = getelementptr inbounds i8, i8* %0, i64 %tmp12.sum %3 = bitcast i8* %arrayidx19 to float* - %tmp20 = load float* %3, align 4 + %tmp20 = load float, float* %3, align 4 %conv21 = fpext float %tmp20 to double - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([33 x i8]* @.str4, i64 0, i64 0), double %conv, double %conv8, double %conv14, double %conv21) - %ivar23 = load i64* @"OBJC_IVAR_$_A.myZ", align 8 - %add.ptr24 = getelementptr i8* %0, i64 %ivar23 + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str4, i64 0, i64 0), double %conv, double %conv8, double %conv14, double %conv21) + %ivar23 = load i64, i64* @"OBJC_IVAR_$_A.myZ", align 8 + %add.ptr24 = getelementptr i8, i8* %0, i64 %ivar23 %4 = bitcast i8* %add.ptr24 to i128* - %srcval = load i128* %4, align 4 + %srcval = load i128, i128* %4, align 4 tail call void @objc_release(i8* %0) nounwind %tmp29 = trunc i128 %srcval to i64 %tmp30 = bitcast i64 %tmp29 to <2 x float> @@ -2725,14 +2730,14 @@ define i32 @"\01-[Top0 _getX]"({}* %self, i8* nocapture %_cmd) nounwind { invoke.cont: %0 = bitcast {}* %self to i8* %1 = tail call i8* @objc_retain(i8* %0) nounwind - %puts = tail call i32 @puts(i8* getelementptr inbounds ([16 x i8]* @str, i64 0, i64 0)) + %puts = tail call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0)) tail call void @objc_release(i8* %0) nounwind ret i32 0 } -@"\01L_OBJC_METH_VAR_NAME_" = internal global [5 x i8] c"frob\00", section "__TEXT,__cstring,cstring_literals", align 1@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([5 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" +@"\01L_OBJC_METH_VAR_NAME_" = internal global [5 x i8] c"frob\00", section "__TEXT,__cstring,cstring_literals", align 1@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" @"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__DATA, __objc_imageinfo, regular, no_dead_strip" -@llvm.used = appending global [3 x i8*] [i8* getelementptr inbounds ([5 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*)], section "llvm.metadata" +@llvm.used = appending global [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*)], section "llvm.metadata" ; A simple loop. Eliminate the retain and release inside of it! @@ -2752,7 +2757,7 @@ entry: for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %1 = tail call i8* @objc_retain(i8* %x) nounwind - %tmp5 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp5 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call = tail call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %1, i8* %tmp5) tail call void @objc_release(i8* %1) nounwind, !clang.imprecise_release !0 %inc = add nsw i64 %i.010, 1 @@ -2828,12 +2833,12 @@ entry: %tmp7 = bitcast %2* %self to i8* %tmp8 = call i8* @objc_retain(i8* %tmp7) nounwind store %4* null, %4** %err, align 8 - %tmp1 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_17", align 8 - %tmp2 = load %struct.__CFString** @kUTTypePlainText, align 8 - %tmp3 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_19", align 8 + %tmp1 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_17", align 8 + %tmp2 = load %struct.__CFString*, %struct.__CFString** @kUTTypePlainText, align 8 + %tmp3 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_19", align 8 %tmp4 = bitcast %struct._class_t* %tmp1 to i8* %call5 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp4, i8* %tmp3, %struct.__CFString* %tmp2) - %tmp5 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_21", align 8 + %tmp5 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_21", align 8 %tmp6 = bitcast %3* %pboard to i8* %call76 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp6, i8* %tmp5, i8* %call5) %tmp9 = call i8* @objc_retain(i8* %call76) nounwind @@ -2841,7 +2846,7 @@ entry: br i1 %tobool, label %end, label %land.lhs.true land.lhs.true: ; preds = %entry - %tmp11 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_23", align 8 + %tmp11 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_23", align 8 %call137 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp6, i8* %tmp11, i8* %tmp9) %tmp = bitcast i8* %call137 to %1* %tmp10 = call i8* @objc_retain(i8* %call137) nounwind @@ -2852,14 +2857,14 @@ land.lhs.true: ; preds = %entry br i1 %tobool16, label %end, label %if.then if.then: ; preds = %land.lhs.true - %tmp19 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_25", align 8 + %tmp19 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_25", align 8 %call21 = call signext i8 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8 (i8*, i8*)*)(i8* %call137, i8* %tmp19) %tobool22 = icmp eq i8 %call21, 0 br i1 %tobool22, label %if.then44, label %land.lhs.true23 land.lhs.true23: ; preds = %if.then - %tmp24 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_26", align 8 - %tmp26 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_28", align 8 + %tmp24 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_26", align 8 + %tmp26 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_28", align 8 %tmp27 = bitcast %struct._class_t* %tmp24 to i8* %call2822 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp27, i8* %tmp26, i8* %call137) %tmp13 = bitcast i8* %call2822 to %5* @@ -2869,38 +2874,38 @@ land.lhs.true23: ; preds = %if.then br i1 %tobool30, label %if.then44, label %if.end if.end: ; preds = %land.lhs.true23 - %tmp32 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_29", align 8 - %tmp33 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_31", align 8 + %tmp32 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_29", align 8 + %tmp33 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_31", align 8 %tmp34 = bitcast %struct._class_t* %tmp32 to i8* %call35 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp34, i8* %tmp33) - %tmp37 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_33", align 8 + %tmp37 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_33", align 8 %call3923 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call35, i8* %tmp37, i8* %call2822, i32 signext 1, %4** %err) %cmp = icmp eq i8* %call3923, null br i1 %cmp, label %if.then44, label %end if.then44: ; preds = %if.end, %land.lhs.true23, %if.then %url.025 = phi %5* [ %tmp13, %if.end ], [ %tmp13, %land.lhs.true23 ], [ null, %if.then ] - %tmp49 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_35", align 8 + %tmp49 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_35", align 8 %call51 = call %struct._NSRange bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %struct._NSRange (i8*, i8*, i64, i64)*)(i8* %call137, i8* %tmp49, i64 0, i64 0) %call513 = extractvalue %struct._NSRange %call51, 0 %call514 = extractvalue %struct._NSRange %call51, 1 - %tmp52 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_37", align 8 + %tmp52 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_37", align 8 %call548 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call137, i8* %tmp52, i64 %call513, i64 %call514) - %tmp55 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_38", align 8 - %tmp56 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_40", align 8 + %tmp55 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_38", align 8 + %tmp56 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_40", align 8 %tmp57 = bitcast %struct._class_t* %tmp55 to i8* %call58 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp57, i8* %tmp56) - %tmp59 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_42", align 8 + %tmp59 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_42", align 8 %call6110 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call548, i8* %tmp59, i8* %call58) %tmp15 = call i8* @objc_retain(i8* %call6110) nounwind call void @objc_release(i8* %call137) nounwind - %tmp64 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_46", align 8 + %tmp64 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_46", align 8 %call66 = call signext i8 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8 (i8*, i8*, %1*)*)(i8* %call6110, i8* %tmp64, %1* bitcast (%struct.NSConstantString* @_unnamed_cfstring_44 to %1*)) %tobool67 = icmp eq i8 %call66, 0 br i1 %tobool67, label %if.end74, label %if.then68 if.then68: ; preds = %if.then44 - %tmp70 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_48", align 8 + %tmp70 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_48", align 8 %call7220 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call6110, i8* %tmp70) %tmp16 = call i8* @objc_retain(i8* %call7220) nounwind call void @objc_release(i8* %call6110) nounwind @@ -2909,52 +2914,52 @@ if.then68: ; preds = %if.then44 if.end74: ; preds = %if.then68, %if.then44 %filename.0.in = phi i8* [ %call7220, %if.then68 ], [ %call6110, %if.then44 ] %filename.0 = bitcast i8* %filename.0.in to %1* - %tmp17 = load i8** bitcast (%0* @"\01l_objc_msgSend_fixup_isEqual_" to i8**), align 16 + %tmp17 = load i8*, i8** bitcast (%0* @"\01l_objc_msgSend_fixup_isEqual_" to i8**), align 16 %tmp18 = bitcast i8* %tmp17 to i8 (i8*, %struct._message_ref_t*, i8*, ...)* %call78 = call signext i8 (i8*, %struct._message_ref_t*, i8*, ...)* %tmp18(i8* %call137, %struct._message_ref_t* bitcast (%0* @"\01l_objc_msgSend_fixup_isEqual_" to %struct._message_ref_t*), i8* %filename.0.in) %tobool79 = icmp eq i8 %call78, 0 br i1 %tobool79, label %land.lhs.true80, label %if.then109 land.lhs.true80: ; preds = %if.end74 - %tmp82 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_25", align 8 + %tmp82 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_25", align 8 %call84 = call signext i8 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8 (i8*, i8*)*)(i8* %filename.0.in, i8* %tmp82) %tobool86 = icmp eq i8 %call84, 0 br i1 %tobool86, label %if.then109, label %if.end106 if.end106: ; preds = %land.lhs.true80 - %tmp88 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_26", align 8 - %tmp90 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_28", align 8 + %tmp88 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_26", align 8 + %tmp90 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_28", align 8 %tmp91 = bitcast %struct._class_t* %tmp88 to i8* %call9218 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp91, i8* %tmp90, i8* %filename.0.in) %tmp20 = bitcast i8* %call9218 to %5* %tmp21 = call i8* @objc_retain(i8* %call9218) nounwind %tmp22 = bitcast %5* %url.025 to i8* call void @objc_release(i8* %tmp22) nounwind - %tmp94 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_29", align 8 - %tmp95 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_31", align 8 + %tmp94 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_29", align 8 + %tmp95 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_31", align 8 %tmp96 = bitcast %struct._class_t* %tmp94 to i8* %call97 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp96, i8* %tmp95) - %tmp99 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_33", align 8 + %tmp99 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_33", align 8 %call10119 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call97, i8* %tmp99, i8* %call9218, i32 signext 1, %4** %err) %phitmp = icmp eq i8* %call10119, null br i1 %phitmp, label %if.then109, label %end if.then109: ; preds = %if.end106, %land.lhs.true80, %if.end74 %url.129 = phi %5* [ %tmp20, %if.end106 ], [ %url.025, %if.end74 ], [ %url.025, %land.lhs.true80 ] - %tmp110 = load %4** %err, align 8 + %tmp110 = load %4*, %4** %err, align 8 %tobool111 = icmp eq %4* %tmp110, null br i1 %tobool111, label %if.then112, label %if.end125 if.then112: ; preds = %if.then109 - %tmp113 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_50", align 8 - %tmp114 = load %1** @NSCocoaErrorDomain, align 8 - %tmp115 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_51", align 8 + %tmp113 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_50", align 8 + %tmp114 = load %1*, %1** @NSCocoaErrorDomain, align 8 + %tmp115 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_51", align 8 %call117 = call %1* @truncatedString(%1* %filename.0, i64 1034) - %tmp118 = load %1** @NSFilePathErrorKey, align 8 - %tmp119 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_53", align 8 + %tmp118 = load %1*, %1** @NSFilePathErrorKey, align 8 + %tmp119 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_53", align 8 %tmp120 = bitcast %struct._class_t* %tmp115 to i8* %call12113 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp120, i8* %tmp119, %1* %call117, %1* %tmp118, i8* null) - %tmp122 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_55", align 8 + %tmp122 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_55", align 8 %tmp123 = bitcast %struct._class_t* %tmp113 to i8* %call12414 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp123, i8* %tmp122, %1* %tmp114, i64 258, i8* %call12113) %tmp23 = call i8* @objc_retain(i8* %call12414) nounwind @@ -2965,11 +2970,11 @@ if.then112: ; preds = %if.then109 if.end125: ; preds = %if.then112, %if.then109 %tmp127 = phi %4* [ %tmp110, %if.then109 ], [ %tmp28, %if.then112 ] - %tmp126 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_56", align 8 - %tmp128 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_58", align 8 + %tmp126 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_56", align 8 + %tmp128 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_58", align 8 %tmp129 = bitcast %struct._class_t* %tmp126 to i8* %call13015 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp129, i8* %tmp128, %4* %tmp127) - %tmp131 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_60", align 8 + %tmp131 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_60", align 8 %call13317 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call13015, i8* %tmp131) br label %end @@ -3012,7 +3017,8 @@ define void @test67(i8* %x) { !llvm.module.flags = !{!1} !0 = !{} -!1 = !{i32 1, !"Debug Info Version", i32 2} +!1 = !{i32 1, !"Debug Info Version", i32 3} +!2 = !MDSubprogram() ; CHECK: attributes #0 = { nounwind readnone } ; CHECK: attributes [[NUW]] = { nounwind } diff --git a/test/Transforms/ObjCARC/cfg-hazards.ll b/test/Transforms/ObjCARC/cfg-hazards.ll index 746d56d..8407e44 100644 --- a/test/Transforms/ObjCARC/cfg-hazards.ll +++ b/test/Transforms/ObjCARC/cfg-hazards.ll @@ -421,7 +421,7 @@ loop: store i8* %a, i8** %block, align 8 %casted_block = bitcast i8** %block to void ()* call void @block_callee(void ()* %casted_block) - %reloaded_a = load i8** %block, align 8 + %reloaded_a = load i8*, i8** %block, align 8 call void @objc_release(i8* %reloaded_a) nounwind, !clang.imprecise_release !0 br i1 undef, label %loop, label %exit diff --git a/test/Transforms/ObjCARC/contract-storestrong-ivar.ll b/test/Transforms/ObjCARC/contract-storestrong-ivar.ll index 4a9b314..8b1a02f 100644 --- a/test/Transforms/ObjCARC/contract-storestrong-ivar.ll +++ b/test/Transforms/ObjCARC/contract-storestrong-ivar.ll @@ -16,11 +16,11 @@ declare void @objc_release(i8*) define hidden void @y(%0* nocapture %self, %1* %preferencesController) nounwind { entry: - %ivar = load i64* @"OBJC_IVAR_$_Controller.preferencesController", align 8 + %ivar = load i64, i64* @"OBJC_IVAR_$_Controller.preferencesController", align 8 %tmp = bitcast %0* %self to i8* - %add.ptr = getelementptr inbounds i8* %tmp, i64 %ivar + %add.ptr = getelementptr inbounds i8, i8* %tmp, i64 %ivar %tmp1 = bitcast i8* %add.ptr to %1** - %tmp2 = load %1** %tmp1, align 8 + %tmp2 = load %1*, %1** %tmp1, align 8 %tmp3 = bitcast %1* %preferencesController to i8* %tmp4 = tail call i8* @objc_retain(i8* %tmp3) nounwind %tmp5 = bitcast %1* %tmp2 to i8* diff --git a/test/Transforms/ObjCARC/contract-storestrong.ll b/test/Transforms/ObjCARC/contract-storestrong.ll index c218e33..aadc3a2 100644 --- a/test/Transforms/ObjCARC/contract-storestrong.ll +++ b/test/Transforms/ObjCARC/contract-storestrong.ll @@ -16,7 +16,7 @@ declare void @use_pointer(i8*) define void @test0(i8* %p) { entry: %0 = tail call i8* @objc_retain(i8* %p) nounwind - %tmp = load i8** @x, align 8 + %tmp = load i8*, i8** @x, align 8 store i8* %0, i8** @x, align 8 tail call void @objc_release(i8* %tmp) nounwind ret void @@ -27,7 +27,7 @@ entry: ; CHECK-LABEL: define void @test1(i8* %p) { ; CHECK-NEXT: entry: ; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) [[NUW]] -; CHECK-NEXT: %tmp = load volatile i8** @x, align 8 +; CHECK-NEXT: %tmp = load volatile i8*, i8** @x, align 8 ; CHECK-NEXT: store i8* %0, i8** @x, align 8 ; CHECK-NEXT: tail call void @objc_release(i8* %tmp) [[NUW]] ; CHECK-NEXT: ret void @@ -35,7 +35,7 @@ entry: define void @test1(i8* %p) { entry: %0 = tail call i8* @objc_retain(i8* %p) nounwind - %tmp = load volatile i8** @x, align 8 + %tmp = load volatile i8*, i8** @x, align 8 store i8* %0, i8** @x, align 8 tail call void @objc_release(i8* %tmp) nounwind ret void @@ -46,7 +46,7 @@ entry: ; CHECK-LABEL: define void @test2(i8* %p) { ; CHECK-NEXT: entry: ; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) [[NUW]] -; CHECK-NEXT: %tmp = load i8** @x, align 8 +; CHECK-NEXT: %tmp = load i8*, i8** @x, align 8 ; CHECK-NEXT: store volatile i8* %0, i8** @x, align 8 ; CHECK-NEXT: tail call void @objc_release(i8* %tmp) [[NUW]] ; CHECK-NEXT: ret void @@ -54,7 +54,7 @@ entry: define void @test2(i8* %p) { entry: %0 = tail call i8* @objc_retain(i8* %p) nounwind - %tmp = load i8** @x, align 8 + %tmp = load i8*, i8** @x, align 8 store volatile i8* %0, i8** @x, align 8 tail call void @objc_release(i8* %tmp) nounwind ret void @@ -66,7 +66,7 @@ entry: ; CHECK-LABEL: define void @test3(i8* %newValue) { ; CHECK-NEXT: entry: ; CHECK-NEXT: %x0 = tail call i8* @objc_retain(i8* %newValue) [[NUW]] -; CHECK-NEXT: %x1 = load i8** @x, align 8 +; CHECK-NEXT: %x1 = load i8*, i8** @x, align 8 ; CHECK-NEXT: store i8* %x0, i8** @x, align 8 ; CHECK-NEXT: tail call void @use_pointer(i8* %x1), !clang.arc.no_objc_arc_exceptions !0 ; CHECK-NEXT: tail call void @objc_release(i8* %x1) [[NUW]], !clang.imprecise_release !0 @@ -75,7 +75,7 @@ entry: define void @test3(i8* %newValue) { entry: %x0 = tail call i8* @objc_retain(i8* %newValue) nounwind - %x1 = load i8** @x, align 8 + %x1 = load i8*, i8** @x, align 8 store i8* %newValue, i8** @x, align 8 tail call void @use_pointer(i8* %x1), !clang.arc.no_objc_arc_exceptions !0 tail call void @objc_release(i8* %x1) nounwind, !clang.imprecise_release !0 @@ -87,7 +87,7 @@ entry: ; CHECK-LABEL: define i1 @test4(i8* %newValue, i8* %foo) { ; CHECK-NEXT: entry: ; CHECK-NEXT: %x0 = tail call i8* @objc_retain(i8* %newValue) [[NUW]] -; CHECK-NEXT: %x1 = load i8** @x, align 8 +; CHECK-NEXT: %x1 = load i8*, i8** @x, align 8 ; CHECK-NEXT: store i8* %x0, i8** @x, align 8 ; CHECK-NEXT: %t = icmp eq i8* %x1, %foo ; CHECK-NEXT: tail call void @objc_release(i8* %x1) [[NUW]], !clang.imprecise_release !0 @@ -96,7 +96,7 @@ entry: define i1 @test4(i8* %newValue, i8* %foo) { entry: %x0 = tail call i8* @objc_retain(i8* %newValue) nounwind - %x1 = load i8** @x, align 8 + %x1 = load i8*, i8** @x, align 8 store i8* %newValue, i8** @x, align 8 %t = icmp eq i8* %x1, %foo tail call void @objc_release(i8* %x1) nounwind, !clang.imprecise_release !0 @@ -112,7 +112,7 @@ entry: define i1 @test5(i8* %newValue, i8* %foo) { entry: %x0 = tail call i8* @objc_retain(i8* %newValue) nounwind - %x1 = load i8** @x, align 8 + %x1 = load i8*, i8** @x, align 8 %t = icmp eq i8* %x1, %foo store i8* %newValue, i8** @x, align 8 tail call void @objc_release(i8* %x1) nounwind, !clang.imprecise_release !0 @@ -128,7 +128,7 @@ entry: define i1 @test6(i8* %newValue, i8* %foo) { entry: %x0 = tail call i8* @objc_retain(i8* %newValue) nounwind - %x1 = load i8** @x, align 8 + %x1 = load i8*, i8** @x, align 8 tail call void @objc_release(i8* %x1) nounwind, !clang.imprecise_release !0 %t = icmp eq i8* %x1, %foo store i8* %newValue, i8** @x, align 8 @@ -140,14 +140,14 @@ entry: ; CHECK-LABEL: define void @test7( ; CHECK-NEXT: entry: ; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) [[NUW]] -; CHECK-NEXT: %tmp = load i8** @x, align 8 +; CHECK-NEXT: %tmp = load i8*, i8** @x, align 8 ; CHECK-NEXT: tail call void @objc_release(i8* %tmp) [[NUW]] ; CHECK-NEXT: ret void ; CHECK-NEXT: } define void @test7(i8* %p) { entry: %0 = tail call i8* @objc_retain(i8* %p) nounwind - %tmp = load i8** @x, align 8 + %tmp = load i8*, i8** @x, align 8 tail call void @objc_release(i8* %tmp) nounwind ret void } @@ -156,14 +156,14 @@ entry: ; CHECK-LABEL: define void @test8( ; CHECK-NEXT: entry: -; CHECK-NEXT: %tmp = load i8** @x, align 8 +; CHECK-NEXT: %tmp = load i8*, i8** @x, align 8 ; CHECK-NEXT: store i8* %p, i8** @x, align 8 ; CHECK-NEXT: tail call void @objc_release(i8* %tmp) [[NUW]] ; CHECK-NEXT: ret void ; CHECK-NEXT: } define void @test8(i8* %p) { entry: - %tmp = load i8** @x, align 8 + %tmp = load i8*, i8** @x, align 8 store i8* %p, i8** @x, align 8 tail call void @objc_release(i8* %tmp) nounwind ret void @@ -181,7 +181,7 @@ define i1 @test9(i8* %newValue, i8* %foo, i8* %unrelated_ptr) { entry: %x0 = tail call i8* @objc_retain(i8* %newValue) nounwind tail call void @objc_release(i8* %unrelated_ptr) nounwind, !clang.imprecise_release !0 - %x1 = load i8** @x, align 8 + %x1 = load i8*, i8** @x, align 8 tail call void @objc_release(i8* %x1) nounwind, !clang.imprecise_release !0 %t = icmp eq i8* %x1, %foo store i8* %newValue, i8** @x, align 8 @@ -196,7 +196,7 @@ define i1 @test10(i8* %newValue, i8* %foo, i8* %unrelated_ptr) { entry: %x0 = tail call i8* @objc_retain(i8* %newValue) nounwind call void @use_pointer(i8* %unrelated_ptr) - %x1 = load i8** @x, align 8 + %x1 = load i8*, i8** @x, align 8 tail call void @objc_release(i8* %x1) nounwind, !clang.imprecise_release !0 %t = icmp eq i8* %x1, %foo store i8* %newValue, i8** @x, align 8 @@ -211,7 +211,7 @@ define i1 @test11(i8* %newValue, i8* %foo, i8* %unrelated_ptr) { entry: %x0 = tail call i8* @objc_retain(i8* %newValue) nounwind %t = icmp eq i8* %newValue, %foo - %x1 = load i8** @x, align 8 + %x1 = load i8*, i8** @x, align 8 tail call void @objc_release(i8* %x1) nounwind, !clang.imprecise_release !0 store i8* %newValue, i8** @x, align 8 ret i1 %t diff --git a/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll b/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll index c72566c..215841c 100644 --- a/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll +++ b/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll @@ -22,29 +22,29 @@ target triple = "x86_64-apple-macosx10.9.0" @"OBJC_CLASS_$_NSObject" = external global %struct._class_t @"\01L_OBJC_CLASSLIST_REFERENCES_$_" = internal global %struct._class_t* @"OBJC_CLASS_$_NSObject", section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8 @"\01L_OBJC_METH_VAR_NAME_" = internal global [4 x i8] c"new\00", section "__TEXT,__objc_methname,cstring_literals", align 1 -@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" +@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" @__CFConstantStringClassReference = external global [0 x i32] @.str = private unnamed_addr constant [11 x i8] c"Failed: %@\00", align 1 -@_unnamed_cfstring_ = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0), i64 10 }, section "__DATA,__cfstring" +@_unnamed_cfstring_ = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i64 10 }, section "__DATA,__cfstring" @"OBJC_CLASS_$_NSException" = external global %struct._class_t @"\01L_OBJC_CLASSLIST_REFERENCES_$_1" = internal global %struct._class_t* @"OBJC_CLASS_$_NSException", section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8 @.str2 = private unnamed_addr constant [4 x i8] c"Foo\00", align 1 -@_unnamed_cfstring_3 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8]* @.str2, i32 0, i32 0), i64 3 }, section "__DATA,__cfstring" +@_unnamed_cfstring_3 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i32 0, i32 0), i64 3 }, section "__DATA,__cfstring" @"\01L_OBJC_METH_VAR_NAME_4" = internal global [14 x i8] c"raise:format:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 -@"\01L_OBJC_SELECTOR_REFERENCES_5" = internal global i8* getelementptr inbounds ([14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" -@llvm.used = appending global [6 x i8*] [i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_1" to i8*), i8* getelementptr inbounds ([14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_5" to i8*)], section "llvm.metadata" +@"\01L_OBJC_SELECTOR_REFERENCES_5" = internal global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" +@llvm.used = appending global [6 x i8*] [i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_1" to i8*), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_5" to i8*)], section "llvm.metadata" define i32 @main() uwtable ssp { entry: - %tmp = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_", align 8, !dbg !37 - %tmp1 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8, !dbg !37, !invariant.load !38 + %tmp = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_", align 8, !dbg !37 + %tmp1 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8, !dbg !37, !invariant.load !38 %tmp2 = bitcast %struct._class_t* %tmp to i8*, !dbg !37 ; CHECK: call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp2, i8* %tmp1) %call = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp2, i8* %tmp1), !dbg !37, !clang.arc.no_objc_arc_exceptions !38 - call void @llvm.dbg.value(metadata i8* %call, i64 0, metadata i32 02, metadata !{}), !dbg !37 + call void @llvm.dbg.value(metadata i8* %call, i64 0, metadata !25, metadata !MDExpression()), !dbg !37 ; CHECK: call i8* @objc_retain(i8* %call) [[NUW:#[0-9]+]] %tmp3 = call i8* @objc_retain(i8* %call) nounwind, !dbg !39 - call void @llvm.dbg.value(metadata i8* %call, i64 0, metadata !25, metadata !{}), !dbg !39 + call void @llvm.dbg.value(metadata i8* %call, i64 0, metadata !25, metadata !MDExpression()), !dbg !39 invoke fastcc void @ThrowFunc(i8* %call) to label %eh.cont unwind label %lpad, !dbg !40, !clang.arc.no_objc_arc_exceptions !38 @@ -58,7 +58,7 @@ lpad: ; preds = %entry catch i8* null, !dbg !40 %tmp5 = extractvalue { i8*, i32 } %tmp4, 0, !dbg !40 %exn.adjusted = call i8* @objc_begin_catch(i8* %tmp5) nounwind, !dbg !44 - call void @llvm.dbg.value(metadata i8 0, i64 0, metadata !21, metadata !{}), !dbg !46 + call void @llvm.dbg.value(metadata i8 0, i64 0, metadata !21, metadata !MDExpression()), !dbg !46 call void @objc_end_catch(), !dbg !49, !clang.arc.no_objc_arc_exceptions !38 ; CHECK: call void @objc_release(i8* %call) call void @objc_release(i8* %call) nounwind, !dbg !42, !clang.imprecise_release !38 @@ -87,9 +87,9 @@ declare void @objc_exception_rethrow() define internal fastcc void @ThrowFunc(i8* %obj) uwtable noinline ssp { entry: %tmp = call i8* @objc_retain(i8* %obj) nounwind - call void @llvm.dbg.value(metadata i8* %obj, i64 0, metadata !32, metadata !{}), !dbg !55 - %tmp1 = load %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_1", align 8, !dbg !56 - %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_5", align 8, !dbg !56, !invariant.load !38 + call void @llvm.dbg.value(metadata i8* %obj, i64 0, metadata !32, metadata !MDExpression()), !dbg !55 + %tmp1 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_1", align 8, !dbg !56 + %tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_5", align 8, !dbg !56, !invariant.load !38 %tmp3 = bitcast %struct._class_t* %tmp1 to i8*, !dbg !56 call void (i8*, i8*, %0*, %0*, ...)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %0*, %0*, ...)*)(i8* %tmp3, i8* %tmp2, %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_3 to %0*), %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_3 to %0*)), !dbg !56, !clang.arc.no_objc_arc_exceptions !38 call void @objc_release(i8* %obj) nounwind, !dbg !58, !clang.imprecise_release !38 @@ -113,37 +113,37 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!33, !34, !35, !36, !61} -!0 = !{!"0x11\0016\00clang version 3.3 \001\00\002\00\000", !60, !1, !1, !3, !1, null} ; [ DW_TAG_compile_unit ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] [DW_LANG_ObjC] +!0 = !MDCompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: true, runtimeVersion: 2, emissionKind: 0, file: !60, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1) !1 = !{i32 0} !3 = !{!5, !27} -!5 = !{!"0x2e\00main\00main\00\009\000\001\000\006\000\001\0010", !60, !6, !7, null, i32 ()* @main, null, null, !10} ; [ DW_TAG_subprogram ] [line 9] [def] [scope 10] [main] -!6 = !{!"0x29", !60} ; [ DW_TAG_file_type ] -!7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!5 = !MDSubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 10, file: !60, scope: !6, type: !7, function: i32 ()* @main, variables: !10) +!6 = !MDFile(filename: "test.m", directory: "/Volumes/Files/gottesmmcab/Radar/12906997") +!7 = !MDSubroutineType(types: !8) !8 = !{!9} -!9 = !{!"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 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !{!11} !11 = !{!12, !21, !25} -!12 = !{!"0x100\00obj\0011\000", !13, !6, !14} ; [ DW_TAG_auto_variable ] [obj] [line 11] -!13 = !{!"0xb\0010\000\000", !60, !5} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] -!14 = !{!"0x16\00id\0011\000\000\000\000", !60, null, !15} ; [ DW_TAG_typedef ] [id] [line 11, size 0, align 0, offset 0] [from ] -!15 = !{!"0xf\00\000\0064\0064\000\000", !60, null, !16} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from objc_object] -!16 = !{!"0x13\00objc_object\000\000\000\000\000\000", !60, null, null, !17, null, i32 0, null} ; [ DW_TAG_structure_type ] [objc_object] [line 0, size 0, align 0, offset 0] [def] [from ] +!12 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "obj", line: 11, scope: !13, file: !6, type: !14) +!13 = distinct !MDLexicalBlock(line: 10, column: 0, file: !60, scope: !5) +!14 = !MDDerivedType(tag: DW_TAG_typedef, name: "id", line: 11, file: !60, baseType: !15) +!15 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !60, baseType: !16) +!16 = !MDCompositeType(tag: DW_TAG_structure_type, name: "objc_object", file: !60, elements: !17) !17 = !{!18} -!18 = !{!"0xd\00isa\000\0064\000\000\000", !60, !16, !19} ; [ DW_TAG_member ] [isa] [line 0, size 64, align 0, offset 0] [from ] -!19 = !{!"0xf\00\000\0064\000\000\000", null, null, !20} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 0, offset 0] [from objc_class] -!20 = !{!"0x13\00objc_class\000\000\000\000\004\000", !60, null, null, null, null, null, null} ; [ DW_TAG_structure_type ] [objc_class] [line 0, size 0, align 0, offset 0] [decl] [from ] -!21 = !{!"0x100\00ok\0013\000", !22, !6, !23} ; [ DW_TAG_auto_variable ] [ok] [line 13] -!22 = !{!"0xb\0012\000\001", !60, !13} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] -!23 = !{!"0x16\00BOOL\0062\000\000\000\000", !60, null, !24} ; [ DW_TAG_typedef ] [BOOL] [line 62, size 0, align 0, offset 0] [from signed char] -!24 = !{!"0x24\00signed char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [signed char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char] -!25 = !{!"0x100\00obj2\0015\000", !26, !6, !14} ; [ DW_TAG_auto_variable ] [obj2] [line 15] -!26 = !{!"0xb\0014\000\002", !60, !22} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] -!27 = !{!"0x2e\00ThrowFunc\00ThrowFunc\00\004\001\001\000\006\00256\001\005", !60, !6, !28, null, void (i8*)* @ThrowFunc, null, null, !30} ; [ DW_TAG_subprogram ] [line 4] [local] [def] [scope 5] [ThrowFunc] -!28 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !29, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!18 = !MDDerivedType(tag: DW_TAG_member, name: "isa", size: 64, file: !60, scope: !16, baseType: !19) +!19 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !20) +!20 = !MDCompositeType(tag: DW_TAG_structure_type, name: "objc_class", flags: DIFlagFwdDecl, file: !60) +!21 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "ok", line: 13, scope: !22, file: !6, type: !23) +!22 = distinct !MDLexicalBlock(line: 12, column: 0, file: !60, scope: !13) +!23 = !MDDerivedType(tag: DW_TAG_typedef, name: "BOOL", line: 62, file: !60, baseType: !24) +!24 = !MDBasicType(tag: DW_TAG_base_type, name: "signed char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!25 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "obj2", line: 15, scope: !26, file: !6, type: !14) +!26 = distinct !MDLexicalBlock(line: 14, column: 0, file: !60, scope: !22) +!27 = !MDSubprogram(name: "ThrowFunc", line: 4, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !60, scope: !6, type: !28, function: void (i8*)* @ThrowFunc, variables: !30) +!28 = !MDSubroutineType(types: !29) !29 = !{null, !14} !30 = !{!31} !31 = !{!32} -!32 = !{!"0x101\00obj\0016777220\000", !27, !6, !14} ; [ DW_TAG_arg_variable ] [obj] [line 4] +!32 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "obj", line: 4, arg: 1, scope: !27, file: !6, type: !14) !33 = !{i32 1, !"Objective-C Version", i32 2} !34 = !{i32 1, !"Objective-C Image Info Version", i32 0} !35 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"} @@ -152,23 +152,23 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !38 = !{} !39 = !MDLocation(line: 15, scope: !26) !40 = !MDLocation(line: 17, scope: !41) -!41 = !{!"0xb\0016\000\003", !60, !26} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] +!41 = distinct !MDLexicalBlock(line: 16, column: 0, file: !60, scope: !26) !42 = !MDLocation(line: 22, scope: !26) !43 = !MDLocation(line: 23, scope: !22) !44 = !MDLocation(line: 19, scope: !41) !45 = !{i8 0} !46 = !MDLocation(line: 20, scope: !47) -!47 = !{!"0xb\0019\000\005", !60, !48} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] -!48 = !{!"0xb\0019\000\004", !60, !26} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] +!47 = distinct !MDLexicalBlock(line: 19, column: 0, file: !60, scope: !48) +!48 = distinct !MDLexicalBlock(line: 19, column: 0, file: !60, scope: !26) !49 = !MDLocation(line: 21, scope: !47) !50 = !MDLocation(line: 24, scope: !51) -!51 = !{!"0xb\0023\000\006", !60, !22} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] +!51 = distinct !MDLexicalBlock(line: 23, column: 0, file: !60, scope: !22) !52 = !MDLocation(line: 25, scope: !51) !53 = !MDLocation(line: 27, scope: !13) !54 = !MDLocation(line: 28, scope: !13) !55 = !MDLocation(line: 4, scope: !27) !56 = !MDLocation(line: 6, scope: !57) -!57 = !{!"0xb\005\000\007", !60, !27} ; [ DW_TAG_lexical_block ] [/Volumes/Files/gottesmmcab/Radar/12906997/test.m] +!57 = distinct !MDLexicalBlock(line: 5, column: 0, file: !60, scope: !27) !58 = !MDLocation(line: 7, scope: !57) -!60 = !{!"test.m", !"/Volumes/Files/gottesmmcab/Radar/12906997"} -!61 = !{i32 1, !"Debug Info Version", i32 2} +!60 = !MDFile(filename: "test.m", directory: "/Volumes/Files/gottesmmcab/Radar/12906997") +!61 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/ObjCARC/escape.ll b/test/Transforms/ObjCARC/escape.ll index 357f759..c7a1b03 100644 --- a/test/Transforms/ObjCARC/escape.ll +++ b/test/Transforms/ObjCARC/escape.ll @@ -17,43 +17,43 @@ define void @test0() nounwind { entry: %weakLogNTimes = alloca %struct.__block_byref_weakLogNTimes, align 8 %block = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, align 8 - %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0 + %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0 store i8* null, i8** %byref.isa, align 8 - %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1 + %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1 store %struct.__block_byref_weakLogNTimes* %weakLogNTimes, %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8 - %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2 + %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2 store i32 33554432, i32* %byref.flags, align 8 - %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3 + %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3 store i32 48, i32* %byref.size, align 4 - %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4 + %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4 store i8* bitcast (void (i8*, i8*)* @__Block_byref_object_copy_ to i8*), i8** %tmp1, align 8 - %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5 + %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5 store i8* bitcast (void (i8*)* @__Block_byref_object_dispose_ to i8*), i8** %tmp2, align 8 - %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6 + %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6 %tmp3 = bitcast void (...)** %weakLogNTimes1 to i8** %tmp4 = call i8* @objc_initWeak(i8** %tmp3, i8* null) nounwind - %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0 + %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0 store i8* null, i8** %block.isa, align 8 - %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1 + %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1 store i32 1107296256, i32* %block.flags, align 8 - %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2 + %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2 store i32 0, i32* %block.reserved, align 4 - %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3 + %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3 store i8* bitcast (void (i8*, i32)* @__main_block_invoke_0 to i8*), i8** %block.invoke, align 8 - %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4 + %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4 store %struct.__block_descriptor* null, %struct.__block_descriptor** %block.descriptor, align 8 - %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5 + %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5 %tmp5 = bitcast %struct.__block_byref_weakLogNTimes* %weakLogNTimes to i8* store i8* %tmp5, i8** %block.captured, align 8 %tmp6 = bitcast <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block to i8* %tmp7 = call i8* @objc_retainBlock(i8* %tmp6) nounwind, !clang.arc.copy_on_escape !0 - %tmp8 = load %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8 - %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6 + %tmp8 = load %struct.__block_byref_weakLogNTimes*, %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8 + %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6 %tmp9 = bitcast void (...)** %weakLogNTimes3 to i8** %tmp10 = call i8* @objc_storeWeak(i8** %tmp9, i8* %tmp7) nounwind - %tmp11 = getelementptr inbounds i8* %tmp7, i64 16 + %tmp11 = getelementptr inbounds i8, i8* %tmp7, i64 16 %tmp12 = bitcast i8* %tmp11 to i8** - %tmp13 = load i8** %tmp12, align 8 + %tmp13 = load i8*, i8** %tmp12, align 8 %tmp14 = bitcast i8* %tmp13 to void (i8*, i32)* call void %tmp14(i8* %tmp7, i32 10) nounwind, !clang.arc.no_objc_arc_exceptions !0 call void @objc_release(i8* %tmp7) nounwind, !clang.imprecise_release !0 @@ -72,43 +72,43 @@ define void @test1() nounwind { entry: %weakLogNTimes = alloca %struct.__block_byref_weakLogNTimes, align 8 %block = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, align 8 - %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0 + %byref.isa = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 0 store i8* null, i8** %byref.isa, align 8 - %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1 + %byref.forwarding = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 1 store %struct.__block_byref_weakLogNTimes* %weakLogNTimes, %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8 - %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2 + %byref.flags = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 2 store i32 33554432, i32* %byref.flags, align 8 - %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3 + %byref.size = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 3 store i32 48, i32* %byref.size, align 4 - %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4 + %tmp1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 4 store i8* bitcast (void (i8*, i8*)* @__Block_byref_object_copy_ to i8*), i8** %tmp1, align 8 - %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5 + %tmp2 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 5 store i8* bitcast (void (i8*)* @__Block_byref_object_dispose_ to i8*), i8** %tmp2, align 8 - %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6 + %weakLogNTimes1 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %weakLogNTimes, i64 0, i32 6 %tmp3 = bitcast void (...)** %weakLogNTimes1 to i8** %tmp4 = call i8* @objc_initWeak(i8** %tmp3, i8* null) nounwind - %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0 + %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 0 store i8* null, i8** %block.isa, align 8 - %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1 + %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 1 store i32 1107296256, i32* %block.flags, align 8 - %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2 + %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 2 store i32 0, i32* %block.reserved, align 4 - %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3 + %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 3 store i8* bitcast (void (i8*, i32)* @__main_block_invoke_0 to i8*), i8** %block.invoke, align 8 - %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4 + %block.descriptor = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 4 store %struct.__block_descriptor* null, %struct.__block_descriptor** %block.descriptor, align 8 - %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5 + %block.captured = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block, i64 0, i32 5 %tmp5 = bitcast %struct.__block_byref_weakLogNTimes* %weakLogNTimes to i8* store i8* %tmp5, i8** %block.captured, align 8 %tmp6 = bitcast <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, i8* }>* %block to i8* %tmp7 = call i8* @objc_retainBlock(i8* %tmp6) nounwind, !clang.arc.copy_on_escape !0 - %tmp8 = load %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8 - %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6 + %tmp8 = load %struct.__block_byref_weakLogNTimes*, %struct.__block_byref_weakLogNTimes** %byref.forwarding, align 8 + %weakLogNTimes3 = getelementptr inbounds %struct.__block_byref_weakLogNTimes, %struct.__block_byref_weakLogNTimes* %tmp8, i64 0, i32 6 %tmp9 = bitcast void (...)** %weakLogNTimes3 to i8** %tmp10 = call i8* @not_really_objc_storeWeak(i8** %tmp9, i8* %tmp7) nounwind - %tmp11 = getelementptr inbounds i8* %tmp7, i64 16 + %tmp11 = getelementptr inbounds i8, i8* %tmp7, i64 16 %tmp12 = bitcast i8* %tmp11 to i8** - %tmp13 = load i8** %tmp12, align 8 + %tmp13 = load i8*, i8** %tmp12, align 8 %tmp14 = bitcast i8* %tmp13 to void (i8*, i32)* call void %tmp14(i8* %tmp7, i32 10) nounwind, !clang.arc.no_objc_arc_exceptions !0 call void @objc_release(i8* %tmp7) nounwind, !clang.imprecise_release !0 diff --git a/test/Transforms/ObjCARC/gvn.ll b/test/Transforms/ObjCARC/gvn.ll index 2d120e7..6f82854 100644 --- a/test/Transforms/ObjCARC/gvn.ll +++ b/test/Transforms/ObjCARC/gvn.ll @@ -11,15 +11,15 @@ declare i32 @objc_sync_exit(i8*) ; CHECK: define i8* @test0(i32 %n) ; CHECK-NEXT: entry: -; CHECK-NEXT: %s = load i8** @x +; CHECK-NEXT: %s = load i8*, i8** @x ; CHECK-NOT: load ; CHECK: ret i8* %s ; CHECK-NEXT: } define i8* @test0(i32 %n) nounwind { entry: - %s = load i8** @x + %s = load i8*, i8** @x %0 = tail call i8* @objc_retain(i8* %s) nounwind - %t = load i8** @x + %t = load i8*, i8** @x ret i8* %t } @@ -33,9 +33,9 @@ entry: ; CHECK: } define i8* @test1(i32 %n) nounwind { entry: - %s = load i8** @x + %s = load i8*, i8** @x %0 = call i32 @objc_sync_enter(i8* %s) - %t = load i8** @x + %t = load i8*, i8** @x %1 = call i32 @objc_sync_exit(i8* %s) ret i8* %t } diff --git a/test/Transforms/ObjCARC/intrinsic-use.ll b/test/Transforms/ObjCARC/intrinsic-use.ll index b1e56c8..d85cb3e 100644 --- a/test/Transforms/ObjCARC/intrinsic-use.ll +++ b/test/Transforms/ObjCARC/intrinsic-use.ll @@ -22,13 +22,13 @@ declare void @test0_helper(i8*, i8**) ; CHECK-NEXT: store i8* %y, i8** %temp0 ; CHECK-NEXT: @objc_retain(i8* %y) ; CHECK-NEXT: call void @test0_helper -; CHECK-NEXT: [[VAL1:%.*]] = load i8** %temp0 +; CHECK-NEXT: [[VAL1:%.*]] = load i8*, i8** %temp0 ; CHECK-NEXT: call void (...)* @clang.arc.use(i8* %y) ; CHECK-NEXT: @objc_retain(i8* [[VAL1]]) ; CHECK-NEXT: @objc_release(i8* %y) ; CHECK-NEXT: store i8* [[VAL1]], i8** %temp1 ; CHECK-NEXT: call void @test0_helper -; CHECK-NEXT: [[VAL2:%.*]] = load i8** %temp1 +; CHECK-NEXT: [[VAL2:%.*]] = load i8*, i8** %temp1 ; CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[VAL1]]) ; CHECK-NEXT: @objc_retain(i8* [[VAL2]]) ; CHECK-NEXT: @objc_release(i8* [[VAL1]]) @@ -47,13 +47,13 @@ entry: %1 = call i8* @objc_retain(i8* %y) nounwind store i8* %y, i8** %temp0 call void @test0_helper(i8* %x, i8** %temp0) - %val1 = load i8** %temp0 + %val1 = load i8*, i8** %temp0 %2 = call i8* @objc_retain(i8* %val1) nounwind call void (...)* @clang.arc.use(i8* %y) nounwind call void @objc_release(i8* %y) nounwind store i8* %val1, i8** %temp1 call void @test0_helper(i8* %x, i8** %temp1) - %val2 = load i8** %temp1 + %val2 = load i8*, i8** %temp1 %3 = call i8* @objc_retain(i8* %val2) nounwind call void (...)* @clang.arc.use(i8* %val1) nounwind call void @objc_release(i8* %val1) nounwind @@ -70,13 +70,13 @@ entry: ; CHECK-NEXT: store i8* %y, i8** %temp0 ; CHECK-NEXT: @objc_retain(i8* %y) ; CHECK-NEXT: call void @test0_helper -; CHECK-NEXT: [[VAL1:%.*]] = load i8** %temp0 +; CHECK-NEXT: [[VAL1:%.*]] = load i8*, i8** %temp0 ; CHECK-NEXT: call void (...)* @clang.arc.use(i8* %y) ; CHECK-NEXT: @objc_retain(i8* [[VAL1]]) ; CHECK-NEXT: @objc_release(i8* %y) ; CHECK-NEXT: store i8* [[VAL1]], i8** %temp1 ; CHECK-NEXT: call void @test0_helper -; CHECK-NEXT: [[VAL2:%.*]] = load i8** %temp1 +; CHECK-NEXT: [[VAL2:%.*]] = load i8*, i8** %temp1 ; CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[VAL1]]) ; CHECK-NEXT: @objc_retain(i8* [[VAL2]]) ; CHECK-NEXT: @objc_release(i8* [[VAL1]]) @@ -93,13 +93,13 @@ entry: %1 = call i8* @objc_retain(i8* %y) nounwind store i8* %y, i8** %temp0 call void @test0_helper(i8* %x, i8** %temp0) - %val1 = load i8** %temp0 + %val1 = load i8*, i8** %temp0 %2 = call i8* @objc_retain(i8* %val1) nounwind call void (...)* @clang.arc.use(i8* %y) nounwind call void @objc_release(i8* %y) nounwind, !clang.imprecise_release !0 store i8* %val1, i8** %temp1 call void @test0_helper(i8* %x, i8** %temp1) - %val2 = load i8** %temp1 + %val2 = load i8*, i8** %temp1 %3 = call i8* @objc_retain(i8* %val2) nounwind call void (...)* @clang.arc.use(i8* %val1) nounwind call void @objc_release(i8* %val1) nounwind, !clang.imprecise_release !0 diff --git a/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll b/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll index 5d05825..9894eb4 100644 --- a/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll +++ b/test/Transforms/ObjCARC/move-and-form-retain-autorelease.ll @@ -80,20 +80,20 @@ declare i8* @objc_explicit_autorelease(i8*) define hidden %14* @foo(%15* %arg, %16* %arg2) { bb: - %tmp = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_3725", align 8 + %tmp = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_3725", align 8 %tmp4 = bitcast %15* %arg to i8* %tmp5 = tail call %18* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %18* (i8*, i8*)*)(i8* %tmp4, i8* %tmp) %tmp6 = bitcast %18* %tmp5 to i8* %tmp7 = tail call i8* @objc_retain(i8* %tmp6) nounwind - %tmp8 = load %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_40", align 8 - %tmp9 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_4227", align 8 + %tmp8 = load %2*, %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_40", align 8 + %tmp9 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_4227", align 8 %tmp10 = bitcast %2* %tmp8 to i8* %tmp11 = tail call %19* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %19* (i8*, i8*)*)(i8* %tmp10, i8* %tmp9) - %tmp12 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_4631", align 8 + %tmp12 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_4631", align 8 %tmp13 = bitcast %19* %tmp11 to i8* %tmp14 = tail call signext i8 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8 (i8*, i8*, %13*)*)(i8* %tmp13, i8* %tmp12, %13* bitcast (%12* @_unnamed_cfstring_386 to %13*)) %tmp15 = bitcast %16* %arg2 to i8* - %tmp16 = load i8** bitcast (%0* @"\01l_objc_msgSend_fixup_count" to i8**), align 16 + %tmp16 = load i8*, i8** bitcast (%0* @"\01l_objc_msgSend_fixup_count" to i8**), align 16 %tmp17 = bitcast i8* %tmp16 to i64 (i8*, %1*)* %tmp18 = tail call i64 %tmp17(i8* %tmp15, %1* bitcast (%0* @"\01l_objc_msgSend_fixup_count" to %1*)) %tmp19 = icmp eq i64 %tmp18, 0 @@ -110,104 +110,104 @@ bb22: ; preds = %bb bb25: ; preds = %bb22, %bb20 %tmp26 = phi i1 [ %tmp21, %bb20 ], [ false, %bb22 ] - %tmp27 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_188", align 8 + %tmp27 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_188", align 8 %tmp28 = tail call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp7, i8* %tmp27) %tmp29 = tail call i8* @objc_explicit_autorelease(i8* %tmp28) nounwind %tmp30 = bitcast i8* %tmp29 to %18* tail call void @objc_release(i8* %tmp7) nounwind - %tmp31 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_389", align 8 + %tmp31 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_389", align 8 %tmp32 = tail call %20* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %20* (i8*, i8*)*)(i8* %tmp29, i8* %tmp31) - %tmp33 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_391", align 8 + %tmp33 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_391", align 8 %tmp34 = bitcast %20* %tmp32 to i8* tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %16*)*)(i8* %tmp34, i8* %tmp33, %16* %arg2) br i1 %tmp26, label %bb46, label %bb35 bb35: ; preds = %bb25 - %tmp36 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_389", align 8 + %tmp36 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_389", align 8 %tmp37 = tail call %20* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %20* (i8*, i8*)*)(i8* %tmp29, i8* %tmp36) - %tmp38 = load %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_70", align 8 - %tmp39 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_393", align 8 + %tmp38 = load %2*, %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_70", align 8 + %tmp39 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_393", align 8 %tmp40 = bitcast %2* %tmp38 to i8* %tmp41 = tail call %21* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %21* (i8*, i8*, i8)*)(i8* %tmp40, i8* %tmp39, i8 signext 1) %tmp42 = bitcast %21* %tmp41 to i8* - %tmp43 = load %13** @NSPrintHeaderAndFooter, align 8 - %tmp44 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_159", align 8 + %tmp43 = load %13*, %13** @NSPrintHeaderAndFooter, align 8 + %tmp44 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_159", align 8 %tmp45 = bitcast %20* %tmp37 to i8* tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8*, %13*)*)(i8* %tmp45, i8* %tmp44, i8* %tmp42, %13* %tmp43) br label %bb46 bb46: ; preds = %bb35, %bb25, %bb22 %tmp47 = phi %18* [ %tmp30, %bb35 ], [ %tmp30, %bb25 ], [ %tmp23, %bb22 ] - %tmp48 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_328", align 8 + %tmp48 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_328", align 8 %tmp49 = tail call %22* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %22* (i8*, i8*)*)(i8* %tmp4, i8* %tmp48) %tmp50 = bitcast %22* %tmp49 to i8* - %tmp51 = load i8** bitcast (%0* @"\01l_objc_msgSend_fixup_count" to i8**), align 16 + %tmp51 = load i8*, i8** bitcast (%0* @"\01l_objc_msgSend_fixup_count" to i8**), align 16 %tmp52 = bitcast i8* %tmp51 to i64 (i8*, %1*)* %tmp53 = tail call i64 %tmp52(i8* %tmp50, %1* bitcast (%0* @"\01l_objc_msgSend_fixup_count" to %1*)) %tmp54 = icmp eq i64 %tmp53, 0 br i1 %tmp54, label %bb55, label %bb57 bb55: ; preds = %bb46 - %tmp56 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_395", align 8 + %tmp56 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_395", align 8 tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*)*)(i8* %tmp4, i8* %tmp56) br label %bb57 bb57: ; preds = %bb55, %bb46 - %tmp58 = load %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_396", align 8 - %tmp59 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_328", align 8 + %tmp58 = load %2*, %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_396", align 8 + %tmp59 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_328", align 8 %tmp60 = tail call %22* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %22* (i8*, i8*)*)(i8* %tmp4, i8* %tmp59) %tmp61 = bitcast %22* %tmp60 to i8* - %tmp62 = load i8** bitcast (%0* @"\01l_objc_msgSend_fixup_objectAtIndex_" to i8**), align 16 + %tmp62 = load i8*, i8** bitcast (%0* @"\01l_objc_msgSend_fixup_objectAtIndex_" to i8**), align 16 %tmp63 = bitcast i8* %tmp62 to i8* (i8*, %1*, i64)* %tmp64 = tail call i8* %tmp63(i8* %tmp61, %1* bitcast (%0* @"\01l_objc_msgSend_fixup_objectAtIndex_" to %1*), i64 0) - %tmp65 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_398", align 8 + %tmp65 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_398", align 8 %tmp66 = tail call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp64, i8* %tmp65) %tmp67 = bitcast i8* %tmp66 to %23* - %tmp68 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_400", align 8 + %tmp68 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_400", align 8 %tmp69 = bitcast %2* %tmp58 to i8* %tmp70 = tail call %14* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %14* (i8*, i8*, %23*, %18*)*)(i8* %tmp69, i8* %tmp68, %23* %tmp67, %18* %tmp47) %tmp71 = bitcast %14* %tmp70 to i8* ; hack to prevent the optimize from using objc_retainAutoreleasedReturnValue. - %tmp71x = getelementptr i8* %tmp71, i64 1 + %tmp71x = getelementptr i8, i8* %tmp71, i64 1 %tmp72 = tail call i8* @objc_retain(i8* %tmp71x) nounwind - %tmp73 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_402", align 8 + %tmp73 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_402", align 8 tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8)*)(i8* %tmp72, i8* %tmp73, i8 signext 1) - %tmp74 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_404", align 8 + %tmp74 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_404", align 8 tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i8)*)(i8* %tmp72, i8* %tmp74, i8 signext 1) - %tmp75 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_328", align 8 + %tmp75 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_328", align 8 %tmp76 = tail call %22* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %22* (i8*, i8*)*)(i8* %tmp4, i8* %tmp75) %tmp77 = bitcast %22* %tmp76 to i8* - %tmp78 = load i8** bitcast (%0* @"\01l_objc_msgSend_fixup_objectAtIndex_" to i8**), align 16 + %tmp78 = load i8*, i8** bitcast (%0* @"\01l_objc_msgSend_fixup_objectAtIndex_" to i8**), align 16 %tmp79 = bitcast i8* %tmp78 to i8* (i8*, %1*, i64)* %tmp80 = tail call i8* %tmp79(i8* %tmp77, %1* bitcast (%0* @"\01l_objc_msgSend_fixup_objectAtIndex_" to %1*), i64 0) - %tmp81 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_406", align 8 + %tmp81 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_406", align 8 tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i64)*)(i8* %tmp80, i8* %tmp81, i64 9223372036854775807) - %tmp82 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_408", align 8 + %tmp82 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_408", align 8 %tmp83 = tail call %24* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %24* (i8*, i8*)*)(i8* %tmp72, i8* %tmp82) %tmp84 = bitcast %24* %tmp83 to i8* %tmp85 = tail call i8* @objc_retain(i8* %tmp84) nounwind - %tmp86 = load %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_409", align 8 + %tmp86 = load %2*, %2** @"\01L_OBJC_CLASSLIST_REFERENCES_$_409", align 8 %tmp87 = bitcast %2* %tmp86 to i8* - %tmp88 = load i8** bitcast (%0* @"\01l_objc_msgSend_fixup_alloc" to i8**), align 16 + %tmp88 = load i8*, i8** bitcast (%0* @"\01l_objc_msgSend_fixup_alloc" to i8**), align 16 %tmp89 = bitcast i8* %tmp88 to i8* (i8*, %1*)* %tmp90 = tail call i8* %tmp89(i8* %tmp87, %1* bitcast (%0* @"\01l_objc_msgSend_fixup_alloc" to %1*)) - %tmp91 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_8", align 8 + %tmp91 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_8", align 8 %tmp92 = tail call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp90, i8* %tmp91) %tmp93 = tail call i8* @objc_explicit_autorelease(i8* %tmp92) nounwind %tmp94 = bitcast i8* %tmp93 to %25* - %tmp95 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_411", align 8 + %tmp95 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_411", align 8 tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %25*)*)(i8* %tmp85, i8* %tmp95, %25* %tmp94) tail call void @objc_release(i8* %tmp93) nounwind - %tmp96 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_148", align 8 + %tmp96 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_148", align 8 %tmp97 = tail call signext i8 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8 (i8*, i8*)*)(i8* %tmp4, i8* %tmp96) %tmp98 = icmp eq i8 %tmp97, 0 br i1 %tmp98, label %bb99, label %bb104 bb99: ; preds = %bb57 - %tmp100 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_413", align 8 + %tmp100 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_413", align 8 %tmp101 = tail call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*)*)(i8* %tmp85, i8* %tmp100) %tmp102 = or i64 %tmp101, 12 - %tmp103 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_415", align 8 + %tmp103 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_415", align 8 tail call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, i64)*)(i8* %tmp85, i8* %tmp103, i64 %tmp102) br label %bb104 diff --git a/test/Transforms/ObjCARC/move-and-merge-autorelease.ll b/test/Transforms/ObjCARC/move-and-merge-autorelease.ll index e5d2f07..5d19f35 100644 --- a/test/Transforms/ObjCARC/move-and-merge-autorelease.ll +++ b/test/Transforms/ObjCARC/move-and-merge-autorelease.ll @@ -35,10 +35,10 @@ declare i8* @objc_autorelease(i8*) define hidden %0* @foo(%1* %arg, %3* %arg3) { bb: - %tmp16 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_620", align 8 + %tmp16 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_620", align 8 %tmp17 = bitcast %3* %arg3 to i8* %tmp18 = call %4* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %4* (i8*, i8*)*)(i8* %tmp17, i8* %tmp16) - %tmp19 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_622", align 8 + %tmp19 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_622", align 8 %tmp20 = bitcast %4* %tmp18 to i8* %tmp21 = call %5* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %5* (i8*, i8*)*)(i8* %tmp20, i8* %tmp19) %tmp22 = bitcast %5* %tmp21 to i8* @@ -48,11 +48,11 @@ bb: br i1 %tmp26, label %bb81, label %bb27 bb27: ; preds = %bb - %tmp29 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_11", align 8 + %tmp29 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_11", align 8 %tmp30 = bitcast %1* %arg to i8* %tmp31 = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %tmp30, i8* %tmp29) %tmp34 = call i8* @objc_retain(i8* %tmp31) nounwind - %tmp37 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_421455", align 8 + %tmp37 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_421455", align 8 %tmp39 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*)*)(i8* %tmp34, i8* %tmp37) %tmp40 = bitcast %0* %tmp39 to i8* %tmp41 = call i8* @objc_retain(i8* %tmp40) nounwind @@ -61,7 +61,7 @@ bb27: ; preds = %bb br i1 %tmp44, label %bb45, label %bb55 bb45: ; preds = %bb27 - %tmp47 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_624", align 8 + %tmp47 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_624", align 8 %tmp49 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*)*)(i8* %tmp34, i8* %tmp47) %tmp51 = bitcast %0* %tmp49 to i8* %tmp52 = call i8* @objc_retain(i8* %tmp51) nounwind @@ -74,14 +74,14 @@ bb55: ; preds = %bb27, %bb45 br i1 %tmp57, label %bb76, label %bb58 bb58: ; preds = %bb55 - %tmp60 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_598", align 8 + %tmp60 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_598", align 8 %tmp61 = bitcast %0* %tmp13.0 to i8* %tmp62 = call signext i8 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8 (i8*, i8*)*)(i8* %tmp61, i8* %tmp60) %tmp64 = icmp eq i8 %tmp62, 0 br i1 %tmp64, label %bb76, label %bb65 bb65: ; preds = %bb58 - %tmp68 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_626", align 8 + %tmp68 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_626", align 8 %tmp69 = bitcast %0* %tmp13.0 to i8* %tmp70 = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*, %5*)*)(i8* %tmp69, i8* %tmp68, %5* %tmp24) %tmp72 = bitcast %0* %tmp70 to i8* diff --git a/test/Transforms/ObjCARC/nested.ll b/test/Transforms/ObjCARC/nested.ll index 7d72e37..464426a 100644 --- a/test/Transforms/ObjCARC/nested.ll +++ b/test/Transforms/ObjCARC/nested.ll @@ -3,7 +3,7 @@ %struct.__objcFastEnumerationState = type { i64, i8**, i64*, [5 x i64] } @"\01L_OBJC_METH_VAR_NAME_" = internal global [43 x i8] c"countByEnumeratingWithState:objects:count:\00", section "__TEXT,__objc_methname,cstring_literals", align 1 -@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([43 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" +@"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([43 x i8], [43 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip" @g = common global i8* null, align 8 @"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__DATA, __objc_imageinfo, regular, no_dead_strip" @@ -37,16 +37,16 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %1 = call i8* @objc_retain(i8* %0) nounwind - %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp2, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 - %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 + %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -57,8 +57,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ 0, %forcoll.loopbody.outer ], [ %4, %forcoll.notmutated ] - %mutationsptr3 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr3, align 8 + %mutationsptr3 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr3, align 8 %2 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %2, label %forcoll.notmutated, label %forcoll.mutated @@ -67,16 +67,16 @@ forcoll.mutated: br label %forcoll.notmutated forcoll.notmutated: - %stateitems = load i8*** %stateitems.ptr, align 8 - %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index - %3 = load i8** %currentitem.ptr, align 8 + %stateitems = load i8**, i8*** %stateitems.ptr, align 8 + %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index + %3 = load i8*, i8** %currentitem.ptr, align 8 call void @use(i8* %3) %4 = add i64 %forcoll.index, 1 %exitcond = icmp eq i64 %4, %umax br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp5 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp5 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call6 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp5, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %5 = icmp eq i64 %call6, 0 br i1 %5, label %forcoll.empty, label %forcoll.loopbody.outer @@ -102,16 +102,16 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %1 = call i8* @objc_retain(i8* %0) nounwind - %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call3 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp2, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call3, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 - %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 + %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -122,8 +122,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ 0, %forcoll.loopbody.outer ], [ %4, %forcoll.notmutated ] - %mutationsptr4 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr4, align 8 + %mutationsptr4 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr4, align 8 %2 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %2, label %forcoll.notmutated, label %forcoll.mutated @@ -132,16 +132,16 @@ forcoll.mutated: br label %forcoll.notmutated forcoll.notmutated: - %stateitems = load i8*** %stateitems.ptr, align 8 - %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index - %3 = load i8** %currentitem.ptr, align 8 + %stateitems = load i8**, i8*** %stateitems.ptr, align 8 + %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index + %3 = load i8*, i8** %currentitem.ptr, align 8 call void @use(i8* %3) %4 = add i64 %forcoll.index, 1 %exitcond = icmp eq i64 %4, %umax br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %5 = icmp eq i64 %call7, 0 br i1 %5, label %forcoll.empty, label %forcoll.loopbody.outer @@ -162,21 +162,21 @@ define void @test4() nounwind { entry: %state.ptr = alloca %struct.__objcFastEnumerationState, align 8 %items.ptr = alloca [16 x i8*], align 8 - %tmp = load i8** @g, align 8 + %tmp = load i8*, i8** @g, align 8 %0 = call i8* @objc_retain(i8* %tmp) nounwind %tmp2 = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp2, i8 0, i64 64, i32 8, i1 false) %1 = call i8* @objc_retain(i8* %0) nounwind - %tmp4 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp4 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp4, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 - %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 + %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -187,8 +187,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ 0, %forcoll.loopbody.outer ], [ %4, %forcoll.notmutated ] - %mutationsptr5 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr5, align 8 + %mutationsptr5 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr5, align 8 %2 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %2, label %forcoll.notmutated, label %forcoll.mutated @@ -197,16 +197,16 @@ forcoll.mutated: br label %forcoll.notmutated forcoll.notmutated: - %stateitems = load i8*** %stateitems.ptr, align 8 - %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index - %3 = load i8** %currentitem.ptr, align 8 + %stateitems = load i8**, i8*** %stateitems.ptr, align 8 + %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index + %3 = load i8*, i8** %currentitem.ptr, align 8 call void @use(i8* %3) %4 = add i64 %forcoll.index, 1 %exitcond = icmp eq i64 %4, %umax br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp7 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp7 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call8 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp7, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %5 = icmp eq i64 %call8, 0 br i1 %5, label %forcoll.empty, label %forcoll.loopbody.outer @@ -229,20 +229,19 @@ entry: %items.ptr = alloca [16 x i8*], align 8 %call = call i8* @returner() %0 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call) nounwind - call void @callee() %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %1 = call i8* @objc_retain(i8* %0) nounwind - %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call3 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp2, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call3, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 - %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 + %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -253,8 +252,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ 0, %forcoll.loopbody.outer ], [ %4, %forcoll.notmutated ] - %mutationsptr4 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr4, align 8 + %mutationsptr4 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr4, align 8 %2 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %2, label %forcoll.notmutated, label %forcoll.mutated @@ -263,16 +262,16 @@ forcoll.mutated: br label %forcoll.notmutated forcoll.notmutated: - %stateitems = load i8*** %stateitems.ptr, align 8 - %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index - %3 = load i8** %currentitem.ptr, align 8 + %stateitems = load i8**, i8*** %stateitems.ptr, align 8 + %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index + %3 = load i8*, i8** %currentitem.ptr, align 8 call void @use(i8* %3) %4 = add i64 %forcoll.index, 1 %exitcond = icmp eq i64 %4, %umax br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %5 = icmp eq i64 %call7, 0 br i1 %5, label %forcoll.empty, label %forcoll.loopbody.outer @@ -283,13 +282,12 @@ forcoll.empty: ret void } -; TODO: Delete a nested retain+release pair. -; The optimizer currently can't do this, because isn't isn't sophisticated enough in -; reasnoning about nesting. - +; We handle this now due to the fact that a release just needs a post dominating +; use. +; ; CHECK-LABEL: define void @test6( ; CHECK: call i8* @objc_retain -; CHECK: @objc_retain +; CHECK-NOT: @objc_retain ; CHECK: } define void @test6() nounwind { entry: @@ -300,16 +298,16 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %1 = call i8* @objc_retain(i8* %0) nounwind - %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call3 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp2, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call3, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 - %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 + %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -320,8 +318,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ 0, %forcoll.loopbody.outer ], [ %4, %forcoll.notmutated ] - %mutationsptr4 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr4, align 8 + %mutationsptr4 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr4, align 8 %2 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %2, label %forcoll.notmutated, label %forcoll.mutated @@ -330,16 +328,16 @@ forcoll.mutated: br label %forcoll.notmutated forcoll.notmutated: - %stateitems = load i8*** %stateitems.ptr, align 8 - %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index - %3 = load i8** %currentitem.ptr, align 8 + %stateitems = load i8**, i8*** %stateitems.ptr, align 8 + %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index + %3 = load i8*, i8** %currentitem.ptr, align 8 call void @use(i8* %3) %4 = add i64 %forcoll.index, 1 %exitcond = icmp eq i64 %4, %umax br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %5 = icmp eq i64 %call7, 0 br i1 %5, label %forcoll.empty, label %forcoll.loopbody.outer @@ -369,16 +367,16 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %1 = call i8* @objc_retain(i8* %0) nounwind - %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call3 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp2, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call3, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 - %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 + %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -389,8 +387,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ 0, %forcoll.loopbody.outer ], [ %4, %forcoll.notmutated ] - %mutationsptr4 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr4, align 8 + %mutationsptr4 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr4, align 8 %2 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %2, label %forcoll.notmutated, label %forcoll.mutated @@ -399,16 +397,16 @@ forcoll.mutated: br label %forcoll.notmutated forcoll.notmutated: - %stateitems = load i8*** %stateitems.ptr, align 8 - %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index - %3 = load i8** %currentitem.ptr, align 8 + %stateitems = load i8**, i8*** %stateitems.ptr, align 8 + %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index + %3 = load i8*, i8** %currentitem.ptr, align 8 call void @use(i8* %3) %4 = add i64 %forcoll.index, 1 %exitcond = icmp eq i64 %4, %umax br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %5 = icmp eq i64 %call7, 0 br i1 %5, label %forcoll.empty, label %forcoll.loopbody.outer @@ -435,16 +433,16 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %1 = call i8* @objc_retain(i8* %0) nounwind - %tmp2 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call3 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp2, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call3, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 - %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 + %stateitems.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 1 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -455,8 +453,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ 0, %forcoll.loopbody.outer ], [ %4, %forcoll.next ] - %mutationsptr4 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr4, align 8 + %mutationsptr4 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr4, align 8 %2 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %2, label %forcoll.notmutated, label %forcoll.mutated @@ -465,9 +463,9 @@ forcoll.mutated: br label %forcoll.notmutated forcoll.notmutated: - %stateitems = load i8*** %stateitems.ptr, align 8 - %currentitem.ptr = getelementptr i8** %stateitems, i64 %forcoll.index - %3 = load i8** %currentitem.ptr, align 8 + %stateitems = load i8**, i8*** %stateitems.ptr, align 8 + %currentitem.ptr = getelementptr i8*, i8** %stateitems, i64 %forcoll.index + %3 = load i8*, i8** %currentitem.ptr, align 8 %tobool = icmp eq i8* %3, null br i1 %tobool, label %forcoll.next, label %if.then @@ -481,7 +479,7 @@ forcoll.next: br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %1, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %5 = icmp eq i64 %call7, 0 br i1 %5, label %forcoll.empty, label %forcoll.loopbody.outer @@ -512,15 +510,15 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %2 = call i8* @objc_retain(i8* %0) nounwind - %tmp3 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp3 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call4 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp3, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call4, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -531,8 +529,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ %phitmp, %forcoll.notmutated.forcoll.loopbody_crit_edge ], [ 1, %forcoll.loopbody.outer ] - %mutationsptr5 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr5, align 8 + %mutationsptr5 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr5, align 8 %3 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %3, label %forcoll.notmutated, label %forcoll.mutated @@ -549,7 +547,7 @@ forcoll.notmutated.forcoll.loopbody_crit_edge: br label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %4 = icmp eq i64 %call7, 0 br i1 %4, label %forcoll.empty, label %forcoll.loopbody.outer @@ -579,15 +577,15 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %2 = call i8* @objc_retain(i8* %0) nounwind - %tmp3 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp3 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call4 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp3, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call4, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -598,8 +596,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ %phitmp, %forcoll.notmutated ], [ 0, %forcoll.loopbody.outer ] - %mutationsptr5 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr5, align 8 + %mutationsptr5 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr5, align 8 %3 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %3, label %forcoll.notmutated, label %forcoll.mutated @@ -613,7 +611,7 @@ forcoll.notmutated: br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %4 = icmp eq i64 %call7, 0 br i1 %4, label %forcoll.empty, label %forcoll.loopbody.outer @@ -646,15 +644,15 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %2 = call i8* @objc_retain(i8* %0) nounwind - %tmp3 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp3 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call4 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp3, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call4, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -665,8 +663,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ %phitmp, %forcoll.notmutated.forcoll.loopbody_crit_edge ], [ 1, %forcoll.loopbody.outer ] - %mutationsptr5 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr5, align 8 + %mutationsptr5 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr5, align 8 %3 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %3, label %forcoll.notmutated, label %forcoll.mutated @@ -683,7 +681,7 @@ forcoll.notmutated.forcoll.loopbody_crit_edge: br label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %4 = icmp eq i64 %call7, 0 br i1 %4, label %forcoll.empty, label %forcoll.loopbody.outer @@ -714,15 +712,15 @@ entry: %tmp = bitcast %struct.__objcFastEnumerationState* %state.ptr to i8* call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 64, i32 8, i1 false) %2 = call i8* @objc_retain(i8* %0) nounwind - %tmp3 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp3 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call4 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp3, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %iszero = icmp eq i64 %call4, 0 br i1 %iszero, label %forcoll.empty, label %forcoll.loopinit forcoll.loopinit: - %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 - %mutationsptr = load i64** %mutationsptr.ptr, align 8 - %forcoll.initial-mutations = load i64* %mutationsptr, align 8 + %mutationsptr.ptr = getelementptr inbounds %struct.__objcFastEnumerationState, %struct.__objcFastEnumerationState* %state.ptr, i64 0, i32 2 + %mutationsptr = load i64*, i64** %mutationsptr.ptr, align 8 + %forcoll.initial-mutations = load i64, i64* %mutationsptr, align 8 br label %forcoll.loopbody.outer forcoll.loopbody.outer: @@ -733,8 +731,8 @@ forcoll.loopbody.outer: forcoll.loopbody: %forcoll.index = phi i64 [ %phitmp, %forcoll.notmutated ], [ 0, %forcoll.loopbody.outer ] - %mutationsptr5 = load i64** %mutationsptr.ptr, align 8 - %statemutations = load i64* %mutationsptr5, align 8 + %mutationsptr5 = load i64*, i64** %mutationsptr.ptr, align 8 + %statemutations = load i64, i64* %mutationsptr5, align 8 %3 = icmp eq i64 %statemutations, %forcoll.initial-mutations br i1 %3, label %forcoll.notmutated, label %forcoll.mutated @@ -748,7 +746,7 @@ forcoll.notmutated: br i1 %exitcond, label %forcoll.refetch, label %forcoll.loopbody forcoll.refetch: - %tmp6 = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 + %tmp6 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8 %call7 = call i64 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i64 (i8*, i8*, %struct.__objcFastEnumerationState*, [16 x i8*]*, i64)*)(i8* %2, i8* %tmp6, %struct.__objcFastEnumerationState* %state.ptr, [16 x i8*]* %items.ptr, i64 16) %4 = icmp eq i64 %call7, 0 br i1 %4, label %forcoll.empty, label %forcoll.loopbody.outer @@ -779,16 +777,16 @@ entry: %block = alloca <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, align 8 %block9 = alloca <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, align 8 %call = call i8* @def(), !clang.arc.no_objc_arc_exceptions !0 - %foo = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 5 - %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 0 + %foo = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 5 + %block.isa = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 0 store i8* bitcast (i8** @_NSConcreteStackBlock to i8*), i8** %block.isa, align 8 - %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 1 + %block.flags = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 1 store i32 1107296256, i32* %block.flags, align 8 - %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 2 + %block.reserved = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 2 store i32 0, i32* %block.reserved, align 4 - %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 3 + %block.invoke = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 3 store i8* bitcast (void (i8*)* @__crasher_block_invoke to i8*), i8** %block.invoke, align 8 - %block.d = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 4 + %block.d = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block, i64 0, i32 4 store %struct.__block_d* bitcast ({ i64, i64, i8*, i8*, i8*, i8* }* @__block_d_tmp to %struct.__block_d*), %struct.__block_d** %block.d, align 8 %foo2 = tail call i8* @objc_retain(i8* %call) nounwind store i8* %foo2, i8** %foo, align 8 @@ -796,18 +794,18 @@ entry: %foo5 = call i8* @objc_retainBlock(i8* %foo4) nounwind call void @use(i8* %foo5), !clang.arc.no_objc_arc_exceptions !0 call void @objc_release(i8* %foo5) nounwind - %strongdestroy = load i8** %foo, align 8 + %strongdestroy = load i8*, i8** %foo, align 8 call void @objc_release(i8* %strongdestroy) nounwind, !clang.imprecise_release !0 - %foo10 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 5 - %block.isa11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 0 + %foo10 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 5 + %block.isa11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 0 store i8* bitcast (i8** @_NSConcreteStackBlock to i8*), i8** %block.isa11, align 8 - %block.flags12 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 1 + %block.flags12 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 1 store i32 1107296256, i32* %block.flags12, align 8 - %block.reserved13 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 2 + %block.reserved13 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 2 store i32 0, i32* %block.reserved13, align 4 - %block.invoke14 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 3 + %block.invoke14 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 3 store i8* bitcast (void (i8*)* @__crasher_block_invoke1 to i8*), i8** %block.invoke14, align 8 - %block.d15 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 4 + %block.d15 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_d*, i8* }>* %block9, i64 0, i32 4 store %struct.__block_d* bitcast ({ i64, i64, i8*, i8*, i8*, i8* }* @__block_d_tmp5 to %struct.__block_d*), %struct.__block_d** %block.d15, align 8 %foo18 = call i8* @objc_retain(i8* %call) nounwind store i8* %call, i8** %foo10, align 8 @@ -815,7 +813,7 @@ entry: %foo21 = call i8* @objc_retainBlock(i8* %foo20) nounwind call void @use(i8* %foo21), !clang.arc.no_objc_arc_exceptions !0 call void @objc_release(i8* %foo21) nounwind - %strongdestroy25 = load i8** %foo10, align 8 + %strongdestroy25 = load i8*, i8** %foo10, align 8 call void @objc_release(i8* %strongdestroy25) nounwind, !clang.imprecise_release !0 call void @objc_release(i8* %call) nounwind, !clang.imprecise_release !0 ret void diff --git a/test/Transforms/ObjCARC/provenance.ll b/test/Transforms/ObjCARC/provenance.ll index 937c689..aa5a932 100644 --- a/test/Transforms/ObjCARC/provenance.ll +++ b/test/Transforms/ObjCARC/provenance.ll @@ -10,28 +10,28 @@ declare void @g(i8) define void @f(i8* %a, i8** %b, i8** %c) { - %y1 = load i8* %a + %y1 = load i8, i8* %a call void @g(i8 %y1) - %y2 = load i8** %b - %y3 = load i8** %c + %y2 = load i8*, i8** %b + %y3 = load i8*, i8** %c - %x0 = load i8* @"\01l_objc_msgSend_fixup_" + %x0 = load i8, i8* @"\01l_objc_msgSend_fixup_" call void @g(i8 %x0) - %x1 = load i8* @g1 + %x1 = load i8, i8* @g1 call void @g(i8 %x1) - %x2 = load i8* @g2 + %x2 = load i8, i8* @g2 call void @g(i8 %x2) - %x3 = load i8* @g3 + %x3 = load i8, i8* @g3 call void @g(i8 %x3) - %x4 = load i8* @g4 + %x4 = load i8, i8* @g4 call void @g(i8 %x4) - %x5 = load i8* @g5 + %x5 = load i8, i8* @g5 call void @g(i8 %x5) ret void } diff --git a/test/Transforms/ObjCARC/retain-block-side-effects.ll b/test/Transforms/ObjCARC/retain-block-side-effects.ll index 7fa73cb..5f5def9 100644 --- a/test/Transforms/ObjCARC/retain-block-side-effects.ll +++ b/test/Transforms/ObjCARC/retain-block-side-effects.ll @@ -6,8 +6,8 @@ ; CHECK: %tmp16 = call i8* @objc_retainBlock(i8* %tmp15) [[NUW:#[0-9]+]] ; CHECK: %tmp17 = bitcast i8* %tmp16 to void ()* -; CHECK: %tmp18 = load %struct.__block_byref_repeater** %byref.forwarding, align 8 -; CHECK: %repeater12 = getelementptr inbounds %struct.__block_byref_repeater* %tmp18, i64 0, i32 6 +; CHECK: %tmp18 = load %struct.__block_byref_repeater*, %struct.__block_byref_repeater** %byref.forwarding, align 8 +; CHECK: %repeater12 = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %tmp18, i64 0, i32 6 ; CHECK: store void ()* %tmp17, void ()** %repeater12, align 8 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" @@ -20,18 +20,18 @@ define void @foo() noreturn { entry: %repeater = alloca %struct.__block_byref_repeater, align 8 %block = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>, align 8 - %byref.forwarding = getelementptr inbounds %struct.__block_byref_repeater* %repeater, i64 0, i32 1 - %tmp10 = getelementptr inbounds %struct.__block_byref_repeater* %repeater, i64 0, i32 6 + %byref.forwarding = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %repeater, i64 0, i32 1 + %tmp10 = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %repeater, i64 0, i32 6 store void ()* null, void ()** %tmp10, align 8 - %block.captured11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>* %block, i64 0, i32 6 + %block.captured11 = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>* %block, i64 0, i32 6 %tmp14 = bitcast %struct.__block_byref_repeater* %repeater to i8* store i8* %tmp14, i8** %block.captured11, align 8 %tmp15 = bitcast <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0*, i8* }>* %block to i8* %tmp16 = call i8* @objc_retainBlock(i8* %tmp15) nounwind %tmp17 = bitcast i8* %tmp16 to void ()* - %tmp18 = load %struct.__block_byref_repeater** %byref.forwarding, align 8 - %repeater12 = getelementptr inbounds %struct.__block_byref_repeater* %tmp18, i64 0, i32 6 - %tmp13 = load void ()** %repeater12, align 8 + %tmp18 = load %struct.__block_byref_repeater*, %struct.__block_byref_repeater** %byref.forwarding, align 8 + %repeater12 = getelementptr inbounds %struct.__block_byref_repeater, %struct.__block_byref_repeater* %tmp18, i64 0, i32 6 + %tmp13 = load void ()*, void ()** %repeater12, align 8 store void ()* %tmp17, void ()** %repeater12, align 8 ret void } diff --git a/test/Transforms/ObjCARC/weak-copies.ll b/test/Transforms/ObjCARC/weak-copies.ll index 13d0b0a..d3177bb 100644 --- a/test/Transforms/ObjCARC/weak-copies.ll +++ b/test/Transforms/ObjCARC/weak-copies.ll @@ -10,9 +10,9 @@ target triple = "x86_64-apple-darwin11.0.0" @_NSConcreteStackBlock = external global i8* @.str = private unnamed_addr constant [6 x i8] c"v8@?0\00" @"\01L_OBJC_CLASS_NAME_" = internal global [3 x i8] c"\01@\00", section "__TEXT,__objc_classname,cstring_literals", align 1 -@__block_descriptor_tmp = internal constant %0 { i64 0, i64 40, i8* bitcast (void (i8*, i8*)* @__copy_helper_block_ to i8*), i8* bitcast (void (i8*)* @__destroy_helper_block_ to i8*), i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0) } +@__block_descriptor_tmp = internal constant %0 { i64 0, i64 40, i8* bitcast (void (i8*, i8*)* @__copy_helper_block_ to i8*), i8* bitcast (void (i8*)* @__destroy_helper_block_ to i8*), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0) } @"\01L_OBJC_IMAGE_INFO" = internal constant [2 x i32] [i32 0, i32 16], section "__DATA, __objc_imageinfo, regular, no_dead_strip" -@llvm.used = appending global [2 x i8*] [i8* getelementptr inbounds ([3 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*)], section "llvm.metadata" +@llvm.used = appending global [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), i8* bitcast ([2 x i32]* @"\01L_OBJC_IMAGE_INFO" to i8*)], section "llvm.metadata" ; Eliminate unnecessary weak pointer copies. @@ -50,17 +50,17 @@ entry: %block = alloca %1, align 8 %0 = call i8* @objc_retain(i8* %me) nounwind %1 = call i8* @objc_initWeak(i8** %w, i8* %0) nounwind - %block.isa = getelementptr inbounds %1* %block, i64 0, i32 0 + %block.isa = getelementptr inbounds %1, %1* %block, i64 0, i32 0 store i8* bitcast (i8** @_NSConcreteStackBlock to i8*), i8** %block.isa, align 8 - %block.flags = getelementptr inbounds %1* %block, i64 0, i32 1 + %block.flags = getelementptr inbounds %1, %1* %block, i64 0, i32 1 store i32 1107296256, i32* %block.flags, align 8 - %block.reserved = getelementptr inbounds %1* %block, i64 0, i32 2 + %block.reserved = getelementptr inbounds %1, %1* %block, i64 0, i32 2 store i32 0, i32* %block.reserved, align 4 - %block.invoke = getelementptr inbounds %1* %block, i64 0, i32 3 + %block.invoke = getelementptr inbounds %1, %1* %block, i64 0, i32 3 store i8* bitcast (void (i8*)* @__qux_block_invoke_0 to i8*), i8** %block.invoke, align 8 - %block.descriptor = getelementptr inbounds %1* %block, i64 0, i32 4 + %block.descriptor = getelementptr inbounds %1, %1* %block, i64 0, i32 4 store %struct.__block_descriptor* bitcast (%0* @__block_descriptor_tmp to %struct.__block_descriptor*), %struct.__block_descriptor** %block.descriptor, align 8 - %block.captured = getelementptr inbounds %1* %block, i64 0, i32 5 + %block.captured = getelementptr inbounds %1, %1* %block, i64 0, i32 5 %2 = call i8* @objc_loadWeak(i8** %w) nounwind %3 = call i8* @objc_initWeak(i8** %block.captured, i8* %2) nounwind %4 = bitcast %1* %block to void ()* diff --git a/test/Transforms/PhaseOrdering/2010-03-22-empty-baseclass.ll b/test/Transforms/PhaseOrdering/2010-03-22-empty-baseclass.ll index 53d98e0..13404a8 100644 --- a/test/Transforms/PhaseOrdering/2010-03-22-empty-baseclass.ll +++ b/test/Transforms/PhaseOrdering/2010-03-22-empty-baseclass.ll @@ -29,29 +29,29 @@ entry: store %struct.empty_base_t* %4, %struct.empty_base_t** %2, align 8 call void @_ZN7empty_tC1Ev(%struct.empty_base_t* %1) nounwind %5 = call i32* @_ZN5boost15compressed_pairI7empty_tiE6secondEv(%"struct.boost::compressed_pair<empty_t,int>"* %x) ssp ; <i32*> [#uses=1] - %6 = load i32* %5, align 4 ; <i32> [#uses=1] + %6 = load i32, i32* %5, align 4 ; <i32> [#uses=1] %7 = icmp ne i32 %6, -3 ; <i1> [#uses=1] %8 = zext i1 %7 to i8 ; <i8> [#uses=1] store i8 %8, i8* %retval.1, align 1 - %9 = load i8* %retval.1, align 1 ; <i8> [#uses=1] + %9 = load i8, i8* %retval.1, align 1 ; <i8> [#uses=1] %toBool = icmp ne i8 %9, 0 ; <i1> [#uses=1] br i1 %toBool, label %bb, label %bb1 bb: ; preds = %entry - %10 = call i32 @puts(i8* getelementptr inbounds ([25 x i8]* @.str, i64 0, i64 0)) ; <i32> [#uses=0] + %10 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)) ; <i32> [#uses=0] call void @abort() noreturn unreachable bb1: ; preds = %entry store i32 0, i32* %0, align 4 - %11 = load i32* %0, align 4 ; <i32> [#uses=1] + %11 = load i32, i32* %0, align 4 ; <i32> [#uses=1] store i32 %11, i32* %retval, align 4 br label %return ; CHECK-NOT: x.second() was clobbered ; CHECK: ret i32 return: ; preds = %bb1 - %retval2 = load i32* %retval ; <i32> [#uses=1] + %retval2 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval2 } @@ -71,7 +71,7 @@ entry: %this_addr = alloca %struct.empty_base_t*, align 8 ; <%struct.empty_base_t**> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store %struct.empty_base_t* %this, %struct.empty_base_t** %this_addr - %0 = load %struct.empty_base_t** %this_addr, align 8 ; <%struct.empty_base_t*> [#uses=1] + %0 = load %struct.empty_base_t*, %struct.empty_base_t** %this_addr, align 8 ; <%struct.empty_base_t*> [#uses=1] call void @_ZN12empty_base_tC2Ev(%struct.empty_base_t* %0) nounwind br label %return @@ -86,15 +86,15 @@ entry: %0 = alloca i32* ; <i32**> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"* %this, %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"** %this_addr - %1 = load %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"** %this_addr, align 8 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] - %2 = getelementptr inbounds %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"* %1, i32 0, i32 0 ; <i32*> [#uses=1] + %1 = load %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*, %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"** %this_addr, align 8 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] + %2 = getelementptr inbounds %"struct.boost::details::compressed_pair_imp<empty_t,int,1>", %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"* %1, i32 0, i32 0 ; <i32*> [#uses=1] store i32* %2, i32** %0, align 8 - %3 = load i32** %0, align 8 ; <i32*> [#uses=1] + %3 = load i32*, i32** %0, align 8 ; <i32*> [#uses=1] store i32* %3, i32** %retval, align 8 br label %return return: ; preds = %entry - %retval1 = load i32** %retval ; <i32*> [#uses=1] + %retval1 = load i32*, i32** %retval ; <i32*> [#uses=1] ret i32* %retval1 } @@ -105,16 +105,16 @@ entry: %0 = alloca i32* ; <i32**> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store %"struct.boost::compressed_pair<empty_t,int>"* %this, %"struct.boost::compressed_pair<empty_t,int>"** %this_addr - %1 = load %"struct.boost::compressed_pair<empty_t,int>"** %this_addr, align 8 ; <%"struct.boost::compressed_pair<empty_t,int>"*> [#uses=1] - %2 = getelementptr inbounds %"struct.boost::compressed_pair<empty_t,int>"* %1, i32 0, i32 0 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] + %1 = load %"struct.boost::compressed_pair<empty_t,int>"*, %"struct.boost::compressed_pair<empty_t,int>"** %this_addr, align 8 ; <%"struct.boost::compressed_pair<empty_t,int>"*> [#uses=1] + %2 = getelementptr inbounds %"struct.boost::compressed_pair<empty_t,int>", %"struct.boost::compressed_pair<empty_t,int>"* %1, i32 0, i32 0 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] %3 = call i32* @_ZN5boost7details19compressed_pair_impI7empty_tiLi1EE6secondEv(%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"* %2) nounwind ; <i32*> [#uses=1] store i32* %3, i32** %0, align 8 - %4 = load i32** %0, align 8 ; <i32*> [#uses=1] + %4 = load i32*, i32** %0, align 8 ; <i32*> [#uses=1] store i32* %4, i32** %retval, align 8 br label %return return: ; preds = %entry - %retval1 = load i32** %retval ; <i32*> [#uses=1] + %retval1 = load i32*, i32** %retval ; <i32*> [#uses=1] ret i32* %retval1 } @@ -125,15 +125,15 @@ entry: %0 = alloca %struct.empty_base_t* ; <%struct.empty_base_t**> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"* %this, %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"** %this_addr - %1 = load %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"** %this_addr, align 8 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] + %1 = load %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*, %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"** %this_addr, align 8 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] %2 = bitcast %"struct.boost::details::compressed_pair_imp<empty_t,int,1>"* %1 to %struct.empty_base_t* ; <%struct.empty_base_t*> [#uses=1] store %struct.empty_base_t* %2, %struct.empty_base_t** %0, align 8 - %3 = load %struct.empty_base_t** %0, align 8 ; <%struct.empty_base_t*> [#uses=1] + %3 = load %struct.empty_base_t*, %struct.empty_base_t** %0, align 8 ; <%struct.empty_base_t*> [#uses=1] store %struct.empty_base_t* %3, %struct.empty_base_t** %retval, align 8 br label %return return: ; preds = %entry - %retval1 = load %struct.empty_base_t** %retval ; <%struct.empty_base_t*> [#uses=1] + %retval1 = load %struct.empty_base_t*, %struct.empty_base_t** %retval ; <%struct.empty_base_t*> [#uses=1] ret %struct.empty_base_t* %retval1 } @@ -144,16 +144,16 @@ entry: %0 = alloca %struct.empty_base_t* ; <%struct.empty_base_t**> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store %"struct.boost::compressed_pair<empty_t,int>"* %this, %"struct.boost::compressed_pair<empty_t,int>"** %this_addr - %1 = load %"struct.boost::compressed_pair<empty_t,int>"** %this_addr, align 8 ; <%"struct.boost::compressed_pair<empty_t,int>"*> [#uses=1] - %2 = getelementptr inbounds %"struct.boost::compressed_pair<empty_t,int>"* %1, i32 0, i32 0 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] + %1 = load %"struct.boost::compressed_pair<empty_t,int>"*, %"struct.boost::compressed_pair<empty_t,int>"** %this_addr, align 8 ; <%"struct.boost::compressed_pair<empty_t,int>"*> [#uses=1] + %2 = getelementptr inbounds %"struct.boost::compressed_pair<empty_t,int>", %"struct.boost::compressed_pair<empty_t,int>"* %1, i32 0, i32 0 ; <%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"*> [#uses=1] %3 = call %struct.empty_base_t* @_ZN5boost7details19compressed_pair_impI7empty_tiLi1EE5firstEv(%"struct.boost::details::compressed_pair_imp<empty_t,int,1>"* %2) nounwind ; <%struct.empty_base_t*> [#uses=1] store %struct.empty_base_t* %3, %struct.empty_base_t** %0, align 8 - %4 = load %struct.empty_base_t** %0, align 8 ; <%struct.empty_base_t*> [#uses=1] + %4 = load %struct.empty_base_t*, %struct.empty_base_t** %0, align 8 ; <%struct.empty_base_t*> [#uses=1] store %struct.empty_base_t* %4, %struct.empty_base_t** %retval, align 8 br label %return return: ; preds = %entry - %retval1 = load %struct.empty_base_t** %retval ; <%struct.empty_base_t*> [#uses=1] + %retval1 = load %struct.empty_base_t*, %struct.empty_base_t** %retval ; <%struct.empty_base_t*> [#uses=1] ret %struct.empty_base_t* %retval1 } diff --git a/test/Transforms/PhaseOrdering/PR6627.ll b/test/Transforms/PhaseOrdering/PR6627.ll index cf95363..f214955 100644 --- a/test/Transforms/PhaseOrdering/PR6627.ll +++ b/test/Transforms/PhaseOrdering/PR6627.ll @@ -8,29 +8,29 @@ declare i32 @doo(...) define void @test2(i8* %arrayidx) nounwind ssp { entry: %xx = bitcast i8* %arrayidx to i32* - %x1 = load i32* %xx, align 4 + %x1 = load i32, i32* %xx, align 4 %tmp = trunc i32 %x1 to i8 %conv = zext i8 %tmp to i32 %cmp = icmp eq i32 %conv, 127 br i1 %cmp, label %land.lhs.true, label %if.end land.lhs.true: ; preds = %entry - %arrayidx4 = getelementptr inbounds i8* %arrayidx, i64 1 - %tmp5 = load i8* %arrayidx4, align 1 + %arrayidx4 = getelementptr inbounds i8, i8* %arrayidx, i64 1 + %tmp5 = load i8, i8* %arrayidx4, align 1 %conv6 = zext i8 %tmp5 to i32 %cmp7 = icmp eq i32 %conv6, 69 br i1 %cmp7, label %land.lhs.true9, label %if.end land.lhs.true9: ; preds = %land.lhs.true - %arrayidx12 = getelementptr inbounds i8* %arrayidx, i64 2 - %tmp13 = load i8* %arrayidx12, align 1 + %arrayidx12 = getelementptr inbounds i8, i8* %arrayidx, i64 2 + %tmp13 = load i8, i8* %arrayidx12, align 1 %conv14 = zext i8 %tmp13 to i32 %cmp15 = icmp eq i32 %conv14, 76 br i1 %cmp15, label %land.lhs.true17, label %if.end land.lhs.true17: ; preds = %land.lhs.true9 - %arrayidx20 = getelementptr inbounds i8* %arrayidx, i64 3 - %tmp21 = load i8* %arrayidx20, align 1 + %arrayidx20 = getelementptr inbounds i8, i8* %arrayidx, i64 3 + %tmp21 = load i8, i8* %arrayidx20, align 1 %conv22 = zext i8 %tmp21 to i32 %cmp23 = icmp eq i32 %conv22, 70 br i1 %cmp23, label %if.then, label %if.end @@ -43,7 +43,7 @@ if.end: ret void ; CHECK-LABEL: @test2( -; CHECK: %x1 = load i32* %xx, align 4 +; CHECK: %x1 = load i32, i32* %xx, align 4 ; CHECK-NEXT: icmp eq i32 %x1, 1179403647 ; CHECK-NEXT: br i1 {{.*}}, label %if.then, label %if.end } @@ -53,28 +53,28 @@ if.end: ; requiring widening. define void @test2a(i8* %arrayidx) nounwind ssp { entry: - %x1 = load i8* %arrayidx, align 4 + %x1 = load i8, i8* %arrayidx, align 4 %conv = zext i8 %x1 to i32 %cmp = icmp eq i32 %conv, 127 br i1 %cmp, label %land.lhs.true, label %if.end land.lhs.true: ; preds = %entry - %arrayidx4 = getelementptr inbounds i8* %arrayidx, i64 1 - %tmp5 = load i8* %arrayidx4, align 1 + %arrayidx4 = getelementptr inbounds i8, i8* %arrayidx, i64 1 + %tmp5 = load i8, i8* %arrayidx4, align 1 %conv6 = zext i8 %tmp5 to i32 %cmp7 = icmp eq i32 %conv6, 69 br i1 %cmp7, label %land.lhs.true9, label %if.end land.lhs.true9: ; preds = %land.lhs.true - %arrayidx12 = getelementptr inbounds i8* %arrayidx, i64 2 - %tmp13 = load i8* %arrayidx12, align 1 + %arrayidx12 = getelementptr inbounds i8, i8* %arrayidx, i64 2 + %tmp13 = load i8, i8* %arrayidx12, align 1 %conv14 = zext i8 %tmp13 to i32 %cmp15 = icmp eq i32 %conv14, 76 br i1 %cmp15, label %land.lhs.true17, label %if.end land.lhs.true17: ; preds = %land.lhs.true9 - %arrayidx20 = getelementptr inbounds i8* %arrayidx, i64 3 - %tmp21 = load i8* %arrayidx20, align 1 + %arrayidx20 = getelementptr inbounds i8, i8* %arrayidx, i64 3 + %tmp21 = load i8, i8* %arrayidx20, align 1 %conv22 = zext i8 %tmp21 to i32 %cmp23 = icmp eq i32 %conv22, 70 br i1 %cmp23, label %if.then, label %if.end @@ -87,7 +87,7 @@ if.end: ret void ; CHECK-LABEL: @test2a( -; CHECK: %x1 = load i32* {{.*}}, align 4 +; CHECK: %x1 = load i32, i32* {{.*}}, align 4 ; CHECK-NEXT: icmp eq i32 %x1, 1179403647 ; CHECK-NEXT: br i1 {{.*}}, label %if.then, label %if.end } diff --git a/test/Transforms/PhaseOrdering/basic.ll b/test/Transforms/PhaseOrdering/basic.ll index 2deefa6..ef57e55 100644 --- a/test/Transforms/PhaseOrdering/basic.ll +++ b/test/Transforms/PhaseOrdering/basic.ll @@ -13,9 +13,9 @@ define void @test1() nounwind ssp { %i = alloca i8*, align 8 %call = call i8* @malloc(i64 1) store i8* %call, i8** %i, align 8 - %tmp = load i8** %i, align 8 + %tmp = load i8*, i8** %i, align 8 store i8 1, i8* %tmp - %tmp1 = load i8** %i, align 8 + %tmp1 = load i8*, i8** %i, align 8 call void @free(i8* %tmp1) ret void @@ -31,15 +31,15 @@ define void @test1() nounwind ssp { define i32 @test2(i32 %a, i32* %p) nounwind uwtable ssp { entry: %div = udiv i32 %a, 4 - %arrayidx = getelementptr inbounds i32* %p, i64 0 + %arrayidx = getelementptr inbounds i32, i32* %p, i64 0 store i32 %div, i32* %arrayidx, align 4 %add = add i32 %div, %div - %arrayidx1 = getelementptr inbounds i32* %p, i64 1 + %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 1 store i32 %add, i32* %arrayidx1, align 4 - %arrayidx2 = getelementptr inbounds i32* %p, i64 1 - %0 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %p, i64 0 - %1 = load i32* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %p, i64 1 + %0 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %p, i64 0 + %1 = load i32, i32* %arrayidx3, align 4 %mul = mul i32 2, %1 %sub = sub i32 %0, %mul ret i32 %sub diff --git a/test/Transforms/PhaseOrdering/gdce.ll b/test/Transforms/PhaseOrdering/gdce.ll index 95f0675..6f79eb8 100644 --- a/test/Transforms/PhaseOrdering/gdce.ll +++ b/test/Transforms/PhaseOrdering/gdce.ll @@ -15,7 +15,7 @@ @_ZTV4Base = linkonce_odr unnamed_addr constant [4 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI4Base to i8*), i8* bitcast (void (%class.Base*)* @_ZN4BaseD1Ev to i8*), i8* bitcast (void (%class.Base*)* @_ZN4BaseD0Ev to i8*)] @_ZTVN10__cxxabiv117__class_type_infoE = external global i8* @_ZTS4Base = linkonce_odr constant [6 x i8] c"4Base\00" -@_ZTI4Base = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([6 x i8]* @_ZTS4Base, i32 0, i32 0) } +@_ZTI4Base = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @_ZTS4Base, i32 0, i32 0) } define i32 @main() uwtable ssp { entry: @@ -27,7 +27,7 @@ entry: store i32 0, i32* %retval store i32 1, i32* %cleanup.dest.slot call void @_ZN4BaseD1Ev(%class.Base* %b) - %0 = load i32* %retval + %0 = load i32, i32* %retval ret i32 %0 } @@ -35,7 +35,7 @@ define linkonce_odr void @_ZN4BaseC1Ev(%class.Base* %this) unnamed_addr uwtable entry: %this.addr = alloca %class.Base*, align 8 store %class.Base* %this, %class.Base** %this.addr, align 8 - %this1 = load %class.Base** %this.addr + %this1 = load %class.Base*, %class.Base** %this.addr call void @_ZN4BaseC2Ev(%class.Base* %this1) ret void } @@ -44,7 +44,7 @@ define linkonce_odr void @_ZN4BaseD1Ev(%class.Base* %this) unnamed_addr uwtable entry: %this.addr = alloca %class.Base*, align 8 store %class.Base* %this, %class.Base** %this.addr, align 8 - %this1 = load %class.Base** %this.addr + %this1 = load %class.Base*, %class.Base** %this.addr call void @_ZN4BaseD2Ev(%class.Base* %this1) ret void } @@ -53,7 +53,7 @@ define linkonce_odr void @_ZN4BaseD2Ev(%class.Base* %this) unnamed_addr nounwind entry: %this.addr = alloca %class.Base*, align 8 store %class.Base* %this, %class.Base** %this.addr, align 8 - %this1 = load %class.Base** %this.addr + %this1 = load %class.Base*, %class.Base** %this.addr ret void } @@ -61,9 +61,9 @@ define linkonce_odr void @_ZN4BaseC2Ev(%class.Base* %this) unnamed_addr nounwind entry: %this.addr = alloca %class.Base*, align 8 store %class.Base* %this, %class.Base** %this.addr, align 8 - %this1 = load %class.Base** %this.addr + %this1 = load %class.Base*, %class.Base** %this.addr %0 = bitcast %class.Base* %this1 to i8*** - store i8** getelementptr inbounds ([4 x i8*]* @_ZTV4Base, i64 0, i64 2), i8*** %0 + store i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV4Base, i64 0, i64 2), i8*** %0 ret void } @@ -73,7 +73,7 @@ entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 store %class.Base* %this, %class.Base** %this.addr, align 8 - %this1 = load %class.Base** %this.addr + %this1 = load %class.Base*, %class.Base** %this.addr invoke void @_ZN4BaseD1Ev(%class.Base* %this1) to label %invoke.cont unwind label %lpad @@ -94,8 +94,8 @@ lpad: ; preds = %entry br label %eh.resume eh.resume: ; preds = %lpad - %exn = load i8** %exn.slot - %sel = load i32* %ehselector.slot + %exn = load i8*, i8** %exn.slot + %sel = load i32, i32* %ehselector.slot %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0 %lpad.val2 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1 resume { i8*, i32 } %lpad.val2 diff --git a/test/Transforms/PhaseOrdering/scev.ll b/test/Transforms/PhaseOrdering/scev.ll index 39adb6b..c616ca2 100644 --- a/test/Transforms/PhaseOrdering/scev.ll +++ b/test/Transforms/PhaseOrdering/scev.ll @@ -7,7 +7,7 @@ ; CHECK: test1 ; The loop body contains two increments by %div. ; Make sure that 2*%div is recognizable, and not expressed as a bit mask of %d. -; CHECK: --> {%p,+,(2 * (%d /u 4) * sizeof(i32))} +; CHECK: --> {%p,+,(8 * (%d /u 4))} define void @test1(i64 %d, i32* %p) nounwind uwtable ssp { entry: %div = udiv i64 %d, 4 @@ -21,9 +21,9 @@ for.cond: ; preds = %for.inc, %entry for.body: ; preds = %for.cond store i32 0, i32* %p.addr.0, align 4 - %add.ptr = getelementptr inbounds i32* %p.addr.0, i64 %div + %add.ptr = getelementptr inbounds i32, i32* %p.addr.0, i64 %div store i32 1, i32* %add.ptr, align 4 - %add.ptr1 = getelementptr inbounds i32* %add.ptr, i64 %div + %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i64 %div br label %for.inc for.inc: ; preds = %for.body @@ -36,7 +36,7 @@ for.end: ; preds = %for.cond ; CHECK: test1a ; Same thing as test1, but it is even more tempting to fold 2 * (%d /u 2) -; CHECK: --> {%p,+,(2 * (%d /u 2) * sizeof(i32))} +; CHECK: --> {%p,+,(8 * (%d /u 2))} define void @test1a(i64 %d, i32* %p) nounwind uwtable ssp { entry: %div = udiv i64 %d, 2 @@ -50,9 +50,9 @@ for.cond: ; preds = %for.inc, %entry for.body: ; preds = %for.cond store i32 0, i32* %p.addr.0, align 4 - %add.ptr = getelementptr inbounds i32* %p.addr.0, i64 %div + %add.ptr = getelementptr inbounds i32, i32* %p.addr.0, i64 %div store i32 1, i32* %add.ptr, align 4 - %add.ptr1 = getelementptr inbounds i32* %add.ptr, i64 %div + %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i64 %div br label %for.inc for.inc: ; preds = %for.body diff --git a/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll b/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll index 003fbb1..1c8f0d2 100644 --- a/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll +++ b/test/Transforms/Reassociate/2011-01-26-UseAfterFree.ll @@ -5,7 +5,7 @@ target triple = "i386-gnu-linux" define void @exp_averages_intraday__deviation() { entry: - %0 = load i32* undef, align 4 + %0 = load i32, i32* undef, align 4 %1 = shl i32 %0, 2 %2 = add nsw i32 undef, %1 %3 = add nsw i32 %2, undef @@ -22,7 +22,7 @@ entry: unreachable "8": ; preds = %"4" - %8 = getelementptr inbounds i8* undef, i32 %6 + %8 = getelementptr inbounds i8, i8* undef, i32 %6 br i1 undef, label %"13", label %"12" "12": ; preds = %"8", %entry diff --git a/test/Transforms/Reassociate/basictest.ll b/test/Transforms/Reassociate/basictest.ll index 0194ce2..015d3b0 100644 --- a/test/Transforms/Reassociate/basictest.ll +++ b/test/Transforms/Reassociate/basictest.ll @@ -28,9 +28,9 @@ define i32 @test2(i32 %reg109, i32 %reg1111) { @f = external global i32 define void @test3() { - %A = load i32* @a - %B = load i32* @b - %C = load i32* @c + %A = load i32, i32* @a + %B = load i32, i32* @b + %C = load i32, i32* @c %t1 = add i32 %A, %B %t2 = add i32 %t1, %C %t3 = add i32 %C, %A @@ -49,9 +49,9 @@ define void @test3() { } define void @test4() { - %A = load i32* @a - %B = load i32* @b - %C = load i32* @c + %A = load i32, i32* @a + %B = load i32, i32* @b + %C = load i32, i32* @c %t1 = add i32 %A, %B %t2 = add i32 %t1, %C %t3 = add i32 %C, %A @@ -70,9 +70,9 @@ define void @test4() { } define void @test5() { - %A = load i32* @a - %B = load i32* @b - %C = load i32* @c + %A = load i32, i32* @a + %B = load i32, i32* @b + %C = load i32, i32* @c %t1 = add i32 %B, %A %t2 = add i32 %t1, %C %t3 = add i32 %C, %A @@ -91,11 +91,11 @@ define void @test5() { } define i32 @test6() { - %tmp.0 = load i32* @a - %tmp.1 = load i32* @b + %tmp.0 = load i32, i32* @a + %tmp.1 = load i32, i32* @b ; (a+b) %tmp.2 = add i32 %tmp.0, %tmp.1 - %tmp.4 = load i32* @c + %tmp.4 = load i32, i32* @c ; (a+b)+c %tmp.5 = add i32 %tmp.2, %tmp.4 ; (a+c) diff --git a/test/Transforms/Reassociate/crash.ll b/test/Transforms/Reassociate/crash.ll index 770f973..f8774ea 100644 --- a/test/Transforms/Reassociate/crash.ll +++ b/test/Transforms/Reassociate/crash.ll @@ -17,7 +17,7 @@ for.cond: ; preds = %for.body, %entry ; PR5981 define i32 @test2() nounwind ssp { entry: - %0 = load i32* undef, align 4 + %0 = load i32, i32* undef, align 4 %1 = mul nsw i32 undef, %0 %2 = mul nsw i32 undef, %0 %3 = add nsw i32 undef, %1 @@ -50,7 +50,7 @@ _: br label %_33 _33: ; preds = %_33, %_ - %tmp348 = load i8* %arg, align 1 + %tmp348 = load i8, i8* %arg, align 1 %tmp349 = lshr i8 %tmp348, 7 %tmp350 = or i8 %tmp349, 42 %tmp351 = add i8 %tmp350, -42 @@ -123,7 +123,7 @@ for.cond: ; preds = %for.cond, %entry ; PR12963 @a = external global i8 define i8 @f0(i8 %x) { - %t0 = load i8* @a + %t0 = load i8, i8* @a %t1 = mul i8 %x, %x %t2 = mul i8 %t1, %t1 %t3 = mul i8 %t2, %t2 diff --git a/test/Transforms/Reassociate/fast-ReassociateVector.ll b/test/Transforms/Reassociate/fast-ReassociateVector.ll index eeae096..9fbb5cc 100644 --- a/test/Transforms/Reassociate/fast-ReassociateVector.ll +++ b/test/Transforms/Reassociate/fast-ReassociateVector.ll @@ -1,46 +1,192 @@ ; RUN: opt < %s -reassociate -S | FileCheck %s -; Canonicalize operands, but don't optimize floating point vector operations. -define <4 x float> @test1() { -; CHECK-LABEL: test1 -; CHECK-NEXT: %tmp1 = fsub fast <4 x float> zeroinitializer, zeroinitializer -; CHECK-NEXT: %tmp2 = fmul fast <4 x float> %tmp1, zeroinitializer - - %tmp1 = fsub fast <4 x float> zeroinitializer, zeroinitializer - %tmp2 = fmul fast <4 x float> zeroinitializer, %tmp1 - ret <4 x float> %tmp2 -} - -; Commute integer vector operations. -define <2 x i32> @test2(<2 x i32> %x, <2 x i32> %y) { -; CHECK-LABEL: test2 -; CHECK-NEXT: %tmp1 = add <2 x i32> %x, %y -; CHECK-NEXT: %tmp2 = add <2 x i32> %x, %y -; CHECK-NEXT: %tmp3 = add <2 x i32> %tmp1, %tmp2 - - %tmp1 = add <2 x i32> %x, %y - %tmp2 = add <2 x i32> %y, %x - %tmp3 = add <2 x i32> %tmp1, %tmp2 - ret <2 x i32> %tmp3 +; Check that a*c+b*c is turned into (a+b)*c +define <4 x float> @test1(<4 x float> %a, <4 x float> %b, <4 x float> %c) { +; CHECK-LABEL: @test1 +; CHECK-NEXT: %tmp = fadd fast <4 x float> %b, %a +; CHECK-NEXT: %tmp1 = fmul fast <4 x float> %tmp, %c +; CHECK-NEXT: ret <4 x float> %tmp1 + + %mul = fmul fast <4 x float> %a, %c + %mul1 = fmul fast <4 x float> %b, %c + %add = fadd fast <4 x float> %mul, %mul1 + ret <4 x float> %add } -define <2 x i32> @test3(<2 x i32> %x, <2 x i32> %y) { -; CHECK-LABEL: test3 -; CHECK-NEXT: %tmp1 = mul <2 x i32> %x, %y -; CHECK-NEXT: %tmp2 = mul <2 x i32> %x, %y -; CHECK-NEXT: %tmp3 = mul <2 x i32> %tmp1, %tmp2 +; Check that a*a*b+a*a*c is turned into a*(a*(b+c)). +define <2 x float> @test2(<2 x float> %a, <2 x float> %b, <2 x float> %c) { +; CHECK-LABEL: @test2 +; CHECK-NEXT: fadd fast <2 x float> %c, %b +; CHECK-NEXT: fmul fast <2 x float> %a, %tmp2 +; CHECK-NEXT: fmul fast <2 x float> %tmp3, %a +; CHECK-NEXT: ret <2 x float> - %tmp1 = mul <2 x i32> %x, %y - %tmp2 = mul <2 x i32> %y, %x - %tmp3 = mul <2 x i32> %tmp1, %tmp2 - ret <2 x i32> %tmp3 + %t0 = fmul fast <2 x float> %a, %b + %t1 = fmul fast <2 x float> %a, %t0 + %t2 = fmul fast <2 x float> %a, %c + %t3 = fmul fast <2 x float> %a, %t2 + %t4 = fadd fast <2 x float> %t1, %t3 + ret <2 x float> %t4 +} + +; Check that a*b+a*c+d is turned into a*(b+c)+d. +define <2 x double> @test3(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x double> %d) { +; CHECK-LABEL: @test3 +; CHECK-NEXT: fadd fast <2 x double> %c, %b +; CHECK-NEXT: fmul fast <2 x double> %tmp, %a +; CHECK-NEXT: fadd fast <2 x double> %tmp1, %d +; CHECK-NEXT: ret <2 x double> + + %t0 = fmul fast <2 x double> %a, %b + %t1 = fmul fast <2 x double> %a, %c + %t2 = fadd fast <2 x double> %t1, %d + %t3 = fadd fast <2 x double> %t0, %t2 + ret <2 x double> %t3 +} + +; No fast-math. +define <2 x float> @test4(<2 x float> %A) { +; CHECK-LABEL: @test4 +; CHECK-NEXT: %X = fadd <2 x float> %A, <float 1.000000e+00, float 1.000000e+00> +; CHECK-NEXT: %Y = fadd <2 x float> %A, <float 1.000000e+00, float 1.000000e+00> +; CHECK-NEXT: %R = fsub <2 x float> %X, %Y +; CHECK-NEXT: ret <2 x float> %R + + %X = fadd <2 x float> %A, < float 1.000000e+00, float 1.000000e+00 > + %Y = fadd <2 x float> %A, < float 1.000000e+00, float 1.000000e+00 > + %R = fsub <2 x float> %X, %Y + ret <2 x float> %R +} + +; Check 47*X + 47*X -> 94*X. +define <2 x float> @test5(<2 x float> %X) { +; CHECK-LABEL: @test5 +; CHECK-NEXT: fmul fast <2 x float> %X, <float 9.400000e+01, float 9.400000e+01> +; CHECK-NEXT: ret <2 x float> + + %Y = fmul fast <2 x float> %X, <float 4.700000e+01, float 4.700000e+01> + %Z = fadd fast <2 x float> %Y, %Y + ret <2 x float> %Z +} + +; Check X+X+X -> 3*X. +define <2 x float> @test6(<2 x float> %X) { +; CHECK-LABEL: @test6 +; CHECK-NEXT: fmul fast <2 x float> %X, <float 3.000000e+00, float 3.000000e+00> +; CHECK-NEXT: ret <2 x float> + + %Y = fadd fast <2 x float> %X ,%X + %Z = fadd fast <2 x float> %Y, %X + ret <2 x float> %Z +} + +; Check 127*W+50*W -> 177*W. +define <2 x double> @test7(<2 x double> %W) { +; CHECK-LABEL: @test7 +; CHECK-NEXT: fmul fast <2 x double> %W, <double 1.770000e+02, double 1.770000e+02> +; CHECK-NEXT: ret <2 x double> + + %X = fmul fast <2 x double> %W, <double 127.0, double 127.0> + %Y = fmul fast <2 x double> %W, <double 50.0, double 50.0> + %Z = fadd fast <2 x double> %Y, %X + ret <2 x double> %Z +} + +; Check X*12*12 -> X*144. +define <2 x float> @test8(<2 x float> %arg) { +; CHECK-LABEL: @test8 +; CHECK: fmul fast <2 x float> %arg, <float 1.440000e+02, float 1.440000e+02> +; CHECK-NEXT: ret <2 x float> %tmp2 + + %tmp1 = fmul fast <2 x float> <float 1.200000e+01, float 1.200000e+01>, %arg + %tmp2 = fmul fast <2 x float> %tmp1, <float 1.200000e+01, float 1.200000e+01> + ret <2 x float> %tmp2 +} + +; Check (b+(a+1234))+-a -> b+1234. +define <2 x double> @test9(<2 x double> %b, <2 x double> %a) { +; CHECK-LABEL: @test9 +; CHECK: fadd fast <2 x double> %b, <double 1.234000e+03, double 1.234000e+03> +; CHECK-NEXT: ret <2 x double> + + %1 = fadd fast <2 x double> %a, <double 1.234000e+03, double 1.234000e+03> + %2 = fadd fast <2 x double> %b, %1 + %3 = fsub fast <2 x double> <double 0.000000e+00, double 0.000000e+00>, %a + %4 = fadd fast <2 x double> %2, %3 + ret <2 x double> %4 +} + +; Check -(-(z*40)*a) -> a*40*z. +define <2 x float> @test10(<2 x float> %a, <2 x float> %b, <2 x float> %z) { +; CHECK-LABEL: @test10 +; CHECK: fmul fast <2 x float> %a, <float 4.000000e+01, float 4.000000e+01> +; CHECK-NEXT: fmul fast <2 x float> %e, %z +; CHECK-NEXT: ret <2 x float> + + %d = fmul fast <2 x float> %z, <float 4.000000e+01, float 4.000000e+01> + %c = fsub fast <2 x float> <float 0.000000e+00, float 0.000000e+00>, %d + %e = fmul fast <2 x float> %a, %c + %f = fsub fast <2 x float> <float 0.000000e+00, float 0.000000e+00>, %e + ret <2 x float> %f +} + +; Check x*y+y*x -> x*y*2. +define <2 x double> @test11(<2 x double> %x, <2 x double> %y) { +; CHECK-LABEL: @test11 +; CHECK-NEXT: %factor = fmul fast <2 x double> %y, <double 2.000000e+00, double 2.000000e+00> +; CHECK-NEXT: %tmp1 = fmul fast <2 x double> %factor, %x +; CHECK-NEXT: ret <2 x double> %tmp1 + + %1 = fmul fast <2 x double> %x, %y + %2 = fmul fast <2 x double> %y, %x + %3 = fadd fast <2 x double> %1, %2 + ret <2 x double> %3 +} + +; FIXME: shifts should be converted to mul to assist further reassociation. +define <2 x i64> @test12(<2 x i64> %b, <2 x i64> %c) { +; CHECK-LABEL: @test12 +; CHECK-NEXT: %mul = mul <2 x i64> %c, %b +; CHECK-NEXT: %shl = shl <2 x i64> %mul, <i64 5, i64 5> +; CHECK-NEXT: ret <2 x i64> %shl + + %mul = mul <2 x i64> %c, %b + %shl = shl <2 x i64> %mul, <i64 5, i64 5> + ret <2 x i64> %shl +} + +; FIXME: expressions with a negative const should be canonicalized to assist +; further reassociation. +; We would expect (-5*b)+a -> a-(5*b) but only the constant operand is commuted. +define <4 x float> @test13(<4 x float> %a, <4 x float> %b) { +; CHECK-LABEL: @test13 +; CHECK-NEXT: %mul = fmul fast <4 x float> %b, <float -5.000000e+00, float -5.000000e+00, float -5.000000e+00, float -5.000000e+00> +; CHECK-NEXT: %add = fadd fast <4 x float> %mul, %a +; CHECK-NEXT: ret <4 x float> %add + + %mul = fmul fast <4 x float> <float -5.000000e+00, float -5.000000e+00, float -5.000000e+00, float -5.000000e+00>, %b + %add = fadd fast <4 x float> %mul, %a + ret <4 x float> %add +} + +; Break up subtract to assist further reassociation. +; Check a+b-c -> a+b+-c. +define <2 x i64> @test14(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) { +; CHECK-LABEL: @test14 +; CHECK-NEXT: %add = add <2 x i64> %b, %a +; CHECK-NEXT: %c.neg = sub <2 x i64> zeroinitializer, %c +; CHECK-NEXT: %sub = add <2 x i64> %add, %c.neg +; CHECK-NEXT: ret <2 x i64> %sub + + %add = add <2 x i64> %b, %a + %sub = sub <2 x i64> %add, %c + ret <2 x i64> %sub } -define <2 x i32> @test4(<2 x i32> %x, <2 x i32> %y) { -; CHECK-LABEL: test4 -; CHECK-NEXT: %tmp1 = and <2 x i32> %x, %y -; CHECK-NEXT: %tmp2 = and <2 x i32> %x, %y -; CHECK-NEXT: %tmp3 = and <2 x i32> %tmp1, %tmp2 +define <2 x i32> @test15(<2 x i32> %x, <2 x i32> %y) { +; CHECK-LABEL: test15 +; CHECK-NEXT: %tmp3 = and <2 x i32> %y, %x +; CHECK-NEXT: ret <2 x i32> %tmp3 %tmp1 = and <2 x i32> %x, %y %tmp2 = and <2 x i32> %y, %x @@ -48,11 +194,10 @@ define <2 x i32> @test4(<2 x i32> %x, <2 x i32> %y) { ret <2 x i32> %tmp3 } -define <2 x i32> @test5(<2 x i32> %x, <2 x i32> %y) { -; CHECK-LABEL: test5 -; CHECK-NEXT: %tmp1 = or <2 x i32> %x, %y -; CHECK-NEXT: %tmp2 = or <2 x i32> %x, %y -; CHECK-NEXT: %tmp3 = or <2 x i32> %tmp1, %tmp2 +define <2 x i32> @test16(<2 x i32> %x, <2 x i32> %y) { +; CHECK-LABEL: test16 +; CHECK-NEXT: %tmp3 = or <2 x i32> %y, %x +; CHECK-NEXT: ret <2 x i32> %tmp3 %tmp1 = or <2 x i32> %x, %y %tmp2 = or <2 x i32> %y, %x @@ -60,8 +205,9 @@ define <2 x i32> @test5(<2 x i32> %x, <2 x i32> %y) { ret <2 x i32> %tmp3 } -define <2 x i32> @test6(<2 x i32> %x, <2 x i32> %y) { -; CHECK-LABEL: test6 +; FIXME: Optimize vector xor. Currently only commute operands. +define <2 x i32> @test17(<2 x i32> %x, <2 x i32> %y) { +; CHECK-LABEL: test17 ; CHECK-NEXT: %tmp1 = xor <2 x i32> %x, %y ; CHECK-NEXT: %tmp2 = xor <2 x i32> %x, %y ; CHECK-NEXT: %tmp3 = xor <2 x i32> %tmp1, %tmp2 diff --git a/test/Transforms/Reassociate/fast-basictest.ll b/test/Transforms/Reassociate/fast-basictest.ll index 67b07f4..64b74e3 100644 --- a/test/Transforms/Reassociate/fast-basictest.ll +++ b/test/Transforms/Reassociate/fast-basictest.ll @@ -48,9 +48,9 @@ define void @test4() { ; CHECK-NOT: fadd fast float ; CHECK: ret void - %A = load float* @fa - %B = load float* @fb - %C = load float* @fc + %A = load float, float* @fa + %B = load float, float* @fb + %C = load float, float* @fc %t1 = fadd fast float %A, %B %t2 = fadd fast float %t1, %C %t3 = fadd fast float %C, %A @@ -69,9 +69,9 @@ define void @test5() { ; CHECK-NOT: fadd ; CHECK: ret void - %A = load float* @fa - %B = load float* @fb - %C = load float* @fc + %A = load float, float* @fa + %B = load float, float* @fb + %C = load float, float* @fc %t1 = fadd fast float %A, %B %t2 = fadd fast float %t1, %C %t3 = fadd fast float %C, %A @@ -90,9 +90,9 @@ define void @test6() { ; CHECK-NOT: fadd ; CHECK: ret void - %A = load float* @fa - %B = load float* @fb - %C = load float* @fc + %A = load float, float* @fa + %B = load float, float* @fb + %C = load float, float* @fc %t1 = fadd fast float %B, %A %t2 = fadd fast float %t1, %C %t3 = fadd fast float %C, %A diff --git a/test/Transforms/Reassociate/looptest.ll b/test/Transforms/Reassociate/looptest.ll index aad3b20..8b6a409 100644 --- a/test/Transforms/Reassociate/looptest.ll +++ b/test/Transforms/Reassociate/looptest.ll @@ -33,7 +33,7 @@ bb4: ; preds = %bb4, %bb3 %reg117 = phi i32 [ %reg118, %bb4 ], [ 0, %bb3 ] ; <i32> [#uses=2] %reg113 = add i32 %reg115, %reg117 ; <i32> [#uses=1] %reg114 = add i32 %reg113, %reg116 ; <i32> [#uses=1] - %cast227 = getelementptr [4 x i8]* @.LC0, i64 0, i64 0 ; <i8*> [#uses=1] + %cast227 = getelementptr [4 x i8], [4 x i8]* @.LC0, i64 0, i64 0 ; <i8*> [#uses=1] call i32 (i8*, ...)* @printf( i8* %cast227, i32 %reg114 ) ; <i32>:0 [#uses=0] %reg118 = add i32 %reg117, 1 ; <i32> [#uses=2] %cond224 = icmp ne i32 %reg118, %Num ; <i1> [#uses=1] diff --git a/test/Transforms/Reassociate/pr12245.ll b/test/Transforms/Reassociate/pr12245.ll index e9b5355..0e7152e 100644 --- a/test/Transforms/Reassociate/pr12245.ll +++ b/test/Transforms/Reassociate/pr12245.ll @@ -6,34 +6,34 @@ define i32 @fn2() nounwind uwtable ssp { entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %dec = add nsw i32 %0, -1 store i32 %dec, i32* @a, align 4 - %1 = load i32* @d, align 4 + %1 = load i32, i32* @d, align 4 %sub = sub nsw i32 %dec, %1 store i32 %sub, i32* @d, align 4 - %2 = load i32* @a, align 4 + %2 = load i32, i32* @a, align 4 %dec1 = add nsw i32 %2, -1 store i32 %dec1, i32* @a, align 4 - %3 = load i32* @d, align 4 + %3 = load i32, i32* @d, align 4 %sub2 = sub nsw i32 %dec1, %3 store i32 %sub2, i32* @d, align 4 - %4 = load i32* @a, align 4 + %4 = load i32, i32* @a, align 4 %dec3 = add nsw i32 %4, -1 store i32 %dec3, i32* @a, align 4 - %5 = load i32* @d, align 4 + %5 = load i32, i32* @d, align 4 %sub4 = sub nsw i32 %dec3, %5 store i32 %sub4, i32* @d, align 4 - %6 = load i32* @a, align 4 + %6 = load i32, i32* @a, align 4 %dec5 = add nsw i32 %6, -1 store i32 %dec5, i32* @a, align 4 - %7 = load i32* @d, align 4 + %7 = load i32, i32* @d, align 4 %sub6 = sub nsw i32 %dec5, %7 store i32 %sub6, i32* @d, align 4 - %8 = load i32* @a, align 4 + %8 = load i32, i32* @a, align 4 %dec7 = add nsw i32 %8, -1 store i32 %dec7, i32* @a, align 4 - %9 = load i32* @d, align 4 + %9 = load i32, i32* @d, align 4 %sub8 = sub nsw i32 %dec7, %9 store i32 %sub8, i32* @d, align 4 ret i32 0 diff --git a/test/Transforms/Reassociate/pr21205.ll b/test/Transforms/Reassociate/pr21205.ll index fcc7150..0c6fd3a 100644 --- a/test/Transforms/Reassociate/pr21205.ll +++ b/test/Transforms/Reassociate/pr21205.ll @@ -11,7 +11,7 @@ define i32 @test1() { entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %conv = sitofp i32 %0 to float %sub = fsub fast float %conv, undef %sub1 = fadd fast float %sub, -1.000000e+00 diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll new file mode 100644 index 0000000..d026d50 --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll @@ -0,0 +1,28 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %merged_value base %base_phi + +declare void @site_for_call_safpeoint() + +define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y, i1 %runtime_condition) gc "statepoint-example" { +entry: + br i1 %runtime_condition, label %here, label %there + +here: + %x = getelementptr i64, i64 addrspace(1)* %base_obj_x, i32 1 + br label %merge + +there: + %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1 + br label %merge + +merge: +; CHECK-LABEL: merge: +; CHECK: %base_phi = phi i64 addrspace(1)* [ %base_obj_x, %here ], [ %base_obj_y, %there ] + %merged_value = phi i64 addrspace(1)* [ %x, %here ], [ %y, %there ] + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + ret i64 addrspace(1)* %merged_value +} + +declare void @foo() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll new file mode 100644 index 0000000..6f02056 --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll @@ -0,0 +1,37 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %next_x base %base_obj_x +; CHECK: derived %next_y base %base_obj_y +; CHECK: derived %next base %base_phi + +declare i1 @runtime_value() +declare void @do_safepoint() + +define void @select_of_phi(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y) gc "statepoint-example" { +entry: + br label %loop + +loop: + %current_x = phi i64 addrspace(1)* [ %base_obj_x , %entry ], [ %next_x, %merge ] + %current_y = phi i64 addrspace(1)* [ %base_obj_y , %entry ], [ %next_y, %merge ] + %current = phi i64 addrspace(1)* [ null , %entry ], [ %next , %merge ] + + %condition = call i1 @runtime_value() + %next_x = getelementptr i64, i64 addrspace(1)* %current_x, i32 1 + %next_y = getelementptr i64, i64 addrspace(1)* %current_y, i32 1 + + br i1 %condition, label %true, label %false + +true: + br label %merge + +false: + br label %merge + +merge: + %next = phi i64 addrspace(1)* [ %next_x, %true ], [ %next_y, %false ] + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop +} + +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll new file mode 100644 index 0000000..1e8d071 --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll @@ -0,0 +1,26 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %next base %base_obj + +declare void @do_safepoint() + +define void @test(i64 addrspace(1)* %base_obj) gc "statepoint-example" { +entry: + %obj = getelementptr i64, i64 addrspace(1)* %base_obj, i32 1 + br label %loop + +loop: ; preds = %loop, %entry +; CHECK-LABEL: loop: +; CHECK: phi i64 addrspace(1)* +; CHECK-DAG: [ %base_obj.relocated, %loop ] +; CHECK-DAG: [ %base_obj, %entry ] +; CHECK: %current = phi i64 addrspace(1)* +; CHECK-DAG: [ %obj, %entry ] +; CHECK-DAG: [ %next.relocated, %loop ] + %current = phi i64 addrspace(1)* [ %obj, %entry ], [ %next, %loop ] + %next = getelementptr i64, i64 addrspace(1)* %current, i32 1 + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop +} + +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll new file mode 100644 index 0000000..94787bf --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll @@ -0,0 +1,21 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %merged_value base %base_obj + + +define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj, i1 %runtime_condition) gc "statepoint-example" { +entry: + br i1 %runtime_condition, label %merge, label %there + +there: + %derived_obj = getelementptr i64, i64 addrspace(1)* %base_obj, i32 1 + br label %merge + +merge: + %merged_value = phi i64 addrspace(1)* [ %base_obj, %entry ], [ %derived_obj, %there ] + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + ret i64 addrspace(1)* %merged_value +} + +declare void @foo() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll new file mode 100644 index 0000000..5aaa47e --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll @@ -0,0 +1,20 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %next.i64 base %base_obj + +define void @test(i64 addrspace(1)* %base_obj) gc "statepoint-example" { +entry: + %obj = getelementptr i64, i64 addrspace(1)* %base_obj, i32 1 + br label %loop + +loop: + %current = phi i64 addrspace(1)* [ %obj, %entry ], [ %next.i64, %loop ] + %current.i32 = bitcast i64 addrspace(1)* %current to i32 addrspace(1)* + %next.i32 = getelementptr i32, i32 addrspace(1)* %current.i32, i32 1 + %next.i64 = bitcast i32 addrspace(1)* %next.i32 to i64 addrspace(1)* + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop +} + +declare void @do_safepoint() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll new file mode 100644 index 0000000..16bb3ac --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll @@ -0,0 +1,53 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + + +; CHECK: derived %obj_to_consume base %base_phi + +declare void @foo() +declare i64 addrspace(1)* @generate_obj() +declare void @consume_obj(i64 addrspace(1)*) + +define void @test(i32 %condition) gc "statepoint-example" { +entry: + br label %loop + +loop: +; CHECK: loop: +; CHECK: %safepoint_token1 = call i32 (i64 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 addrspace(1)* ()* @generate_obj, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i3 +; CHECK-NEXT: %obj2 = call i64 addrspace(1)* @llvm.experimental.gc.result + %safepoint_token1 = call i32 (i64 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 addrspace(1)* ()* @generate_obj, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + %obj2 = call i64 addrspace(1)* @llvm.experimental.gc.result.p1i64(i32 %safepoint_token1) + switch i32 %condition, label %dest_a [ + i32 0, label %dest_b + i32 1, label %dest_c + ] + +dest_a: + br label %merge + +dest_b: + br label %merge + +dest_c: + br label %merge + +merge: +; CHECK: merge: +; CHECK: %base_phi = phi i64 addrspace(1)* [ %obj2, %dest_a ], [ null, %dest_b ], [ null, %dest_c ] +; CHECK: %obj_to_consume = phi i64 addrspace(1)* [ %obj2, %dest_a ], [ null, %dest_b ], [ null, %dest_c ] + + %obj_to_consume = phi i64 addrspace(1)* [ %obj2, %dest_a ], [ null, %dest_b ], [ null, %dest_c ] + %safepoint_token3 = call i32 (void (i64 addrspace(1)*)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)* @consume_obj, i32 1, i32 0, i64 addrspace(1)* %obj_to_consume, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %merge.split + +merge.split: ; preds = %merge + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop +} + + +; Function Attrs: nounwind +declare i64 addrspace(1)* @llvm.experimental.gc.result.p1i64(i32) #0 +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) +declare i32 @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 addrspace(1)* ()*, i32, i32, ...) +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll new file mode 100644 index 0000000..8390ecd --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll @@ -0,0 +1,31 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %merged_value base %base_phi + +declare void @foo() + +define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y, i1 %runtime_condition) gc "statepoint-example" { +entry: + br i1 %runtime_condition, label %here, label %there + +here: + br label %bump + +bump: + br label %merge + +there: + %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1 + br label %merge + +merge: +; CHECK: merge: +; CHECK: %base_phi = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %base_obj_y, %there ] +; CHECK-NEXT: %merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ] + %merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ] + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + ret i64 addrspace(1)* %merged_value +} + +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) + diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll new file mode 100644 index 0000000..1d60d03 --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll @@ -0,0 +1,41 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %merged_value base %base_phi + +declare void @site_for_call_safpeoint() + +define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y, i1 %runtime_condition_x, i1 %runtime_condition_y) gc "statepoint-example" { +entry: + br i1 %runtime_condition_x, label %here, label %there + +here: + br i1 %runtime_condition_y, label %bump_here_a, label %bump_here_b + +bump_here_a: + %x_a = getelementptr i64, i64 addrspace(1)* %base_obj_x, i32 1 + br label %merge_here + +bump_here_b: + %x_b = getelementptr i64, i64 addrspace(1)* %base_obj_x, i32 2 + br label %merge_here + + +merge_here: + %x = phi i64 addrspace(1)* [ %x_a , %bump_here_a ], [ %x_b , %bump_here_b ] + br label %merge + +there: + %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1 + br label %merge + +merge: +; CHECK: merge: +; CHECK: %base_phi = phi i64 addrspace(1)* [ %base_obj_x, %merge_here ], [ %base_obj_y, %there ] +; CHECK-NEXT: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ] + %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ] + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + ret i64 addrspace(1)* %merged_value +} + +declare void @do_safepoint() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll new file mode 100644 index 0000000..e4807e6 --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll @@ -0,0 +1,53 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %merged_value base %base_phi + +declare void @site_for_call_safpeoint() + +define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x, + i64 addrspace(1)* %base_obj_y, i1 %runtime_condition_x, + i1 %runtime_condition_y) gc "statepoint-example" { +entry: + br i1 %runtime_condition_x, label %here, label %there + +here: + br i1 %runtime_condition_y, label %bump_here_a, label %bump_here_b + +bump_here_a: + %x_a = getelementptr i64, i64 addrspace(1)* %base_obj_x, i32 1 + br label %merge_here + +bump_here_b: + %x_b = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 2 + br label %merge_here + + +merge_here: +; CHECK: merge_here: +; CHECK-DAG: %base_phi +; CHECK-DAG: phi i64 addrspace(1)* +; CHECK-DAG: [ %base_obj_x, %bump_here_a ] +; CHECK-DAG: [ %base_obj_y, %bump_here_b ] + %x = phi i64 addrspace(1)* [ %x_a , %bump_here_a ], [ %x_b , %bump_here_b ] + br label %merge + +there: + %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1 + br label %merge + +merge: +; CHECK: merge: +; CHECK-DAG: %base_phi1 +; CHECK-DAG: phi i64 addrspace(1)* +; CHECK-DAG: %merge_here +; CHECK-DAG: [ %base_obj_y, %there ] +; CHECK: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ] + %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ] + + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + ret i64 addrspace(1)* %merged_value +} + +declare void @do_safepoint() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) + diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll new file mode 100644 index 0000000..488b61e --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll @@ -0,0 +1,38 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %next_element_ptr base %array_obj + +define i32 @null_in_array(i64 addrspace(1)* %array_obj) gc "statepoint-example" { +entry: + %array_len_pointer.i64 = getelementptr i64, i64 addrspace(1)* %array_obj, i32 1 + %array_len_pointer.i32 = bitcast i64 addrspace(1)* %array_len_pointer.i64 to i32 addrspace(1)* + %array_len = load i32, i32 addrspace(1)* %array_len_pointer.i32 + %array_elems = bitcast i32 addrspace(1)* %array_len_pointer.i32 to i64 addrspace(1)* addrspace(1)* + br label %loop_check + +loop_check: + %index = phi i32 [ 0, %entry ], [ %next_index, %loop_back ] + %current_element_ptr = phi i64 addrspace(1)* addrspace(1)* [ %array_elems, %entry ], [ %next_element_ptr, %loop_back ] + %index_lt = icmp ult i32 %index, %array_len + br i1 %index_lt, label %check_for_null, label %not_found + +check_for_null: + %current_element = load i64 addrspace(1)*, i64 addrspace(1)* addrspace(1)* %current_element_ptr + %is_null = icmp eq i64 addrspace(1)* %current_element, null + br i1 %is_null, label %found, label %loop_back + +loop_back: + %next_element_ptr = getelementptr i64 addrspace(1)*, i64 addrspace(1)* addrspace(1)* %current_element_ptr, i32 1 + %next_index = add i32 %index, 1 + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop_check + +not_found: + ret i32 -1 + +found: + ret i32 %index +} + +declare void @do_safepoint() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll new file mode 100644 index 0000000..c9fbcd6 --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll @@ -0,0 +1,21 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s + +; CHECK: derived %next base %base_obj + +declare i1 @runtime_value() + +define void @maybe_GEP(i64 addrspace(1)* %base_obj) gc "statepoint-example" { +entry: + br label %loop + +loop: + %current = phi i64 addrspace(1)* [ %base_obj, %entry ], [ %next, %loop ] + %condition = call i1 @runtime_value() + %maybe_next = getelementptr i64, i64 addrspace(1)* %current, i32 1 + %next = select i1 %condition, i64 addrspace(1)* %maybe_next, i64 addrspace(1)* %current + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop +} + +declare void @do_safepoint() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers.ll new file mode 100644 index 0000000..c5035eb --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/base-pointers.ll @@ -0,0 +1,98 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -S 2>&1 | FileCheck %s + +declare i64 addrspace(1)* @generate_obj() +declare void @use_obj(i64 addrspace(1)*) + +; The rewriting needs to make %obj loop variant by inserting a phi +; of the original value and it's relocation. +define void @def_use_safepoint() gc "statepoint-example" { +; CHECK-LABEL: def_use_safepoint +entry: + %obj = call i64 addrspace(1)* @generate_obj() + br label %loop + +loop: +; CHECK: phi i64 addrspace(1)* +; CHECK-DAG: [ %obj.relocated, %loop ] +; CHECK-DAG: [ %obj, %entry ] + call void @use_obj(i64 addrspace(1)* %obj) + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop +} + +declare void @do_safepoint() + +declare void @parse_point(i64 addrspace(1)*) + +define i64 addrspace(1)* @test1(i32 %caller, i8 addrspace(1)* %a, i8 addrspace(1)* %b, i32 %unknown) gc "statepoint-example" { +; CHECK-LABEL: test1 + entry: + br i1 undef, label %left, label %right + + left: + %a.cast = bitcast i8 addrspace(1)* %a to i64 addrspace(1)* +; CHECK: left: +; CHECK-NEXT: %a.cast = bitcast i8 addrspace(1)* %a to i64 addrspace(1)* +; CHECK-NEXT: [[CAST_L:%.*]] = bitcast i8 addrspace(1)* %a to i64 addrspace(1)* + +; Our safepoint placement pass calls removeUnreachableBlocks, which does a bunch +; of simplifications to branch instructions. This bug is visible only when +; there are multiple branches into the same block from the same predecessor, and +; the following ceremony is to make that artefact survive a call to +; removeUnreachableBlocks. As an example, "br i1 undef, label %merge, label %merge" +; will get simplified to "br label %merge" by removeUnreachableBlocks. + switch i32 %unknown, label %right [ i32 0, label %merge + i32 1, label %merge + i32 5, label %merge + i32 3, label %right ] + + right: + %b.cast = bitcast i8 addrspace(1)* %b to i64 addrspace(1)* + br label %merge +; CHECK: right: +; CHECK-NEXT: %b.cast = bitcast i8 addrspace(1)* %b to i64 addrspace(1)* +; CHECK-NEXT: [[CAST_R:%.*]] = bitcast i8 addrspace(1)* %b to i64 addrspace(1)* + + merge: +; CHECK: merge: +; CHECK-NEXT: %base_phi = phi i64 addrspace(1)* [ [[CAST_L]], %left ], [ [[CAST_L]], %left ], [ [[CAST_L]], %left ], [ [[CAST_R]], %right ], !is_base_value !0 + %value = phi i64 addrspace(1)* [ %a.cast, %left], [ %a.cast, %left], [ %a.cast, %left], [ %b.cast, %right] + %safepoint_token = call i32 (void (i64 addrspace(1)*)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)* @parse_point, i32 1, i32 0, i64 addrspace(1)* %value, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0) + + ret i64 addrspace(1)* %value +} + +;; The purpose of this test is to ensure that when two live values share a +;; base defining value with inherent conflicts, we end up with a *single* +;; base phi/select per such node. This is testing an optimization, not a +;; fundemental correctness criteria +define void @test2(i1 %cnd, i64 addrspace(1)* %base_obj, i64 addrspace(1)* %base_arg2) gc "statepoint-example" { +; CHECK-LABEL: @test2 +entry: + %obj = getelementptr i64, i64 addrspace(1)* %base_obj, i32 1 + br label %loop + +loop: ; preds = %loop, %entry +; CHECK-LABEL: loop +; CHECK: %base_phi = phi i64 addrspace(1)* +; CHECK-DAG: [ %base_obj, %entry ] +; CHECK-DAG: [ %base_select.relocated, %loop ] +; CHECK-NOT: base_phi2 +; CHECK: next = select +; CHECK: base_select +; CHECK: extra2 = select +; CHECK: base_select +; CHECK: statepoint +;; Both 'next' and 'extra2' are live across the backedge safepoint... + %current = phi i64 addrspace(1)* [ %obj, %entry ], [ %next, %loop ] + %extra = phi i64 addrspace(1)* [ %obj, %entry ], [ %extra2, %loop ] + %nexta = getelementptr i64, i64 addrspace(1)* %current, i32 1 + %next = select i1 %cnd, i64 addrspace(1)* %nexta, i64 addrspace(1)* %base_arg2 + %extra2 = select i1 %cnd, i64 addrspace(1)* %nexta, i64 addrspace(1)* %base_arg2 + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %loop +} + +declare void @foo() +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)*, i32, i32, ...) diff --git a/test/Transforms/RewriteStatepointsForGC/basics.ll b/test/Transforms/RewriteStatepointsForGC/basics.ll index ec522ab..c1a1e4e 100644 --- a/test/Transforms/RewriteStatepointsForGC/basics.ll +++ b/test/Transforms/RewriteStatepointsForGC/basics.ll @@ -35,14 +35,14 @@ define i8 @test3(i8 addrspace(1)* %obj) gc "statepoint-example" { ; CHECK-NEXT: gc.statepoint ; CHECK-NEXT: %derived.relocated = call coldcc i8 addrspace(1)* ; CHECK-NEXT: %obj.relocated = call coldcc i8 addrspace(1)* -; CHECK-NEXT: load i8 addrspace(1)* %derived.relocated -; CHECK-NEXT: load i8 addrspace(1)* %obj.relocated +; CHECK-NEXT: load i8, i8 addrspace(1)* %derived.relocated +; CHECK-NEXT: load i8, i8 addrspace(1)* %obj.relocated entry: - %derived = getelementptr i8 addrspace(1)* %obj, i64 10 + %derived = getelementptr i8, i8 addrspace(1)* %obj, i64 10 call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) - %a = load i8 addrspace(1)* %derived - %b = load i8 addrspace(1)* %obj + %a = load i8, i8 addrspace(1)* %derived + %b = load i8, i8 addrspace(1)* %obj %c = sub i8 %a, %b ret i8 %c } diff --git a/test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll b/test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll new file mode 100644 index 0000000..b2dc2a1 --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll @@ -0,0 +1,33 @@ +;; RUN: opt -rewrite-statepoints-for-gc -verify -S < %s | FileCheck %s + +;; This test is to verify that RewriteStatepointsForGC correctly relocates values +;; defined by invoke instruction results. + +declare i64* addrspace(1)* @non_gc_call() + +declare void @gc_call() + +declare i32* @fake_personality_function() + +; Function Attrs: nounwind +define i64* addrspace(1)* @test() gc "statepoint-example" { +entry: + %obj = invoke i64* addrspace(1)* @non_gc_call() + to label %normal_dest unwind label %unwind_dest + +unwind_dest: + %lpad = landingpad { i8*, i32 } personality i32* ()* @fake_personality_function + cleanup + resume { i8*, i32 } undef + +normal_dest: +;; CHECK-LABEL: normal_dest: +;; CHECK-NEXT: gc.statepoint +;; CHECK-NEXT: %obj.relocated = call coldcc i64* addrspace(1)* + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @gc_call, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + ret i64* addrspace(1)* %obj +} + +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) + + diff --git a/test/Transforms/RewriteStatepointsForGC/relocation.ll b/test/Transforms/RewriteStatepointsForGC/relocation.ll new file mode 100644 index 0000000..c3bda3d --- /dev/null +++ b/test/Transforms/RewriteStatepointsForGC/relocation.ll @@ -0,0 +1,295 @@ +; RUN: opt %s -rewrite-statepoints-for-gc -S 2>&1 | FileCheck %s + + +declare void @foo() +declare void @use(...) + +define i64 addrspace(1)* @test1(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj2, i1 %condition) gc "statepoint-example" { +entry: +; CHECK-LABEL: @test1 +; CHECK-DAG: %obj.relocated +; CHECK-DAG: %obj2.relocated + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0) + br label %joint + +joint: +; CHECK-LABEL: joint: +; CHECK: %phi1 = phi i64 addrspace(1)* [ %obj.relocated, %entry ], [ %obj3, %joint2 ] + %phi1 = phi i64 addrspace(1)* [ %obj, %entry ], [ %obj3, %joint2 ] + br i1 %condition, label %use, label %joint2 + +use: + br label %joint2 + +joint2: +; CHECK-LABEL: joint2: +; CHECK: %phi2 = phi i64 addrspace(1)* [ %obj.relocated, %use ], [ %obj2.relocated, %joint ] +; CHECK: %obj3 = getelementptr i64, i64 addrspace(1)* %obj2.relocated, i32 1 + %phi2 = phi i64 addrspace(1)* [ %obj, %use ], [ %obj2, %joint ] + %obj3 = getelementptr i64, i64 addrspace(1)* %obj2, i32 1 + br label %joint +} + +declare i64 addrspace(1)* @generate_obj() + +declare void @consume_obj(i64 addrspace(1)*) + +declare i1 @rt() + +define void @test2() gc "statepoint-example" { +; CHECK-LABEL: @test2 +entry: + %obj_init = call i64 addrspace(1)* @generate_obj() + %obj = getelementptr i64, i64 addrspace(1)* %obj_init, i32 42 + br label %loop + +loop: +; CHECK: loop: +; CHECK-DAG: [ %obj_init.relocated, %loop.backedge ] +; CHECK-DAG: [ %obj_init, %entry ] +; CHECK-DAG: [ %obj.relocated, %loop.backedge ] +; CHECK-DAG: [ %obj, %entry ] + %index = phi i32 [ 0, %entry ], [ %index.inc, %loop.backedge ] +; CHECK-NOT: %location = getelementptr i64, i64 addrspace(1)* %obj, i32 %index + %location = getelementptr i64, i64 addrspace(1)* %obj, i32 %index + call void @consume_obj(i64 addrspace(1)* %location) + %index.inc = add i32 %index, 1 + %condition = call i1 @rt() + br i1 %condition, label %loop_x, label %loop_y + +loop_x: + br label %loop.backedge + +loop.backedge: + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0) + br label %loop + +loop_y: + br label %loop.backedge +} + +declare void @some_call(i8 addrspace(1)*) + +define void @relocate_merge(i1 %cnd, i8 addrspace(1)* %arg) gc "statepoint-example" { +; CHECK-LABEL: @relocate_merge +bci_0: + br i1 %cnd, label %if_branch, label %else_branch + +if_branch: +; CHECK-LABEL: if_branch: +; CHECK: gc.statepoint +; CHECK: gc.relocate + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0) + br label %join + +else_branch: +; CHECK-LABEL: else_branch: +; CHECK: gc.statepoint +; CHECK: gc.relocate + %safepoint_token1 = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0) + br label %join + +join: +; We need to end up with a single relocation phi updated from both paths +; CHECK-LABEL: join: +; CHECK: phi i8 addrspace(1)* +; CHECK-DAG: [ %arg.relocated, %if_branch ] +; CHECK-DAG: [ %arg.relocated4, %else_branch ] +; CHECK-NOT: phi + call void (i8 addrspace(1)*)* @some_call(i8 addrspace(1)* %arg) + ret void +} + +; Make sure a use in a statepoint gets properly relocated at a previous one. +; This is basically just making sure that statepoints aren't accidentally +; treated specially. +define void @test3(i64 addrspace(1)* %obj) gc "statepoint-example" { +entry: +; CHECK-LABEL: @test3 +; CHECK: gc.statepoint +; CHECK-NEXT: gc.relocate +; CHECK-NEXT: gc.statepoint + %safepoint_token = call i32 (void (i64)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidi64f(void (i64)* undef, i32 1, i32 0, i64 undef, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + %safepoint_token1 = call i32 (i32 (i64 addrspace(1)*)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i32p1i64f(i32 (i64 addrspace(1)*)* undef, i32 1, i32 0, i64 addrspace(1)* %obj, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + ret void +} + +; Check specifically for the case where the result of a statepoint needs to +; be relocated itself +define void @test4() gc "statepoint-example" { +; CHECK-LABEL: @test4 +; CHECK: gc.statepoint +; CHECK: gc.result +; CHECK: gc.statepoint +; CHECK: gc.relocate +; CHECK: @use(i8 addrspace(1)* %res.relocated) + %safepoint_token2 = tail call i32 (i8 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0) + %res = call i8 addrspace(1)* @llvm.experimental.gc.result.ptr.p1i8(i32 %safepoint_token2) + call i32 (i8 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0) + call void (...)* @use(i8 addrspace(1)* %res) + unreachable +} + + +; Test updating a phi where not all inputs are live to begin with +define void @test5(i8 addrspace(1)* %arg) gc "statepoint-example" { +; CHECK-LABEL: test5 +entry: + call i32 (i8 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0) + switch i32 undef, label %kill [ + i32 10, label %merge + i32 13, label %merge + ] + +kill: + br label %merge + +merge: +; CHECK: merge: +; CHECK: %test = phi i8 addrspace(1) +; CHECK-DAG: [ null, %kill ] +; CHECK-DAG: [ %arg.relocated, %entry ] +; CHECK-DAG: [ %arg.relocated, %entry ] + %test = phi i8 addrspace(1)* [ null, %kill ], [ %arg, %entry ], [ %arg, %entry ] + call void (...)* @use(i8 addrspace(1)* %test) + unreachable +} + + +; Check to make sure we handle values live over an entry statepoint +define void @test6(i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, + i8 addrspace(1)* %arg3) gc "statepoint-example" { +; CHECK-LABEL: @test6 +entry: + br i1 undef, label %gc.safepoint_poll.exit2, label %do_safepoint + +do_safepoint: +; CHECK-LABEL: do_safepoint: +; CHECK: gc.statepoint +; CHECK: arg1.relocated = +; CHECK: arg2.relocated = +; CHECK: arg3.relocated = + call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 3, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, i8 addrspace(1)* %arg3) + br label %gc.safepoint_poll.exit2 + +gc.safepoint_poll.exit2: +; CHECK-LABEL: gc.safepoint_poll.exit2: +; CHECK: phi i8 addrspace(1)* +; CHECK-DAG: [ %arg3, %entry ] +; CHECK-DAG: [ %arg3.relocated, %do_safepoint ] +; CHECK: phi i8 addrspace(1)* +; CHECK-DAG: [ %arg2, %entry ] +; CHECK-DAG: [ %arg2.relocated, %do_safepoint ] +; CHECK: phi i8 addrspace(1)* +; CHECK-DAG: [ %arg1, %entry ] +; CHECK-DAG: [ %arg1.relocated, %do_safepoint ] + call void (...)* @use(i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, i8 addrspace(1)* %arg3) + ret void +} + +; Check relocation in a loop nest where a relocation happens in the outer +; but not the inner loop +define void @test_outer_loop(i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, + i1 %cmp) gc "statepoint-example" { +; CHECK-LABEL: @test_outer_loop +bci_0: + br label %outer-loop + +outer-loop: +; CHECK-LABEL: outer-loop: +; CHECK: phi i8 addrspace(1)* [ %arg2, %bci_0 ], [ %arg2.relocated, %outer-inc ] +; CHECK: phi i8 addrspace(1)* [ %arg1, %bci_0 ], [ %arg1.relocated, %outer-inc ] + br label %inner-loop + +inner-loop: + br i1 %cmp, label %inner-loop, label %outer-inc + +outer-inc: +; CHECK-LABEL: outer-inc: +; CHECK: %arg1.relocated +; CHECK: %arg2.relocated + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 2, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2) + br label %outer-loop +} + +; Check that both inner and outer loops get phis when relocation is in +; inner loop +define void @test_inner_loop(i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, + i1 %cmp) gc "statepoint-example" { +; CHECK-LABEL: @test_inner_loop +bci_0: + br label %outer-loop + +outer-loop: +; CHECK-LABEL: outer-loop: +; CHECK: phi i8 addrspace(1)* [ %arg2, %bci_0 ], [ %arg2.relocated, %outer-inc ] +; CHECK: phi i8 addrspace(1)* [ %arg1, %bci_0 ], [ %arg1.relocated, %outer-inc ] + br label %inner-loop + +inner-loop: +; CHECK-LABEL: inner-loop +; CHECK: phi i8 addrspace(1)* +; CHECK-DAG: %outer-loop ] +; CHECK-DAG: [ %arg2.relocated, %inner-loop ] +; CHECKL phi i8 addrspace(1)* +; CHECK-DAG: %outer-loop ] +; CHECK-DAG: [ %arg1.relocated, %inner-loop ] +; CHECK: gc.statepoint +; CHECK: %arg1.relocated +; CHECK: %arg2.relocated + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 2, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2) + br i1 %cmp, label %inner-loop, label %outer-inc + +outer-inc: +; CHECK-LABEL: outer-inc: + br label %outer-loop +} + + +; This test shows why updating just those uses of the original value being +; relocated dominated by the inserted relocation is not always sufficient. +define i64 addrspace(1)* @test7(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj2, i1 %condition) gc "statepoint-example" { +; CHECK-LABEL: @test7 +entry: + br i1 %condition, label %branch2, label %join + +branch2: + br i1 %condition, label %callbb, label %join2 + +callbb: + %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0) + br label %join + +join: +; CHECK-LABEL: join: +; CHECK: phi i64 addrspace(1)* [ %obj.relocated, %callbb ], [ %obj, %entry ] +; CHECK: phi i64 addrspace(1)* +; CHECK-DAG: [ %obj, %entry ] +; CHECK-DAG: [ %obj2.relocated, %callbb ] + ; This is a phi outside the dominator region of the new defs inserted by + ; the safepoint, BUT we can't stop the search here or we miss the second + ; phi below. + %phi1 = phi i64 addrspace(1)* [ %obj, %entry ], [ %obj2, %callbb ] + br label %join2 + +join2: +; CHECK-LABEL: join2: +; CHECK: phi2 = phi i64 addrspace(1)* +; CHECK-DAG: %join ] +; CHECK-DAG: [ %obj2, %branch2 ] + %phi2 = phi i64 addrspace(1)* [ %obj, %join ], [ %obj2, %branch2 ] + ret i64 addrspace(1)* %phi2 +} + + +declare void @do_safepoint() + +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...) +declare i32 @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()*, i32, i32, ...) +declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidi64f(void (i64)*, i32, i32, ...) +declare i32 @llvm.experimental.gc.statepoint.p0f_i32p1i64f(i32 (i64 addrspace(1)*)*, i32, i32, ...) +declare i8 addrspace(1)* @llvm.experimental.gc.result.ptr.p1i8(i32) #3 + + + + diff --git a/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll b/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll index 6aaf33e..7b88a66 100644 --- a/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll +++ b/test/Transforms/SCCP/2002-08-30-GetElementPtrTest.ll @@ -3,7 +3,7 @@ @G = external global [40 x i32] ; <[40 x i32]*> [#uses=1] define i32* @test() { - %X = getelementptr [40 x i32]* @G, i64 0, i64 0 ; <i32*> [#uses=1] + %X = getelementptr [40 x i32], [40 x i32]* @G, i64 0, i64 0 ; <i32*> [#uses=1] ret i32* %X } diff --git a/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll b/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll index 576f5d6..e5a1d679 100644 --- a/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll +++ b/test/Transforms/SCCP/2003-06-24-OverdefinedPHIValue.ll @@ -3,7 +3,7 @@ define void @cprop_test11(i32* %data.1) { entry: - %tmp.1 = load i32* %data.1 ; <i32> [#uses=3] + %tmp.1 = load i32, i32* %data.1 ; <i32> [#uses=3] %tmp.41 = icmp sgt i32 %tmp.1, 1 ; <i1> [#uses=1] br i1 %tmp.41, label %no_exit, label %loopexit no_exit: ; preds = %endif, %then, %entry @@ -22,9 +22,9 @@ endif: ; preds = %no_exit loopexit: ; preds = %endif, %then, %entry %j.1 = phi i32 [ 1, %entry ], [ %j.0, %endif ], [ %i.0, %then ] ; <i32> [#uses=1] %i.1 = phi i32 [ 1, %entry ], [ %inc, %endif ], [ %inc1, %then ] ; <i32> [#uses=1] - %tmp.17 = getelementptr i32* %data.1, i64 1 ; <i32*> [#uses=1] + %tmp.17 = getelementptr i32, i32* %data.1, i64 1 ; <i32*> [#uses=1] store i32 %j.1, i32* %tmp.17 - %tmp.23 = getelementptr i32* %data.1, i64 2 ; <i32*> [#uses=1] + %tmp.23 = getelementptr i32, i32* %data.1, i64 2 ; <i32*> [#uses=1] store i32 %i.1, i32* %tmp.23 ret void } diff --git a/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll b/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll index 47f9cb4..9724e6e 100644 --- a/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll +++ b/test/Transforms/SCCP/2006-10-23-IPSCCP-Crash.ll @@ -37,7 +37,7 @@ cond_next50: ; preds = %entry %tmp52 = icmp sgt i32 %D, 0 ; <i1> [#uses=1] br i1 %tmp52, label %cond_true53, label %cond_next71 cond_true53: ; preds = %cond_next50 - %tmp54 = load i32* @JUMP ; <i32> [#uses=1] + %tmp54 = load i32, i32* @JUMP ; <i32> [#uses=1] %tmp55 = icmp eq i32 %tmp54, 1 ; <i1> [#uses=1] br i1 %tmp55, label %cond_true56, label %cond_next63 cond_true56: ; preds = %cond_true53 @@ -67,9 +67,9 @@ bb217: ; preds = %cond_true260 ret void cond_next252: ; preds = %cond_next208, %entry %D.0.0 = phi i32 [ 0, %entry ], [ %tmp229, %cond_next208 ] ; <i32> [#uses=1] - %tmp254 = getelementptr i8** null, i32 1 ; <i8**> [#uses=1] - %tmp256 = load i8** %tmp254 ; <i8*> [#uses=1] - %tmp258 = load i8* %tmp256 ; <i8> [#uses=1] + %tmp254 = getelementptr i8*, i8** null, i32 1 ; <i8**> [#uses=1] + %tmp256 = load i8*, i8** %tmp254 ; <i8*> [#uses=1] + %tmp258 = load i8, i8* %tmp256 ; <i8> [#uses=1] %tmp259 = icmp eq i8 %tmp258, 45 ; <i1> [#uses=1] br i1 %tmp259, label %cond_true260, label %bb263 cond_true260: ; preds = %cond_next252 diff --git a/test/Transforms/SCCP/2006-12-04-PackedType.ll b/test/Transforms/SCCP/2006-12-04-PackedType.ll index cee3349..05cf5ff 100644 --- a/test/Transforms/SCCP/2006-12-04-PackedType.ll +++ b/test/Transforms/SCCP/2006-12-04-PackedType.ll @@ -103,14 +103,14 @@ target triple = "powerpc-apple-darwin8" define void @gldLLVMVecPointRender(%struct.GLDContextRec* %ctx) { entry: - %tmp.uip = getelementptr %struct.GLDContextRec* %ctx, i32 0, i32 22 ; <i32*> [#uses=1] - %tmp = load i32* %tmp.uip ; <i32> [#uses=3] + %tmp.uip = getelementptr %struct.GLDContextRec, %struct.GLDContextRec* %ctx, i32 0, i32 22 ; <i32*> [#uses=1] + %tmp = load i32, i32* %tmp.uip ; <i32> [#uses=3] %tmp91 = lshr i32 %tmp, 5 ; <i32> [#uses=1] %tmp92 = trunc i32 %tmp91 to i1 ; <i1> [#uses=1] br i1 %tmp92, label %cond_true93, label %cond_next116 cond_true93: ; preds = %entry - %tmp.upgrd.1 = getelementptr %struct.GLDContextRec* %ctx, i32 0, i32 31, i32 14 ; <i32*> [#uses=1] - %tmp95 = load i32* %tmp.upgrd.1 ; <i32> [#uses=1] + %tmp.upgrd.1 = getelementptr %struct.GLDContextRec, %struct.GLDContextRec* %ctx, i32 0, i32 31, i32 14 ; <i32*> [#uses=1] + %tmp95 = load i32, i32* %tmp.upgrd.1 ; <i32> [#uses=1] %tmp95.upgrd.2 = sitofp i32 %tmp95 to float ; <float> [#uses=1] %tmp108 = fmul float undef, %tmp95.upgrd.2 ; <float> [#uses=1] br label %cond_next116 diff --git a/test/Transforms/SCCP/apint-array.ll b/test/Transforms/SCCP/apint-array.ll index 888b9e1..eff6cc9 100644 --- a/test/Transforms/SCCP/apint-array.ll +++ b/test/Transforms/SCCP/apint-array.ll @@ -6,16 +6,16 @@ define i101 @array() { Head: - %A = getelementptr [6 x i101]* @Y, i32 0, i32 1 + %A = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 1 - %B = load i101* %A + %B = load i101, i101* %A %C = icmp sge i101 %B, 1 br i1 %C, label %True, label %False True: %D = and i101 %B, 1 %E = trunc i101 %D to i32 - %F = getelementptr [6 x i101]* @Y, i32 0, i32 %E - %G = load i101* %F + %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 %E + %G = load i101, i101* %F br label %False False: %H = phi i101 [%G, %True], [-1, %Head] diff --git a/test/Transforms/SCCP/apint-bigarray.ll b/test/Transforms/SCCP/apint-bigarray.ll index 0dd9ad3..e023199 100644 --- a/test/Transforms/SCCP/apint-bigarray.ll +++ b/test/Transforms/SCCP/apint-bigarray.ll @@ -3,7 +3,7 @@ @G = global [1000000 x i10000] zeroinitializer define internal i10000* @test(i10000 %Arg) { - %X = getelementptr [1000000 x i10000]* @G, i32 0, i32 999 + %X = getelementptr [1000000 x i10000], [1000000 x i10000]* @G, i32 0, i32 999 store i10000 %Arg, i10000* %X ret i10000* %X } @@ -11,13 +11,13 @@ define internal i10000* @test(i10000 %Arg) { define i10000 @caller() { %Y = call i10000* @test(i10000 -1) - %Z = load i10000* %Y + %Z = load i10000, i10000* %Y ret i10000 %Z } define i10000 @caller2() { %Y = call i10000* @test(i10000 1) - %Z = load i10000* %Y + %Z = load i10000, i10000* %Y ret i10000 %Z } diff --git a/test/Transforms/SCCP/apint-bigint2.ll b/test/Transforms/SCCP/apint-bigint2.ll index 660eaad..f28b966 100644 --- a/test/Transforms/SCCP/apint-bigint2.ll +++ b/test/Transforms/SCCP/apint-bigint2.ll @@ -6,13 +6,13 @@ define i101 @array() { Head: - %A = getelementptr [6 x i101]* @Y, i32 0, i32 1 - %B = load i101* %A + %A = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 1 + %B = load i101, i101* %A %D = and i101 %B, 1 %DD = or i101 %D, 1 %E = trunc i101 %DD to i32 - %F = getelementptr [6 x i101]* @Y, i32 0, i32 %E - %G = load i101* %F + %F = getelementptr [6 x i101], [6 x i101]* @Y, i32 0, i32 %E + %G = load i101, i101* %F ret i101 %G } diff --git a/test/Transforms/SCCP/apint-ipsccp3.ll b/test/Transforms/SCCP/apint-ipsccp3.ll index 68987ae..c99ae58 100644 --- a/test/Transforms/SCCP/apint-ipsccp3.ll +++ b/test/Transforms/SCCP/apint-ipsccp3.ll @@ -5,13 +5,13 @@ define void @foo() { - %X = load i66* @G + %X = load i66, i66* @G store i66 %X, i66* @G ret void } define i66 @bar() { - %V = load i66* @G + %V = load i66, i66* @G %C = icmp eq i66 %V, 17 br i1 %C, label %T, label %F T: diff --git a/test/Transforms/SCCP/apint-ipsccp4.ll b/test/Transforms/SCCP/apint-ipsccp4.ll index 75875ff..be06d03 100644 --- a/test/Transforms/SCCP/apint-ipsccp4.ll +++ b/test/Transforms/SCCP/apint-ipsccp4.ll @@ -9,14 +9,14 @@ { i212, float } { i212 37, float 2.0 } ] define internal float @test2() { - %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1 - %B = load float* %A + %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1 + %B = load float, float* %A ret float %B } define internal float @test3() { - %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 0, i32 1 - %B = load float* %A + %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 0, i32 1 + %B = load float, float* %A ret float %B } diff --git a/test/Transforms/SCCP/apint-load.ll b/test/Transforms/SCCP/apint-load.ll index 56fdb35..17506fc 100644 --- a/test/Transforms/SCCP/apint-load.ll +++ b/test/Transforms/SCCP/apint-load.ll @@ -7,19 +7,19 @@ @Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, { i212, float } { i212 37, float 0x3FF3B2FEC0000000 } ] define i212 @test1() { - %B = load i212* @X + %B = load i212, i212* @X ret i212 %B } define internal float @test2() { - %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1 - %B = load float* %A + %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1 + %B = load float, float* %A ret float %B } define internal i212 @test3() { - %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 0, i32 0 - %B = load i212* %A + %A = getelementptr [2 x { i212, float}], [2 x { i212, float}]* @Y, i32 0, i32 0, i32 0 + %B = load i212, i212* %A ret i212 %B } diff --git a/test/Transforms/SCCP/apint-select.ll b/test/Transforms/SCCP/apint-select.ll index c797519..893331e 100644 --- a/test/Transforms/SCCP/apint-select.ll +++ b/test/Transforms/SCCP/apint-select.ll @@ -3,7 +3,7 @@ @A = constant i32 10 define i712 @test1() { - %P = getelementptr i32* @A, i32 0 + %P = getelementptr i32, i32* @A, i32 0 %B = ptrtoint i32* %P to i64 %BB = and i64 %B, undef %C = icmp sge i64 %BB, 0 diff --git a/test/Transforms/SCCP/atomic-load-store.ll b/test/Transforms/SCCP/atomic-load-store.ll index 53e4c10..45b5d7c 100644 --- a/test/Transforms/SCCP/atomic-load-store.ll +++ b/test/Transforms/SCCP/atomic-load-store.ll @@ -6,7 +6,7 @@ @C = internal constant i32 222 define i32 @test1() { - %V = load atomic i32* @G seq_cst, align 4 + %V = load atomic i32, i32* @G seq_cst, align 4 %C = icmp eq i32 %V, 17 br i1 %C, label %T, label %F T: @@ -21,7 +21,7 @@ F: ; CHECK: ret i32 17 define i32 @test2() { - %V = load atomic i32* @C seq_cst, align 4 + %V = load atomic i32, i32* @C seq_cst, align 4 ret i32 %V } diff --git a/test/Transforms/SCCP/ipsccp-basic.ll b/test/Transforms/SCCP/ipsccp-basic.ll index 107b7af..c74063f 100644 --- a/test/Transforms/SCCP/ipsccp-basic.ll +++ b/test/Transforms/SCCP/ipsccp-basic.ll @@ -50,7 +50,7 @@ define i32 @test2b() { @G = internal global i32 undef define void @test3a() { - %X = load i32* @G + %X = load i32, i32* @G store i32 %X, i32* @G ret void } @@ -59,7 +59,7 @@ define void @test3a() { define i32 @test3b() { - %V = load i32* @G + %V = load i32, i32* @G %C = icmp eq i32 %V, 17 br i1 %C, label %T, label %F T: @@ -203,7 +203,7 @@ define void @test8b(i32* %P) { define void @test9() { entry: %local_foo = alloca { } - load { }* @test9g + load { }, { }* @test9g store { } %0, { }* %local_foo ret void } diff --git a/test/Transforms/SCCP/loadtest.ll b/test/Transforms/SCCP/loadtest.ll index dd1dba6..b88b44b 100644 --- a/test/Transforms/SCCP/loadtest.ll +++ b/test/Transforms/SCCP/loadtest.ll @@ -10,25 +10,25 @@ @Y = constant [2 x { i32, float }] [ { i32, float } { i32 12, float 1.000000e+00 }, { i32, float } { i32 37, float 0x3FF3B2FEC0000000 } ] ; <[2 x { i32, float }]*> [#uses=2] define i32 @test1() { - %B = load i32* @X ; <i32> [#uses=1] + %B = load i32, i32* @X ; <i32> [#uses=1] ret i32 %B } define float @test2() { - %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; <float*> [#uses=1] - %B = load float* %A ; <float> [#uses=1] + %A = getelementptr [2 x { i32, float }], [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; <float*> [#uses=1] + %B = load float, float* %A ; <float> [#uses=1] ret float %B } define i32 @test3() { - %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1] - %B = load i32* %A + %A = getelementptr [2 x { i32, float }], [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1] + %B = load i32, i32* %A ret i32 %B } define i8 @test4() { %A = bitcast i32* @X to i8* - %B = load i8* %A + %B = load i8, i8* %A ret i8 %B } diff --git a/test/Transforms/SLPVectorizer/AArch64/commute.ll b/test/Transforms/SLPVectorizer/AArch64/commute.ll index 4ee91a5..1cff73d 100644 --- a/test/Transforms/SLPVectorizer/AArch64/commute.ll +++ b/test/Transforms/SLPVectorizer/AArch64/commute.ll @@ -6,10 +6,10 @@ target triple = "aarch64--linux-gnu" define void @test1(%structA* nocapture readonly %J, i32 %xmin, i32 %ymin) { ; CHECK-LABEL: test1 -; CHECK: %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 -; CHECK: %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 +; CHECK: %arrayidx4 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 0 +; CHECK: %arrayidx9 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 1 ; CHECK: %3 = bitcast float* %arrayidx4 to <2 x float>* -; CHECK: %4 = load <2 x float>* %3, align 4 +; CHECK: %4 = load <2 x float>, <2 x float>* %3, align 4 ; CHECK: %5 = fsub fast <2 x float> %2, %4 ; CHECK: %6 = fmul fast <2 x float> %5, %5 ; CHECK: %7 = extractelement <2 x float> %6, i32 0 @@ -23,11 +23,11 @@ entry: for.body3.lr.ph: %conv5 = sitofp i32 %ymin to float %conv = sitofp i32 %xmin to float - %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 - %0 = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 0 + %0 = load float, float* %arrayidx4, align 4 %sub = fsub fast float %conv, %0 - %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 - %1 = load float* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 1 + %1 = load float, float* %arrayidx9, align 4 %sub10 = fsub fast float %conv5, %1 %mul11 = fmul fast float %sub, %sub %mul12 = fmul fast float %sub10, %sub10 @@ -41,10 +41,10 @@ for.end27: define void @test2(%structA* nocapture readonly %J, i32 %xmin, i32 %ymin) { ; CHECK-LABEL: test2 -; CHECK: %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 -; CHECK: %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 +; CHECK: %arrayidx4 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 0 +; CHECK: %arrayidx9 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 1 ; CHECK: %3 = bitcast float* %arrayidx4 to <2 x float>* -; CHECK: %4 = load <2 x float>* %3, align 4 +; CHECK: %4 = load <2 x float>, <2 x float>* %3, align 4 ; CHECK: %5 = fsub fast <2 x float> %2, %4 ; CHECK: %6 = fmul fast <2 x float> %5, %5 ; CHECK: %7 = extractelement <2 x float> %6, i32 0 @@ -58,11 +58,11 @@ entry: for.body3.lr.ph: %conv5 = sitofp i32 %ymin to float %conv = sitofp i32 %xmin to float - %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 - %0 = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 0 + %0 = load float, float* %arrayidx4, align 4 %sub = fsub fast float %conv, %0 - %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 - %1 = load float* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds %structA, %structA* %J, i64 0, i32 0, i64 1 + %1 = load float, float* %arrayidx9, align 4 %sub10 = fsub fast float %conv5, %1 %mul11 = fmul fast float %sub, %sub %mul12 = fmul fast float %sub10, %sub10 diff --git a/test/Transforms/SLPVectorizer/AArch64/load-store-q.ll b/test/Transforms/SLPVectorizer/AArch64/load-store-q.ll index 45fa2f9..6ff1118 100644 --- a/test/Transforms/SLPVectorizer/AArch64/load-store-q.ll +++ b/test/Transforms/SLPVectorizer/AArch64/load-store-q.ll @@ -13,10 +13,10 @@ target triple = "arm64-apple-ios5.0.0" ; CHECK: store double ; CHECK: store double define void @f(double* %p, double* %q) { - %addr2 = getelementptr double* %q, i32 1 - %addr = getelementptr double* %p, i32 1 - %x = load double* %p - %y = load double* %addr + %addr2 = getelementptr double, double* %q, i32 1 + %addr = getelementptr double, double* %p, i32 1 + %x = load double, double* %p + %y = load double, double* %addr call void @g() store double %x, double* %q store double %y, double* %addr2 @@ -35,12 +35,12 @@ entry: loop: %p1 = phi double [0.0, %entry], [%x, %loop] %p2 = phi double [0.0, %entry], [%y, %loop] - %addr2 = getelementptr double* %q, i32 1 - %addr = getelementptr double* %p, i32 1 + %addr2 = getelementptr double, double* %q, i32 1 + %addr = getelementptr double, double* %p, i32 1 store double %p1, double* %q store double %p2, double* %addr2 - %x = load double* %p - %y = load double* %addr + %x = load double, double* %p + %y = load double, double* %addr br label %loop } diff --git a/test/Transforms/SLPVectorizer/AArch64/sdiv-pow2.ll b/test/Transforms/SLPVectorizer/AArch64/sdiv-pow2.ll index e49c7ad..72c7082 100644 --- a/test/Transforms/SLPVectorizer/AArch64/sdiv-pow2.ll +++ b/test/Transforms/SLPVectorizer/AArch64/sdiv-pow2.ll @@ -9,34 +9,34 @@ target triple = "aarch64--linux-gnu" define void @test1(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32* noalias nocapture readonly %c) { entry: - %0 = load i32* %b, align 4 - %1 = load i32* %c, align 4 + %0 = load i32, i32* %b, align 4 + %1 = load i32, i32* %c, align 4 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 store i32 %div, i32* %a, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 1 - %2 = load i32* %arrayidx3, align 4 - %arrayidx4 = getelementptr inbounds i32* %c, i64 1 - %3 = load i32* %arrayidx4, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 1 + %2 = load i32, i32* %arrayidx3, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %c, i64 1 + %3 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %3, %2 %div6 = sdiv i32 %add5, 2 - %arrayidx7 = getelementptr inbounds i32* %a, i64 1 + %arrayidx7 = getelementptr inbounds i32, i32* %a, i64 1 store i32 %div6, i32* %arrayidx7, align 4 - %arrayidx8 = getelementptr inbounds i32* %b, i64 2 - %4 = load i32* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds i32* %c, i64 2 - %5 = load i32* %arrayidx9, align 4 + %arrayidx8 = getelementptr inbounds i32, i32* %b, i64 2 + %4 = load i32, i32* %arrayidx8, align 4 + %arrayidx9 = getelementptr inbounds i32, i32* %c, i64 2 + %5 = load i32, i32* %arrayidx9, align 4 %add10 = add nsw i32 %5, %4 %div11 = sdiv i32 %add10, 2 - %arrayidx12 = getelementptr inbounds i32* %a, i64 2 + %arrayidx12 = getelementptr inbounds i32, i32* %a, i64 2 store i32 %div11, i32* %arrayidx12, align 4 - %arrayidx13 = getelementptr inbounds i32* %b, i64 3 - %6 = load i32* %arrayidx13, align 4 - %arrayidx14 = getelementptr inbounds i32* %c, i64 3 - %7 = load i32* %arrayidx14, align 4 + %arrayidx13 = getelementptr inbounds i32, i32* %b, i64 3 + %6 = load i32, i32* %arrayidx13, align 4 + %arrayidx14 = getelementptr inbounds i32, i32* %c, i64 3 + %7 = load i32, i32* %arrayidx14, align 4 %add15 = add nsw i32 %7, %6 %div16 = sdiv i32 %add15, 2 - %arrayidx17 = getelementptr inbounds i32* %a, i64 3 + %arrayidx17 = getelementptr inbounds i32, i32* %a, i64 3 store i32 %div16, i32* %arrayidx17, align 4 ret void } diff --git a/test/Transforms/SLPVectorizer/ARM/memory.ll b/test/Transforms/SLPVectorizer/ARM/memory.ll index 383c808..57d7cce 100644 --- a/test/Transforms/SLPVectorizer/ARM/memory.ll +++ b/test/Transforms/SLPVectorizer/ARM/memory.ll @@ -10,11 +10,11 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64- ; CHECK-NOT: store <2 x double> define void @expensive_double_store(double* noalias %dst, double* noalias %src, i64 %count) { entry: - %0 = load double* %src, align 8 + %0 = load double, double* %src, align 8 store double %0, double* %dst, align 8 - %arrayidx2 = getelementptr inbounds double* %src, i64 1 - %1 = load double* %arrayidx2, align 8 - %arrayidx3 = getelementptr inbounds double* %dst, i64 1 + %arrayidx2 = getelementptr inbounds double, double* %src, i64 1 + %1 = load double, double* %arrayidx2, align 8 + %arrayidx3 = getelementptr inbounds double, double* %dst, i64 1 store double %1, double* %arrayidx3, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/ARM/sroa.ll b/test/Transforms/SLPVectorizer/ARM/sroa.ll index 899cfb1..65e0260 100644 --- a/test/Transforms/SLPVectorizer/ARM/sroa.ll +++ b/test/Transforms/SLPVectorizer/ARM/sroa.ll @@ -44,9 +44,9 @@ entry: %3 = bitcast i64 %b.sroa.3.12.insert.insert to double %add = fadd double %0, %2 %add3 = fadd double %1, %3 - %re.i.i = getelementptr inbounds %class.Complex* %agg.result, i32 0, i32 0 + %re.i.i = getelementptr inbounds %class.Complex, %class.Complex* %agg.result, i32 0, i32 0 store double %add, double* %re.i.i, align 4 - %im.i.i = getelementptr inbounds %class.Complex* %agg.result, i32 0, i32 1 + %im.i.i = getelementptr inbounds %class.Complex, %class.Complex* %agg.result, i32 0, i32 1 store double %add3, double* %im.i.i, align 4 ret void } diff --git a/test/Transforms/SLPVectorizer/R600/simplebb.ll b/test/Transforms/SLPVectorizer/R600/simplebb.ll index b6d794b..9ed86f8 100644 --- a/test/Transforms/SLPVectorizer/R600/simplebb.ll +++ b/test/Transforms/SLPVectorizer/R600/simplebb.ll @@ -6,60 +6,60 @@ target datalayout = "e-p:32:32:32-p3:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32- ; Simple 3-pair chain with loads and stores define void @test1_as_3_3_3(double addrspace(3)* %a, double addrspace(3)* %b, double addrspace(3)* %c) { ; CHECK-LABEL: @test1_as_3_3_3( -; CHECK: load <2 x double> addrspace(3)* -; CHECK: load <2 x double> addrspace(3)* +; CHECK: load <2 x double>, <2 x double> addrspace(3)* +; CHECK: load <2 x double>, <2 x double> addrspace(3)* ; CHECK: store <2 x double> %{{.*}}, <2 x double> addrspace(3)* % ; CHECK: ret - %i0 = load double addrspace(3)* %a, align 8 - %i1 = load double addrspace(3)* %b, align 8 + %i0 = load double, double addrspace(3)* %a, align 8 + %i1 = load double, double addrspace(3)* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double addrspace(3)* %a, i64 1 - %i3 = load double addrspace(3)* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double addrspace(3)* %b, i64 1 - %i4 = load double addrspace(3)* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double addrspace(3)* %a, i64 1 + %i3 = load double, double addrspace(3)* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double addrspace(3)* %b, i64 1 + %i4 = load double, double addrspace(3)* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double addrspace(3)* %c, align 8 - %arrayidx5 = getelementptr inbounds double addrspace(3)* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double addrspace(3)* %c, i64 1 store double %mul5, double addrspace(3)* %arrayidx5, align 8 ret void } define void @test1_as_3_0_0(double addrspace(3)* %a, double* %b, double* %c) { ; CHECK-LABEL: @test1_as_3_0_0( -; CHECK: load <2 x double> addrspace(3)* -; CHECK: load <2 x double>* +; CHECK: load <2 x double>, <2 x double> addrspace(3)* +; CHECK: load <2 x double>, <2 x double>* ; CHECK: store <2 x double> %{{.*}}, <2 x double>* % ; CHECK: ret - %i0 = load double addrspace(3)* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double addrspace(3)* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double addrspace(3)* %a, i64 1 - %i3 = load double addrspace(3)* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double addrspace(3)* %a, i64 1 + %i3 = load double, double addrspace(3)* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void } define void @test1_as_0_0_3(double* %a, double* %b, double addrspace(3)* %c) { ; CHECK-LABEL: @test1_as_0_0_3( -; CHECK: load <2 x double>* -; CHECK: load <2 x double>* +; CHECK: load <2 x double>, <2 x double>* +; CHECK: load <2 x double>, <2 x double>* ; CHECK: store <2 x double> %{{.*}}, <2 x double> addrspace(3)* % ; CHECK: ret - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double addrspace(3)* %c, align 8 - %arrayidx5 = getelementptr inbounds double addrspace(3)* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double addrspace(3)* %c, i64 1 store double %mul5, double addrspace(3)* %arrayidx5, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/addsub.ll b/test/Transforms/SLPVectorizer/X86/addsub.ll index d082b07..7056a14 100644 --- a/test/Transforms/SLPVectorizer/X86/addsub.ll +++ b/test/Transforms/SLPVectorizer/X86/addsub.ll @@ -21,38 +21,38 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable define void @addsub() #0 { entry: - %0 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 0), align 4 - %1 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 0), align 4 + %0 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 0), align 4 + %1 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 0), align 4 %add = add nsw i32 %0, %1 - %2 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 0), align 4 - %3 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 0), align 4 + %2 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 0), align 4 + %3 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 0), align 4 %add1 = add nsw i32 %2, %3 %add2 = add nsw i32 %add, %add1 - store i32 %add2, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 0), align 4 - %4 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 1), align 4 - %5 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 1), align 4 + store i32 %add2, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 0), align 4 + %4 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 1), align 4 + %5 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 1), align 4 %add3 = add nsw i32 %4, %5 - %6 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 1), align 4 - %7 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 1), align 4 + %6 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 1), align 4 + %7 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 1), align 4 %add4 = add nsw i32 %6, %7 %sub = sub nsw i32 %add3, %add4 - store i32 %sub, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 1), align 4 - %8 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 2), align 4 - %9 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 2), align 4 + store i32 %sub, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 1), align 4 + %8 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 2), align 4 + %9 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 2), align 4 %add5 = add nsw i32 %8, %9 - %10 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 2), align 4 - %11 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 2), align 4 + %10 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 2), align 4 + %11 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 2), align 4 %add6 = add nsw i32 %10, %11 %add7 = add nsw i32 %add5, %add6 - store i32 %add7, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 2), align 4 - %12 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 3), align 4 - %13 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 3), align 4 + store i32 %add7, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 2), align 4 + %12 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 3), align 4 + %13 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 3), align 4 %add8 = add nsw i32 %12, %13 - %14 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 3), align 4 - %15 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 3), align 4 + %14 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 3), align 4 + %15 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 3), align 4 %add9 = add nsw i32 %14, %15 %sub10 = sub nsw i32 %add8, %add9 - store i32 %sub10, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 3), align 4 + store i32 %sub10, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 3), align 4 ret void } @@ -65,38 +65,38 @@ entry: ; Function Attrs: nounwind uwtable define void @subadd() #0 { entry: - %0 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 0), align 4 - %1 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 0), align 4 + %0 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 0), align 4 + %1 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 0), align 4 %add = add nsw i32 %0, %1 - %2 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 0), align 4 - %3 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 0), align 4 + %2 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 0), align 4 + %3 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 0), align 4 %add1 = add nsw i32 %2, %3 %sub = sub nsw i32 %add, %add1 - store i32 %sub, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 0), align 4 - %4 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 1), align 4 - %5 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 1), align 4 + store i32 %sub, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 0), align 4 + %4 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 1), align 4 + %5 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 1), align 4 %add2 = add nsw i32 %4, %5 - %6 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 1), align 4 - %7 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 1), align 4 + %6 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 1), align 4 + %7 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 1), align 4 %add3 = add nsw i32 %6, %7 %add4 = add nsw i32 %add2, %add3 - store i32 %add4, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 1), align 4 - %8 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 2), align 4 - %9 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 2), align 4 + store i32 %add4, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 1), align 4 + %8 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 2), align 4 + %9 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 2), align 4 %add5 = add nsw i32 %8, %9 - %10 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 2), align 4 - %11 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 2), align 4 + %10 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 2), align 4 + %11 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 2), align 4 %add6 = add nsw i32 %10, %11 %sub7 = sub nsw i32 %add5, %add6 - store i32 %sub7, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 2), align 4 - %12 = load i32* getelementptr inbounds ([4 x i32]* @b, i32 0, i64 3), align 4 - %13 = load i32* getelementptr inbounds ([4 x i32]* @c, i32 0, i64 3), align 4 + store i32 %sub7, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 2), align 4 + %12 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @b, i32 0, i64 3), align 4 + %13 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @c, i32 0, i64 3), align 4 %add8 = add nsw i32 %12, %13 - %14 = load i32* getelementptr inbounds ([4 x i32]* @d, i32 0, i64 3), align 4 - %15 = load i32* getelementptr inbounds ([4 x i32]* @e, i32 0, i64 3), align 4 + %14 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @d, i32 0, i64 3), align 4 + %15 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @e, i32 0, i64 3), align 4 %add9 = add nsw i32 %14, %15 %add10 = add nsw i32 %add8, %add9 - store i32 %add10, i32* getelementptr inbounds ([4 x i32]* @a, i32 0, i64 3), align 4 + store i32 %add10, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i32 0, i64 3), align 4 ret void } @@ -107,22 +107,22 @@ entry: ; Function Attrs: nounwind uwtable define void @faddfsub() #0 { entry: - %0 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 0), align 4 - %1 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 0), align 4 + %0 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 0), align 4 + %1 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 0), align 4 %add = fadd float %0, %1 - store float %add, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 0), align 4 - %2 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 1), align 4 - %3 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 1), align 4 + store float %add, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 0), align 4 + %2 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 1), align 4 + %3 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 1), align 4 %sub = fsub float %2, %3 - store float %sub, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 1), align 4 - %4 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 2), align 4 - %5 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 2), align 4 + store float %sub, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 1), align 4 + %4 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 2), align 4 + %5 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 2), align 4 %add1 = fadd float %4, %5 - store float %add1, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 2), align 4 - %6 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 3), align 4 - %7 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 3), align 4 + store float %add1, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 2), align 4 + %6 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 3), align 4 + %7 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 3), align 4 %sub2 = fsub float %6, %7 - store float %sub2, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 3), align 4 + store float %sub2, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 3), align 4 ret void } @@ -133,22 +133,22 @@ entry: ; Function Attrs: nounwind uwtable define void @fsubfadd() #0 { entry: - %0 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 0), align 4 - %1 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 0), align 4 + %0 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 0), align 4 + %1 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 0), align 4 %sub = fsub float %0, %1 - store float %sub, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 0), align 4 - %2 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 1), align 4 - %3 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 1), align 4 + store float %sub, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 0), align 4 + %2 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 1), align 4 + %3 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 1), align 4 %add = fadd float %2, %3 - store float %add, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 1), align 4 - %4 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 2), align 4 - %5 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 2), align 4 + store float %add, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 1), align 4 + %4 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 2), align 4 + %5 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 2), align 4 %sub1 = fsub float %4, %5 - store float %sub1, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 2), align 4 - %6 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 3), align 4 - %7 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 3), align 4 + store float %sub1, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 2), align 4 + %6 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 3), align 4 + %7 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 3), align 4 %add2 = fadd float %6, %7 - store float %add2, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 3), align 4 + store float %add2, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 3), align 4 ret void } @@ -159,22 +159,22 @@ entry: ; Function Attrs: nounwind uwtable define void @No_faddfsub() #0 { entry: - %0 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 0), align 4 - %1 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 0), align 4 + %0 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 0), align 4 + %1 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 0), align 4 %add = fadd float %0, %1 - store float %add, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 0), align 4 - %2 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 1), align 4 - %3 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 1), align 4 + store float %add, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 0), align 4 + %2 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 1), align 4 + %3 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 1), align 4 %add1 = fadd float %2, %3 - store float %add1, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 1), align 4 - %4 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 2), align 4 - %5 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 2), align 4 + store float %add1, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 1), align 4 + %4 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 2), align 4 + %5 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 2), align 4 %add2 = fadd float %4, %5 - store float %add2, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 2), align 4 - %6 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 3), align 4 - %7 = load float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 3), align 4 + store float %add2, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 2), align 4 + %6 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 3), align 4 + %7 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 3), align 4 %sub = fsub float %6, %7 - store float %sub, float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 3), align 4 + store float %sub, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 3), align 4 ret void } @@ -189,22 +189,22 @@ entry: ; CHECK: %4 = fsub <4 x float> %1, %2 ; CHECK: %5 = shufflevector <4 x float> %3, <4 x float> %4, <4 x i32> <i32 0, i32 5, i32 2, i32 7> define void @reorder_alt() #0 { - %1 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 0), align 4 - %2 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 0), align 4 + %1 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 0), align 4 + %2 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 0), align 4 %3 = fadd float %1, %2 - store float %3, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 0), align 4 - %4 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 1), align 4 - %5 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 1), align 4 + store float %3, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 0), align 4 + %4 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 1), align 4 + %5 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 1), align 4 %6 = fsub float %4, %5 - store float %6, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 1), align 4 - %7 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 2), align 4 - %8 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 2), align 4 + store float %6, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 1), align 4 + %7 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 2), align 4 + %8 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 2), align 4 %9 = fadd float %7, %8 - store float %9, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 2), align 4 - %10 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 3), align 4 - %11 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 3), align 4 + store float %9, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 2), align 4 + %10 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 3), align 4 + %11 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 3), align 4 %12 = fsub float %10, %11 - store float %12, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 3), align 4 + store float %12, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 3), align 4 ret void } @@ -222,30 +222,30 @@ define void @reorder_alt() #0 { ; CHECK: %8 = fsub <4 x float> %1, %6 ; CHECK: %9 = shufflevector <4 x float> %7, <4 x float> %8, <4 x i32> <i32 0, i32 5, i32 2, i32 7> define void @reorder_alt_subTree() #0 { - %1 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 0), align 4 - %2 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 0), align 4 - %3 = load float* getelementptr inbounds ([4 x float]* @fd, i32 0, i64 0), align 4 + %1 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 0), align 4 + %2 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 0), align 4 + %3 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fd, i32 0, i64 0), align 4 %4 = fsub float %2, %3 %5 = fadd float %1, %4 - store float %5, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 0), align 4 - %6 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 1), align 4 - %7 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 1), align 4 - %8 = load float* getelementptr inbounds ([4 x float]* @fd, i32 0, i64 1), align 4 + store float %5, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 0), align 4 + %6 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 1), align 4 + %7 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 1), align 4 + %8 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fd, i32 0, i64 1), align 4 %9 = fadd float %7, %8 %10 = fsub float %6, %9 - store float %10, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 1), align 4 - %11 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 2), align 4 - %12 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 2), align 4 - %13 = load float* getelementptr inbounds ([4 x float]* @fd, i32 0, i64 2), align 4 + store float %10, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 1), align 4 + %11 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 2), align 4 + %12 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 2), align 4 + %13 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fd, i32 0, i64 2), align 4 %14 = fsub float %12, %13 %15 = fadd float %11, %14 - store float %15, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 2), align 4 - %16 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 3), align 4 - %17 = load float* getelementptr inbounds ([4 x float]* @fd, i32 0, i64 3), align 4 - %18 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 3), align 4 + store float %15, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 2), align 4 + %16 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 3), align 4 + %17 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fd, i32 0, i64 3), align 4 + %18 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 3), align 4 %19 = fadd float %17, %18 %20 = fsub float %16, %19 - store float %20, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 3), align 4 + store float %20, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 3), align 4 ret void } @@ -258,21 +258,21 @@ define void @reorder_alt_subTree() #0 { ; CHECK: fsub <2 x double> ; CHECK: shufflevector <2 x double> define void @reorder_alt_rightsubTree(double* nocapture %c, double* noalias nocapture readonly %a, double* noalias nocapture readonly %b, double* noalias nocapture readonly %d) { - %1 = load double* %a - %2 = load double* %b + %1 = load double, double* %a + %2 = load double, double* %b %3 = fadd double %1, %2 - %4 = load double* %d + %4 = load double, double* %d %5 = fsub double %3, %4 store double %5, double* %c - %6 = getelementptr inbounds double* %d, i64 1 - %7 = load double* %6 - %8 = getelementptr inbounds double* %a, i64 1 - %9 = load double* %8 - %10 = getelementptr inbounds double* %b, i64 1 - %11 = load double* %10 + %6 = getelementptr inbounds double, double* %d, i64 1 + %7 = load double, double* %6 + %8 = getelementptr inbounds double, double* %a, i64 1 + %9 = load double, double* %8 + %10 = getelementptr inbounds double, double* %b, i64 1 + %11 = load double, double* %10 %12 = fadd double %9, %11 %13 = fadd double %7, %12 - %14 = getelementptr inbounds double* %c, i64 1 + %14 = getelementptr inbounds double, double* %c, i64 1 store double %13, double* %14 ret void } @@ -290,22 +290,22 @@ define void @reorder_alt_rightsubTree(double* nocapture %c, double* noalias noca ; CHECK-NOT: fsub <4 x float> ; CHECK-NOT: shufflevector define void @no_vec_shuff_reorder() #0 { - %1 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 0), align 4 - %2 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 0), align 4 + %1 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 0), align 4 + %2 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 0), align 4 %3 = fadd float %1, %2 - store float %3, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 0), align 4 - %4 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 1), align 4 - %5 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 1), align 4 + store float %3, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 0), align 4 + %4 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 1), align 4 + %5 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 1), align 4 %6 = fsub float %4, %5 - store float %6, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 1), align 4 - %7 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 2), align 4 - %8 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 2), align 4 + store float %6, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 1), align 4 + %7 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 2), align 4 + %8 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 2), align 4 %9 = fadd float %7, %8 - store float %9, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 2), align 4 - %10 = load float* getelementptr inbounds ([4 x float]* @fb, i32 0, i64 3), align 4 - %11 = load float* getelementptr inbounds ([4 x float]* @fa, i32 0, i64 3), align 4 + store float %9, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 2), align 4 + %10 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fb, i32 0, i64 3), align 4 + %11 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @fa, i32 0, i64 3), align 4 %12 = fsub float %10, %11 - store float %12, float* getelementptr inbounds ([4 x float]* @fc, i32 0, i64 3), align 4 + store float %12, float* getelementptr inbounds ([4 x float], [4 x float]* @fc, i32 0, i64 3), align 4 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/align.ll b/test/Transforms/SLPVectorizer/X86/align.ll index ce80620..b74b709 100644 --- a/test/Transforms/SLPVectorizer/X86/align.ll +++ b/test/Transforms/SLPVectorizer/X86/align.ll @@ -8,16 +8,16 @@ target triple = "x86_64-apple-macosx10.8.0" define void @test1(double* %a, double* %b, double* %c) { entry: %agg.tmp.i.i.sroa.0 = alloca [3 x double], align 16 -; CHECK: %[[V0:[0-9]+]] = load <2 x double>* %[[V2:[0-9]+]], align 8 - %i0 = load double* %a - %i1 = load double* %b +; CHECK: %[[V0:[0-9]+]] = load <2 x double>, <2 x double>* %[[V2:[0-9]+]], align 8 + %i0 = load double, double* %a + %i1 = load double, double* %b %mul = fmul double %i0, %i1 - %store1 = getelementptr inbounds [3 x double]* %agg.tmp.i.i.sroa.0, i64 0, i64 1 - %store2 = getelementptr inbounds [3 x double]* %agg.tmp.i.i.sroa.0, i64 0, i64 2 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %store1 = getelementptr inbounds [3 x double], [3 x double]* %agg.tmp.i.i.sroa.0, i64 0, i64 1 + %store2 = getelementptr inbounds [3 x double], [3 x double]* %agg.tmp.i.i.sroa.0, i64 0, i64 2 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 ; CHECK: store <2 x double> %[[V1:[0-9]+]], <2 x double>* %[[V2:[0-9]+]], align 8 store double %mul, double* %store1 @@ -37,19 +37,19 @@ entry: define void @test2(float * %a, float * %b) { entry: - %l0 = load float* %a - %a1 = getelementptr inbounds float* %a, i64 1 - %l1 = load float* %a1 - %a2 = getelementptr inbounds float* %a, i64 2 - %l2 = load float* %a2 - %a3 = getelementptr inbounds float* %a, i64 3 - %l3 = load float* %a3 + %l0 = load float, float* %a + %a1 = getelementptr inbounds float, float* %a, i64 1 + %l1 = load float, float* %a1 + %a2 = getelementptr inbounds float, float* %a, i64 2 + %l2 = load float, float* %a2 + %a3 = getelementptr inbounds float, float* %a, i64 3 + %l3 = load float, float* %a3 store float %l0, float* %b - %b1 = getelementptr inbounds float* %b, i64 1 + %b1 = getelementptr inbounds float, float* %b, i64 1 store float %l1, float* %b1 - %b2 = getelementptr inbounds float* %b, i64 2 + %b2 = getelementptr inbounds float, float* %b, i64 2 store float %l2, float* %b2 - %b3 = getelementptr inbounds float* %b, i64 3 + %b3 = getelementptr inbounds float, float* %b, i64 3 store float %l3, float* %b3 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/atomics.ll b/test/Transforms/SLPVectorizer/X86/atomics.ll index 6cb322e..a48b793 100644 --- a/test/Transforms/SLPVectorizer/X86/atomics.ll +++ b/test/Transforms/SLPVectorizer/X86/atomics.ll @@ -18,14 +18,14 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" ; CHECK: store atomic i32 define void @test() { entry: - store i32 0, i32* getelementptr inbounds ([4 x i32]* @a, i64 0, i64 0), align 16 - store atomic i32 0, i32* getelementptr inbounds ([4 x i32]* @x, i64 0, i64 0) release, align 16 - store i32 0, i32* getelementptr inbounds ([4 x i32]* @a, i64 0, i64 1), align 4 - store atomic i32 1, i32* getelementptr inbounds ([4 x i32]* @x, i64 0, i64 1) release, align 4 - store i32 0, i32* getelementptr inbounds ([4 x i32]* @a, i64 0, i64 2), align 8 - store atomic i32 2, i32* getelementptr inbounds ([4 x i32]* @x, i64 0, i64 2) release, align 8 - store i32 0, i32* getelementptr inbounds ([4 x i32]* @a, i64 0, i64 3), align 4 - store atomic i32 3, i32* getelementptr inbounds ([4 x i32]* @x, i64 0, i64 3) release, align 4 + store i32 0, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i64 0, i64 0), align 16 + store atomic i32 0, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @x, i64 0, i64 0) release, align 16 + store i32 0, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i64 0, i64 1), align 4 + store atomic i32 1, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @x, i64 0, i64 1) release, align 4 + store i32 0, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i64 0, i64 2), align 8 + store atomic i32 2, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @x, i64 0, i64 2) release, align 8 + store i32 0, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @a, i64 0, i64 3), align 4 + store atomic i32 3, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @x, i64 0, i64 3) release, align 4 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/bad_types.ll b/test/Transforms/SLPVectorizer/X86/bad_types.ll index 38ed18d..2d8f383 100644 --- a/test/Transforms/SLPVectorizer/X86/bad_types.ll +++ b/test/Transforms/SLPVectorizer/X86/bad_types.ll @@ -16,7 +16,7 @@ entry: %b.cast = bitcast x86_mmx %b to i64 %a.and = and i64 %a.cast, 42 %b.and = and i64 %b.cast, 42 - %gep = getelementptr i64* %ptr, i32 1 + %gep = getelementptr i64, i64* %ptr, i32 1 store i64 %a.and, i64* %ptr store i64 %b.and, i64* %gep ret void diff --git a/test/Transforms/SLPVectorizer/X86/barriercall.ll b/test/Transforms/SLPVectorizer/X86/barriercall.ll index bba2855..9def190 100644 --- a/test/Transforms/SLPVectorizer/X86/barriercall.ll +++ b/test/Transforms/SLPVectorizer/X86/barriercall.ll @@ -14,15 +14,15 @@ entry: store i32 %add, i32* %A, align 4 %mul1 = mul nsw i32 %n, 9 %add2 = add nsw i32 %mul1, 9 - %arrayidx3 = getelementptr inbounds i32* %A, i64 1 + %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 1 store i32 %add2, i32* %arrayidx3, align 4 %mul4 = shl i32 %n, 3 %add5 = add nsw i32 %mul4, 9 - %arrayidx6 = getelementptr inbounds i32* %A, i64 2 + %arrayidx6 = getelementptr inbounds i32, i32* %A, i64 2 store i32 %add5, i32* %arrayidx6, align 4 %mul7 = mul nsw i32 %n, 10 %add8 = add nsw i32 %mul7, 9 - %arrayidx9 = getelementptr inbounds i32* %A, i64 3 + %arrayidx9 = getelementptr inbounds i32, i32* %A, i64 3 store i32 %add8, i32* %arrayidx9, align 4 ret i32 undef } diff --git a/test/Transforms/SLPVectorizer/X86/call.ll b/test/Transforms/SLPVectorizer/X86/call.ll index 83d45c0..b76ac2c 100644 --- a/test/Transforms/SLPVectorizer/X86/call.ll +++ b/test/Transforms/SLPVectorizer/X86/call.ll @@ -15,18 +15,18 @@ declare i64 @round(i64) ; CHECK: ret void define void @sin_libm(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 %call = tail call double @sin(double %mul) nounwind readnone - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 %call5 = tail call double @sin(double %mul5) nounwind readnone store double %call, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %call5, double* %arrayidx5, align 8 ret void } @@ -36,18 +36,18 @@ entry: ; CHECK: ret void define void @cos_libm(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 %call = tail call double @cos(double %mul) nounwind readnone - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 %call5 = tail call double @cos(double %mul5) nounwind readnone store double %call, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %call5, double* %arrayidx5, align 8 ret void } @@ -57,18 +57,18 @@ entry: ; CHECK: ret void define void @pow_libm(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 %call = tail call double @pow(double %mul,double %mul) nounwind readnone - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 %call5 = tail call double @pow(double %mul5,double %mul5) nounwind readnone store double %call, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %call5, double* %arrayidx5, align 8 ret void } @@ -79,18 +79,18 @@ entry: ; CHECK: ret void define void @exp2_libm(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 %call = tail call double @exp2(double %mul) nounwind readnone - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 %call5 = tail call double @exp2(double %mul5) nounwind readnone store double %call, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %call5, double* %arrayidx5, align 8 ret void } @@ -102,18 +102,18 @@ entry: ; CHECK: ret void define void @round_custom(i64* %a, i64* %b, i64* %c) { entry: - %i0 = load i64* %a, align 8 - %i1 = load i64* %b, align 8 + %i0 = load i64, i64* %a, align 8 + %i1 = load i64, i64* %b, align 8 %mul = mul i64 %i0, %i1 %call = tail call i64 @round(i64 %mul) nounwind readnone - %arrayidx3 = getelementptr inbounds i64* %a, i64 1 - %i3 = load i64* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds i64* %b, i64 1 - %i4 = load i64* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds i64, i64* %a, i64 1 + %i3 = load i64, i64* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds i64, i64* %b, i64 1 + %i4 = load i64, i64* %arrayidx4, align 8 %mul5 = mul i64 %i3, %i4 %call5 = tail call i64 @round(i64 %mul5) nounwind readnone store i64 %call, i64* %c, align 8 - %arrayidx5 = getelementptr inbounds i64* %c, i64 1 + %arrayidx5 = getelementptr inbounds i64, i64* %c, i64 1 store i64 %call5, i64* %arrayidx5, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/cast.ll b/test/Transforms/SLPVectorizer/X86/cast.ll index e340fba..044db5d 100644 --- a/test/Transforms/SLPVectorizer/X86/cast.ll +++ b/test/Transforms/SLPVectorizer/X86/cast.ll @@ -15,23 +15,23 @@ target triple = "x86_64-apple-macosx10.9.0" ;CHECK: store <4 x i32> define i32 @foo(i32* noalias nocapture %A, i8* noalias nocapture %B) { entry: - %0 = load i8* %B, align 1 + %0 = load i8, i8* %B, align 1 %conv = sext i8 %0 to i32 store i32 %conv, i32* %A, align 4 - %arrayidx2 = getelementptr inbounds i8* %B, i64 1 - %1 = load i8* %arrayidx2, align 1 + %arrayidx2 = getelementptr inbounds i8, i8* %B, i64 1 + %1 = load i8, i8* %arrayidx2, align 1 %conv3 = sext i8 %1 to i32 - %arrayidx4 = getelementptr inbounds i32* %A, i64 1 + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 1 store i32 %conv3, i32* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds i8* %B, i64 2 - %2 = load i8* %arrayidx5, align 1 + %arrayidx5 = getelementptr inbounds i8, i8* %B, i64 2 + %2 = load i8, i8* %arrayidx5, align 1 %conv6 = sext i8 %2 to i32 - %arrayidx7 = getelementptr inbounds i32* %A, i64 2 + %arrayidx7 = getelementptr inbounds i32, i32* %A, i64 2 store i32 %conv6, i32* %arrayidx7, align 4 - %arrayidx8 = getelementptr inbounds i8* %B, i64 3 - %3 = load i8* %arrayidx8, align 1 + %arrayidx8 = getelementptr inbounds i8, i8* %B, i64 3 + %3 = load i8, i8* %arrayidx8, align 1 %conv9 = sext i8 %3 to i32 - %arrayidx10 = getelementptr inbounds i32* %A, i64 3 + %arrayidx10 = getelementptr inbounds i32, i32* %A, i64 3 store i32 %conv9, i32* %arrayidx10, align 4 ret i32 undef } diff --git a/test/Transforms/SLPVectorizer/X86/cmp_sel.ll b/test/Transforms/SLPVectorizer/X86/cmp_sel.ll index 0c124a7..a3e2b21 100644 --- a/test/Transforms/SLPVectorizer/X86/cmp_sel.ll +++ b/test/Transforms/SLPVectorizer/X86/cmp_sel.ll @@ -16,16 +16,16 @@ target triple = "x86_64-apple-macosx10.8.0" ;CHECK: ret i32 undef define i32 @foo(double* noalias nocapture %A, double* noalias nocapture %B, double %G) { entry: - %arrayidx = getelementptr inbounds double* %B, i64 10 - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %B, i64 10 + %0 = load double, double* %arrayidx, align 8 %tobool = fcmp une double %0, 0.000000e+00 %cond = select i1 %tobool, double %G, double 1.000000e+00 store double %cond, double* %A, align 8 - %arrayidx2 = getelementptr inbounds double* %B, i64 11 - %1 = load double* %arrayidx2, align 8 + %arrayidx2 = getelementptr inbounds double, double* %B, i64 11 + %1 = load double, double* %arrayidx2, align 8 %tobool3 = fcmp une double %1, 0.000000e+00 %cond7 = select i1 %tobool3, double %G, double 1.000000e+00 - %arrayidx8 = getelementptr inbounds double* %A, i64 1 + %arrayidx8 = getelementptr inbounds double, double* %A, i64 1 store double %cond7, double* %arrayidx8, align 8 ret i32 undef } diff --git a/test/Transforms/SLPVectorizer/X86/compare-reduce.ll b/test/Transforms/SLPVectorizer/X86/compare-reduce.ll index 9653d18..3c457c4 100644 --- a/test/Transforms/SLPVectorizer/X86/compare-reduce.ll +++ b/test/Transforms/SLPVectorizer/X86/compare-reduce.ll @@ -21,14 +21,14 @@ entry: for.body: ; preds = %for.inc, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] %0 = shl nsw i64 %indvars.iv, 1 - %arrayidx = getelementptr inbounds double* %A, i64 %0 - %1 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %A, i64 %0 + %1 = load double, double* %arrayidx, align 8 %mul1 = fmul double %conv, %1 %mul2 = fmul double %mul1, 7.000000e+00 %add = fadd double %mul2, 5.000000e+00 %2 = or i64 %0, 1 - %arrayidx6 = getelementptr inbounds double* %A, i64 %2 - %3 = load double* %arrayidx6, align 8 + %arrayidx6 = getelementptr inbounds double, double* %A, i64 %2 + %3 = load double, double* %arrayidx6, align 8 %mul8 = fmul double %conv, %3 %mul9 = fmul double %mul8, 4.000000e+00 %add10 = fadd double %mul9, 9.000000e+00 @@ -36,7 +36,7 @@ for.body: ; preds = %for.inc, %entry br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %for.body - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str, i64 0, i64 0)) + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)) br label %for.inc for.inc: ; preds = %for.body, %if.then diff --git a/test/Transforms/SLPVectorizer/X86/consecutive-access.ll b/test/Transforms/SLPVectorizer/X86/consecutive-access.ll index aa59429..1ad4d69 100644 --- a/test/Transforms/SLPVectorizer/X86/consecutive-access.ll +++ b/test/Transforms/SLPVectorizer/X86/consecutive-access.ll @@ -20,26 +20,26 @@ entry: store i32 %u, i32* %u.addr, align 4 %mul = mul nsw i32 %u, 3 %idxprom = sext i32 %mul to i64 - %arrayidx = getelementptr inbounds [2000 x double]* @A, i32 0, i64 %idxprom - %0 = load double* %arrayidx, align 8 - %arrayidx4 = getelementptr inbounds [2000 x double]* @B, i32 0, i64 %idxprom - %1 = load double* %arrayidx4, align 8 + %arrayidx = getelementptr inbounds [2000 x double], [2000 x double]* @A, i32 0, i64 %idxprom + %0 = load double, double* %arrayidx, align 8 + %arrayidx4 = getelementptr inbounds [2000 x double], [2000 x double]* @B, i32 0, i64 %idxprom + %1 = load double, double* %arrayidx4, align 8 %add5 = fadd double %0, %1 store double %add5, double* %arrayidx, align 8 %add11 = add nsw i32 %mul, 1 %idxprom12 = sext i32 %add11 to i64 - %arrayidx13 = getelementptr inbounds [2000 x double]* @A, i32 0, i64 %idxprom12 - %2 = load double* %arrayidx13, align 8 - %arrayidx17 = getelementptr inbounds [2000 x double]* @B, i32 0, i64 %idxprom12 - %3 = load double* %arrayidx17, align 8 + %arrayidx13 = getelementptr inbounds [2000 x double], [2000 x double]* @A, i32 0, i64 %idxprom12 + %2 = load double, double* %arrayidx13, align 8 + %arrayidx17 = getelementptr inbounds [2000 x double], [2000 x double]* @B, i32 0, i64 %idxprom12 + %3 = load double, double* %arrayidx17, align 8 %add18 = fadd double %2, %3 store double %add18, double* %arrayidx13, align 8 %add24 = add nsw i32 %mul, 2 %idxprom25 = sext i32 %add24 to i64 - %arrayidx26 = getelementptr inbounds [2000 x double]* @A, i32 0, i64 %idxprom25 - %4 = load double* %arrayidx26, align 8 - %arrayidx30 = getelementptr inbounds [2000 x double]* @B, i32 0, i64 %idxprom25 - %5 = load double* %arrayidx30, align 8 + %arrayidx26 = getelementptr inbounds [2000 x double], [2000 x double]* @A, i32 0, i64 %idxprom25 + %4 = load double, double* %arrayidx26, align 8 + %arrayidx30 = getelementptr inbounds [2000 x double], [2000 x double]* @B, i32 0, i64 %idxprom25 + %5 = load double, double* %arrayidx30, align 8 %add31 = fadd double %4, %5 store double %add31, double* %arrayidx26, align 8 ret void @@ -57,18 +57,18 @@ entry: store i32 %u, i32* %u.addr, align 4 %mul = mul nsw i32 %u, 2 %idxprom = sext i32 %mul to i64 - %arrayidx = getelementptr inbounds [2000 x double]* @A, i32 0, i64 %idxprom - %0 = load double* %arrayidx, align 8 - %arrayidx4 = getelementptr inbounds [2000 x double]* @B, i32 0, i64 %idxprom - %1 = load double* %arrayidx4, align 8 + %arrayidx = getelementptr inbounds [2000 x double], [2000 x double]* @A, i32 0, i64 %idxprom + %0 = load double, double* %arrayidx, align 8 + %arrayidx4 = getelementptr inbounds [2000 x double], [2000 x double]* @B, i32 0, i64 %idxprom + %1 = load double, double* %arrayidx4, align 8 %add5 = fadd double %0, %1 store double %add5, double* %arrayidx, align 8 %add11 = add nsw i32 %mul, 1 %idxprom12 = sext i32 %add11 to i64 - %arrayidx13 = getelementptr inbounds [2000 x double]* @A, i32 0, i64 %idxprom12 - %2 = load double* %arrayidx13, align 8 - %arrayidx17 = getelementptr inbounds [2000 x double]* @B, i32 0, i64 %idxprom12 - %3 = load double* %arrayidx17, align 8 + %arrayidx13 = getelementptr inbounds [2000 x double], [2000 x double]* @A, i32 0, i64 %idxprom12 + %2 = load double, double* %arrayidx13, align 8 + %arrayidx17 = getelementptr inbounds [2000 x double], [2000 x double]* @B, i32 0, i64 %idxprom12 + %3 = load double, double* %arrayidx17, align 8 %add18 = fadd double %2, %3 store double %add18, double* %arrayidx13, align 8 ret void @@ -84,34 +84,34 @@ entry: store i32 %u, i32* %u.addr, align 4 %mul = mul nsw i32 %u, 4 %idxprom = sext i32 %mul to i64 - %arrayidx = getelementptr inbounds [2000 x float]* @C, i32 0, i64 %idxprom - %0 = load float* %arrayidx, align 4 - %arrayidx4 = getelementptr inbounds [2000 x float]* @D, i32 0, i64 %idxprom - %1 = load float* %arrayidx4, align 4 + %arrayidx = getelementptr inbounds [2000 x float], [2000 x float]* @C, i32 0, i64 %idxprom + %0 = load float, float* %arrayidx, align 4 + %arrayidx4 = getelementptr inbounds [2000 x float], [2000 x float]* @D, i32 0, i64 %idxprom + %1 = load float, float* %arrayidx4, align 4 %add5 = fadd float %0, %1 store float %add5, float* %arrayidx, align 4 %add11 = add nsw i32 %mul, 1 %idxprom12 = sext i32 %add11 to i64 - %arrayidx13 = getelementptr inbounds [2000 x float]* @C, i32 0, i64 %idxprom12 - %2 = load float* %arrayidx13, align 4 - %arrayidx17 = getelementptr inbounds [2000 x float]* @D, i32 0, i64 %idxprom12 - %3 = load float* %arrayidx17, align 4 + %arrayidx13 = getelementptr inbounds [2000 x float], [2000 x float]* @C, i32 0, i64 %idxprom12 + %2 = load float, float* %arrayidx13, align 4 + %arrayidx17 = getelementptr inbounds [2000 x float], [2000 x float]* @D, i32 0, i64 %idxprom12 + %3 = load float, float* %arrayidx17, align 4 %add18 = fadd float %2, %3 store float %add18, float* %arrayidx13, align 4 %add24 = add nsw i32 %mul, 2 %idxprom25 = sext i32 %add24 to i64 - %arrayidx26 = getelementptr inbounds [2000 x float]* @C, i32 0, i64 %idxprom25 - %4 = load float* %arrayidx26, align 4 - %arrayidx30 = getelementptr inbounds [2000 x float]* @D, i32 0, i64 %idxprom25 - %5 = load float* %arrayidx30, align 4 + %arrayidx26 = getelementptr inbounds [2000 x float], [2000 x float]* @C, i32 0, i64 %idxprom25 + %4 = load float, float* %arrayidx26, align 4 + %arrayidx30 = getelementptr inbounds [2000 x float], [2000 x float]* @D, i32 0, i64 %idxprom25 + %5 = load float, float* %arrayidx30, align 4 %add31 = fadd float %4, %5 store float %add31, float* %arrayidx26, align 4 %add37 = add nsw i32 %mul, 3 %idxprom38 = sext i32 %add37 to i64 - %arrayidx39 = getelementptr inbounds [2000 x float]* @C, i32 0, i64 %idxprom38 - %6 = load float* %arrayidx39, align 4 - %arrayidx43 = getelementptr inbounds [2000 x float]* @D, i32 0, i64 %idxprom38 - %7 = load float* %arrayidx43, align 4 + %arrayidx39 = getelementptr inbounds [2000 x float], [2000 x float]* @C, i32 0, i64 %idxprom38 + %6 = load float, float* %arrayidx39, align 4 + %arrayidx43 = getelementptr inbounds [2000 x float], [2000 x float]* @D, i32 0, i64 %idxprom38 + %7 = load float, float* %arrayidx43, align 4 %add44 = fadd float %6, %7 store float %add44, float* %arrayidx39, align 4 ret void @@ -142,13 +142,13 @@ for.body: ; preds = %for.body.lr.ph, %fo %1 = phi double [ 0.000000e+00, %for.body.lr.ph ], [ %add7, %for.body ] %mul = mul nsw i32 %0, 2 %idxprom = sext i32 %mul to i64 - %arrayidx = getelementptr inbounds double* %A, i64 %idxprom - %2 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %A, i64 %idxprom + %2 = load double, double* %arrayidx, align 8 %mul1 = fmul double 7.000000e+00, %2 %add = add nsw i32 %mul, 1 %idxprom3 = sext i32 %add to i64 - %arrayidx4 = getelementptr inbounds double* %A, i64 %idxprom3 - %3 = load double* %arrayidx4, align 8 + %arrayidx4 = getelementptr inbounds double, double* %A, i64 %idxprom3 + %3 = load double, double* %arrayidx4, align 8 %mul5 = fmul double 7.000000e+00, %3 %add6 = fadd double %mul1, %mul5 %add7 = fadd double %1, %add6 diff --git a/test/Transforms/SLPVectorizer/X86/continue_vectorizing.ll b/test/Transforms/SLPVectorizer/X86/continue_vectorizing.ll index ed22574..ecae70e 100644 --- a/test/Transforms/SLPVectorizer/X86/continue_vectorizing.ll +++ b/test/Transforms/SLPVectorizer/X86/continue_vectorizing.ll @@ -9,21 +9,21 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK: ret define void @test1(double* %a, double* %b, double* %c, double* %d) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 %0 = bitcast double* %a to <4 x i32>* - %1 = load <4 x i32>* %0, align 8 + %1 = load <4 x i32>, <4 x i32>* %0, align 8 %2 = bitcast double* %b to <4 x i32>* - %3 = load <4 x i32>* %2, align 8 + %3 = load <4 x i32>, <4 x i32>* %2, align 8 %4 = mul <4 x i32> %1, %3 %5 = bitcast double* %d to <4 x i32>* store <4 x i32> %4, <4 x i32>* %5, align 8 diff --git a/test/Transforms/SLPVectorizer/X86/crash_7zip.ll b/test/Transforms/SLPVectorizer/X86/crash_7zip.ll index 51b1c08..54e5d5a 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_7zip.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_7zip.ll @@ -8,8 +8,8 @@ target triple = "x86_64-apple-macosx10.8.0" define fastcc void @LzmaDec_DecodeReal2(%struct.CLzmaDec.1.28.55.82.103.124.145.166.181.196.229.259.334* %p) { entry: - %range20.i = getelementptr inbounds %struct.CLzmaDec.1.28.55.82.103.124.145.166.181.196.229.259.334* %p, i64 0, i32 4 - %code21.i = getelementptr inbounds %struct.CLzmaDec.1.28.55.82.103.124.145.166.181.196.229.259.334* %p, i64 0, i32 5 + %range20.i = getelementptr inbounds %struct.CLzmaDec.1.28.55.82.103.124.145.166.181.196.229.259.334, %struct.CLzmaDec.1.28.55.82.103.124.145.166.181.196.229.259.334* %p, i64 0, i32 4 + %code21.i = getelementptr inbounds %struct.CLzmaDec.1.28.55.82.103.124.145.166.181.196.229.259.334, %struct.CLzmaDec.1.28.55.82.103.124.145.166.181.196.229.259.334* %p, i64 0, i32 5 br label %do.body66.i do.body66.i: ; preds = %do.cond.i, %entry diff --git a/test/Transforms/SLPVectorizer/X86/crash_binaryop.ll b/test/Transforms/SLPVectorizer/X86/crash_binaryop.ll index dc99366..9046c35 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_binaryop.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_binaryop.ll @@ -7,7 +7,7 @@ target triple = "x86_64-apple-darwin13.3.0" define i32 @fn1() { entry: - %init = load double* @a, align 8 + %init = load double, double* @a, align 8 br label %loop loop: diff --git a/test/Transforms/SLPVectorizer/X86/crash_bullet.ll b/test/Transforms/SLPVectorizer/X86/crash_bullet.ll index 3898921..1bad671 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_bullet.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_bullet.ll @@ -13,8 +13,8 @@ if.then: ; preds = %entry ret void if.else: ; preds = %entry - %m_numConstraintRows4 = getelementptr inbounds %"struct.btTypedConstraint::btConstraintInfo1.17.157.357.417.477.960"* %info, i64 0, i32 0 - %nub5 = getelementptr inbounds %"struct.btTypedConstraint::btConstraintInfo1.17.157.357.417.477.960"* %info, i64 0, i32 1 + %m_numConstraintRows4 = getelementptr inbounds %"struct.btTypedConstraint::btConstraintInfo1.17.157.357.417.477.960", %"struct.btTypedConstraint::btConstraintInfo1.17.157.357.417.477.960"* %info, i64 0, i32 0 + %nub5 = getelementptr inbounds %"struct.btTypedConstraint::btConstraintInfo1.17.157.357.417.477.960", %"struct.btTypedConstraint::btConstraintInfo1.17.157.357.417.477.960"* %info, i64 0, i32 1 br i1 undef, label %land.lhs.true.i.1, label %if.then7.1 land.lhs.true.i.1: ; preds = %if.else @@ -43,9 +43,9 @@ for.inc.1: ; preds = %if.then7.1, %land.l define void @_ZN30GIM_TRIANGLE_CALCULATION_CACHE18triangle_collisionERK9btVector3S2_S2_fS2_S2_S2_fR25GIM_TRIANGLE_CONTACT_DATA(%class.GIM_TRIANGLE_CALCULATION_CACHE.9.34.69.94.119.144.179.189.264.284.332* %this) { entry: - %arrayidx26 = getelementptr inbounds %class.GIM_TRIANGLE_CALCULATION_CACHE.9.34.69.94.119.144.179.189.264.284.332* %this, i64 0, i32 2, i64 0, i32 0, i64 1 - %arrayidx36 = getelementptr inbounds %class.GIM_TRIANGLE_CALCULATION_CACHE.9.34.69.94.119.144.179.189.264.284.332* %this, i64 0, i32 2, i64 0, i32 0, i64 2 - %0 = load float* %arrayidx36, align 4 + %arrayidx26 = getelementptr inbounds %class.GIM_TRIANGLE_CALCULATION_CACHE.9.34.69.94.119.144.179.189.264.284.332, %class.GIM_TRIANGLE_CALCULATION_CACHE.9.34.69.94.119.144.179.189.264.284.332* %this, i64 0, i32 2, i64 0, i32 0, i64 1 + %arrayidx36 = getelementptr inbounds %class.GIM_TRIANGLE_CALCULATION_CACHE.9.34.69.94.119.144.179.189.264.284.332, %class.GIM_TRIANGLE_CALCULATION_CACHE.9.34.69.94.119.144.179.189.264.284.332* %this, i64 0, i32 2, i64 0, i32 0, i64 2 + %0 = load float, float* %arrayidx36, align 4 %add587 = fadd float undef, undef %sub600 = fsub float %add587, undef store float %sub600, float* undef, align 4 diff --git a/test/Transforms/SLPVectorizer/X86/crash_bullet3.ll b/test/Transforms/SLPVectorizer/X86/crash_bullet3.ll index 25c6545..8102769 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_bullet3.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_bullet3.ll @@ -59,9 +59,9 @@ if.end332: ; preds = %if.then329, %if.end %dy276.1 = phi float [ undef, %if.then329 ], [ undef, %if.end327 ], [ 0x3F847AE140000000, %if.then291 ] %sub334 = fsub float %add294, %dx272.1 %sub338 = fsub float %add297, %dy276.1 - %arrayidx.i.i606 = getelementptr inbounds %class.btVector3.23.221.463.485.507.573.595.683.727.749.815.837.991.1585.1607.1629.1651.1849.2047.2069.2091.2113* %vertices, i64 0, i32 0, i64 0 + %arrayidx.i.i606 = getelementptr inbounds %class.btVector3.23.221.463.485.507.573.595.683.727.749.815.837.991.1585.1607.1629.1651.1849.2047.2069.2091.2113, %class.btVector3.23.221.463.485.507.573.595.683.727.749.815.837.991.1585.1607.1629.1651.1849.2047.2069.2091.2113* %vertices, i64 0, i32 0, i64 0 store float %sub334, float* %arrayidx.i.i606, align 4 - %arrayidx3.i607 = getelementptr inbounds %class.btVector3.23.221.463.485.507.573.595.683.727.749.815.837.991.1585.1607.1629.1651.1849.2047.2069.2091.2113* %vertices, i64 0, i32 0, i64 1 + %arrayidx3.i607 = getelementptr inbounds %class.btVector3.23.221.463.485.507.573.595.683.727.749.815.837.991.1585.1607.1629.1651.1849.2047.2069.2091.2113, %class.btVector3.23.221.463.485.507.573.595.683.727.749.815.837.991.1585.1607.1629.1651.1849.2047.2069.2091.2113* %vertices, i64 0, i32 0, i64 1 store float %sub338, float* %arrayidx3.i607, align 4 br label %return diff --git a/test/Transforms/SLPVectorizer/X86/crash_cmpop.ll b/test/Transforms/SLPVectorizer/X86/crash_cmpop.ll index 18a96e5..f10c862 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_cmpop.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_cmpop.ll @@ -12,10 +12,10 @@ for.body: %acc1.056 = phi float [ 0.000000e+00, %entry ], [ %add13, %for.body ] %s1.055 = phi float [ 0.000000e+00, %entry ], [ %cond.i40, %for.body ] %s0.054 = phi float [ 0.000000e+00, %entry ], [ %cond.i44, %for.body ] - %arrayidx = getelementptr inbounds float* %src, i64 %indvars.iv - %0 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %src, i64 %indvars.iv + %0 = load float, float* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %arrayidx2 = getelementptr inbounds float* %dest, i64 %indvars.iv + %arrayidx2 = getelementptr inbounds float, float* %dest, i64 %indvars.iv store float %acc1.056, float* %arrayidx2, align 4 %add = fadd float %s0.054, %0 %add3 = fadd float %s1.055, %0 diff --git a/test/Transforms/SLPVectorizer/X86/crash_dequeue.ll b/test/Transforms/SLPVectorizer/X86/crash_dequeue.ll index ce01590..28b7aa3 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_dequeue.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_dequeue.ll @@ -7,13 +7,13 @@ target triple = "x86_64-apple-macosx10.8.0" ; Function Attrs: nounwind ssp uwtable define void @_ZSt6uniqueISt15_Deque_iteratorIdRdPdEET_S4_S4_(%"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__first, %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* nocapture %__last) { entry: - %_M_cur2.i.i = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__first, i64 0, i32 0 - %0 = load double** %_M_cur2.i.i, align 8 - %_M_first3.i.i = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__first, i64 0, i32 1 - %_M_cur2.i.i81 = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__last, i64 0, i32 0 - %1 = load double** %_M_cur2.i.i81, align 8 - %_M_first3.i.i83 = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__last, i64 0, i32 1 - %2 = load double** %_M_first3.i.i83, align 8 + %_M_cur2.i.i = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731", %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__first, i64 0, i32 0 + %0 = load double*, double** %_M_cur2.i.i, align 8 + %_M_first3.i.i = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731", %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__first, i64 0, i32 1 + %_M_cur2.i.i81 = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731", %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__last, i64 0, i32 0 + %1 = load double*, double** %_M_cur2.i.i81, align 8 + %_M_first3.i.i83 = getelementptr inbounds %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731", %"struct.std::_Deque_iterator.4.157.174.208.259.276.344.731"* %__last, i64 0, i32 1 + %2 = load double*, double** %_M_first3.i.i83, align 8 br i1 undef, label %_ZSt13adjacent_findISt15_Deque_iteratorIdRdPdEET_S4_S4_.exit, label %while.cond.i.preheader while.cond.i.preheader: ; preds = %entry diff --git a/test/Transforms/SLPVectorizer/X86/crash_gep.ll b/test/Transforms/SLPVectorizer/X86/crash_gep.ll index dd4034c..bd1e8f7 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_gep.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_gep.ll @@ -8,10 +8,10 @@ target triple = "x86_64-unknown-linux-gnu" ; Function Attrs: nounwind uwtable define i32 @fn1() { entry: - %0 = load i64** @a, align 8 - %add.ptr = getelementptr inbounds i64* %0, i64 1 + %0 = load i64*, i64** @a, align 8 + %add.ptr = getelementptr inbounds i64, i64* %0, i64 1 %1 = ptrtoint i64* %add.ptr to i64 - %arrayidx = getelementptr inbounds i64* %0, i64 2 + %arrayidx = getelementptr inbounds i64, i64* %0, i64 2 store i64 %1, i64* %arrayidx, align 8 %2 = ptrtoint i64* %arrayidx to i64 store i64 %2, i64* %add.ptr, align 8 diff --git a/test/Transforms/SLPVectorizer/X86/crash_lencod.ll b/test/Transforms/SLPVectorizer/X86/crash_lencod.ll index c02e1fa..70b13fd 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_lencod.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_lencod.ll @@ -68,23 +68,23 @@ if.end103: ; preds = %if.else, %if.then88 define void @intrapred_luma() { entry: %conv153 = trunc i32 undef to i16 - %arrayidx154 = getelementptr inbounds [13 x i16]* undef, i64 0, i64 12 + %arrayidx154 = getelementptr inbounds [13 x i16], [13 x i16]* undef, i64 0, i64 12 store i16 %conv153, i16* %arrayidx154, align 8 - %arrayidx155 = getelementptr inbounds [13 x i16]* undef, i64 0, i64 11 + %arrayidx155 = getelementptr inbounds [13 x i16], [13 x i16]* undef, i64 0, i64 11 store i16 %conv153, i16* %arrayidx155, align 2 - %arrayidx156 = getelementptr inbounds [13 x i16]* undef, i64 0, i64 10 + %arrayidx156 = getelementptr inbounds [13 x i16], [13 x i16]* undef, i64 0, i64 10 store i16 %conv153, i16* %arrayidx156, align 4 ret void } define fastcc void @dct36(double* %inbuf) { entry: - %arrayidx41 = getelementptr inbounds double* %inbuf, i64 2 - %arrayidx44 = getelementptr inbounds double* %inbuf, i64 1 - %0 = load double* %arrayidx44, align 8 + %arrayidx41 = getelementptr inbounds double, double* %inbuf, i64 2 + %arrayidx44 = getelementptr inbounds double, double* %inbuf, i64 1 + %0 = load double, double* %arrayidx44, align 8 %add46 = fadd double %0, undef store double %add46, double* %arrayidx41, align 8 - %1 = load double* %inbuf, align 8 + %1 = load double, double* %inbuf, align 8 %add49 = fadd double %1, %0 store double %add49, double* %arrayidx44, align 8 ret void diff --git a/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll b/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll index d6915e2..f82343f 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_mandeltext.ll @@ -55,18 +55,18 @@ for.end48: ; preds = %for.end44 define void @zot(%struct.hoge* %arg) { bb: - %tmp = load double* undef, align 8 + %tmp = load double, double* undef, align 8 %tmp1 = fsub double %tmp, undef - %tmp2 = load double* undef, align 8 + %tmp2 = load double, double* undef, align 8 %tmp3 = fsub double %tmp2, undef %tmp4 = fmul double %tmp3, undef %tmp5 = fmul double %tmp3, undef %tmp6 = fsub double %tmp5, undef - %tmp7 = getelementptr inbounds %struct.hoge* %arg, i64 0, i32 1 + %tmp7 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i64 0, i32 1 store double %tmp6, double* %tmp7, align 8 %tmp8 = fmul double %tmp1, undef %tmp9 = fsub double %tmp8, undef - %tmp10 = getelementptr inbounds %struct.hoge* %arg, i64 0, i32 2 + %tmp10 = getelementptr inbounds %struct.hoge, %struct.hoge* %arg, i64 0, i32 2 store double %tmp9, double* %tmp10, align 8 br i1 undef, label %bb11, label %bb12 @@ -86,8 +86,8 @@ bb14: ; preds = %bb12, %bb11 define void @rc4_crypt(%struct.rc4_state.0.24* nocapture %s) { entry: - %x1 = getelementptr inbounds %struct.rc4_state.0.24* %s, i64 0, i32 0 - %y2 = getelementptr inbounds %struct.rc4_state.0.24* %s, i64 0, i32 1 + %x1 = getelementptr inbounds %struct.rc4_state.0.24, %struct.rc4_state.0.24* %s, i64 0, i32 0 + %y2 = getelementptr inbounds %struct.rc4_state.0.24, %struct.rc4_state.0.24* %s, i64 0, i32 1 br i1 undef, label %for.body, label %for.end for.body: ; preds = %for.body, %entry diff --git a/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll b/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll index 8da3c34..e1df98d 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_netbsd_decompress.ll @@ -13,14 +13,14 @@ target triple = "x86_64-apple-macosx10.8.0" define i32 @fn1() { entry: - %0 = load i32* getelementptr inbounds (%struct.DState* @b, i32 0, i32 0), align 4 - %1 = load i32* getelementptr inbounds (%struct.DState* @b, i32 0, i32 1), align 4 - %2 = load i32* @d, align 4 + %0 = load i32, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 0), align 4 + %1 = load i32, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 1), align 4 + %2 = load i32, i32* @d, align 4 %cond = icmp eq i32 %2, 0 br i1 %cond, label %sw.bb, label %save_state_and_return sw.bb: ; preds = %entry - %3 = load i32* @c, align 4 + %3 = load i32, i32* @c, align 4 %and = and i32 %3, 7 store i32 %and, i32* @a, align 4 switch i32 %and, label %if.end [ @@ -34,8 +34,8 @@ if.end: ; preds = %sw.bb save_state_and_return: ; preds = %sw.bb, %sw.bb, %if.end, %entry %t.0 = phi i32 [ 0, %if.end ], [ %0, %entry ], [ %0, %sw.bb ], [ %0, %sw.bb ] %f.0 = phi i32 [ 0, %if.end ], [ %1, %entry ], [ 0, %sw.bb ], [ 0, %sw.bb ] - store i32 %t.0, i32* getelementptr inbounds (%struct.DState* @b, i32 0, i32 0), align 4 - store i32 %f.0, i32* getelementptr inbounds (%struct.DState* @b, i32 0, i32 1), align 4 + store i32 %t.0, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 0), align 4 + store i32 %f.0, i32* getelementptr inbounds (%struct.DState, %struct.DState* @b, i32 0, i32 1), align 4 ret i32 undef } diff --git a/test/Transforms/SLPVectorizer/X86/crash_scheduling.ll b/test/Transforms/SLPVectorizer/X86/crash_scheduling.ll index e6cc0f7..14a8b35 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_scheduling.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_scheduling.ll @@ -25,11 +25,11 @@ for.body: %p3.addr.0258 = phi double [ %add, %bb1 ], [ %add28, %for.body ] %vecinit.i.i237 = insertelement <2 x double> undef, double %t.0259, i32 0 %x13 = tail call i32 @_xfn(<2 x double> %vecinit.i.i237) #2 - %arrayidx = getelementptr inbounds [256 x i32]* %tab1, i64 0, i64 %indvars.iv266 + %arrayidx = getelementptr inbounds [256 x i32], [256 x i32]* %tab1, i64 0, i64 %indvars.iv266 store i32 %x13, i32* %arrayidx, align 4, !tbaa !4 %vecinit.i.i = insertelement <2 x double> undef, double %p3.addr.0258, i32 0 %x14 = tail call i32 @_xfn(<2 x double> %vecinit.i.i) #2 - %arrayidx26 = getelementptr inbounds [256 x i32]* %tab2, i64 0, i64 %indvars.iv266 + %arrayidx26 = getelementptr inbounds [256 x i32], [256 x i32]* %tab2, i64 0, i64 %indvars.iv266 store i32 %x14, i32* %arrayidx26, align 4, !tbaa !4 %add27 = fadd double %mul19, %t.0259 %add28 = fadd double %mul21, %p3.addr.0258 diff --git a/test/Transforms/SLPVectorizer/X86/crash_sim4b1.ll b/test/Transforms/SLPVectorizer/X86/crash_sim4b1.ll index 0541545..5a576c2 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_sim4b1.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_sim4b1.ll @@ -34,13 +34,13 @@ land.rhs.lr.ph: ; preds = %if.then17 unreachable if.end98: ; preds = %if.then17 - %from299 = getelementptr inbounds %struct._exon_t.12.103.220.363.480.649.740.857.1039.1065.1078.1091.1117.1130.1156.1169.1195.1221.1234.1286.1299.1312.1338.1429.1455.1468.1494.1520.1884.1897.1975.2066.2105.2170.2171* undef, i64 0, i32 1 + %from299 = getelementptr inbounds %struct._exon_t.12.103.220.363.480.649.740.857.1039.1065.1078.1091.1117.1130.1156.1169.1195.1221.1234.1286.1299.1312.1338.1429.1455.1468.1494.1520.1884.1897.1975.2066.2105.2170.2171, %struct._exon_t.12.103.220.363.480.649.740.857.1039.1065.1078.1091.1117.1130.1156.1169.1195.1221.1234.1286.1299.1312.1338.1429.1455.1468.1494.1520.1884.1897.1975.2066.2105.2170.2171* undef, i64 0, i32 1 br i1 undef, label %land.lhs.true167, label %if.then103 if.then103: ; preds = %if.end98 %.sub100 = select i1 undef, i32 250, i32 undef %mul114 = shl nsw i32 %.sub100, 2 - %from1115 = getelementptr inbounds %struct._exon_t.12.103.220.363.480.649.740.857.1039.1065.1078.1091.1117.1130.1156.1169.1195.1221.1234.1286.1299.1312.1338.1429.1455.1468.1494.1520.1884.1897.1975.2066.2105.2170.2171* undef, i64 0, i32 0 + %from1115 = getelementptr inbounds %struct._exon_t.12.103.220.363.480.649.740.857.1039.1065.1078.1091.1117.1130.1156.1169.1195.1221.1234.1286.1299.1312.1338.1429.1455.1468.1494.1520.1884.1897.1975.2066.2105.2170.2171, %struct._exon_t.12.103.220.363.480.649.740.857.1039.1065.1078.1091.1117.1130.1156.1169.1195.1221.1234.1286.1299.1312.1338.1429.1455.1468.1494.1520.1884.1897.1975.2066.2105.2170.2171* undef, i64 0, i32 0 %cond125 = select i1 undef, i32 undef, i32 %mul114 br label %for.cond.i diff --git a/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll b/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll index 915c41b..273584c 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_smallpt.ll @@ -21,10 +21,10 @@ invoke.cont: ; preds = %invoke.cont, %cond. br i1 undef, label %arrayctor.cont, label %invoke.cont arrayctor.cont: ; preds = %invoke.cont - %agg.tmp99208.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 0, i32 0 - %agg.tmp99208.sroa.1.8.idx388 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 0, i32 1 - %agg.tmp101211.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 1, i32 0 - %agg.tmp101211.sroa.1.8.idx390 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 1, i32 1 + %agg.tmp99208.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 0, i32 0 + %agg.tmp99208.sroa.1.8.idx388 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 0, i32 1 + %agg.tmp101211.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 1, i32 0 + %agg.tmp101211.sroa.1.8.idx390 = getelementptr inbounds %struct.Ray.5.11.53.113.119.137.149.185.329.389.416, %struct.Ray.5.11.53.113.119.137.149.185.329.389.416* undef, i64 0, i32 1, i32 1 br label %for.cond36.preheader for.cond36.preheader: ; preds = %_Z5clampd.exit.1, %arrayctor.cont @@ -89,9 +89,9 @@ if.then38: ; preds = %entry %add4.i698 = fadd double undef, %add4.i719 %mul.i.i679 = fmul double undef, %add.i695 %mul2.i.i680 = fmul double undef, %add4.i698 - %agg.tmp74663.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601* undef, i64 0, i32 1, i32 0 + %agg.tmp74663.sroa.0.0.idx = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601, %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601* undef, i64 0, i32 1, i32 0 store double %mul.i.i679, double* %agg.tmp74663.sroa.0.0.idx, align 8 - %agg.tmp74663.sroa.1.8.idx943 = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601* undef, i64 0, i32 1, i32 1 + %agg.tmp74663.sroa.1.8.idx943 = getelementptr inbounds %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601, %struct.Ray.5.11.53.95.137.191.197.203.239.257.263.269.275.281.287.293.383.437.443.455.461.599.601* undef, i64 0, i32 1, i32 1 store double %mul2.i.i680, double* %agg.tmp74663.sroa.1.8.idx943, align 8 br label %return diff --git a/test/Transforms/SLPVectorizer/X86/crash_vectorizeTree.ll b/test/Transforms/SLPVectorizer/X86/crash_vectorizeTree.ll index 9f1fb71..45ca99a 100644 --- a/test/Transforms/SLPVectorizer/X86/crash_vectorizeTree.ll +++ b/test/Transforms/SLPVectorizer/X86/crash_vectorizeTree.ll @@ -17,12 +17,12 @@ target triple = "x86_64-apple-macosx10.9.0" ;define fastcc void @bar() { define void @bar() { - %1 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 0 - %2 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 1 - %3 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 0 - %4 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 1 - %5 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 0 - %6 = getelementptr inbounds %0* undef, i64 0, i32 1, i32 1 + %1 = getelementptr inbounds %0, %0* undef, i64 0, i32 1, i32 0 + %2 = getelementptr inbounds %0, %0* undef, i64 0, i32 1, i32 1 + %3 = getelementptr inbounds %0, %0* undef, i64 0, i32 1, i32 0 + %4 = getelementptr inbounds %0, %0* undef, i64 0, i32 1, i32 1 + %5 = getelementptr inbounds %0, %0* undef, i64 0, i32 1, i32 0 + %6 = getelementptr inbounds %0, %0* undef, i64 0, i32 1, i32 1 br label %7 ; <label>:7 ; preds = %18, %17, %17, %0 @@ -30,8 +30,8 @@ define void @bar() { %9 = phi double [ 1.800000e+01, %0 ], [ %10, %18 ], [ %10, %17 ], [ %10, %17 ] store double %9, double* %1, align 8 store double %8, double* %2, align 8 - %10 = load double* %3, align 8 - %11 = load double* %4, align 8 + %10 = load double, double* %3, align 8 + %11 = load double, double* %4, align 8 br i1 undef, label %12, label %13 ; <label>:12 ; preds = %7 diff --git a/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll b/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll index 06c4b52..ea0064d 100644 --- a/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll +++ b/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll @@ -26,9 +26,9 @@ target triple = "x86_64-apple-macosx10.8.0" ;CHECK: ret define i32 @foo(double* nocapture %A, float* nocapture %B, i32 %g) { entry: - %0 = load float* %B, align 4 - %arrayidx1 = getelementptr inbounds float* %B, i64 1 - %1 = load float* %arrayidx1, align 4 + %0 = load float, float* %B, align 4 + %arrayidx1 = getelementptr inbounds float, float* %B, i64 1 + %1 = load float, float* %arrayidx1, align 4 %add = fadd float %0, 5.000000e+00 %add2 = fadd float %1, 8.000000e+00 %tobool = icmp eq i32 %g, 0 @@ -40,12 +40,12 @@ if.then: if.end: %conv = fpext float %add to double - %2 = load double* %A, align 8 + %2 = load double, double* %A, align 8 %add4 = fadd double %conv, %2 store double %add4, double* %A, align 8 %conv5 = fpext float %add2 to double - %arrayidx6 = getelementptr inbounds double* %A, i64 1 - %3 = load double* %arrayidx6, align 8 + %arrayidx6 = getelementptr inbounds double, double* %A, i64 1 + %3 = load double, double* %arrayidx6, align 8 %add7 = fadd double %conv5, %3 store double %add7, double* %arrayidx6, align 8 ret i32 undef diff --git a/test/Transforms/SLPVectorizer/X86/cse.ll b/test/Transforms/SLPVectorizer/X86/cse.ll index d2ad7eb..9f56e21 100644 --- a/test/Transforms/SLPVectorizer/X86/cse.ll +++ b/test/Transforms/SLPVectorizer/X86/cse.ll @@ -21,23 +21,23 @@ target triple = "i386-apple-macosx10.8.0" define i32 @test(double* nocapture %G) { entry: - %arrayidx = getelementptr inbounds double* %G, i64 5 - %0 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %G, i64 5 + %0 = load double, double* %arrayidx, align 8 %mul = fmul double %0, 4.000000e+00 %add = fadd double %mul, 1.000000e+00 store double %add, double* %G, align 8 - %arrayidx2 = getelementptr inbounds double* %G, i64 6 - %1 = load double* %arrayidx2, align 8 + %arrayidx2 = getelementptr inbounds double, double* %G, i64 6 + %1 = load double, double* %arrayidx2, align 8 %mul3 = fmul double %1, 3.000000e+00 %add4 = fadd double %mul3, 6.000000e+00 - %arrayidx5 = getelementptr inbounds double* %G, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %G, i64 1 store double %add4, double* %arrayidx5, align 8 %add8 = fadd double %mul, 7.000000e+00 - %arrayidx9 = getelementptr inbounds double* %G, i64 2 + %arrayidx9 = getelementptr inbounds double, double* %G, i64 2 store double %add8, double* %arrayidx9, align 8 %mul11 = fmul double %1, 4.000000e+00 %add12 = fadd double %mul11, 8.000000e+00 - %arrayidx13 = getelementptr inbounds double* %G, i64 3 + %arrayidx13 = getelementptr inbounds double, double* %G, i64 3 store double %add12, double* %arrayidx13, align 8 ret i32 undef } @@ -55,26 +55,26 @@ entry: ;CHECK: ret define i32 @foo(double* nocapture %A, i32 %n) { entry: - %0 = load double* %A, align 8 + %0 = load double, double* %A, align 8 %mul = fmul double %0, 7.900000e+00 %conv = sitofp i32 %n to double %mul1 = fmul double %conv, %mul %add = fadd double %mul1, 6.000000e+00 store double %add, double* %A, align 8 - %arrayidx3 = getelementptr inbounds double* %A, i64 1 - %1 = load double* %arrayidx3, align 8 + %arrayidx3 = getelementptr inbounds double, double* %A, i64 1 + %1 = load double, double* %arrayidx3, align 8 %mul4 = fmul double %1, 7.700000e+00 %mul6 = fmul double %conv, %mul4 %add7 = fadd double %mul6, 2.000000e+00 store double %add7, double* %arrayidx3, align 8 - %arrayidx9 = getelementptr inbounds double* %A, i64 2 - %2 = load double* %arrayidx9, align 8 + %arrayidx9 = getelementptr inbounds double, double* %A, i64 2 + %2 = load double, double* %arrayidx9, align 8 %mul10 = fmul double %2, 7.600000e+00 %mul12 = fmul double %conv, %mul10 %add13 = fadd double %mul12, 3.000000e+00 store double %add13, double* %arrayidx9, align 8 - %arrayidx15 = getelementptr inbounds double* %A, i64 3 - %3 = load double* %arrayidx15, align 8 + %arrayidx15 = getelementptr inbounds double, double* %A, i64 3 + %3 = load double, double* %arrayidx15, align 8 %mul16 = fmul double %3, 7.400000e+00 %mul18 = fmul double %conv, %mul16 %add19 = fadd double %mul18, 4.000000e+00 @@ -101,31 +101,31 @@ entry: ; CHECK: ret define i32 @test2(double* nocapture %G, i32 %k) { %1 = icmp eq i32 %k, 0 - %2 = getelementptr inbounds double* %G, i64 5 - %3 = load double* %2, align 8 + %2 = getelementptr inbounds double, double* %G, i64 5 + %3 = load double, double* %2, align 8 %4 = fmul double %3, 4.000000e+00 br i1 %1, label %12, label %5 ; <label>:5 ; preds = %0 %6 = fadd double %4, 1.000000e+00 store double %6, double* %G, align 8 - %7 = getelementptr inbounds double* %G, i64 6 - %8 = load double* %7, align 8 + %7 = getelementptr inbounds double, double* %G, i64 6 + %8 = load double, double* %7, align 8 %9 = fmul double %8, 3.000000e+00 %10 = fadd double %9, 6.000000e+00 - %11 = getelementptr inbounds double* %G, i64 1 + %11 = getelementptr inbounds double, double* %G, i64 1 store double %10, double* %11, align 8 br label %20 ; <label>:12 ; preds = %0 %13 = fadd double %4, 7.000000e+00 - %14 = getelementptr inbounds double* %G, i64 2 + %14 = getelementptr inbounds double, double* %G, i64 2 store double %13, double* %14, align 8 - %15 = getelementptr inbounds double* %G, i64 6 - %16 = load double* %15, align 8 + %15 = getelementptr inbounds double, double* %G, i64 6 + %16 = load double, double* %15, align 8 %17 = fmul double %16, 3.000000e+00 %18 = fadd double %17, 8.000000e+00 - %19 = getelementptr inbounds double* %G, i64 3 + %19 = getelementptr inbounds double, double* %G, i64 3 store double %18, double* %19, align 8 br label %20 @@ -147,26 +147,26 @@ define i32 @test2(double* nocapture %G, i32 %k) { ;CHECK: ret define i32 @foo4(double* nocapture %A, i32 %n) { entry: - %0 = load double* %A, align 8 + %0 = load double, double* %A, align 8 %mul = fmul double %0, 7.900000e+00 %conv = sitofp i32 %n to double %mul1 = fmul double %conv, %mul %add = fadd double %mul1, 6.000000e+00 store double %add, double* %A, align 8 - %arrayidx3 = getelementptr inbounds double* %A, i64 1 - %1 = load double* %arrayidx3, align 8 + %arrayidx3 = getelementptr inbounds double, double* %A, i64 1 + %1 = load double, double* %arrayidx3, align 8 %mul4 = fmul double %1, 7.900000e+00 %mul6 = fmul double %conv, %mul4 %add7 = fadd double %mul6, 6.000000e+00 store double %add7, double* %arrayidx3, align 8 - %arrayidx9 = getelementptr inbounds double* %A, i64 2 - %2 = load double* %arrayidx9, align 8 + %arrayidx9 = getelementptr inbounds double, double* %A, i64 2 + %2 = load double, double* %arrayidx9, align 8 %mul10 = fmul double %2, 7.900000e+00 %mul12 = fmul double %conv, %mul10 %add13 = fadd double %mul12, 6.000000e+00 store double %add13, double* %arrayidx9, align 8 - %arrayidx15 = getelementptr inbounds double* %A, i64 3 - %3 = load double* %arrayidx15, align 8 + %arrayidx15 = getelementptr inbounds double, double* %A, i64 3 + %3 = load double, double* %arrayidx15, align 8 %mul16 = fmul double %3, 7.900000e+00 %mul18 = fmul double %conv, %mul16 %add19 = fadd double %mul18, 6.000000e+00 @@ -189,24 +189,24 @@ entry: ;CHECK: ret define i32 @partial_mrg(double* nocapture %A, i32 %n) { entry: - %0 = load double* %A, align 8 + %0 = load double, double* %A, align 8 %conv = sitofp i32 %n to double %mul = fmul double %conv, %0 store double %mul, double* %A, align 8 - %arrayidx2 = getelementptr inbounds double* %A, i64 1 - %1 = load double* %arrayidx2, align 8 + %arrayidx2 = getelementptr inbounds double, double* %A, i64 1 + %1 = load double, double* %arrayidx2, align 8 %mul4 = fmul double %conv, %1 store double %mul4, double* %arrayidx2, align 8 %cmp = icmp slt i32 %n, 4 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry - %arrayidx7 = getelementptr inbounds double* %A, i64 2 - %2 = load double* %arrayidx7, align 8 + %arrayidx7 = getelementptr inbounds double, double* %A, i64 2 + %2 = load double, double* %arrayidx7, align 8 %mul9 = fmul double %conv, %2 store double %mul9, double* %arrayidx7, align 8 - %arrayidx11 = getelementptr inbounds double* %A, i64 3 - %3 = load double* %arrayidx11, align 8 + %arrayidx11 = getelementptr inbounds double, double* %A, i64 3 + %3 = load double, double* %arrayidx11, align 8 %add = add nsw i32 %n, 4 %conv12 = sitofp i32 %add to double %mul13 = fmul double %conv12, %3 @@ -227,19 +227,19 @@ entry: br i1 undef, label %if.end13, label %if.end13 sw.epilog7: ; No predecessors! - %.in = getelementptr inbounds %class.B.53.55* %this, i64 0, i32 0, i32 1 - %0 = load double* %.in, align 8 + %.in = getelementptr inbounds %class.B.53.55, %class.B.53.55* %this, i64 0, i32 0, i32 1 + %0 = load double, double* %.in, align 8 %add = fadd double undef, 0.000000e+00 %add6 = fadd double %add, %0 - %1 = load double* @a, align 8 + %1 = load double, double* @a, align 8 %add8 = fadd double %1, 0.000000e+00 - %_dy = getelementptr inbounds %class.B.53.55* %this, i64 0, i32 0, i32 2 - %2 = load double* %_dy, align 8 + %_dy = getelementptr inbounds %class.B.53.55, %class.B.53.55* %this, i64 0, i32 0, i32 2 + %2 = load double, double* %_dy, align 8 %add10 = fadd double %add8, %2 br i1 undef, label %if.then12, label %if.end13 if.then12: ; preds = %sw.epilog7 - %3 = load double* undef, align 8 + %3 = load double, double* undef, align 8 br label %if.end13 if.end13: ; preds = %if.then12, %sw.epilog7, %entry diff --git a/test/Transforms/SLPVectorizer/X86/cycle_dup.ll b/test/Transforms/SLPVectorizer/X86/cycle_dup.ll index bac2c3c..0a4e961 100644 --- a/test/Transforms/SLPVectorizer/X86/cycle_dup.ll +++ b/test/Transforms/SLPVectorizer/X86/cycle_dup.ll @@ -23,15 +23,15 @@ target triple = "x86_64-apple-macosx10.9.0" ;CHECK-NEXT:ret i32 undef define i32 @foo(i32* nocapture %A) #0 { entry: - %0 = load i32* %A, align 4 - %arrayidx1 = getelementptr inbounds i32* %A, i64 1 - %1 = load i32* %arrayidx1, align 4 - %arrayidx2 = getelementptr inbounds i32* %A, i64 2 - %2 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %A, i64 3 - %3 = load i32* %arrayidx3, align 4 - %arrayidx4 = getelementptr inbounds i32* %A, i64 13 - %4 = load i32* %arrayidx4, align 4 + %0 = load i32, i32* %A, align 4 + %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 1 + %1 = load i32, i32* %arrayidx1, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 2 + %2 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 3 + %3 = load i32, i32* %arrayidx3, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 13 + %4 = load i32, i32* %arrayidx4, align 4 %cmp24 = icmp sgt i32 %4, 0 br i1 %cmp24, label %for.body, label %for.end diff --git a/test/Transforms/SLPVectorizer/X86/debug_info.ll b/test/Transforms/SLPVectorizer/X86/debug_info.ll index 21f51d7..ccacbcc 100644 --- a/test/Transforms/SLPVectorizer/X86/debug_info.ll +++ b/test/Transforms/SLPVectorizer/X86/debug_info.ll @@ -15,7 +15,7 @@ target triple = "x86_64-apple-macosx10.7.0" ;CHECK: @depth ;CHECK: getelementptr inbounds {{.*}}, !dbg ![[LOC:[0-9]+]] ;CHECK: bitcast double* {{.*}}, !dbg ![[LOC]] -;CHECK: load <2 x double>* {{.*}}, !dbg ![[LOC]] +;CHECK: load <2 x double>, <2 x double>* {{.*}}, !dbg ![[LOC]] ;CHECK: store <2 x double> {{.*}}, !dbg ![[LOC2:[0-9]+]] ;CHECK: ret ;CHECK: ![[LOC]] = !MDLocation(line: 4, scope: @@ -23,27 +23,27 @@ target triple = "x86_64-apple-macosx10.7.0" define i32 @depth(double* nocapture %A, i32 %m) #0 { entry: - tail call void @llvm.dbg.value(metadata double* %A, i64 0, metadata !12, metadata !{}), !dbg !19 - tail call void @llvm.dbg.value(metadata i32 %m, i64 0, metadata !13, metadata !{}), !dbg !19 - tail call void @llvm.dbg.value(metadata i32 00, i64 0, metadata !14, metadata !{}), !dbg !21 - tail call void @llvm.dbg.value(metadata i32 02, i64 0, metadata !15, metadata !{}), !dbg !21 - tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !{}), !dbg !23 + tail call void @llvm.dbg.value(metadata double* %A, i64 0, metadata !12, metadata !MDExpression()), !dbg !19 + tail call void @llvm.dbg.value(metadata i32 %m, i64 0, metadata !13, metadata !MDExpression()), !dbg !19 + tail call void @llvm.dbg.value(metadata i32 00, i64 0, metadata !14, metadata !MDExpression()), !dbg !21 + tail call void @llvm.dbg.value(metadata i32 02, i64 0, metadata !15, metadata !MDExpression()), !dbg !21 + tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !MDExpression()), !dbg !23 %cmp8 = icmp sgt i32 %m, 0, !dbg !23 br i1 %cmp8, label %for.body.lr.ph, label %for.end, !dbg !23 for.body.lr.ph: ; preds = %entry - %arrayidx = getelementptr inbounds double* %A, i64 4, !dbg !24 - %0 = load double* %arrayidx, align 8, !dbg !24 - %arrayidx1 = getelementptr inbounds double* %A, i64 5, !dbg !29 - %1 = load double* %arrayidx1, align 8, !dbg !29 + %arrayidx = getelementptr inbounds double, double* %A, i64 4, !dbg !24 + %0 = load double, double* %arrayidx, align 8, !dbg !24 + %arrayidx1 = getelementptr inbounds double, double* %A, i64 5, !dbg !29 + %1 = load double, double* %arrayidx1, align 8, !dbg !29 br label %for.end, !dbg !23 for.end: ; preds = %for.body.lr.ph, %entry %y1.0.lcssa = phi double [ %1, %for.body.lr.ph ], [ 1.000000e+00, %entry ] %y0.0.lcssa = phi double [ %0, %for.body.lr.ph ], [ 0.000000e+00, %entry ] - %arrayidx2 = getelementptr inbounds double* %A, i64 8, !dbg !30 + %arrayidx2 = getelementptr inbounds double, double* %A, i64 8, !dbg !30 store double %y0.0.lcssa, double* %arrayidx2, align 8, !dbg !30 - %arrayidx3 = getelementptr inbounds double* %A, i64 9, !dbg !30 + %arrayidx3 = getelementptr inbounds double, double* %A, i64 9, !dbg !30 store double %y1.0.lcssa, double* %arrayidx3, align 8, !dbg !30 ret i32 undef, !dbg !31 } @@ -57,24 +57,24 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!18, !32} -!0 = !{!"0x11\0012\00clang version 3.4 (trunk 187335) (llvm/trunk 187335:187340M)\001\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/Users/nadav/file.c] [DW_LANG_C99] -!1 = !{!"file.c", !"/Users/nadav"} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 187335) (llvm/trunk 187335:187340M)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "file.c", directory: "/Users/nadav") !2 = !{i32 0} !3 = !{!4} -!4 = !{!"0x2e\00depth\00depth\00\001\000\001\000\006\00256\001\001", !1, !5, !6, null, i32 (double*, i32)* @depth, null, null, !11} ; [ DW_TAG_subprogram ] [line 1] [def] [depth] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/Users/nadav/file.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "depth", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (double*, i32)* @depth, variables: !11) +!5 = !MDFile(filename: "file.c", directory: "/Users/nadav") +!6 = !MDSubroutineType(types: !7) !7 = !{!8, !9, !8} -!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 = !{!"0xf\00\000\0064\0064\000\000", null, null, !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from double] -!10 = !{!"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] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10) +!10 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) !11 = !{!12, !13, !14, !15, !16} -!12 = !{!"0x101\00A\0016777217\000", !4, !5, !9} ; [ DW_TAG_arg_variable ] [A] [line 1] -!13 = !{!"0x101\00m\0033554433\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [m] [line 1] -!14 = !{!"0x100\00y0\002\000", !4, !5, !10} ; [ DW_TAG_auto_variable ] [y0] [line 2] -!15 = !{!"0x100\00y1\002\000", !4, !5, !10} ; [ DW_TAG_auto_variable ] [y1] [line 2] -!16 = !{!"0x100\00i\003\000", !17, !5, !8} ; [ DW_TAG_auto_variable ] [i] [line 3] -!17 = !{!"0xb\003\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [/Users/nadav/file.c] +!12 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "A", line: 1, arg: 1, scope: !4, file: !5, type: !9) +!13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "m", line: 1, arg: 2, scope: !4, file: !5, type: !8) +!14 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "y0", line: 2, scope: !4, file: !5, type: !10) +!15 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "y1", line: 2, scope: !4, file: !5, type: !10) +!16 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 3, scope: !17, file: !5, type: !8) +!17 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !4) !18 = !{i32 2, !"Dwarf Version", i32 2} !19 = !MDLocation(line: 1, scope: !4) !20 = !{double 0.000000e+00} @@ -82,8 +82,8 @@ attributes #1 = { nounwind readnone } !22 = !{double 1.000000e+00} !23 = !MDLocation(line: 3, scope: !17) !24 = !MDLocation(line: 4, scope: !25) -!25 = !{!"0xb\003\000\001", !1, !17} ; [ DW_TAG_lexical_block ] [/Users/nadav/file.c] +!25 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !17) !29 = !MDLocation(line: 5, scope: !25) !30 = !MDLocation(line: 7, scope: !4) !31 = !MDLocation(line: 8, scope: !4) -!32 = !{i32 1, !"Debug Info Version", i32 2} +!32 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/SLPVectorizer/X86/diamond.ll b/test/Transforms/SLPVectorizer/X86/diamond.ll index 5135a92..4e2c02f 100644 --- a/test/Transforms/SLPVectorizer/X86/diamond.ll +++ b/test/Transforms/SLPVectorizer/X86/diamond.ll @@ -18,24 +18,24 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK: ret define i32 @foo(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) #0 { entry: - %0 = load i32* %A, align 4 + %0 = load i32, i32* %A, align 4 %mul238 = add i32 %m, %n %add = mul i32 %0, %mul238 store i32 %add, i32* %B, align 4 - %arrayidx4 = getelementptr inbounds i32* %A, i64 1 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 1 + %1 = load i32, i32* %arrayidx4, align 4 %add8 = mul i32 %1, %mul238 - %arrayidx9 = getelementptr inbounds i32* %B, i64 1 + %arrayidx9 = getelementptr inbounds i32, i32* %B, i64 1 store i32 %add8, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %A, i64 2 - %2 = load i32* %arrayidx10, align 4 + %arrayidx10 = getelementptr inbounds i32, i32* %A, i64 2 + %2 = load i32, i32* %arrayidx10, align 4 %add14 = mul i32 %2, %mul238 - %arrayidx15 = getelementptr inbounds i32* %B, i64 2 + %arrayidx15 = getelementptr inbounds i32, i32* %B, i64 2 store i32 %add14, i32* %arrayidx15, align 4 - %arrayidx16 = getelementptr inbounds i32* %A, i64 3 - %3 = load i32* %arrayidx16, align 4 + %arrayidx16 = getelementptr inbounds i32, i32* %A, i64 3 + %3 = load i32, i32* %arrayidx16, align 4 %add20 = mul i32 %3, %mul238 - %arrayidx21 = getelementptr inbounds i32* %B, i64 3 + %arrayidx21 = getelementptr inbounds i32, i32* %B, i64 3 store i32 %add20, i32* %arrayidx21, align 4 ret i32 0 } @@ -56,24 +56,24 @@ entry: ; CHECK-NEXT: ret define i32 @extr_user(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) { entry: - %0 = load i32* %A, align 4 + %0 = load i32, i32* %A, align 4 %mul238 = add i32 %m, %n %add = mul i32 %0, %mul238 store i32 %add, i32* %B, align 4 - %arrayidx4 = getelementptr inbounds i32* %A, i64 1 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 1 + %1 = load i32, i32* %arrayidx4, align 4 %add8 = mul i32 %1, %mul238 - %arrayidx9 = getelementptr inbounds i32* %B, i64 1 + %arrayidx9 = getelementptr inbounds i32, i32* %B, i64 1 store i32 %add8, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %A, i64 2 - %2 = load i32* %arrayidx10, align 4 + %arrayidx10 = getelementptr inbounds i32, i32* %A, i64 2 + %2 = load i32, i32* %arrayidx10, align 4 %add14 = mul i32 %2, %mul238 - %arrayidx15 = getelementptr inbounds i32* %B, i64 2 + %arrayidx15 = getelementptr inbounds i32, i32* %B, i64 2 store i32 %add14, i32* %arrayidx15, align 4 - %arrayidx16 = getelementptr inbounds i32* %A, i64 3 - %3 = load i32* %arrayidx16, align 4 + %arrayidx16 = getelementptr inbounds i32, i32* %A, i64 3 + %3 = load i32, i32* %arrayidx16, align 4 %add20 = mul i32 %3, %mul238 - %arrayidx21 = getelementptr inbounds i32* %B, i64 3 + %arrayidx21 = getelementptr inbounds i32, i32* %B, i64 3 store i32 %add20, i32* %arrayidx21, align 4 ret i32 %0 ;<--------- This value has multiple users } @@ -86,24 +86,24 @@ entry: ; CHECK-NEXT: ret define i32 @extr_user1(i32* noalias nocapture %B, i32* noalias nocapture %A, i32 %n, i32 %m) { entry: - %0 = load i32* %A, align 4 + %0 = load i32, i32* %A, align 4 %mul238 = add i32 %m, %n %add = mul i32 %0, %mul238 store i32 %add, i32* %B, align 4 - %arrayidx4 = getelementptr inbounds i32* %A, i64 1 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 1 + %1 = load i32, i32* %arrayidx4, align 4 %add8 = mul i32 %1, %mul238 - %arrayidx9 = getelementptr inbounds i32* %B, i64 1 + %arrayidx9 = getelementptr inbounds i32, i32* %B, i64 1 store i32 %add8, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %A, i64 2 - %2 = load i32* %arrayidx10, align 4 + %arrayidx10 = getelementptr inbounds i32, i32* %A, i64 2 + %2 = load i32, i32* %arrayidx10, align 4 %add14 = mul i32 %2, %mul238 - %arrayidx15 = getelementptr inbounds i32* %B, i64 2 + %arrayidx15 = getelementptr inbounds i32, i32* %B, i64 2 store i32 %add14, i32* %arrayidx15, align 4 - %arrayidx16 = getelementptr inbounds i32* %A, i64 3 - %3 = load i32* %arrayidx16, align 4 + %arrayidx16 = getelementptr inbounds i32, i32* %A, i64 3 + %3 = load i32, i32* %arrayidx16, align 4 %add20 = mul i32 %3, %mul238 - %arrayidx21 = getelementptr inbounds i32* %B, i64 3 + %arrayidx21 = getelementptr inbounds i32, i32* %B, i64 3 store i32 %add20, i32* %arrayidx21, align 4 ret i32 %1 ;<--------- This value has multiple users } diff --git a/test/Transforms/SLPVectorizer/X86/external_user.ll b/test/Transforms/SLPVectorizer/X86/external_user.ll index 6d09aa6..bf2febd 100644 --- a/test/Transforms/SLPVectorizer/X86/external_user.ll +++ b/test/Transforms/SLPVectorizer/X86/external_user.ll @@ -33,9 +33,9 @@ target triple = "x86_64-apple-macosx10.8.0" define double @ext_user(double* noalias nocapture %B, double* noalias nocapture %A, i32 %n, i32 %m) { entry: - %arrayidx = getelementptr inbounds double* %A, i64 1 - %0 = load double* %arrayidx, align 8 - %1 = load double* %A, align 8 + %arrayidx = getelementptr inbounds double, double* %A, i64 1 + %0 = load double, double* %arrayidx, align 8 + %1 = load double, double* %A, align 8 br label %for.body for.body: ; preds = %for.body, %entry @@ -54,7 +54,7 @@ for.body: ; preds = %for.body, %entry for.end: ; preds = %for.body store double %add5, double* %B, align 8 - %arrayidx7 = getelementptr inbounds double* %B, i64 1 + %arrayidx7 = getelementptr inbounds double, double* %B, i64 1 store double %add4, double* %arrayidx7, align 8 ret double %mul3 } @@ -69,9 +69,9 @@ for.end: ; preds = %for.body define i32 @needtogather(double *noalias %a, i32 *noalias %b, float * noalias %c, i32 * noalias %d) { entry: - %0 = load i32* %d, align 4 + %0 = load i32, i32* %d, align 4 %conv = sitofp i32 %0 to float - %1 = load float* %c + %1 = load float, float* %c %sub = fsub float 0.000000e+00, %1 %mul = fmul float %sub, 0.000000e+00 %add = fadd float %conv, %mul diff --git a/test/Transforms/SLPVectorizer/X86/extract.ll b/test/Transforms/SLPVectorizer/X86/extract.ll index f611fd4..9a6ee2a 100644 --- a/test/Transforms/SLPVectorizer/X86/extract.ll +++ b/test/Transforms/SLPVectorizer/X86/extract.ll @@ -9,11 +9,11 @@ target triple = "x86_64-apple-macosx10.8.0" ;CHECK: ret void define void @fextr(double* %ptr) { entry: - %LD = load <2 x double>* undef + %LD = load <2 x double>, <2 x double>* undef %V0 = extractelement <2 x double> %LD, i32 0 %V1 = extractelement <2 x double> %LD, i32 1 - %P0 = getelementptr inbounds double* %ptr, i64 0 - %P1 = getelementptr inbounds double* %ptr, i64 1 + %P0 = getelementptr inbounds double, double* %ptr, i64 0 + %P1 = getelementptr inbounds double, double* %ptr, i64 1 %A0 = fadd double %V0, 0.0 %A1 = fadd double %V1, 1.1 store double %A0, double* %P0, align 4 @@ -27,11 +27,11 @@ entry: ;CHECK: ret void define void @fextr1(double* %ptr) { entry: - %LD = load <2 x double>* undef + %LD = load <2 x double>, <2 x double>* undef %V0 = extractelement <2 x double> %LD, i32 0 %V1 = extractelement <2 x double> %LD, i32 1 - %P0 = getelementptr inbounds double* %ptr, i64 1 ; <--- incorrect order - %P1 = getelementptr inbounds double* %ptr, i64 0 + %P0 = getelementptr inbounds double, double* %ptr, i64 1 ; <--- incorrect order + %P1 = getelementptr inbounds double, double* %ptr, i64 0 %A0 = fadd double %V0, 1.2 %A1 = fadd double %V1, 3.4 store double %A0, double* %P0, align 4 @@ -45,11 +45,11 @@ entry: ;CHECK: ret void define void @fextr2(double* %ptr) { entry: - %LD = load <4 x double>* undef + %LD = load <4 x double>, <4 x double>* undef %V0 = extractelement <4 x double> %LD, i32 0 ; <--- invalid size. %V1 = extractelement <4 x double> %LD, i32 1 - %P0 = getelementptr inbounds double* %ptr, i64 0 - %P1 = getelementptr inbounds double* %ptr, i64 1 + %P0 = getelementptr inbounds double, double* %ptr, i64 0 + %P1 = getelementptr inbounds double, double* %ptr, i64 1 %A0 = fadd double %V0, 5.5 %A1 = fadd double %V1, 6.6 store double %A0, double* %P0, align 4 diff --git a/test/Transforms/SLPVectorizer/X86/extract_in_tree_user.ll b/test/Transforms/SLPVectorizer/X86/extract_in_tree_user.ll index 3628042..6e5415b 100644 --- a/test/Transforms/SLPVectorizer/X86/extract_in_tree_user.ll +++ b/test/Transforms/SLPVectorizer/X86/extract_in_tree_user.ll @@ -7,13 +7,13 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" ; Function Attrs: nounwind ssp uwtable define i32 @fn1() { entry: - %0 = load i64** @a, align 8 - %add.ptr = getelementptr inbounds i64* %0, i64 11 + %0 = load i64*, i64** @a, align 8 + %add.ptr = getelementptr inbounds i64, i64* %0, i64 11 %1 = ptrtoint i64* %add.ptr to i64 store i64 %1, i64* %add.ptr, align 8 - %add.ptr1 = getelementptr inbounds i64* %0, i64 56 + %add.ptr1 = getelementptr inbounds i64, i64* %0, i64 56 %2 = ptrtoint i64* %add.ptr1 to i64 - %arrayidx2 = getelementptr inbounds i64* %0, i64 12 + %arrayidx2 = getelementptr inbounds i64, i64* %0, i64 12 store i64 %2, i64* %arrayidx2, align 8 ret i32 undef ; CHECK-LABEL: @fn1( @@ -25,42 +25,42 @@ entry: declare float @llvm.powi.f32(float, i32) define void @fn2(i32* %a, i32* %b, float* %c) { entry: - %i0 = load i32* %a, align 4 - %i1 = load i32* %b, align 4 + %i0 = load i32, i32* %a, align 4 + %i1 = load i32, i32* %b, align 4 %add1 = add i32 %i0, %i1 %fp1 = sitofp i32 %add1 to float %call1 = tail call float @llvm.powi.f32(float %fp1,i32 %add1) nounwind readnone - %arrayidx2 = getelementptr inbounds i32* %a, i32 1 - %i2 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i32 1 - %i3 = load i32* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i32 1 + %i2 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i32 1 + %i3 = load i32, i32* %arrayidx3, align 4 %add2 = add i32 %i2, %i3 %fp2 = sitofp i32 %add2 to float %call2 = tail call float @llvm.powi.f32(float %fp2,i32 %add1) nounwind readnone - %arrayidx4 = getelementptr inbounds i32* %a, i32 2 - %i4 = load i32* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds i32* %b, i32 2 - %i5 = load i32* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i32 2 + %i4 = load i32, i32* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds i32, i32* %b, i32 2 + %i5 = load i32, i32* %arrayidx5, align 4 %add3 = add i32 %i4, %i5 %fp3 = sitofp i32 %add3 to float %call3 = tail call float @llvm.powi.f32(float %fp3,i32 %add1) nounwind readnone - %arrayidx6 = getelementptr inbounds i32* %a, i32 3 - %i6 = load i32* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds i32* %b, i32 3 - %i7 = load i32* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %a, i32 3 + %i6 = load i32, i32* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %b, i32 3 + %i7 = load i32, i32* %arrayidx7, align 4 %add4 = add i32 %i6, %i7 %fp4 = sitofp i32 %add4 to float %call4 = tail call float @llvm.powi.f32(float %fp4,i32 %add1) nounwind readnone store float %call1, float* %c, align 4 - %arrayidx8 = getelementptr inbounds float* %c, i32 1 + %arrayidx8 = getelementptr inbounds float, float* %c, i32 1 store float %call2, float* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds float* %c, i32 2 + %arrayidx9 = getelementptr inbounds float, float* %c, i32 2 store float %call3, float* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds float* %c, i32 3 + %arrayidx10 = getelementptr inbounds float, float* %c, i32 3 store float %call4, float* %arrayidx10, align 4 ret void diff --git a/test/Transforms/SLPVectorizer/X86/extractcost.ll b/test/Transforms/SLPVectorizer/X86/extractcost.ll index 01baf66..164ddf3 100644 --- a/test/Transforms/SLPVectorizer/X86/extractcost.ll +++ b/test/Transforms/SLPVectorizer/X86/extractcost.ll @@ -13,15 +13,15 @@ entry: store i32 %add, i32* %A, align 4 %mul1 = mul nsw i32 %n, 9 %add2 = add nsw i32 %mul1, 9 - %arrayidx3 = getelementptr inbounds i32* %A, i64 1 + %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 1 store i32 %add2, i32* %arrayidx3, align 4 %mul4 = shl i32 %n, 3 %add5 = add nsw i32 %mul4, 9 - %arrayidx6 = getelementptr inbounds i32* %A, i64 2 + %arrayidx6 = getelementptr inbounds i32, i32* %A, i64 2 store i32 %add5, i32* %arrayidx6, align 4 %mul7 = mul nsw i32 %n, 10 %add8 = add nsw i32 %mul7, 9 - %arrayidx9 = getelementptr inbounds i32* %A, i64 3 + %arrayidx9 = getelementptr inbounds i32, i32* %A, i64 3 store i32 %add8, i32* %arrayidx9, align 4 %externaluse1 = add nsw i32 %add, %m %externaluse2 = mul nsw i32 %add, %m ; we should add the extract cost only once and the store will be vectorized diff --git a/test/Transforms/SLPVectorizer/X86/flag.ll b/test/Transforms/SLPVectorizer/X86/flag.ll index 3ca5407..7db8d75 100644 --- a/test/Transforms/SLPVectorizer/X86/flag.ll +++ b/test/Transforms/SLPVectorizer/X86/flag.ll @@ -15,17 +15,17 @@ define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i6 .lr.ph: ; preds = %0, %.lr.ph %i.019 = phi i64 [ %26, %.lr.ph ], [ 0, %0 ] %2 = shl i64 %i.019, 2 - %3 = getelementptr inbounds i32* %in, i64 %2 - %4 = load i32* %3, align 4 + %3 = getelementptr inbounds i32, i32* %in, i64 %2 + %4 = load i32, i32* %3, align 4 %5 = or i64 %2, 1 - %6 = getelementptr inbounds i32* %in, i64 %5 - %7 = load i32* %6, align 4 + %6 = getelementptr inbounds i32, i32* %in, i64 %5 + %7 = load i32, i32* %6, align 4 %8 = or i64 %2, 2 - %9 = getelementptr inbounds i32* %in, i64 %8 - %10 = load i32* %9, align 4 + %9 = getelementptr inbounds i32, i32* %in, i64 %8 + %10 = load i32, i32* %9, align 4 %11 = or i64 %2, 3 - %12 = getelementptr inbounds i32* %in, i64 %11 - %13 = load i32* %12, align 4 + %12 = getelementptr inbounds i32, i32* %in, i64 %11 + %13 = load i32, i32* %12, align 4 %14 = mul i32 %4, 7 %15 = add i32 %14, 7 %16 = mul i32 %7, 7 @@ -34,13 +34,13 @@ define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i6 %19 = add i32 %18, 21 %20 = mul i32 %13, 7 %21 = add i32 %20, 28 - %22 = getelementptr inbounds i32* %out, i64 %2 + %22 = getelementptr inbounds i32, i32* %out, i64 %2 store i32 %15, i32* %22, align 4 - %23 = getelementptr inbounds i32* %out, i64 %5 + %23 = getelementptr inbounds i32, i32* %out, i64 %5 store i32 %17, i32* %23, align 4 - %24 = getelementptr inbounds i32* %out, i64 %8 + %24 = getelementptr inbounds i32, i32* %out, i64 %8 store i32 %19, i32* %24, align 4 - %25 = getelementptr inbounds i32* %out, i64 %11 + %25 = getelementptr inbounds i32, i32* %out, i64 %11 store i32 %21, i32* %25, align 4 %26 = add i64 %i.019, 1 %exitcond = icmp eq i64 %26, %n diff --git a/test/Transforms/SLPVectorizer/X86/gep.ll b/test/Transforms/SLPVectorizer/X86/gep.ll index 9e105ec..3f952d7 100644 --- a/test/Transforms/SLPVectorizer/X86/gep.ll +++ b/test/Transforms/SLPVectorizer/X86/gep.ll @@ -9,15 +9,15 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" ; CHECK-LABEL: foo1 ; CHECK: <2 x i32*> define void @foo1 ({ i32*, i32* }* noalias %x, { i32*, i32* }* noalias %y) { - %1 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 0 - %2 = load i32** %1, align 8 - %3 = getelementptr inbounds i32* %2, i64 16 - %4 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 0 + %1 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %y, i64 0, i32 0 + %2 = load i32*, i32** %1, align 8 + %3 = getelementptr inbounds i32, i32* %2, i64 16 + %4 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %x, i64 0, i32 0 store i32* %3, i32** %4, align 8 - %5 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 1 - %6 = load i32** %5, align 8 - %7 = getelementptr inbounds i32* %6, i64 16 - %8 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 1 + %5 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %y, i64 0, i32 1 + %6 = load i32*, i32** %5, align 8 + %7 = getelementptr inbounds i32, i32* %6, i64 16 + %8 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %x, i64 0, i32 1 store i32* %7, i32** %8, align 8 ret void } @@ -27,15 +27,15 @@ define void @foo1 ({ i32*, i32* }* noalias %x, { i32*, i32* }* noalias %y) { ; CHECK-LABEL: foo2 ; CHECK-NOT: <2 x i32*> define void @foo2 ({ i32*, i32* }* noalias %x, { i32*, i32* }* noalias %y, i32 %i) { - %1 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 0 - %2 = load i32** %1, align 8 - %3 = getelementptr inbounds i32* %2, i32 %i - %4 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 0 + %1 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %y, i64 0, i32 0 + %2 = load i32*, i32** %1, align 8 + %3 = getelementptr inbounds i32, i32* %2, i32 %i + %4 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %x, i64 0, i32 0 store i32* %3, i32** %4, align 8 - %5 = getelementptr inbounds { i32*, i32* }* %y, i64 0, i32 1 - %6 = load i32** %5, align 8 - %7 = getelementptr inbounds i32* %6, i32 %i - %8 = getelementptr inbounds { i32*, i32* }* %x, i64 0, i32 1 + %5 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %y, i64 0, i32 1 + %6 = load i32*, i32** %5, align 8 + %7 = getelementptr inbounds i32, i32* %6, i32 %i + %8 = getelementptr inbounds { i32*, i32* }, { i32*, i32* }* %x, i64 0, i32 1 store i32* %7, i32** %8, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/hoist.ll b/test/Transforms/SLPVectorizer/X86/hoist.ll index 78c58f1..36c939b 100644 --- a/test/Transforms/SLPVectorizer/X86/hoist.ll +++ b/test/Transforms/SLPVectorizer/X86/hoist.ll @@ -30,23 +30,23 @@ entry: for.body: ; preds = %entry, %for.body %i.024 = phi i32 [ 0, %entry ], [ %add10, %for.body ] - %arrayidx = getelementptr inbounds i32* %A, i32 %i.024 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.024 + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %n store i32 %add, i32* %arrayidx, align 4 %add121 = or i32 %i.024, 1 - %arrayidx2 = getelementptr inbounds i32* %A, i32 %add121 - %1 = load i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i32 %add121 + %1 = load i32, i32* %arrayidx2, align 4 %add3 = add nsw i32 %1, %k store i32 %add3, i32* %arrayidx2, align 4 %add422 = or i32 %i.024, 2 - %arrayidx5 = getelementptr inbounds i32* %A, i32 %add422 - %2 = load i32* %arrayidx5, align 4 + %arrayidx5 = getelementptr inbounds i32, i32* %A, i32 %add422 + %2 = load i32, i32* %arrayidx5, align 4 %add6 = add nsw i32 %2, %n store i32 %add6, i32* %arrayidx5, align 4 %add723 = or i32 %i.024, 3 - %arrayidx8 = getelementptr inbounds i32* %A, i32 %add723 - %3 = load i32* %arrayidx8, align 4 + %arrayidx8 = getelementptr inbounds i32, i32* %A, i32 %add723 + %3 = load i32, i32* %arrayidx8, align 4 %add9 = add nsw i32 %3, %k store i32 %add9, i32* %arrayidx8, align 4 %add10 = add nsw i32 %i.024, 4 diff --git a/test/Transforms/SLPVectorizer/X86/horizontal.ll b/test/Transforms/SLPVectorizer/X86/horizontal.ll index 1836047..83b2e01 100644 --- a/test/Transforms/SLPVectorizer/X86/horizontal.ll +++ b/test/Transforms/SLPVectorizer/X86/horizontal.ll @@ -32,22 +32,22 @@ for.body: %i.033 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %sum.032 = phi float [ 0.000000e+00, %for.body.lr.ph ], [ %add17, %for.body ] %mul = shl nsw i64 %i.033, 2 - %arrayidx = getelementptr inbounds float* %A, i64 %mul - %1 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %A, i64 %mul + %1 = load float, float* %arrayidx, align 4 %mul2 = fmul float %1, 7.000000e+00 %add28 = or i64 %mul, 1 - %arrayidx4 = getelementptr inbounds float* %A, i64 %add28 - %2 = load float* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds float, float* %A, i64 %add28 + %2 = load float, float* %arrayidx4, align 4 %mul5 = fmul float %2, 7.000000e+00 %add6 = fadd fast float %mul2, %mul5 %add829 = or i64 %mul, 2 - %arrayidx9 = getelementptr inbounds float* %A, i64 %add829 - %3 = load float* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds float, float* %A, i64 %add829 + %3 = load float, float* %arrayidx9, align 4 %mul10 = fmul float %3, 7.000000e+00 %add11 = fadd fast float %add6, %mul10 %add1330 = or i64 %mul, 3 - %arrayidx14 = getelementptr inbounds float* %A, i64 %add1330 - %4 = load float* %arrayidx14, align 4 + %arrayidx14 = getelementptr inbounds float, float* %A, i64 %add1330 + %4 = load float, float* %arrayidx14, align 4 %mul15 = fmul float %4, 7.000000e+00 %add16 = fadd fast float %add11, %mul15 %add17 = fadd fast float %sum.032, %add16 @@ -85,13 +85,13 @@ entry: br i1 %cmp38, label %for.body.lr.ph, label %for.end for.body.lr.ph: - %0 = load float* %B, align 4 - %arrayidx4 = getelementptr inbounds float* %B, i64 1 - %1 = load float* %arrayidx4, align 4 - %arrayidx9 = getelementptr inbounds float* %B, i64 2 - %2 = load float* %arrayidx9, align 4 - %arrayidx15 = getelementptr inbounds float* %B, i64 3 - %3 = load float* %arrayidx15, align 4 + %0 = load float, float* %B, align 4 + %arrayidx4 = getelementptr inbounds float, float* %B, i64 1 + %1 = load float, float* %arrayidx4, align 4 + %arrayidx9 = getelementptr inbounds float, float* %B, i64 2 + %2 = load float, float* %arrayidx9, align 4 + %arrayidx15 = getelementptr inbounds float, float* %B, i64 3 + %3 = load float, float* %arrayidx15, align 4 %4 = sext i32 %n to i64 br label %for.body @@ -99,22 +99,22 @@ for.body: %i.040 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %sum.039 = phi float [ 0.000000e+00, %for.body.lr.ph ], [ %mul21, %for.body ] %mul = shl nsw i64 %i.040, 2 - %arrayidx2 = getelementptr inbounds float* %A, i64 %mul - %5 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %mul + %5 = load float, float* %arrayidx2, align 4 %mul3 = fmul float %0, %5 %add35 = or i64 %mul, 1 - %arrayidx6 = getelementptr inbounds float* %A, i64 %add35 - %6 = load float* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds float, float* %A, i64 %add35 + %6 = load float, float* %arrayidx6, align 4 %mul7 = fmul float %1, %6 %add8 = fadd fast float %mul3, %mul7 %add1136 = or i64 %mul, 2 - %arrayidx12 = getelementptr inbounds float* %A, i64 %add1136 - %7 = load float* %arrayidx12, align 4 + %arrayidx12 = getelementptr inbounds float, float* %A, i64 %add1136 + %7 = load float, float* %arrayidx12, align 4 %mul13 = fmul float %2, %7 %add14 = fadd fast float %add8, %mul13 %add1737 = or i64 %mul, 3 - %arrayidx18 = getelementptr inbounds float* %A, i64 %add1737 - %8 = load float* %arrayidx18, align 4 + %arrayidx18 = getelementptr inbounds float, float* %A, i64 %add1737 + %8 = load float, float* %arrayidx18, align 4 %mul19 = fmul float %3, %8 %add20 = fadd fast float %add14, %mul19 %mul21 = fmul float %sum.039, %add20 @@ -157,23 +157,23 @@ entry: br i1 %cmp81, label %for.body.lr.ph, label %for.end for.body.lr.ph: - %0 = load float* %B, align 4 - %arrayidx4 = getelementptr inbounds float* %B, i64 1 - %1 = load float* %arrayidx4, align 4 - %arrayidx9 = getelementptr inbounds float* %B, i64 2 - %2 = load float* %arrayidx9, align 4 - %arrayidx15 = getelementptr inbounds float* %B, i64 3 - %3 = load float* %arrayidx15, align 4 - %arrayidx21 = getelementptr inbounds float* %B, i64 4 - %4 = load float* %arrayidx21, align 4 - %arrayidx27 = getelementptr inbounds float* %B, i64 5 - %5 = load float* %arrayidx27, align 4 - %arrayidx33 = getelementptr inbounds float* %B, i64 6 - %6 = load float* %arrayidx33, align 4 - %arrayidx39 = getelementptr inbounds float* %B, i64 7 - %7 = load float* %arrayidx39, align 4 - %arrayidx45 = getelementptr inbounds float* %B, i64 8 - %8 = load float* %arrayidx45, align 4 + %0 = load float, float* %B, align 4 + %arrayidx4 = getelementptr inbounds float, float* %B, i64 1 + %1 = load float, float* %arrayidx4, align 4 + %arrayidx9 = getelementptr inbounds float, float* %B, i64 2 + %2 = load float, float* %arrayidx9, align 4 + %arrayidx15 = getelementptr inbounds float, float* %B, i64 3 + %3 = load float, float* %arrayidx15, align 4 + %arrayidx21 = getelementptr inbounds float, float* %B, i64 4 + %4 = load float, float* %arrayidx21, align 4 + %arrayidx27 = getelementptr inbounds float, float* %B, i64 5 + %5 = load float, float* %arrayidx27, align 4 + %arrayidx33 = getelementptr inbounds float, float* %B, i64 6 + %6 = load float, float* %arrayidx33, align 4 + %arrayidx39 = getelementptr inbounds float, float* %B, i64 7 + %7 = load float, float* %arrayidx39, align 4 + %arrayidx45 = getelementptr inbounds float, float* %B, i64 8 + %8 = load float, float* %arrayidx45, align 4 %9 = sext i32 %n to i64 br label %for.body @@ -181,47 +181,47 @@ for.body: %i.083 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %sum.082 = phi float [ 0.000000e+00, %for.body.lr.ph ], [ %add51, %for.body ] %mul = mul nsw i64 %i.083, 6 - %arrayidx2 = getelementptr inbounds float* %A, i64 %mul - %10 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %mul + %10 = load float, float* %arrayidx2, align 4 %mul3 = fmul fast float %0, %10 %add80 = or i64 %mul, 1 - %arrayidx6 = getelementptr inbounds float* %A, i64 %add80 - %11 = load float* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds float, float* %A, i64 %add80 + %11 = load float, float* %arrayidx6, align 4 %mul7 = fmul fast float %1, %11 %add8 = fadd fast float %mul3, %mul7 %add11 = add nsw i64 %mul, 2 - %arrayidx12 = getelementptr inbounds float* %A, i64 %add11 - %12 = load float* %arrayidx12, align 4 + %arrayidx12 = getelementptr inbounds float, float* %A, i64 %add11 + %12 = load float, float* %arrayidx12, align 4 %mul13 = fmul fast float %2, %12 %add14 = fadd fast float %add8, %mul13 %add17 = add nsw i64 %mul, 3 - %arrayidx18 = getelementptr inbounds float* %A, i64 %add17 - %13 = load float* %arrayidx18, align 4 + %arrayidx18 = getelementptr inbounds float, float* %A, i64 %add17 + %13 = load float, float* %arrayidx18, align 4 %mul19 = fmul fast float %3, %13 %add20 = fadd fast float %add14, %mul19 %add23 = add nsw i64 %mul, 4 - %arrayidx24 = getelementptr inbounds float* %A, i64 %add23 - %14 = load float* %arrayidx24, align 4 + %arrayidx24 = getelementptr inbounds float, float* %A, i64 %add23 + %14 = load float, float* %arrayidx24, align 4 %mul25 = fmul fast float %4, %14 %add26 = fadd fast float %add20, %mul25 %add29 = add nsw i64 %mul, 5 - %arrayidx30 = getelementptr inbounds float* %A, i64 %add29 - %15 = load float* %arrayidx30, align 4 + %arrayidx30 = getelementptr inbounds float, float* %A, i64 %add29 + %15 = load float, float* %arrayidx30, align 4 %mul31 = fmul fast float %5, %15 %add32 = fadd fast float %add26, %mul31 %add35 = add nsw i64 %mul, 6 - %arrayidx36 = getelementptr inbounds float* %A, i64 %add35 - %16 = load float* %arrayidx36, align 4 + %arrayidx36 = getelementptr inbounds float, float* %A, i64 %add35 + %16 = load float, float* %arrayidx36, align 4 %mul37 = fmul fast float %6, %16 %add38 = fadd fast float %add32, %mul37 %add41 = add nsw i64 %mul, 7 - %arrayidx42 = getelementptr inbounds float* %A, i64 %add41 - %17 = load float* %arrayidx42, align 4 + %arrayidx42 = getelementptr inbounds float, float* %A, i64 %add41 + %17 = load float, float* %arrayidx42, align 4 %mul43 = fmul fast float %7, %17 %add44 = fadd fast float %add38, %mul43 %add47 = add nsw i64 %mul, 8 - %arrayidx48 = getelementptr inbounds float* %A, i64 %add47 - %18 = load float* %arrayidx48, align 4 + %arrayidx48 = getelementptr inbounds float, float* %A, i64 %add47 + %18 = load float, float* %arrayidx48, align 4 %mul49 = fmul fast float %8, %18 %add50 = fadd fast float %add44, %mul49 %add51 = fadd fast float %sum.082, %add50 @@ -259,13 +259,13 @@ entry: br i1 %cmp41, label %for.body.lr.ph, label %for.end for.body.lr.ph: - %0 = load float* %B, align 4 - %arrayidx4 = getelementptr inbounds float* %B, i64 1 - %1 = load float* %arrayidx4, align 4 - %arrayidx10 = getelementptr inbounds float* %B, i64 2 - %2 = load float* %arrayidx10, align 4 - %arrayidx16 = getelementptr inbounds float* %B, i64 3 - %3 = load float* %arrayidx16, align 4 + %0 = load float, float* %B, align 4 + %arrayidx4 = getelementptr inbounds float, float* %B, i64 1 + %1 = load float, float* %arrayidx4, align 4 + %arrayidx10 = getelementptr inbounds float, float* %B, i64 2 + %2 = load float, float* %arrayidx10, align 4 + %arrayidx16 = getelementptr inbounds float, float* %B, i64 3 + %3 = load float, float* %arrayidx16, align 4 %4 = sext i32 %n to i64 br label %for.body @@ -273,23 +273,23 @@ for.body: %i.043 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %sum.042 = phi float [ 0.000000e+00, %for.body.lr.ph ], [ %add21, %for.body ] %mul = shl nsw i64 %i.043, 2 - %arrayidx2 = getelementptr inbounds float* %A, i64 %mul - %5 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %mul + %5 = load float, float* %arrayidx2, align 4 %mul3 = fmul fast float %0, %5 %add = fadd fast float %sum.042, %mul3 %add638 = or i64 %mul, 1 - %arrayidx7 = getelementptr inbounds float* %A, i64 %add638 - %6 = load float* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds float, float* %A, i64 %add638 + %6 = load float, float* %arrayidx7, align 4 %mul8 = fmul fast float %1, %6 %add9 = fadd fast float %add, %mul8 %add1239 = or i64 %mul, 2 - %arrayidx13 = getelementptr inbounds float* %A, i64 %add1239 - %7 = load float* %arrayidx13, align 4 + %arrayidx13 = getelementptr inbounds float, float* %A, i64 %add1239 + %7 = load float, float* %arrayidx13, align 4 %mul14 = fmul fast float %2, %7 %add15 = fadd fast float %add9, %mul14 %add1840 = or i64 %mul, 3 - %arrayidx19 = getelementptr inbounds float* %A, i64 %add1840 - %8 = load float* %arrayidx19, align 4 + %arrayidx19 = getelementptr inbounds float, float* %A, i64 %add1840 + %8 = load float, float* %arrayidx19, align 4 %mul20 = fmul fast float %3, %8 %add21 = fadd fast float %add15, %mul20 %inc = add nsw i64 %i.043, 1 @@ -326,40 +326,40 @@ entry: br i1 %cmp37, label %for.body.lr.ph, label %for.end for.body.lr.ph: - %arrayidx4 = getelementptr inbounds float* %B, i64 1 - %arrayidx9 = getelementptr inbounds float* %B, i64 2 - %arrayidx15 = getelementptr inbounds float* %B, i64 3 + %arrayidx4 = getelementptr inbounds float, float* %B, i64 1 + %arrayidx9 = getelementptr inbounds float, float* %B, i64 2 + %arrayidx15 = getelementptr inbounds float, float* %B, i64 3 %0 = sext i32 %n to i64 br label %for.body for.body: %i.039 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %C.addr.038 = phi float* [ %C, %for.body.lr.ph ], [ %incdec.ptr, %for.body ] - %1 = load float* %B, align 4 + %1 = load float, float* %B, align 4 %mul = shl nsw i64 %i.039, 2 - %arrayidx2 = getelementptr inbounds float* %A, i64 %mul - %2 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 %mul + %2 = load float, float* %arrayidx2, align 4 %mul3 = fmul fast float %1, %2 - %3 = load float* %arrayidx4, align 4 + %3 = load float, float* %arrayidx4, align 4 %add34 = or i64 %mul, 1 - %arrayidx6 = getelementptr inbounds float* %A, i64 %add34 - %4 = load float* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds float, float* %A, i64 %add34 + %4 = load float, float* %arrayidx6, align 4 %mul7 = fmul fast float %3, %4 %add8 = fadd fast float %mul3, %mul7 - %5 = load float* %arrayidx9, align 4 + %5 = load float, float* %arrayidx9, align 4 %add1135 = or i64 %mul, 2 - %arrayidx12 = getelementptr inbounds float* %A, i64 %add1135 - %6 = load float* %arrayidx12, align 4 + %arrayidx12 = getelementptr inbounds float, float* %A, i64 %add1135 + %6 = load float, float* %arrayidx12, align 4 %mul13 = fmul fast float %5, %6 %add14 = fadd fast float %add8, %mul13 - %7 = load float* %arrayidx15, align 4 + %7 = load float, float* %arrayidx15, align 4 %add1736 = or i64 %mul, 3 - %arrayidx18 = getelementptr inbounds float* %A, i64 %add1736 - %8 = load float* %arrayidx18, align 4 + %arrayidx18 = getelementptr inbounds float, float* %A, i64 %add1736 + %8 = load float, float* %arrayidx18, align 4 %mul19 = fmul fast float %7, %8 %add20 = fadd fast float %add14, %mul19 store float %add20, float* %C.addr.038, align 4 - %incdec.ptr = getelementptr inbounds float* %C.addr.038, i64 1 + %incdec.ptr = getelementptr inbounds float, float* %C.addr.038, i64 1 %inc = add nsw i64 %i.039, 1 %exitcond = icmp eq i64 %inc, %0 br i1 %exitcond, label %for.end, label %for.body @@ -389,24 +389,24 @@ entry: br i1 %cmp17, label %for.body.lr.ph, label %for.end for.body.lr.ph: - %0 = load double* %B, align 8 - %arrayidx4 = getelementptr inbounds double* %B, i64 1 - %1 = load double* %arrayidx4, align 8 + %0 = load double, double* %B, align 8 + %arrayidx4 = getelementptr inbounds double, double* %B, i64 1 + %1 = load double, double* %arrayidx4, align 8 %2 = sext i32 %n to i64 br label %for.body for.body: %i.018 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %mul = shl nsw i64 %i.018, 2 - %arrayidx2 = getelementptr inbounds double* %A, i64 %mul - %3 = load double* %arrayidx2, align 8 + %arrayidx2 = getelementptr inbounds double, double* %A, i64 %mul + %3 = load double, double* %arrayidx2, align 8 %mul3 = fmul fast double %0, %3 %add16 = or i64 %mul, 1 - %arrayidx6 = getelementptr inbounds double* %A, i64 %add16 - %4 = load double* %arrayidx6, align 8 + %arrayidx6 = getelementptr inbounds double, double* %A, i64 %add16 + %4 = load double, double* %arrayidx6, align 8 %mul7 = fmul fast double %1, %4 %add8 = fadd fast double %mul3, %mul7 - %arrayidx9 = getelementptr inbounds double* %C, i64 %i.018 + %arrayidx9 = getelementptr inbounds double, double* %C, i64 %i.018 store double %add8, double* %arrayidx9, align 8 %inc = add nsw i64 %i.018, 1 %exitcond = icmp eq i64 %inc, %2 diff --git a/test/Transforms/SLPVectorizer/X86/implicitfloat.ll b/test/Transforms/SLPVectorizer/X86/implicitfloat.ll index f63f268..f7283f0 100644 --- a/test/Transforms/SLPVectorizer/X86/implicitfloat.ll +++ b/test/Transforms/SLPVectorizer/X86/implicitfloat.ll @@ -9,16 +9,16 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK: ret define void @test1(double* %a, double* %b, double* %c) noimplicitfloat { ; <------ noimplicitfloat attribute here! entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/in-tree-user.ll b/test/Transforms/SLPVectorizer/X86/in-tree-user.ll index 194a0fb..a638548 100644 --- a/test/Transforms/SLPVectorizer/X86/in-tree-user.ll +++ b/test/Transforms/SLPVectorizer/X86/in-tree-user.ll @@ -19,15 +19,15 @@ entry: for.body: ; preds = %for.inc, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ] %0 = shl nsw i64 %indvars.iv, 1 - %arrayidx = getelementptr inbounds double* %A, i64 %0 - %1 = load double* %arrayidx, align 8 + %arrayidx = getelementptr inbounds double, double* %A, i64 %0 + %1 = load double, double* %arrayidx, align 8 %mul1 = fmul double %conv, %1 %mul2 = fmul double %mul1, 7.000000e+00 %add = fadd double %mul2, 5.000000e+00 %InTreeUser = fadd double %add, %add ; <------------------ In tree user. %2 = or i64 %0, 1 - %arrayidx6 = getelementptr inbounds double* %A, i64 %2 - %3 = load double* %arrayidx6, align 8 + %arrayidx6 = getelementptr inbounds double, double* %A, i64 %2 + %3 = load double, double* %arrayidx6, align 8 %mul8 = fmul double %conv, %3 %mul9 = fmul double %mul8, 4.000000e+00 %add10 = fadd double %mul9, 9.000000e+00 @@ -35,7 +35,7 @@ for.body: ; preds = %for.inc, %entry br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %for.body - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str, i64 0, i64 0)) + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)) br label %for.inc for.inc: ; preds = %for.body, %if.then diff --git a/test/Transforms/SLPVectorizer/X86/intrinsic.ll b/test/Transforms/SLPVectorizer/X86/intrinsic.ll index 937252f..cc5a4af 100644 --- a/test/Transforms/SLPVectorizer/X86/intrinsic.ll +++ b/test/Transforms/SLPVectorizer/X86/intrinsic.ll @@ -13,18 +13,18 @@ declare double @llvm.fabs.f64(double) nounwind readnone ;CHECK: ret define void @vec_fabs_f64(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 %call = tail call double @llvm.fabs.f64(double %mul) nounwind readnone - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 %call5 = tail call double @llvm.fabs.f64(double %mul5) nounwind readnone store double %call, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %call5, double* %arrayidx5, align 8 ret void } @@ -39,33 +39,33 @@ declare float @llvm.copysign.f32(float, float) nounwind readnone ;CHECK: ret define void @vec_copysign_f32(float* %a, float* %b, float* noalias %c) { entry: - %0 = load float* %a, align 4 - %1 = load float* %b, align 4 + %0 = load float, float* %a, align 4 + %1 = load float, float* %b, align 4 %call0 = tail call float @llvm.copysign.f32(float %0, float %1) nounwind readnone store float %call0, float* %c, align 4 - %ix2 = getelementptr inbounds float* %a, i64 1 - %2 = load float* %ix2, align 4 - %ix3 = getelementptr inbounds float* %b, i64 1 - %3 = load float* %ix3, align 4 + %ix2 = getelementptr inbounds float, float* %a, i64 1 + %2 = load float, float* %ix2, align 4 + %ix3 = getelementptr inbounds float, float* %b, i64 1 + %3 = load float, float* %ix3, align 4 %call1 = tail call float @llvm.copysign.f32(float %2, float %3) nounwind readnone - %c1 = getelementptr inbounds float* %c, i64 1 + %c1 = getelementptr inbounds float, float* %c, i64 1 store float %call1, float* %c1, align 4 - %ix4 = getelementptr inbounds float* %a, i64 2 - %4 = load float* %ix4, align 4 - %ix5 = getelementptr inbounds float* %b, i64 2 - %5 = load float* %ix5, align 4 + %ix4 = getelementptr inbounds float, float* %a, i64 2 + %4 = load float, float* %ix4, align 4 + %ix5 = getelementptr inbounds float, float* %b, i64 2 + %5 = load float, float* %ix5, align 4 %call2 = tail call float @llvm.copysign.f32(float %4, float %5) nounwind readnone - %c2 = getelementptr inbounds float* %c, i64 2 + %c2 = getelementptr inbounds float, float* %c, i64 2 store float %call2, float* %c2, align 4 - %ix6 = getelementptr inbounds float* %a, i64 3 - %6 = load float* %ix6, align 4 - %ix7 = getelementptr inbounds float* %b, i64 3 - %7 = load float* %ix7, align 4 + %ix6 = getelementptr inbounds float, float* %a, i64 3 + %6 = load float, float* %ix6, align 4 + %ix7 = getelementptr inbounds float, float* %b, i64 3 + %7 = load float, float* %ix7, align 4 %call3 = tail call float @llvm.copysign.f32(float %6, float %7) nounwind readnone - %c3 = getelementptr inbounds float* %c, i64 3 + %c3 = getelementptr inbounds float, float* %c, i64 3 store float %call3, float* %c3, align 4 ret void @@ -75,38 +75,38 @@ declare i32 @llvm.bswap.i32(i32) nounwind readnone define void @vec_bswap_i32(i32* %a, i32* %b, i32* %c) { entry: - %i0 = load i32* %a, align 4 - %i1 = load i32* %b, align 4 + %i0 = load i32, i32* %a, align 4 + %i1 = load i32, i32* %b, align 4 %add1 = add i32 %i0, %i1 %call1 = tail call i32 @llvm.bswap.i32(i32 %add1) nounwind readnone - %arrayidx2 = getelementptr inbounds i32* %a, i32 1 - %i2 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i32 1 - %i3 = load i32* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i32 1 + %i2 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i32 1 + %i3 = load i32, i32* %arrayidx3, align 4 %add2 = add i32 %i2, %i3 %call2 = tail call i32 @llvm.bswap.i32(i32 %add2) nounwind readnone - %arrayidx4 = getelementptr inbounds i32* %a, i32 2 - %i4 = load i32* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds i32* %b, i32 2 - %i5 = load i32* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i32 2 + %i4 = load i32, i32* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds i32, i32* %b, i32 2 + %i5 = load i32, i32* %arrayidx5, align 4 %add3 = add i32 %i4, %i5 %call3 = tail call i32 @llvm.bswap.i32(i32 %add3) nounwind readnone - %arrayidx6 = getelementptr inbounds i32* %a, i32 3 - %i6 = load i32* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds i32* %b, i32 3 - %i7 = load i32* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %a, i32 3 + %i6 = load i32, i32* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %b, i32 3 + %i7 = load i32, i32* %arrayidx7, align 4 %add4 = add i32 %i6, %i7 %call4 = tail call i32 @llvm.bswap.i32(i32 %add4) nounwind readnone store i32 %call1, i32* %c, align 4 - %arrayidx8 = getelementptr inbounds i32* %c, i32 1 + %arrayidx8 = getelementptr inbounds i32, i32* %c, i32 1 store i32 %call2, i32* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds i32* %c, i32 2 + %arrayidx9 = getelementptr inbounds i32, i32* %c, i32 2 store i32 %call3, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %c, i32 3 + %arrayidx10 = getelementptr inbounds i32, i32* %c, i32 3 store i32 %call4, i32* %arrayidx10, align 4 ret void @@ -122,38 +122,38 @@ declare i32 @llvm.ctlz.i32(i32,i1) nounwind readnone define void @vec_ctlz_i32(i32* %a, i32* %b, i32* %c, i1) { entry: - %i0 = load i32* %a, align 4 - %i1 = load i32* %b, align 4 + %i0 = load i32, i32* %a, align 4 + %i1 = load i32, i32* %b, align 4 %add1 = add i32 %i0, %i1 %call1 = tail call i32 @llvm.ctlz.i32(i32 %add1,i1 true) nounwind readnone - %arrayidx2 = getelementptr inbounds i32* %a, i32 1 - %i2 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i32 1 - %i3 = load i32* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i32 1 + %i2 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i32 1 + %i3 = load i32, i32* %arrayidx3, align 4 %add2 = add i32 %i2, %i3 %call2 = tail call i32 @llvm.ctlz.i32(i32 %add2,i1 true) nounwind readnone - %arrayidx4 = getelementptr inbounds i32* %a, i32 2 - %i4 = load i32* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds i32* %b, i32 2 - %i5 = load i32* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i32 2 + %i4 = load i32, i32* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds i32, i32* %b, i32 2 + %i5 = load i32, i32* %arrayidx5, align 4 %add3 = add i32 %i4, %i5 %call3 = tail call i32 @llvm.ctlz.i32(i32 %add3,i1 true) nounwind readnone - %arrayidx6 = getelementptr inbounds i32* %a, i32 3 - %i6 = load i32* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds i32* %b, i32 3 - %i7 = load i32* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %a, i32 3 + %i6 = load i32, i32* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %b, i32 3 + %i7 = load i32, i32* %arrayidx7, align 4 %add4 = add i32 %i6, %i7 %call4 = tail call i32 @llvm.ctlz.i32(i32 %add4,i1 true) nounwind readnone store i32 %call1, i32* %c, align 4 - %arrayidx8 = getelementptr inbounds i32* %c, i32 1 + %arrayidx8 = getelementptr inbounds i32, i32* %c, i32 1 store i32 %call2, i32* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds i32* %c, i32 2 + %arrayidx9 = getelementptr inbounds i32, i32* %c, i32 2 store i32 %call3, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %c, i32 3 + %arrayidx10 = getelementptr inbounds i32, i32* %c, i32 3 store i32 %call4, i32* %arrayidx10, align 4 ret void @@ -167,38 +167,38 @@ entry: define void @vec_ctlz_i32_neg(i32* %a, i32* %b, i32* %c, i1) { entry: - %i0 = load i32* %a, align 4 - %i1 = load i32* %b, align 4 + %i0 = load i32, i32* %a, align 4 + %i1 = load i32, i32* %b, align 4 %add1 = add i32 %i0, %i1 %call1 = tail call i32 @llvm.ctlz.i32(i32 %add1,i1 true) nounwind readnone - %arrayidx2 = getelementptr inbounds i32* %a, i32 1 - %i2 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i32 1 - %i3 = load i32* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i32 1 + %i2 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i32 1 + %i3 = load i32, i32* %arrayidx3, align 4 %add2 = add i32 %i2, %i3 %call2 = tail call i32 @llvm.ctlz.i32(i32 %add2,i1 false) nounwind readnone - %arrayidx4 = getelementptr inbounds i32* %a, i32 2 - %i4 = load i32* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds i32* %b, i32 2 - %i5 = load i32* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i32 2 + %i4 = load i32, i32* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds i32, i32* %b, i32 2 + %i5 = load i32, i32* %arrayidx5, align 4 %add3 = add i32 %i4, %i5 %call3 = tail call i32 @llvm.ctlz.i32(i32 %add3,i1 true) nounwind readnone - %arrayidx6 = getelementptr inbounds i32* %a, i32 3 - %i6 = load i32* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds i32* %b, i32 3 - %i7 = load i32* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %a, i32 3 + %i6 = load i32, i32* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %b, i32 3 + %i7 = load i32, i32* %arrayidx7, align 4 %add4 = add i32 %i6, %i7 %call4 = tail call i32 @llvm.ctlz.i32(i32 %add4,i1 false) nounwind readnone store i32 %call1, i32* %c, align 4 - %arrayidx8 = getelementptr inbounds i32* %c, i32 1 + %arrayidx8 = getelementptr inbounds i32, i32* %c, i32 1 store i32 %call2, i32* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds i32* %c, i32 2 + %arrayidx9 = getelementptr inbounds i32, i32* %c, i32 2 store i32 %call3, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %c, i32 3 + %arrayidx10 = getelementptr inbounds i32, i32* %c, i32 3 store i32 %call4, i32* %arrayidx10, align 4 ret void @@ -212,38 +212,38 @@ declare i32 @llvm.cttz.i32(i32,i1) nounwind readnone define void @vec_cttz_i32(i32* %a, i32* %b, i32* %c, i1) { entry: - %i0 = load i32* %a, align 4 - %i1 = load i32* %b, align 4 + %i0 = load i32, i32* %a, align 4 + %i1 = load i32, i32* %b, align 4 %add1 = add i32 %i0, %i1 %call1 = tail call i32 @llvm.cttz.i32(i32 %add1,i1 true) nounwind readnone - %arrayidx2 = getelementptr inbounds i32* %a, i32 1 - %i2 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i32 1 - %i3 = load i32* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i32 1 + %i2 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i32 1 + %i3 = load i32, i32* %arrayidx3, align 4 %add2 = add i32 %i2, %i3 %call2 = tail call i32 @llvm.cttz.i32(i32 %add2,i1 true) nounwind readnone - %arrayidx4 = getelementptr inbounds i32* %a, i32 2 - %i4 = load i32* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds i32* %b, i32 2 - %i5 = load i32* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i32 2 + %i4 = load i32, i32* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds i32, i32* %b, i32 2 + %i5 = load i32, i32* %arrayidx5, align 4 %add3 = add i32 %i4, %i5 %call3 = tail call i32 @llvm.cttz.i32(i32 %add3,i1 true) nounwind readnone - %arrayidx6 = getelementptr inbounds i32* %a, i32 3 - %i6 = load i32* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds i32* %b, i32 3 - %i7 = load i32* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %a, i32 3 + %i6 = load i32, i32* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %b, i32 3 + %i7 = load i32, i32* %arrayidx7, align 4 %add4 = add i32 %i6, %i7 %call4 = tail call i32 @llvm.cttz.i32(i32 %add4,i1 true) nounwind readnone store i32 %call1, i32* %c, align 4 - %arrayidx8 = getelementptr inbounds i32* %c, i32 1 + %arrayidx8 = getelementptr inbounds i32, i32* %c, i32 1 store i32 %call2, i32* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds i32* %c, i32 2 + %arrayidx9 = getelementptr inbounds i32, i32* %c, i32 2 store i32 %call3, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %c, i32 3 + %arrayidx10 = getelementptr inbounds i32, i32* %c, i32 3 store i32 %call4, i32* %arrayidx10, align 4 ret void @@ -257,38 +257,38 @@ entry: define void @vec_cttz_i32_neg(i32* %a, i32* %b, i32* %c, i1) { entry: - %i0 = load i32* %a, align 4 - %i1 = load i32* %b, align 4 + %i0 = load i32, i32* %a, align 4 + %i1 = load i32, i32* %b, align 4 %add1 = add i32 %i0, %i1 %call1 = tail call i32 @llvm.cttz.i32(i32 %add1,i1 true) nounwind readnone - %arrayidx2 = getelementptr inbounds i32* %a, i32 1 - %i2 = load i32* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i32 1 - %i3 = load i32* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %a, i32 1 + %i2 = load i32, i32* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i32 1 + %i3 = load i32, i32* %arrayidx3, align 4 %add2 = add i32 %i2, %i3 %call2 = tail call i32 @llvm.cttz.i32(i32 %add2,i1 false) nounwind readnone - %arrayidx4 = getelementptr inbounds i32* %a, i32 2 - %i4 = load i32* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds i32* %b, i32 2 - %i5 = load i32* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %a, i32 2 + %i4 = load i32, i32* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds i32, i32* %b, i32 2 + %i5 = load i32, i32* %arrayidx5, align 4 %add3 = add i32 %i4, %i5 %call3 = tail call i32 @llvm.cttz.i32(i32 %add3,i1 true) nounwind readnone - %arrayidx6 = getelementptr inbounds i32* %a, i32 3 - %i6 = load i32* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds i32* %b, i32 3 - %i7 = load i32* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %a, i32 3 + %i6 = load i32, i32* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds i32, i32* %b, i32 3 + %i7 = load i32, i32* %arrayidx7, align 4 %add4 = add i32 %i6, %i7 %call4 = tail call i32 @llvm.cttz.i32(i32 %add4,i1 false) nounwind readnone store i32 %call1, i32* %c, align 4 - %arrayidx8 = getelementptr inbounds i32* %c, i32 1 + %arrayidx8 = getelementptr inbounds i32, i32* %c, i32 1 store i32 %call2, i32* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds i32* %c, i32 2 + %arrayidx9 = getelementptr inbounds i32, i32* %c, i32 2 store i32 %call3, i32* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds i32* %c, i32 3 + %arrayidx10 = getelementptr inbounds i32, i32* %c, i32 3 store i32 %call4, i32* %arrayidx10, align 4 ret void @@ -300,38 +300,38 @@ entry: declare float @llvm.powi.f32(float, i32) define void @vec_powi_f32(float* %a, float* %b, float* %c, i32 %P) { entry: - %i0 = load float* %a, align 4 - %i1 = load float* %b, align 4 + %i0 = load float, float* %a, align 4 + %i1 = load float, float* %b, align 4 %add1 = fadd float %i0, %i1 %call1 = tail call float @llvm.powi.f32(float %add1,i32 %P) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %a, i32 1 - %i2 = load float* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds float* %b, i32 1 - %i3 = load float* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds float, float* %a, i32 1 + %i2 = load float, float* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds float, float* %b, i32 1 + %i3 = load float, float* %arrayidx3, align 4 %add2 = fadd float %i2, %i3 %call2 = tail call float @llvm.powi.f32(float %add2,i32 %P) nounwind readnone - %arrayidx4 = getelementptr inbounds float* %a, i32 2 - %i4 = load float* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds float* %b, i32 2 - %i5 = load float* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds float, float* %a, i32 2 + %i4 = load float, float* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds float, float* %b, i32 2 + %i5 = load float, float* %arrayidx5, align 4 %add3 = fadd float %i4, %i5 %call3 = tail call float @llvm.powi.f32(float %add3,i32 %P) nounwind readnone - %arrayidx6 = getelementptr inbounds float* %a, i32 3 - %i6 = load float* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds float* %b, i32 3 - %i7 = load float* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds float, float* %a, i32 3 + %i6 = load float, float* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds float, float* %b, i32 3 + %i7 = load float, float* %arrayidx7, align 4 %add4 = fadd float %i6, %i7 %call4 = tail call float @llvm.powi.f32(float %add4,i32 %P) nounwind readnone store float %call1, float* %c, align 4 - %arrayidx8 = getelementptr inbounds float* %c, i32 1 + %arrayidx8 = getelementptr inbounds float, float* %c, i32 1 store float %call2, float* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds float* %c, i32 2 + %arrayidx9 = getelementptr inbounds float, float* %c, i32 2 store float %call3, float* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds float* %c, i32 3 + %arrayidx10 = getelementptr inbounds float, float* %c, i32 3 store float %call4, float* %arrayidx10, align 4 ret void @@ -346,38 +346,38 @@ entry: define void @vec_powi_f32_neg(float* %a, float* %b, float* %c, i32 %P, i32 %Q) { entry: - %i0 = load float* %a, align 4 - %i1 = load float* %b, align 4 + %i0 = load float, float* %a, align 4 + %i1 = load float, float* %b, align 4 %add1 = fadd float %i0, %i1 %call1 = tail call float @llvm.powi.f32(float %add1,i32 %P) nounwind readnone - %arrayidx2 = getelementptr inbounds float* %a, i32 1 - %i2 = load float* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds float* %b, i32 1 - %i3 = load float* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds float, float* %a, i32 1 + %i2 = load float, float* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds float, float* %b, i32 1 + %i3 = load float, float* %arrayidx3, align 4 %add2 = fadd float %i2, %i3 %call2 = tail call float @llvm.powi.f32(float %add2,i32 %Q) nounwind readnone - %arrayidx4 = getelementptr inbounds float* %a, i32 2 - %i4 = load float* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds float* %b, i32 2 - %i5 = load float* %arrayidx5, align 4 + %arrayidx4 = getelementptr inbounds float, float* %a, i32 2 + %i4 = load float, float* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds float, float* %b, i32 2 + %i5 = load float, float* %arrayidx5, align 4 %add3 = fadd float %i4, %i5 %call3 = tail call float @llvm.powi.f32(float %add3,i32 %P) nounwind readnone - %arrayidx6 = getelementptr inbounds float* %a, i32 3 - %i6 = load float* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds float* %b, i32 3 - %i7 = load float* %arrayidx7, align 4 + %arrayidx6 = getelementptr inbounds float, float* %a, i32 3 + %i6 = load float, float* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds float, float* %b, i32 3 + %i7 = load float, float* %arrayidx7, align 4 %add4 = fadd float %i6, %i7 %call4 = tail call float @llvm.powi.f32(float %add4,i32 %Q) nounwind readnone store float %call1, float* %c, align 4 - %arrayidx8 = getelementptr inbounds float* %c, i32 1 + %arrayidx8 = getelementptr inbounds float, float* %c, i32 1 store float %call2, float* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds float* %c, i32 2 + %arrayidx9 = getelementptr inbounds float, float* %c, i32 2 store float %call3, float* %arrayidx9, align 4 - %arrayidx10 = getelementptr inbounds float* %c, i32 3 + %arrayidx10 = getelementptr inbounds float, float* %c, i32 3 store float %call4, float* %arrayidx10, align 4 ret void diff --git a/test/Transforms/SLPVectorizer/X86/long_chains.ll b/test/Transforms/SLPVectorizer/X86/long_chains.ll index 5af3e6d..f87dabf 100644 --- a/test/Transforms/SLPVectorizer/X86/long_chains.ll +++ b/test/Transforms/SLPVectorizer/X86/long_chains.ll @@ -13,9 +13,9 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK: ret define i32 @test(double* nocapture %A, i8* nocapture %B) { entry: - %0 = load i8* %B, align 1 - %arrayidx1 = getelementptr inbounds i8* %B, i64 1 - %1 = load i8* %arrayidx1, align 1 + %0 = load i8, i8* %B, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %B, i64 1 + %1 = load i8, i8* %arrayidx1, align 1 %add = add i8 %0, 3 %add4 = add i8 %1, 3 %conv6 = sitofp i8 %add to double @@ -41,7 +41,7 @@ entry: %mul25 = fmul double %add22, %add22 %add26 = fadd double %mul25, 1.000000e+00 store double %add24, double* %A, align 8 - %arrayidx28 = getelementptr inbounds double* %A, i64 1 + %arrayidx28 = getelementptr inbounds double, double* %A, i64 1 store double %add26, double* %arrayidx28, align 8 ret i32 undef } diff --git a/test/Transforms/SLPVectorizer/X86/loopinvariant.ll b/test/Transforms/SLPVectorizer/X86/loopinvariant.ll index bc12926..0c16c34 100644 --- a/test/Transforms/SLPVectorizer/X86/loopinvariant.ll +++ b/test/Transforms/SLPVectorizer/X86/loopinvariant.ll @@ -18,43 +18,43 @@ entry: for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i32* %A, i64 %indvars.iv - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv + %0 = load i32, i32* %arrayidx, align 4 %add1 = add nsw i32 %0, %n store i32 %add1, i32* %arrayidx, align 4 %1 = or i64 %indvars.iv, 1 - %arrayidx4 = getelementptr inbounds i32* %A, i64 %1 - %2 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %1 + %2 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %2, %n store i32 %add5, i32* %arrayidx4, align 4 %3 = or i64 %indvars.iv, 2 - %arrayidx8 = getelementptr inbounds i32* %A, i64 %3 - %4 = load i32* %arrayidx8, align 4 + %arrayidx8 = getelementptr inbounds i32, i32* %A, i64 %3 + %4 = load i32, i32* %arrayidx8, align 4 %add9 = add nsw i32 %4, %n store i32 %add9, i32* %arrayidx8, align 4 %5 = or i64 %indvars.iv, 3 - %arrayidx12 = getelementptr inbounds i32* %A, i64 %5 - %6 = load i32* %arrayidx12, align 4 + %arrayidx12 = getelementptr inbounds i32, i32* %A, i64 %5 + %6 = load i32, i32* %arrayidx12, align 4 %add13 = add nsw i32 %6, %n store i32 %add13, i32* %arrayidx12, align 4 %7 = or i64 %indvars.iv, 4 - %arrayidx16 = getelementptr inbounds i32* %A, i64 %7 - %8 = load i32* %arrayidx16, align 4 + %arrayidx16 = getelementptr inbounds i32, i32* %A, i64 %7 + %8 = load i32, i32* %arrayidx16, align 4 %add17 = add nsw i32 %8, %n store i32 %add17, i32* %arrayidx16, align 4 %9 = or i64 %indvars.iv, 5 - %arrayidx20 = getelementptr inbounds i32* %A, i64 %9 - %10 = load i32* %arrayidx20, align 4 + %arrayidx20 = getelementptr inbounds i32, i32* %A, i64 %9 + %10 = load i32, i32* %arrayidx20, align 4 %add21 = add nsw i32 %10, %n store i32 %add21, i32* %arrayidx20, align 4 %11 = or i64 %indvars.iv, 6 - %arrayidx24 = getelementptr inbounds i32* %A, i64 %11 - %12 = load i32* %arrayidx24, align 4 + %arrayidx24 = getelementptr inbounds i32, i32* %A, i64 %11 + %12 = load i32, i32* %arrayidx24, align 4 %add25 = add nsw i32 %12, %n store i32 %add25, i32* %arrayidx24, align 4 %13 = or i64 %indvars.iv, 7 - %arrayidx28 = getelementptr inbounds i32* %A, i64 %13 - %14 = load i32* %arrayidx28, align 4 + %arrayidx28 = getelementptr inbounds i32, i32* %A, i64 %13 + %14 = load i32, i32* %arrayidx28, align 4 %add29 = add nsw i32 %14, %n store i32 %add29, i32* %arrayidx28, align 4 %indvars.iv.next = add i64 %indvars.iv, 8 diff --git a/test/Transforms/SLPVectorizer/X86/metadata.ll b/test/Transforms/SLPVectorizer/X86/metadata.ll index e021cca..ebef6b5 100644 --- a/test/Transforms/SLPVectorizer/X86/metadata.ll +++ b/test/Transforms/SLPVectorizer/X86/metadata.ll @@ -12,16 +12,16 @@ target triple = "x86_64-apple-macosx10.8.0" define void @test1(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8, !tbaa !4 - %i1 = load double* %b, align 8, !tbaa !4 + %i0 = load double, double* %a, align 8, !tbaa !4 + %i1 = load double, double* %b, align 8, !tbaa !4 %mul = fmul double %i0, %i1, !fpmath !0 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8, !tbaa !4 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8, !tbaa !4 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8, !tbaa !4 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8, !tbaa !4 %mul5 = fmul double %i3, %i4, !fpmath !0 store double %mul, double* %c, align 8, !tbaa !4 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8, !tbaa !4 ret void } @@ -35,17 +35,17 @@ entry: define void @test2(double* %a, double* %b, i8* %e) { entry: - %i0 = load double* %a, align 8, !tbaa !4 - %i1 = load double* %b, align 8, !tbaa !4 + %i0 = load double, double* %a, align 8, !tbaa !4 + %i1 = load double, double* %b, align 8, !tbaa !4 %mul = fmul double %i0, %i1, !fpmath !1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8, !tbaa !4 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8, !tbaa !4 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8, !tbaa !4 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8, !tbaa !4 %mul5 = fmul double %i3, %i4, !fpmath !1 %c = bitcast i8* %e to double* store double %mul, double* %c, align 8, !tbaa !4 - %carrayidx5 = getelementptr inbounds i8* %e, i64 8 + %carrayidx5 = getelementptr inbounds i8, i8* %e, i64 8 %arrayidx5 = bitcast i8* %carrayidx5 to double* store double %mul5, double* %arrayidx5, align 8, !tbaa !4 ret void diff --git a/test/Transforms/SLPVectorizer/X86/multi_block.ll b/test/Transforms/SLPVectorizer/X86/multi_block.ll index 2f1cc74..993054a 100644 --- a/test/Transforms/SLPVectorizer/X86/multi_block.ll +++ b/test/Transforms/SLPVectorizer/X86/multi_block.ll @@ -25,9 +25,9 @@ target triple = "x86_64-apple-macosx10.7.0" ;CHECK: store <2 x double> ;CHECK: ret define i32 @bar(double* nocapture %A, i32 %d) { - %1 = load double* %A, align 8 - %2 = getelementptr inbounds double* %A, i64 1 - %3 = load double* %2, align 8 + %1 = load double, double* %A, align 8 + %2 = getelementptr inbounds double, double* %A, i64 1 + %3 = load double, double* %2, align 8 %4 = fptrunc double %1 to float %5 = fptrunc double %3 to float %6 = icmp eq i32 %d, 0 @@ -42,11 +42,11 @@ define i32 @bar(double* nocapture %A, i32 %d) { %11 = fadd float %5, 5.000000e+00 %12 = fpext float %10 to double %13 = fadd double %12, 9.000000e+00 - %14 = getelementptr inbounds double* %A, i64 8 + %14 = getelementptr inbounds double, double* %A, i64 8 store double %13, double* %14, align 8 %15 = fpext float %11 to double %16 = fadd double %15, 5.000000e+00 - %17 = getelementptr inbounds double* %A, i64 9 + %17 = getelementptr inbounds double, double* %A, i64 9 store double %16, double* %17, align 8 ret i32 undef } diff --git a/test/Transforms/SLPVectorizer/X86/multi_user.ll b/test/Transforms/SLPVectorizer/X86/multi_user.ll index 63a77e4..3197f6d 100644 --- a/test/Transforms/SLPVectorizer/X86/multi_user.ll +++ b/test/Transforms/SLPVectorizer/X86/multi_user.ll @@ -20,27 +20,27 @@ target triple = "x86_64-apple-macosx10.7.0" define i32 @foo(i32* nocapture %A, i32 %n) { %1 = mul nsw i32 %n, 5 %2 = add nsw i32 %1, 7 - %3 = load i32* %A, align 4 + %3 = load i32, i32* %A, align 4 %4 = add nsw i32 %2, %3 store i32 %4, i32* %A, align 4 %5 = add nsw i32 %1, 8 - %6 = getelementptr inbounds i32* %A, i64 1 - %7 = load i32* %6, align 4 + %6 = getelementptr inbounds i32, i32* %A, i64 1 + %7 = load i32, i32* %6, align 4 %8 = add nsw i32 %5, %7 store i32 %8, i32* %6, align 4 %9 = add nsw i32 %1, 9 - %10 = getelementptr inbounds i32* %A, i64 2 - %11 = load i32* %10, align 4 + %10 = getelementptr inbounds i32, i32* %A, i64 2 + %11 = load i32, i32* %10, align 4 %12 = add nsw i32 %9, %11 store i32 %12, i32* %10, align 4 %13 = add nsw i32 %1, 10 - %14 = getelementptr inbounds i32* %A, i64 3 - %15 = load i32* %14, align 4 + %14 = getelementptr inbounds i32, i32* %A, i64 3 + %15 = load i32, i32* %14, align 4 %16 = add nsw i32 %13, %15 store i32 %16, i32* %14, align 4 %17 = add nsw i32 %1, 11 - %18 = getelementptr inbounds i32* %A, i64 4 - %19 = load i32* %18, align 4 + %18 = getelementptr inbounds i32, i32* %A, i64 4 + %19 = load i32, i32* %18, align 4 %20 = add nsw i32 %17, %19 store i32 %20, i32* %18, align 4 ret i32 undef diff --git a/test/Transforms/SLPVectorizer/X86/odd_store.ll b/test/Transforms/SLPVectorizer/X86/odd_store.ll index 027f601..25f049a 100644 --- a/test/Transforms/SLPVectorizer/X86/odd_store.ll +++ b/test/Transforms/SLPVectorizer/X86/odd_store.ll @@ -18,28 +18,28 @@ target triple = "x86_64-apple-macosx10.8.0" ;CHECK-NOT: store <3 x i8> ;CHECK: ret define i32 @foo(i8* noalias nocapture %A, float* noalias nocapture %B, float %T) { - %1 = getelementptr inbounds float* %B, i64 10 - %2 = load float* %1, align 4 + %1 = getelementptr inbounds float, float* %B, i64 10 + %2 = load float, float* %1, align 4 %3 = fmul float %2, %T %4 = fpext float %3 to double %5 = fadd double %4, 4.000000e+00 %6 = fptosi double %5 to i8 store i8 %6, i8* %A, align 1 - %7 = getelementptr inbounds float* %B, i64 11 - %8 = load float* %7, align 4 + %7 = getelementptr inbounds float, float* %B, i64 11 + %8 = load float, float* %7, align 4 %9 = fmul float %8, %T %10 = fpext float %9 to double %11 = fadd double %10, 5.000000e+00 %12 = fptosi double %11 to i8 - %13 = getelementptr inbounds i8* %A, i64 1 + %13 = getelementptr inbounds i8, i8* %A, i64 1 store i8 %12, i8* %13, align 1 - %14 = getelementptr inbounds float* %B, i64 12 - %15 = load float* %14, align 4 + %14 = getelementptr inbounds float, float* %B, i64 12 + %15 = load float, float* %14, align 4 %16 = fmul float %15, %T %17 = fpext float %16 to double %18 = fadd double %17, 6.000000e+00 %19 = fptosi double %18 to i8 - %20 = getelementptr inbounds i8* %A, i64 2 + %20 = getelementptr inbounds i8, i8* %A, i64 2 store i8 %19, i8* %20, align 1 ret i32 undef } diff --git a/test/Transforms/SLPVectorizer/X86/operandorder.ll b/test/Transforms/SLPVectorizer/X86/operandorder.ll index cd446f0..109540b 100644 --- a/test/Transforms/SLPVectorizer/X86/operandorder.ll +++ b/test/Transforms/SLPVectorizer/X86/operandorder.ll @@ -13,12 +13,12 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define void @shuffle_operands1(double * noalias %from, double * noalias %to, double %v1, double %v2) { - %from_1 = getelementptr double *%from, i64 1 - %v0_1 = load double * %from - %v0_2 = load double * %from_1 + %from_1 = getelementptr double, double *%from, i64 1 + %v0_1 = load double , double * %from + %v0_2 = load double , double * %from_1 %v1_1 = fadd double %v0_1, %v1 %v1_2 = fadd double %v2, %v0_2 - %to_2 = getelementptr double * %to, i64 1 + %to_2 = getelementptr double, double * %to, i64 1 store double %v1_1, double *%to store double %v1_2, double *%to_2 ret void @@ -35,12 +35,12 @@ br label %lp lp: %p = phi double [ 1.000000e+00, %lp ], [ 0.000000e+00, %entry ] - %from_1 = getelementptr double *%from, i64 1 - %v0_1 = load double * %from - %v0_2 = load double * %from_1 + %from_1 = getelementptr double, double *%from, i64 1 + %v0_1 = load double , double * %from + %v0_2 = load double , double * %from_1 %v1_1 = fadd double %v0_1, %p %v1_2 = fadd double %v0_1, %v0_2 - %to_2 = getelementptr double * %to, i64 1 + %to_2 = getelementptr double, double * %to, i64 1 store double %v1_1, double *%to store double %v1_2, double *%to_2 br i1 undef, label %lp, label %ext @@ -60,12 +60,12 @@ br label %lp lp: %p = phi double [ 1.000000e+00, %lp ], [ 0.000000e+00, %entry ] - %from_1 = getelementptr double *%from, i64 1 - %v0_1 = load double * %from - %v0_2 = load double * %from_1 + %from_1 = getelementptr double, double *%from, i64 1 + %v0_1 = load double , double * %from + %v0_2 = load double , double * %from_1 %v1_1 = fadd double %p, %v0_1 %v1_2 = fadd double %v0_2, %v0_1 - %to_2 = getelementptr double * %to, i64 1 + %to_2 = getelementptr double, double * %to, i64 1 store double %v1_1, double *%to store double %v1_2, double *%to_2 br i1 undef, label %lp, label %ext @@ -85,12 +85,12 @@ br label %lp lp: %p = phi double [ 1.000000e+00, %lp ], [ 0.000000e+00, %entry ] - %from_1 = getelementptr double *%from, i64 1 - %v0_1 = load double * %from - %v0_2 = load double * %from_1 + %from_1 = getelementptr double, double *%from, i64 1 + %v0_1 = load double , double * %from + %v0_2 = load double , double * %from_1 %v1_1 = fadd double %p, %v0_1 %v1_2 = fadd double %v0_1, %v0_2 - %to_2 = getelementptr double * %to, i64 1 + %to_2 = getelementptr double, double * %to, i64 1 store double %v1_1, double *%to store double %v1_2, double *%to_2 br i1 undef, label %lp, label %ext @@ -111,12 +111,12 @@ br label %lp lp: %p = phi double [ 1.000000e+00, %lp ], [ 0.000000e+00, %entry ] - %from_1 = getelementptr double *%from, i64 1 - %v0_1 = load double * %from - %v0_2 = load double * %from_1 + %from_1 = getelementptr double, double *%from, i64 1 + %v0_1 = load double , double * %from + %v0_2 = load double , double * %from_1 %v1_1 = fadd double %v0_2, %v0_1 %v1_2 = fadd double %p, %v0_1 - %to_2 = getelementptr double * %to, i64 1 + %to_2 = getelementptr double, double * %to, i64 1 store double %v1_1, double *%to store double %v1_2, double *%to_2 br i1 undef, label %lp, label %ext @@ -136,12 +136,12 @@ br label %lp lp: %p = phi double [ 1.000000e+00, %lp ], [ 0.000000e+00, %entry ] - %from_1 = getelementptr double *%from, i64 1 - %v0_1 = load double * %from - %v0_2 = load double * %from_1 + %from_1 = getelementptr double, double *%from, i64 1 + %v0_1 = load double , double * %from + %v0_2 = load double , double * %from_1 %v1_1 = fadd double %v0_1, %v0_2 %v1_2 = fadd double %p, %v0_1 - %to_2 = getelementptr double * %to, i64 1 + %to_2 = getelementptr double, double * %to, i64 1 store double %v1_1, double *%to store double %v1_2, double *%to_2 br i1 undef, label %lp, label %ext @@ -162,12 +162,12 @@ br label %lp lp: %p = phi double [ 1.000000e+00, %lp ], [ 0.000000e+00, %entry ] - %from_1 = getelementptr double *%from, i64 1 - %v0_1 = load double * %from - %v0_2 = load double * %from_1 + %from_1 = getelementptr double, double *%from, i64 1 + %v0_1 = load double , double * %from + %v0_2 = load double , double * %from_1 %v1_1 = fadd double %v0_1, %v0_2 %v1_2 = fadd double %v0_1, %p - %to_2 = getelementptr double * %to, i64 1 + %to_2 = getelementptr double, double * %to, i64 1 store double %v1_1, double *%to store double %v1_2, double *%to_2 br i1 undef, label %lp, label %ext @@ -181,7 +181,7 @@ ext: ; CHECK-LABEL: good_load_order -; CHECK: %[[V1:[0-9]+]] = load <4 x float>* +; CHECK: %[[V1:[0-9]+]] = load <4 x float>, <4 x float>* ; CHECK: %[[V2:[0-9]+]] = insertelement <4 x float> undef, float %1, i32 0 ; CHECK: %[[V3:[0-9]+]] = shufflevector <4 x float> %[[V2]], <4 x float> %[[V1]], <4 x i32> <i32 0, i32 4, i32 5, i32 6> ; CHECK: = fmul <4 x float> %[[V1]], %[[V3]] @@ -193,36 +193,36 @@ entry: br label %for.cond1.preheader for.cond1.preheader: - %0 = load float* getelementptr inbounds ([32000 x float]* @a, i64 0, i64 0), align 16 + %0 = load float, float* getelementptr inbounds ([32000 x float], [32000 x float]* @a, i64 0, i64 0), align 16 br label %for.body3 for.body3: %1 = phi float [ %0, %for.cond1.preheader ], [ %10, %for.body3 ] %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] %2 = add nsw i64 %indvars.iv, 1 - %arrayidx = getelementptr inbounds [32000 x float]* @a, i64 0, i64 %2 - %3 = load float* %arrayidx, align 4 - %arrayidx5 = getelementptr inbounds [32000 x float]* @a, i64 0, i64 %indvars.iv + %arrayidx = getelementptr inbounds [32000 x float], [32000 x float]* @a, i64 0, i64 %2 + %3 = load float, float* %arrayidx, align 4 + %arrayidx5 = getelementptr inbounds [32000 x float], [32000 x float]* @a, i64 0, i64 %indvars.iv %mul6 = fmul float %3, %1 store float %mul6, float* %arrayidx5, align 4 %4 = add nsw i64 %indvars.iv, 2 - %arrayidx11 = getelementptr inbounds [32000 x float]* @a, i64 0, i64 %4 - %5 = load float* %arrayidx11, align 4 + %arrayidx11 = getelementptr inbounds [32000 x float], [32000 x float]* @a, i64 0, i64 %4 + %5 = load float, float* %arrayidx11, align 4 %mul15 = fmul float %5, %3 store float %mul15, float* %arrayidx, align 4 %6 = add nsw i64 %indvars.iv, 3 - %arrayidx21 = getelementptr inbounds [32000 x float]* @a, i64 0, i64 %6 - %7 = load float* %arrayidx21, align 4 + %arrayidx21 = getelementptr inbounds [32000 x float], [32000 x float]* @a, i64 0, i64 %6 + %7 = load float, float* %arrayidx21, align 4 %mul25 = fmul float %7, %5 store float %mul25, float* %arrayidx11, align 4 %8 = add nsw i64 %indvars.iv, 4 - %arrayidx31 = getelementptr inbounds [32000 x float]* @a, i64 0, i64 %8 - %9 = load float* %arrayidx31, align 4 + %arrayidx31 = getelementptr inbounds [32000 x float], [32000 x float]* @a, i64 0, i64 %8 + %9 = load float, float* %arrayidx31, align 4 %mul35 = fmul float %9, %7 store float %mul35, float* %arrayidx21, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 5 - %arrayidx41 = getelementptr inbounds [32000 x float]* @a, i64 0, i64 %indvars.iv.next - %10 = load float* %arrayidx41, align 4 + %arrayidx41 = getelementptr inbounds [32000 x float], [32000 x float]* @a, i64 0, i64 %indvars.iv.next + %10 = load float, float* %arrayidx41, align 4 %mul45 = fmul float %10, %9 store float %mul45, float* %arrayidx31, align 4 %11 = trunc i64 %indvars.iv.next to i32 @@ -238,19 +238,19 @@ for.end: ; c[1] = b[1]+a[1]; // swapped b[1] and a[1] ; CHECK-LABEL: load_reorder_double -; CHECK: load <2 x double>* +; CHECK: load <2 x double>, <2 x double>* ; CHECK: fadd <2 x double> define void @load_reorder_double(double* nocapture %c, double* noalias nocapture readonly %a, double* noalias nocapture readonly %b){ - %1 = load double* %a - %2 = load double* %b + %1 = load double, double* %a + %2 = load double, double* %b %3 = fadd double %1, %2 store double %3, double* %c - %4 = getelementptr inbounds double* %b, i64 1 - %5 = load double* %4 - %6 = getelementptr inbounds double* %a, i64 1 - %7 = load double* %6 + %4 = getelementptr inbounds double, double* %b, i64 1 + %5 = load double, double* %4 + %6 = getelementptr inbounds double, double* %a, i64 1 + %7 = load double, double* %6 %8 = fadd double %5, %7 - %9 = getelementptr inbounds double* %c, i64 1 + %9 = getelementptr inbounds double, double* %c, i64 1 store double %8, double* %9 ret void } @@ -262,33 +262,33 @@ define void @load_reorder_double(double* nocapture %c, double* noalias nocapture ; c[3] = a[3]+b[3]; ; CHECK-LABEL: load_reorder_float -; CHECK: load <4 x float>* +; CHECK: load <4 x float>, <4 x float>* ; CHECK: fadd <4 x float> define void @load_reorder_float(float* nocapture %c, float* noalias nocapture readonly %a, float* noalias nocapture readonly %b){ - %1 = load float* %a - %2 = load float* %b + %1 = load float, float* %a + %2 = load float, float* %b %3 = fadd float %1, %2 store float %3, float* %c - %4 = getelementptr inbounds float* %b, i64 1 - %5 = load float* %4 - %6 = getelementptr inbounds float* %a, i64 1 - %7 = load float* %6 + %4 = getelementptr inbounds float, float* %b, i64 1 + %5 = load float, float* %4 + %6 = getelementptr inbounds float, float* %a, i64 1 + %7 = load float, float* %6 %8 = fadd float %5, %7 - %9 = getelementptr inbounds float* %c, i64 1 + %9 = getelementptr inbounds float, float* %c, i64 1 store float %8, float* %9 - %10 = getelementptr inbounds float* %a, i64 2 - %11 = load float* %10 - %12 = getelementptr inbounds float* %b, i64 2 - %13 = load float* %12 + %10 = getelementptr inbounds float, float* %a, i64 2 + %11 = load float, float* %10 + %12 = getelementptr inbounds float, float* %b, i64 2 + %13 = load float, float* %12 %14 = fadd float %11, %13 - %15 = getelementptr inbounds float* %c, i64 2 + %15 = getelementptr inbounds float, float* %c, i64 2 store float %14, float* %15 - %16 = getelementptr inbounds float* %a, i64 3 - %17 = load float* %16 - %18 = getelementptr inbounds float* %b, i64 3 - %19 = load float* %18 + %16 = getelementptr inbounds float, float* %a, i64 3 + %17 = load float, float* %16 + %18 = getelementptr inbounds float, float* %b, i64 3 + %19 = load float, float* %18 %20 = fadd float %17, %19 - %21 = getelementptr inbounds float* %c, i64 3 + %21 = getelementptr inbounds float, float* %c, i64 3 store float %20, float* %21 ret void } @@ -300,45 +300,45 @@ define void @load_reorder_float(float* nocapture %c, float* noalias nocapture re ; a[3] = (b[3]+c[3])+d[3]; ; CHECK-LABEL: opcode_reorder -; CHECK: load <4 x float>* +; CHECK: load <4 x float>, <4 x float>* ; CHECK: fadd <4 x float> define void @opcode_reorder(float* noalias nocapture %a, float* noalias nocapture readonly %b, float* noalias nocapture readonly %c,float* noalias nocapture readonly %d){ - %1 = load float* %b - %2 = load float* %c + %1 = load float, float* %b + %2 = load float, float* %c %3 = fadd float %1, %2 - %4 = load float* %d + %4 = load float, float* %d %5 = fadd float %3, %4 store float %5, float* %a - %6 = getelementptr inbounds float* %d, i64 1 - %7 = load float* %6 - %8 = getelementptr inbounds float* %b, i64 1 - %9 = load float* %8 - %10 = getelementptr inbounds float* %c, i64 1 - %11 = load float* %10 + %6 = getelementptr inbounds float, float* %d, i64 1 + %7 = load float, float* %6 + %8 = getelementptr inbounds float, float* %b, i64 1 + %9 = load float, float* %8 + %10 = getelementptr inbounds float, float* %c, i64 1 + %11 = load float, float* %10 %12 = fadd float %9, %11 %13 = fadd float %7, %12 - %14 = getelementptr inbounds float* %a, i64 1 + %14 = getelementptr inbounds float, float* %a, i64 1 store float %13, float* %14 - %15 = getelementptr inbounds float* %b, i64 2 - %16 = load float* %15 - %17 = getelementptr inbounds float* %c, i64 2 - %18 = load float* %17 + %15 = getelementptr inbounds float, float* %b, i64 2 + %16 = load float, float* %15 + %17 = getelementptr inbounds float, float* %c, i64 2 + %18 = load float, float* %17 %19 = fadd float %16, %18 - %20 = getelementptr inbounds float* %d, i64 2 - %21 = load float* %20 + %20 = getelementptr inbounds float, float* %d, i64 2 + %21 = load float, float* %20 %22 = fadd float %19, %21 - %23 = getelementptr inbounds float* %a, i64 2 + %23 = getelementptr inbounds float, float* %a, i64 2 store float %22, float* %23 - %24 = getelementptr inbounds float* %b, i64 3 - %25 = load float* %24 - %26 = getelementptr inbounds float* %c, i64 3 - %27 = load float* %26 + %24 = getelementptr inbounds float, float* %b, i64 3 + %25 = load float, float* %24 + %26 = getelementptr inbounds float, float* %c, i64 3 + %27 = load float, float* %26 %28 = fadd float %25, %27 - %29 = getelementptr inbounds float* %d, i64 3 - %30 = load float* %29 + %29 = getelementptr inbounds float, float* %d, i64 3 + %30 = load float, float* %29 %31 = fadd float %28, %30 - %32 = getelementptr inbounds float* %a, i64 3 + %32 = getelementptr inbounds float, float* %a, i64 3 store float %31, float* %32 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/opt.ll b/test/Transforms/SLPVectorizer/X86/opt.ll index 14137c1..824e999 100644 --- a/test/Transforms/SLPVectorizer/X86/opt.ll +++ b/test/Transforms/SLPVectorizer/X86/opt.ll @@ -15,16 +15,16 @@ target triple = "x86_64-apple-macosx10.8.0" define void @test1(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/ordering.ll b/test/Transforms/SLPVectorizer/X86/ordering.ll index d2ecd45..0fa72c9 100644 --- a/test/Transforms/SLPVectorizer/X86/ordering.ll +++ b/test/Transforms/SLPVectorizer/X86/ordering.ll @@ -5,7 +5,7 @@ target triple = "x86_64-apple-macosx10.8.0" define void @updateModelQPFrame(i32 %m_Bits) { entry: - %0 = load double* undef, align 8 + %0 = load double, double* undef, align 8 %mul = fmul double undef, %0 %mul2 = fmul double undef, %mul %mul4 = fmul double %0, %mul2 diff --git a/test/Transforms/SLPVectorizer/X86/phi.ll b/test/Transforms/SLPVectorizer/X86/phi.ll index 0c53b60..ef94467 100644 --- a/test/Transforms/SLPVectorizer/X86/phi.ll +++ b/test/Transforms/SLPVectorizer/X86/phi.ll @@ -29,17 +29,17 @@ entry: br i1 %tobool, label %if.else, label %if.end if.else: ; preds = %entry - %arrayidx = getelementptr inbounds double* %A, i64 10 - %0 = load double* %arrayidx, align 8 - %arrayidx1 = getelementptr inbounds double* %A, i64 11 - %1 = load double* %arrayidx1, align 8 + %arrayidx = getelementptr inbounds double, double* %A, i64 10 + %0 = load double, double* %arrayidx, align 8 + %arrayidx1 = getelementptr inbounds double, double* %A, i64 11 + %1 = load double, double* %arrayidx1, align 8 br label %if.end if.end: ; preds = %entry, %if.else %A0.0 = phi double [ %0, %if.else ], [ 3.000000e+00, %entry ] %A1.0 = phi double [ %1, %if.else ], [ 5.000000e+00, %entry ] store double %A0.0, double* %A, align 8 - %arrayidx3 = getelementptr inbounds double* %A, i64 1 + %arrayidx3 = getelementptr inbounds double, double* %A, i64 1 store double %A1.0, double* %arrayidx3, align 8 ret i32 undef } @@ -69,9 +69,9 @@ if.end: ; preds = %entry, %if.else ;CHECK: ret define i32 @foo2(double* noalias nocapture %B, double* noalias nocapture %A, i32 %n, i32 %m) #0 { entry: - %arrayidx = getelementptr inbounds double* %A, i64 1 - %0 = load double* %arrayidx, align 8 - %1 = load double* %A, align 8 + %arrayidx = getelementptr inbounds double, double* %A, i64 1 + %0 = load double, double* %arrayidx, align 8 + %1 = load double, double* %A, align 8 br label %for.body for.body: ; preds = %for.body, %entry @@ -90,7 +90,7 @@ for.body: ; preds = %for.body, %entry for.end: ; preds = %for.body store double %add5, double* %B, align 8 - %arrayidx7 = getelementptr inbounds double* %B, i64 1 + %arrayidx7 = getelementptr inbounds double, double* %B, i64 1 store double %add4, double* %arrayidx7, align 8 ret i32 0 } @@ -123,15 +123,15 @@ for.end: ; preds = %for.body define float @foo3(float* nocapture readonly %A) #0 { entry: - %0 = load float* %A, align 4 - %arrayidx1 = getelementptr inbounds float* %A, i64 1 - %1 = load float* %arrayidx1, align 4 - %arrayidx2 = getelementptr inbounds float* %A, i64 2 - %2 = load float* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds float* %A, i64 3 - %3 = load float* %arrayidx3, align 4 - %arrayidx4 = getelementptr inbounds float* %A, i64 4 - %4 = load float* %arrayidx4, align 4 + %0 = load float, float* %A, align 4 + %arrayidx1 = getelementptr inbounds float, float* %A, i64 1 + %1 = load float, float* %arrayidx1, align 4 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 2 + %2 = load float, float* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds float, float* %A, i64 3 + %3 = load float, float* %arrayidx3, align 4 + %arrayidx4 = getelementptr inbounds float, float* %A, i64 4 + %4 = load float, float* %arrayidx4, align 4 br label %for.body for.body: ; preds = %for.body, %entry @@ -148,18 +148,18 @@ for.body: ; preds = %for.body, %entry %mul10 = fmul float %5, 8.000000e+00 %add11 = fadd float %G.053, %mul10 %7 = add nsw i64 %indvars.iv, 2 - %arrayidx14 = getelementptr inbounds float* %A, i64 %7 - %8 = load float* %arrayidx14, align 4 + %arrayidx14 = getelementptr inbounds float, float* %A, i64 %7 + %8 = load float, float* %arrayidx14, align 4 %mul15 = fmul float %8, 9.000000e+00 %add16 = fadd float %B.054, %mul15 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 3 - %arrayidx19 = getelementptr inbounds float* %A, i64 %indvars.iv.next - %9 = load float* %arrayidx19, align 4 + %arrayidx19 = getelementptr inbounds float, float* %A, i64 %indvars.iv.next + %9 = load float, float* %arrayidx19, align 4 %mul20 = fmul float %9, 1.000000e+01 %add21 = fadd float %Y.055, %mul20 %10 = add nsw i64 %indvars.iv, 4 - %arrayidx24 = getelementptr inbounds float* %A, i64 %10 - %11 = load float* %arrayidx24, align 4 + %arrayidx24 = getelementptr inbounds float, float* %A, i64 %10 + %11 = load float, float* %arrayidx24, align 4 %mul25 = fmul float %11, 1.100000e+01 %add26 = fadd float %P.056, %mul25 %12 = trunc i64 %indvars.iv.next to i32 @@ -215,22 +215,22 @@ define void @test(x86_fp80* %i1, x86_fp80* %i2, x86_fp80* %o) { ; We disable the vectorization of x86_fp80 for now. entry: - %i1.0 = load x86_fp80* %i1, align 16 - %i1.gep1 = getelementptr x86_fp80* %i1, i64 1 - %i1.1 = load x86_fp80* %i1.gep1, align 16 -; CHECK: load x86_fp80* -; CHECK: load x86_fp80* + %i1.0 = load x86_fp80, x86_fp80* %i1, align 16 + %i1.gep1 = getelementptr x86_fp80, x86_fp80* %i1, i64 1 + %i1.1 = load x86_fp80, x86_fp80* %i1.gep1, align 16 +; CHECK: load x86_fp80, x86_fp80* +; CHECK: load x86_fp80, x86_fp80* ; CHECK-NOT: insertelement <2 x x86_fp80> ; CHECK-NOT: insertelement <2 x x86_fp80> br i1 undef, label %then, label %end then: - %i2.gep0 = getelementptr inbounds x86_fp80* %i2, i64 0 - %i2.0 = load x86_fp80* %i2.gep0, align 16 - %i2.gep1 = getelementptr inbounds x86_fp80* %i2, i64 1 - %i2.1 = load x86_fp80* %i2.gep1, align 16 -; CHECK: load x86_fp80* -; CHECK: load x86_fp80* + %i2.gep0 = getelementptr inbounds x86_fp80, x86_fp80* %i2, i64 0 + %i2.0 = load x86_fp80, x86_fp80* %i2.gep0, align 16 + %i2.gep1 = getelementptr inbounds x86_fp80, x86_fp80* %i2, i64 1 + %i2.1 = load x86_fp80, x86_fp80* %i2.gep1, align 16 +; CHECK: load x86_fp80, x86_fp80* +; CHECK: load x86_fp80, x86_fp80* ; CHECK-NOT: insertelement <2 x x86_fp80> ; CHECK-NOT: insertelement <2 x x86_fp80> br label %end @@ -242,7 +242,7 @@ end: ; CHECK-NOT: extractelement <2 x x86_fp80> ; CHECK-NOT: extractelement <2 x x86_fp80> store x86_fp80 %phi0, x86_fp80* %o, align 16 - %o.gep1 = getelementptr inbounds x86_fp80* %o, i64 1 + %o.gep1 = getelementptr inbounds x86_fp80, x86_fp80* %o, i64 1 store x86_fp80 %phi1, x86_fp80* %o.gep1, align 16 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/phi3.ll b/test/Transforms/SLPVectorizer/X86/phi3.ll index fd8d361..6162830 100644 --- a/test/Transforms/SLPVectorizer/X86/phi3.ll +++ b/test/Transforms/SLPVectorizer/X86/phi3.ll @@ -12,7 +12,7 @@ declare %struct.GPar.0.16.26* @Rf_gpptr(...) define void @Rf_GReset() { entry: %sub = fsub double -0.000000e+00, undef - %0 = load double* @d, align 8 + %0 = load double, double* @d, align 8 %sub1 = fsub double -0.000000e+00, %0 br i1 icmp eq (%struct.GPar.0.16.26* (...)* inttoptr (i64 115 to %struct.GPar.0.16.26* (...)*), %struct.GPar.0.16.26* (...)* @Rf_gpptr), label %if.then, label %if.end7 diff --git a/test/Transforms/SLPVectorizer/X86/phi_overalignedtype.ll b/test/Transforms/SLPVectorizer/X86/phi_overalignedtype.ll index 520e672..fa08eff 100644 --- a/test/Transforms/SLPVectorizer/X86/phi_overalignedtype.ll +++ b/test/Transforms/SLPVectorizer/X86/phi_overalignedtype.ll @@ -12,22 +12,22 @@ define void @test(double* %i1, double* %i2, double* %o) { ; size is less than the alignment, and through various different GEP formations. entry: - %i1.0 = load double* %i1, align 16 - %i1.gep1 = getelementptr double* %i1, i64 1 - %i1.1 = load double* %i1.gep1, align 16 -; CHECK: load double* -; CHECK: load double* + %i1.0 = load double, double* %i1, align 16 + %i1.gep1 = getelementptr double, double* %i1, i64 1 + %i1.1 = load double, double* %i1.gep1, align 16 +; CHECK: load double, double* +; CHECK: load double, double* ; CHECK: insertelement <2 x double> ; CHECK: insertelement <2 x double> br i1 undef, label %then, label %end then: - %i2.gep0 = getelementptr inbounds double* %i2, i64 0 - %i2.0 = load double* %i2.gep0, align 16 - %i2.gep1 = getelementptr inbounds double* %i2, i64 1 - %i2.1 = load double* %i2.gep1, align 16 -; CHECK: load double* -; CHECK: load double* + %i2.gep0 = getelementptr inbounds double, double* %i2, i64 0 + %i2.0 = load double, double* %i2.gep0, align 16 + %i2.gep1 = getelementptr inbounds double, double* %i2, i64 1 + %i2.1 = load double, double* %i2.gep1, align 16 +; CHECK: load double, double* +; CHECK: load double, double* ; CHECK: insertelement <2 x double> ; CHECK: insertelement <2 x double> br label %end @@ -39,7 +39,7 @@ end: ; CHECK: extractelement <2 x double> ; CHECK: extractelement <2 x double> store double %phi0, double* %o, align 16 - %o.gep1 = getelementptr inbounds double* %o, i64 1 + %o.gep1 = getelementptr inbounds double, double* %o, i64 1 store double %phi1, double* %o.gep1, align 16 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/powof2div.ll b/test/Transforms/SLPVectorizer/X86/powof2div.ll index 7aa1efd..a97b870 100644 --- a/test/Transforms/SLPVectorizer/X86/powof2div.ll +++ b/test/Transforms/SLPVectorizer/X86/powof2div.ll @@ -4,39 +4,39 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" ;CHECK-LABEL: @powof2div( -;CHECK: load <4 x i32>* +;CHECK: load <4 x i32>, <4 x i32>* ;CHECK: add nsw <4 x i32> ;CHECK: sdiv <4 x i32> define void @powof2div(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32* noalias nocapture readonly %c){ entry: - %0 = load i32* %b, align 4 - %1 = load i32* %c, align 4 + %0 = load i32, i32* %b, align 4 + %1 = load i32, i32* %c, align 4 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 store i32 %div, i32* %a, align 4 - %arrayidx3 = getelementptr inbounds i32* %b, i64 1 - %2 = load i32* %arrayidx3, align 4 - %arrayidx4 = getelementptr inbounds i32* %c, i64 1 - %3 = load i32* %arrayidx4, align 4 + %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 1 + %2 = load i32, i32* %arrayidx3, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %c, i64 1 + %3 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %3, %2 %div6 = sdiv i32 %add5, 2 - %arrayidx7 = getelementptr inbounds i32* %a, i64 1 + %arrayidx7 = getelementptr inbounds i32, i32* %a, i64 1 store i32 %div6, i32* %arrayidx7, align 4 - %arrayidx8 = getelementptr inbounds i32* %b, i64 2 - %4 = load i32* %arrayidx8, align 4 - %arrayidx9 = getelementptr inbounds i32* %c, i64 2 - %5 = load i32* %arrayidx9, align 4 + %arrayidx8 = getelementptr inbounds i32, i32* %b, i64 2 + %4 = load i32, i32* %arrayidx8, align 4 + %arrayidx9 = getelementptr inbounds i32, i32* %c, i64 2 + %5 = load i32, i32* %arrayidx9, align 4 %add10 = add nsw i32 %5, %4 %div11 = sdiv i32 %add10, 2 - %arrayidx12 = getelementptr inbounds i32* %a, i64 2 + %arrayidx12 = getelementptr inbounds i32, i32* %a, i64 2 store i32 %div11, i32* %arrayidx12, align 4 - %arrayidx13 = getelementptr inbounds i32* %b, i64 3 - %6 = load i32* %arrayidx13, align 4 - %arrayidx14 = getelementptr inbounds i32* %c, i64 3 - %7 = load i32* %arrayidx14, align 4 + %arrayidx13 = getelementptr inbounds i32, i32* %b, i64 3 + %6 = load i32, i32* %arrayidx13, align 4 + %arrayidx14 = getelementptr inbounds i32, i32* %c, i64 3 + %7 = load i32, i32* %arrayidx14, align 4 %add15 = add nsw i32 %7, %6 %div16 = sdiv i32 %add15, 2 - %arrayidx17 = getelementptr inbounds i32* %a, i64 3 + %arrayidx17 = getelementptr inbounds i32, i32* %a, i64 3 store i32 %div16, i32* %arrayidx17, align 4 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/pr16628.ll b/test/Transforms/SLPVectorizer/X86/pr16628.ll index 3f9d775..c22ed34 100644 --- a/test/Transforms/SLPVectorizer/X86/pr16628.ll +++ b/test/Transforms/SLPVectorizer/X86/pr16628.ll @@ -11,10 +11,10 @@ target triple = "x86_64-apple-macosx10.9.0" define void @f() { entry: %call = tail call i32 (...)* @g() - %0 = load i32* @c, align 4 + %0 = load i32, i32* @c, align 4 %lnot = icmp eq i32 %0, 0 %lnot.ext = zext i1 %lnot to i32 - %1 = load i16* @a, align 2 + %1 = load i16, i16* @a, align 2 %lnot2 = icmp eq i16 %1, 0 %lnot.ext3 = zext i1 %lnot2 to i32 %or = or i32 %lnot.ext3, %lnot.ext diff --git a/test/Transforms/SLPVectorizer/X86/pr16899.ll b/test/Transforms/SLPVectorizer/X86/pr16899.ll index c642f3c..0de14ec 100644 --- a/test/Transforms/SLPVectorizer/X86/pr16899.ll +++ b/test/Transforms/SLPVectorizer/X86/pr16899.ll @@ -7,10 +7,10 @@ target triple = "i386--netbsd" ; Function Attrs: noreturn nounwind readonly define i32 @fn1() #0 { entry: - %0 = load i32** @a, align 4, !tbaa !4 - %1 = load i32* %0, align 4, !tbaa !5 - %arrayidx1 = getelementptr inbounds i32* %0, i32 1 - %2 = load i32* %arrayidx1, align 4, !tbaa !5 + %0 = load i32*, i32** @a, align 4, !tbaa !4 + %1 = load i32, i32* %0, align 4, !tbaa !5 + %arrayidx1 = getelementptr inbounds i32, i32* %0, i32 1 + %2 = load i32, i32* %arrayidx1, align 4, !tbaa !5 br label %do.body do.body: ; preds = %do.body, %entry diff --git a/test/Transforms/SLPVectorizer/X86/pr19657.ll b/test/Transforms/SLPVectorizer/X86/pr19657.ll index 9352308..a687aec 100644 --- a/test/Transforms/SLPVectorizer/X86/pr19657.ll +++ b/test/Transforms/SLPVectorizer/X86/pr19657.ll @@ -3,7 +3,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -;CHECK: load <2 x double>* +;CHECK: load <2 x double>, <2 x double>* ;CHECK: fadd <2 x double> ;CHECK: store <2 x double> @@ -11,61 +11,61 @@ target triple = "x86_64-unknown-linux-gnu" define void @foo(double* %x) #0 { %1 = alloca double*, align 8 store double* %x, double** %1, align 8 - %2 = load double** %1, align 8 - %3 = getelementptr inbounds double* %2, i64 0 - %4 = load double* %3, align 8 - %5 = load double** %1, align 8 - %6 = getelementptr inbounds double* %5, i64 0 - %7 = load double* %6, align 8 + %2 = load double*, double** %1, align 8 + %3 = getelementptr inbounds double, double* %2, i64 0 + %4 = load double, double* %3, align 8 + %5 = load double*, double** %1, align 8 + %6 = getelementptr inbounds double, double* %5, i64 0 + %7 = load double, double* %6, align 8 %8 = fadd double %4, %7 - %9 = load double** %1, align 8 - %10 = getelementptr inbounds double* %9, i64 0 - %11 = load double* %10, align 8 + %9 = load double*, double** %1, align 8 + %10 = getelementptr inbounds double, double* %9, i64 0 + %11 = load double, double* %10, align 8 %12 = fadd double %8, %11 - %13 = load double** %1, align 8 - %14 = getelementptr inbounds double* %13, i64 0 + %13 = load double*, double** %1, align 8 + %14 = getelementptr inbounds double, double* %13, i64 0 store double %12, double* %14, align 8 - %15 = load double** %1, align 8 - %16 = getelementptr inbounds double* %15, i64 1 - %17 = load double* %16, align 8 - %18 = load double** %1, align 8 - %19 = getelementptr inbounds double* %18, i64 1 - %20 = load double* %19, align 8 + %15 = load double*, double** %1, align 8 + %16 = getelementptr inbounds double, double* %15, i64 1 + %17 = load double, double* %16, align 8 + %18 = load double*, double** %1, align 8 + %19 = getelementptr inbounds double, double* %18, i64 1 + %20 = load double, double* %19, align 8 %21 = fadd double %17, %20 - %22 = load double** %1, align 8 - %23 = getelementptr inbounds double* %22, i64 1 - %24 = load double* %23, align 8 + %22 = load double*, double** %1, align 8 + %23 = getelementptr inbounds double, double* %22, i64 1 + %24 = load double, double* %23, align 8 %25 = fadd double %21, %24 - %26 = load double** %1, align 8 - %27 = getelementptr inbounds double* %26, i64 1 + %26 = load double*, double** %1, align 8 + %27 = getelementptr inbounds double, double* %26, i64 1 store double %25, double* %27, align 8 - %28 = load double** %1, align 8 - %29 = getelementptr inbounds double* %28, i64 2 - %30 = load double* %29, align 8 - %31 = load double** %1, align 8 - %32 = getelementptr inbounds double* %31, i64 2 - %33 = load double* %32, align 8 + %28 = load double*, double** %1, align 8 + %29 = getelementptr inbounds double, double* %28, i64 2 + %30 = load double, double* %29, align 8 + %31 = load double*, double** %1, align 8 + %32 = getelementptr inbounds double, double* %31, i64 2 + %33 = load double, double* %32, align 8 %34 = fadd double %30, %33 - %35 = load double** %1, align 8 - %36 = getelementptr inbounds double* %35, i64 2 - %37 = load double* %36, align 8 + %35 = load double*, double** %1, align 8 + %36 = getelementptr inbounds double, double* %35, i64 2 + %37 = load double, double* %36, align 8 %38 = fadd double %34, %37 - %39 = load double** %1, align 8 - %40 = getelementptr inbounds double* %39, i64 2 + %39 = load double*, double** %1, align 8 + %40 = getelementptr inbounds double, double* %39, i64 2 store double %38, double* %40, align 8 - %41 = load double** %1, align 8 - %42 = getelementptr inbounds double* %41, i64 3 - %43 = load double* %42, align 8 - %44 = load double** %1, align 8 - %45 = getelementptr inbounds double* %44, i64 3 - %46 = load double* %45, align 8 + %41 = load double*, double** %1, align 8 + %42 = getelementptr inbounds double, double* %41, i64 3 + %43 = load double, double* %42, align 8 + %44 = load double*, double** %1, align 8 + %45 = getelementptr inbounds double, double* %44, i64 3 + %46 = load double, double* %45, align 8 %47 = fadd double %43, %46 - %48 = load double** %1, align 8 - %49 = getelementptr inbounds double* %48, i64 3 - %50 = load double* %49, align 8 + %48 = load double*, double** %1, align 8 + %49 = getelementptr inbounds double, double* %48, i64 3 + %50 = load double, double* %49, align 8 %51 = fadd double %47, %50 - %52 = load double** %1, align 8 - %53 = getelementptr inbounds double* %52, i64 3 + %52 = load double*, double** %1, align 8 + %53 = getelementptr inbounds double, double* %52, i64 3 store double %51, double* %53, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll b/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll index 3843ef7..a3b0c8f 100644 --- a/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll +++ b/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll @@ -10,15 +10,15 @@ target triple = "x86_64-unknown-unknown" ; CHECK-LABEL: @exact( ; CHECK: lshr exact <4 x i32> define void @exact(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = lshr exact i32 %load1, 1 %op2 = lshr exact i32 %load2, 1 @@ -36,15 +36,15 @@ define void @exact(i32* %x) { ; CHECK-LABEL: @not_exact( ; CHECK: lshr <4 x i32> define void @not_exact(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = lshr exact i32 %load1, 1 %op2 = lshr i32 %load2, 1 @@ -62,15 +62,15 @@ define void @not_exact(i32* %x) { ; CHECK-LABEL: @nsw( ; CHECK: add nsw <4 x i32> define void @nsw(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = add nsw i32 %load1, 1 %op2 = add nsw i32 %load2, 1 @@ -88,15 +88,15 @@ define void @nsw(i32* %x) { ; CHECK-LABEL: @not_nsw( ; CHECK: add <4 x i32> define void @not_nsw(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = add nsw i32 %load1, 1 %op2 = add nsw i32 %load2, 1 @@ -114,15 +114,15 @@ define void @not_nsw(i32* %x) { ; CHECK-LABEL: @nuw( ; CHECK: add nuw <4 x i32> define void @nuw(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = add nuw i32 %load1, 1 %op2 = add nuw i32 %load2, 1 @@ -140,15 +140,15 @@ define void @nuw(i32* %x) { ; CHECK-LABEL: @not_nuw( ; CHECK: add <4 x i32> define void @not_nuw(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = add nuw i32 %load1, 1 %op2 = add i32 %load2, 1 @@ -166,15 +166,15 @@ define void @not_nuw(i32* %x) { ; CHECK-LABEL: @nnan( ; CHECK: fadd nnan <4 x float> define void @nnan(float* %x) { - %idx1 = getelementptr inbounds float* %x, i64 0 - %idx2 = getelementptr inbounds float* %x, i64 1 - %idx3 = getelementptr inbounds float* %x, i64 2 - %idx4 = getelementptr inbounds float* %x, i64 3 + %idx1 = getelementptr inbounds float, float* %x, i64 0 + %idx2 = getelementptr inbounds float, float* %x, i64 1 + %idx3 = getelementptr inbounds float, float* %x, i64 2 + %idx4 = getelementptr inbounds float, float* %x, i64 3 - %load1 = load float* %idx1, align 4 - %load2 = load float* %idx2, align 4 - %load3 = load float* %idx3, align 4 - %load4 = load float* %idx4, align 4 + %load1 = load float, float* %idx1, align 4 + %load2 = load float, float* %idx2, align 4 + %load3 = load float, float* %idx3, align 4 + %load4 = load float, float* %idx4, align 4 %op1 = fadd fast nnan float %load1, 1.0 %op2 = fadd nnan ninf float %load2, 1.0 @@ -192,15 +192,15 @@ define void @nnan(float* %x) { ; CHECK-LABEL: @not_nnan( ; CHECK: fadd <4 x float> define void @not_nnan(float* %x) { - %idx1 = getelementptr inbounds float* %x, i64 0 - %idx2 = getelementptr inbounds float* %x, i64 1 - %idx3 = getelementptr inbounds float* %x, i64 2 - %idx4 = getelementptr inbounds float* %x, i64 3 + %idx1 = getelementptr inbounds float, float* %x, i64 0 + %idx2 = getelementptr inbounds float, float* %x, i64 1 + %idx3 = getelementptr inbounds float, float* %x, i64 2 + %idx4 = getelementptr inbounds float, float* %x, i64 3 - %load1 = load float* %idx1, align 4 - %load2 = load float* %idx2, align 4 - %load3 = load float* %idx3, align 4 - %load4 = load float* %idx4, align 4 + %load1 = load float, float* %idx1, align 4 + %load2 = load float, float* %idx2, align 4 + %load3 = load float, float* %idx3, align 4 + %load4 = load float, float* %idx4, align 4 %op1 = fadd nnan float %load1, 1.0 %op2 = fadd ninf float %load2, 1.0 @@ -218,15 +218,15 @@ define void @not_nnan(float* %x) { ; CHECK-LABEL: @only_fast( ; CHECK: fadd fast <4 x float> define void @only_fast(float* %x) { - %idx1 = getelementptr inbounds float* %x, i64 0 - %idx2 = getelementptr inbounds float* %x, i64 1 - %idx3 = getelementptr inbounds float* %x, i64 2 - %idx4 = getelementptr inbounds float* %x, i64 3 + %idx1 = getelementptr inbounds float, float* %x, i64 0 + %idx2 = getelementptr inbounds float, float* %x, i64 1 + %idx3 = getelementptr inbounds float, float* %x, i64 2 + %idx4 = getelementptr inbounds float, float* %x, i64 3 - %load1 = load float* %idx1, align 4 - %load2 = load float* %idx2, align 4 - %load3 = load float* %idx3, align 4 - %load4 = load float* %idx4, align 4 + %load1 = load float, float* %idx1, align 4 + %load2 = load float, float* %idx2, align 4 + %load3 = load float, float* %idx3, align 4 + %load4 = load float, float* %idx4, align 4 %op1 = fadd fast nnan float %load1, 1.0 %op2 = fadd fast nnan ninf float %load2, 1.0 @@ -244,15 +244,15 @@ define void @only_fast(float* %x) { ; CHECK-LABEL: @only_arcp( ; CHECK: fadd arcp <4 x float> define void @only_arcp(float* %x) { - %idx1 = getelementptr inbounds float* %x, i64 0 - %idx2 = getelementptr inbounds float* %x, i64 1 - %idx3 = getelementptr inbounds float* %x, i64 2 - %idx4 = getelementptr inbounds float* %x, i64 3 + %idx1 = getelementptr inbounds float, float* %x, i64 0 + %idx2 = getelementptr inbounds float, float* %x, i64 1 + %idx3 = getelementptr inbounds float, float* %x, i64 2 + %idx4 = getelementptr inbounds float, float* %x, i64 3 - %load1 = load float* %idx1, align 4 - %load2 = load float* %idx2, align 4 - %load3 = load float* %idx3, align 4 - %load4 = load float* %idx4, align 4 + %load1 = load float, float* %idx1, align 4 + %load2 = load float, float* %idx2, align 4 + %load3 = load float, float* %idx3, align 4 + %load4 = load float, float* %idx4, align 4 %op1 = fadd fast float %load1, 1.0 %op2 = fadd fast float %load2, 1.0 @@ -271,15 +271,15 @@ define void @only_arcp(float* %x) { ; CHECK: add nsw <4 x i32> ; CHECK: sub nsw <4 x i32> define void @addsub_all_nsw(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = add nsw i32 %load1, 1 %op2 = sub nsw i32 %load2, 1 @@ -298,15 +298,15 @@ define void @addsub_all_nsw(i32* %x) { ; CHECK: add nsw <4 x i32> ; CHECK: sub <4 x i32> define void @addsub_some_nsw(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = add nsw i32 %load1, 1 %op2 = sub nsw i32 %load2, 1 @@ -325,15 +325,15 @@ define void @addsub_some_nsw(i32* %x) { ; CHECK: add <4 x i32> ; CHECK: sub <4 x i32> define void @addsub_no_nsw(i32* %x) { - %idx1 = getelementptr inbounds i32* %x, i64 0 - %idx2 = getelementptr inbounds i32* %x, i64 1 - %idx3 = getelementptr inbounds i32* %x, i64 2 - %idx4 = getelementptr inbounds i32* %x, i64 3 - - %load1 = load i32* %idx1, align 4 - %load2 = load i32* %idx2, align 4 - %load3 = load i32* %idx3, align 4 - %load4 = load i32* %idx4, align 4 + %idx1 = getelementptr inbounds i32, i32* %x, i64 0 + %idx2 = getelementptr inbounds i32, i32* %x, i64 1 + %idx3 = getelementptr inbounds i32, i32* %x, i64 2 + %idx4 = getelementptr inbounds i32, i32* %x, i64 3 + + %load1 = load i32, i32* %idx1, align 4 + %load2 = load i32, i32* %idx2, align 4 + %load3 = load i32, i32* %idx3, align 4 + %load4 = load i32, i32* %idx4, align 4 %op1 = add i32 %load1, 1 %op2 = sub nsw i32 %load2, 1 diff --git a/test/Transforms/SLPVectorizer/X86/reduction.ll b/test/Transforms/SLPVectorizer/X86/reduction.ll index 70b7c3a..4c5f126 100644 --- a/test/Transforms/SLPVectorizer/X86/reduction.ll +++ b/test/Transforms/SLPVectorizer/X86/reduction.ll @@ -23,12 +23,12 @@ for.body: ; preds = %entry, %for.body %i.015 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %sum.014 = phi double [ %add6, %for.body ], [ 0.000000e+00, %entry ] %mul = shl nsw i32 %i.015, 1 - %arrayidx = getelementptr inbounds double* %A, i32 %mul - %0 = load double* %arrayidx, align 4 + %arrayidx = getelementptr inbounds double, double* %A, i32 %mul + %0 = load double, double* %arrayidx, align 4 %mul1 = fmul double %0, 7.000000e+00 %add12 = or i32 %mul, 1 - %arrayidx3 = getelementptr inbounds double* %A, i32 %add12 - %1 = load double* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds double, double* %A, i32 %add12 + %1 = load double, double* %arrayidx3, align 4 %mul4 = fmul double %1, 7.000000e+00 %add5 = fadd double %mul1, %mul4 %add6 = fadd double %sum.014, %add5 diff --git a/test/Transforms/SLPVectorizer/X86/reduction2.ll b/test/Transforms/SLPVectorizer/X86/reduction2.ll index f21e86c..507a61a 100644 --- a/test/Transforms/SLPVectorizer/X86/reduction2.ll +++ b/test/Transforms/SLPVectorizer/X86/reduction2.ll @@ -13,13 +13,13 @@ define double @foo(double* nocapture %D) { %i.02 = phi i32 [ 0, %0 ], [ %10, %1 ] %sum.01 = phi double [ 0.000000e+00, %0 ], [ %9, %1 ] %2 = shl nsw i32 %i.02, 1 - %3 = getelementptr inbounds double* %D, i32 %2 - %4 = load double* %3, align 4 + %3 = getelementptr inbounds double, double* %D, i32 %2 + %4 = load double, double* %3, align 4 %A4 = fmul double %4, %4 %A42 = fmul double %A4, %A4 %5 = or i32 %2, 1 - %6 = getelementptr inbounds double* %D, i32 %5 - %7 = load double* %6, align 4 + %6 = getelementptr inbounds double, double* %D, i32 %5 + %7 = load double, double* %6, align 4 %A7 = fmul double %7, %7 %A72 = fmul double %A7, %A7 %8 = fadd double %A42, %A72 diff --git a/test/Transforms/SLPVectorizer/X86/return.ll b/test/Transforms/SLPVectorizer/X86/return.ll index 1a81c23..e2b2637 100644 --- a/test/Transforms/SLPVectorizer/X86/return.ll +++ b/test/Transforms/SLPVectorizer/X86/return.ll @@ -13,17 +13,17 @@ target triple = "x86_64--linux-gnu" ; } ; CHECK-LABEL: @return1 -; CHECK: %0 = load <2 x double>* -; CHECK: %1 = load <2 x double>* +; CHECK: %0 = load <2 x double>, <2 x double>* +; CHECK: %1 = load <2 x double>, <2 x double>* ; CHECK: %2 = fadd <2 x double> define double @return1() { entry: - %a0 = load double* getelementptr inbounds ([4 x double]* @a, i32 0, i32 0), align 8 - %b0 = load double* getelementptr inbounds ([4 x double]* @b, i32 0, i32 0), align 8 + %a0 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @a, i32 0, i32 0), align 8 + %b0 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @b, i32 0, i32 0), align 8 %add0 = fadd double %a0, %b0 - %a1 = load double* getelementptr inbounds ([4 x double]* @a, i32 0, i32 1), align 8 - %b1 = load double* getelementptr inbounds ([4 x double]* @b, i32 0, i32 1), align 8 + %a1 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @a, i32 0, i32 1), align 8 + %b1 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @b, i32 0, i32 1), align 8 %add1 = fadd double %a1, %b1 %add2 = fadd double %add0, %add1 ret double %add2 @@ -34,20 +34,20 @@ entry: ; } ; CHECK-LABEL: @return2 -; CHECK: %1 = load <2 x double>* -; CHECK: %3 = load <2 x double>* %2 +; CHECK: %1 = load <2 x double>, <2 x double>* +; CHECK: %3 = load <2 x double>, <2 x double>* %2 ; CHECK: %4 = fadd <2 x double> %1, %3 define double @return2(double* nocapture readonly %x) { entry: - %x0 = load double* %x, align 4 - %arrayidx1 = getelementptr inbounds double* %x, i32 2 - %x2 = load double* %arrayidx1, align 4 + %x0 = load double, double* %x, align 4 + %arrayidx1 = getelementptr inbounds double, double* %x, i32 2 + %x2 = load double, double* %arrayidx1, align 4 %add3 = fadd double %x0, %x2 - %arrayidx2 = getelementptr inbounds double* %x, i32 1 - %x1 = load double* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds double* %x, i32 3 - %x3 = load double* %arrayidx3, align 4 + %arrayidx2 = getelementptr inbounds double, double* %x, i32 1 + %x1 = load double, double* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds double, double* %x, i32 3 + %x3 = load double, double* %arrayidx3, align 4 %add4 = fadd double %x1, %x3 %add5 = fadd double %add3, %add4 ret double %add5 diff --git a/test/Transforms/SLPVectorizer/X86/rgb_phi.ll b/test/Transforms/SLPVectorizer/X86/rgb_phi.ll index 6aea5d3..0bdb7da 100644 --- a/test/Transforms/SLPVectorizer/X86/rgb_phi.ll +++ b/test/Transforms/SLPVectorizer/X86/rgb_phi.ll @@ -33,11 +33,11 @@ target triple = "i386-apple-macosx10.9.0" define float @foo(float* nocapture readonly %A) { entry: - %0 = load float* %A, align 4 - %arrayidx1 = getelementptr inbounds float* %A, i64 1 - %1 = load float* %arrayidx1, align 4 - %arrayidx2 = getelementptr inbounds float* %A, i64 2 - %2 = load float* %arrayidx2, align 4 + %0 = load float, float* %A, align 4 + %arrayidx1 = getelementptr inbounds float, float* %A, i64 1 + %1 = load float, float* %arrayidx1, align 4 + %arrayidx2 = getelementptr inbounds float, float* %A, i64 2 + %2 = load float, float* %arrayidx2, align 4 br label %for.body for.body: ; preds = %for.body.for.body_crit_edge, %entry @@ -49,13 +49,13 @@ for.body: ; preds = %for.body.for.body_c %mul = fmul float %3, 7.000000e+00 %add4 = fadd float %R.030, %mul %4 = add nsw i64 %indvars.iv, 1 - %arrayidx7 = getelementptr inbounds float* %A, i64 %4 - %5 = load float* %arrayidx7, align 4 + %arrayidx7 = getelementptr inbounds float, float* %A, i64 %4 + %5 = load float, float* %arrayidx7, align 4 %mul8 = fmul float %5, 8.000000e+00 %add9 = fadd float %G.031, %mul8 %6 = add nsw i64 %indvars.iv, 2 - %arrayidx12 = getelementptr inbounds float* %A, i64 %6 - %7 = load float* %arrayidx12, align 4 + %arrayidx12 = getelementptr inbounds float, float* %A, i64 %6 + %7 = load float, float* %arrayidx12, align 4 %mul13 = fmul float %7, 9.000000e+00 %add14 = fadd float %B.032, %mul13 %indvars.iv.next = add i64 %indvars.iv, 3 @@ -64,8 +64,8 @@ for.body: ; preds = %for.body.for.body_c br i1 %cmp, label %for.body.for.body_crit_edge, label %for.end for.body.for.body_crit_edge: ; preds = %for.body - %arrayidx3.phi.trans.insert = getelementptr inbounds float* %A, i64 %indvars.iv.next - %.pre = load float* %arrayidx3.phi.trans.insert, align 4 + %arrayidx3.phi.trans.insert = getelementptr inbounds float, float* %A, i64 %indvars.iv.next + %.pre = load float, float* %arrayidx3.phi.trans.insert, align 4 br label %for.body for.end: ; preds = %for.body diff --git a/test/Transforms/SLPVectorizer/X86/saxpy.ll b/test/Transforms/SLPVectorizer/X86/saxpy.ll index 4b39d46..a9ca093 100644 --- a/test/Transforms/SLPVectorizer/X86/saxpy.ll +++ b/test/Transforms/SLPVectorizer/X86/saxpy.ll @@ -9,35 +9,35 @@ target triple = "x86_64-apple-macosx10.8.0" ;CHECK: ret define void @SAXPY(i32* noalias nocapture %x, i32* noalias nocapture %y, i32 %a, i64 %i) { - %1 = getelementptr inbounds i32* %x, i64 %i - %2 = load i32* %1, align 4 + %1 = getelementptr inbounds i32, i32* %x, i64 %i + %2 = load i32, i32* %1, align 4 %3 = mul nsw i32 %2, %a - %4 = getelementptr inbounds i32* %y, i64 %i - %5 = load i32* %4, align 4 + %4 = getelementptr inbounds i32, i32* %y, i64 %i + %5 = load i32, i32* %4, align 4 %6 = add nsw i32 %3, %5 store i32 %6, i32* %1, align 4 %7 = add i64 %i, 1 - %8 = getelementptr inbounds i32* %x, i64 %7 - %9 = load i32* %8, align 4 + %8 = getelementptr inbounds i32, i32* %x, i64 %7 + %9 = load i32, i32* %8, align 4 %10 = mul nsw i32 %9, %a - %11 = getelementptr inbounds i32* %y, i64 %7 - %12 = load i32* %11, align 4 + %11 = getelementptr inbounds i32, i32* %y, i64 %7 + %12 = load i32, i32* %11, align 4 %13 = add nsw i32 %10, %12 store i32 %13, i32* %8, align 4 %14 = add i64 %i, 2 - %15 = getelementptr inbounds i32* %x, i64 %14 - %16 = load i32* %15, align 4 + %15 = getelementptr inbounds i32, i32* %x, i64 %14 + %16 = load i32, i32* %15, align 4 %17 = mul nsw i32 %16, %a - %18 = getelementptr inbounds i32* %y, i64 %14 - %19 = load i32* %18, align 4 + %18 = getelementptr inbounds i32, i32* %y, i64 %14 + %19 = load i32, i32* %18, align 4 %20 = add nsw i32 %17, %19 store i32 %20, i32* %15, align 4 %21 = add i64 %i, 3 - %22 = getelementptr inbounds i32* %x, i64 %21 - %23 = load i32* %22, align 4 + %22 = getelementptr inbounds i32, i32* %x, i64 %21 + %23 = load i32, i32* %22, align 4 %24 = mul nsw i32 %23, %a - %25 = getelementptr inbounds i32* %y, i64 %21 - %26 = load i32* %25, align 4 + %25 = getelementptr inbounds i32, i32* %y, i64 %21 + %26 = load i32, i32* %25, align 4 %27 = add nsw i32 %24, %26 store i32 %27, i32* %22, align 4 ret void @@ -46,15 +46,15 @@ define void @SAXPY(i32* noalias nocapture %x, i32* noalias nocapture %y, i32 %a, ; Make sure we don't crash on this one. define void @SAXPY_crash(i32* noalias nocapture %x, i32* noalias nocapture %y, i64 %i) { %1 = add i64 %i, 1 - %2 = getelementptr inbounds i32* %x, i64 %1 - %3 = getelementptr inbounds i32* %y, i64 %1 - %4 = load i32* %3, align 4 + %2 = getelementptr inbounds i32, i32* %x, i64 %1 + %3 = getelementptr inbounds i32, i32* %y, i64 %1 + %4 = load i32, i32* %3, align 4 %5 = add nsw i32 undef, %4 store i32 %5, i32* %2, align 4 %6 = add i64 %i, 2 - %7 = getelementptr inbounds i32* %x, i64 %6 - %8 = getelementptr inbounds i32* %y, i64 %6 - %9 = load i32* %8, align 4 + %7 = getelementptr inbounds i32, i32* %x, i64 %6 + %8 = getelementptr inbounds i32, i32* %y, i64 %6 + %9 = load i32, i32* %8, align 4 %10 = add nsw i32 undef, %9 store i32 %10, i32* %7, align 4 ret void diff --git a/test/Transforms/SLPVectorizer/X86/scheduling.ll b/test/Transforms/SLPVectorizer/X86/scheduling.ll index 3b3bd80..33bdc6a 100644 --- a/test/Transforms/SLPVectorizer/X86/scheduling.ll +++ b/test/Transforms/SLPVectorizer/X86/scheduling.ll @@ -24,43 +24,43 @@ for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %a.088 = phi i32 [ 0, %entry ], [ %add52, %for.body ] %1 = shl i64 %indvars.iv, 3 - %arrayidx = getelementptr inbounds i32* %diff, i64 %1 - %2 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %diff, i64 %1 + %2 = load i32, i32* %arrayidx, align 4 %3 = or i64 %1, 4 - %arrayidx2 = getelementptr inbounds i32* %diff, i64 %3 - %4 = load i32* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds i32, i32* %diff, i64 %3 + %4 = load i32, i32* %arrayidx2, align 4 %add3 = add nsw i32 %4, %2 - %arrayidx6 = getelementptr inbounds [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 0 + %arrayidx6 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 0 store i32 %add3, i32* %arrayidx6, align 16 %add10 = add nsw i32 %add3, %a.088 %5 = or i64 %1, 1 - %arrayidx13 = getelementptr inbounds i32* %diff, i64 %5 - %6 = load i32* %arrayidx13, align 4 + %arrayidx13 = getelementptr inbounds i32, i32* %diff, i64 %5 + %6 = load i32, i32* %arrayidx13, align 4 %7 = or i64 %1, 5 - %arrayidx16 = getelementptr inbounds i32* %diff, i64 %7 - %8 = load i32* %arrayidx16, align 4 + %arrayidx16 = getelementptr inbounds i32, i32* %diff, i64 %7 + %8 = load i32, i32* %arrayidx16, align 4 %add17 = add nsw i32 %8, %6 - %arrayidx20 = getelementptr inbounds [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 1 + %arrayidx20 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 1 store i32 %add17, i32* %arrayidx20, align 4 %add24 = add nsw i32 %add10, %add17 %9 = or i64 %1, 2 - %arrayidx27 = getelementptr inbounds i32* %diff, i64 %9 - %10 = load i32* %arrayidx27, align 4 + %arrayidx27 = getelementptr inbounds i32, i32* %diff, i64 %9 + %10 = load i32, i32* %arrayidx27, align 4 %11 = or i64 %1, 6 - %arrayidx30 = getelementptr inbounds i32* %diff, i64 %11 - %12 = load i32* %arrayidx30, align 4 + %arrayidx30 = getelementptr inbounds i32, i32* %diff, i64 %11 + %12 = load i32, i32* %arrayidx30, align 4 %add31 = add nsw i32 %12, %10 - %arrayidx34 = getelementptr inbounds [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 2 + %arrayidx34 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 2 store i32 %add31, i32* %arrayidx34, align 8 %add38 = add nsw i32 %add24, %add31 %13 = or i64 %1, 3 - %arrayidx41 = getelementptr inbounds i32* %diff, i64 %13 - %14 = load i32* %arrayidx41, align 4 + %arrayidx41 = getelementptr inbounds i32, i32* %diff, i64 %13 + %14 = load i32, i32* %arrayidx41, align 4 %15 = or i64 %1, 7 - %arrayidx44 = getelementptr inbounds i32* %diff, i64 %15 - %16 = load i32* %arrayidx44, align 4 + %arrayidx44 = getelementptr inbounds i32, i32* %diff, i64 %15 + %16 = load i32, i32* %arrayidx44, align 4 %add45 = add nsw i32 %16, %14 - %arrayidx48 = getelementptr inbounds [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 3 + %arrayidx48 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %m2, i64 0, i64 %indvars.iv, i64 3 store i32 %add45, i32* %arrayidx48, align 4 %add52 = add nsw i32 %add38, %add45 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -68,7 +68,7 @@ for.body: ; preds = %for.body, %entry br i1 %exitcond, label %for.end, label %for.body for.end: ; preds = %for.body - %arraydecay = getelementptr inbounds [8 x [8 x i32]]* %m2, i64 0, i64 0 + %arraydecay = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %m2, i64 0, i64 0 call void @ff([8 x i32]* %arraydecay) #1 ret i32 %add52 } diff --git a/test/Transforms/SLPVectorizer/X86/simple-loop.ll b/test/Transforms/SLPVectorizer/X86/simple-loop.ll index 0111b94..c9bb884 100644 --- a/test/Transforms/SLPVectorizer/X86/simple-loop.ll +++ b/test/Transforms/SLPVectorizer/X86/simple-loop.ll @@ -11,18 +11,18 @@ define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i6 .lr.ph: ; preds = %0, %.lr.ph %i.019 = phi i64 [ %26, %.lr.ph ], [ 0, %0 ] %2 = shl i64 %i.019, 2 - %3 = getelementptr inbounds i32* %in, i64 %2 + %3 = getelementptr inbounds i32, i32* %in, i64 %2 ;CHECK:load <4 x i32> - %4 = load i32* %3, align 4 + %4 = load i32, i32* %3, align 4 %5 = or i64 %2, 1 - %6 = getelementptr inbounds i32* %in, i64 %5 - %7 = load i32* %6, align 4 + %6 = getelementptr inbounds i32, i32* %in, i64 %5 + %7 = load i32, i32* %6, align 4 %8 = or i64 %2, 2 - %9 = getelementptr inbounds i32* %in, i64 %8 - %10 = load i32* %9, align 4 + %9 = getelementptr inbounds i32, i32* %in, i64 %8 + %10 = load i32, i32* %9, align 4 %11 = or i64 %2, 3 - %12 = getelementptr inbounds i32* %in, i64 %11 - %13 = load i32* %12, align 4 + %12 = getelementptr inbounds i32, i32* %in, i64 %11 + %13 = load i32, i32* %12, align 4 ;CHECK:mul <4 x i32> %14 = mul i32 %4, 7 ;CHECK:add <4 x i32> @@ -33,14 +33,14 @@ define i32 @rollable(i32* noalias nocapture %in, i32* noalias nocapture %out, i6 %19 = add i32 %18, 21 %20 = mul i32 %13, 7 %21 = add i32 %20, 28 - %22 = getelementptr inbounds i32* %out, i64 %2 + %22 = getelementptr inbounds i32, i32* %out, i64 %2 ;CHECK:store <4 x i32> store i32 %15, i32* %22, align 4 - %23 = getelementptr inbounds i32* %out, i64 %5 + %23 = getelementptr inbounds i32, i32* %out, i64 %5 store i32 %17, i32* %23, align 4 - %24 = getelementptr inbounds i32* %out, i64 %8 + %24 = getelementptr inbounds i32, i32* %out, i64 %8 store i32 %19, i32* %24, align 4 - %25 = getelementptr inbounds i32* %out, i64 %11 + %25 = getelementptr inbounds i32, i32* %out, i64 %11 store i32 %21, i32* %25, align 4 %26 = add i64 %i.019, 1 %exitcond = icmp eq i64 %26, %n @@ -61,17 +61,17 @@ define i32 @unrollable(i32* %in, i32* %out, i64 %n) nounwind ssp uwtable { .lr.ph: ; preds = %0, %.lr.ph %i.019 = phi i64 [ %26, %.lr.ph ], [ 0, %0 ] %2 = shl i64 %i.019, 2 - %3 = getelementptr inbounds i32* %in, i64 %2 - %4 = load i32* %3, align 4 + %3 = getelementptr inbounds i32, i32* %in, i64 %2 + %4 = load i32, i32* %3, align 4 %5 = or i64 %2, 1 - %6 = getelementptr inbounds i32* %in, i64 %5 - %7 = load i32* %6, align 4 + %6 = getelementptr inbounds i32, i32* %in, i64 %5 + %7 = load i32, i32* %6, align 4 %8 = or i64 %2, 2 - %9 = getelementptr inbounds i32* %in, i64 %8 - %10 = load i32* %9, align 4 + %9 = getelementptr inbounds i32, i32* %in, i64 %8 + %10 = load i32, i32* %9, align 4 %11 = or i64 %2, 3 - %12 = getelementptr inbounds i32* %in, i64 %11 - %13 = load i32* %12, align 4 + %12 = getelementptr inbounds i32, i32* %in, i64 %11 + %13 = load i32, i32* %12, align 4 %14 = mul i32 %4, 7 %15 = add i32 %14, 7 %16 = mul i32 %7, 7 @@ -80,14 +80,14 @@ define i32 @unrollable(i32* %in, i32* %out, i64 %n) nounwind ssp uwtable { %19 = add i32 %18, 21 %20 = mul i32 %13, 7 %21 = add i32 %20, 28 - %22 = getelementptr inbounds i32* %out, i64 %2 + %22 = getelementptr inbounds i32, i32* %out, i64 %2 store i32 %15, i32* %22, align 4 - %23 = getelementptr inbounds i32* %out, i64 %5 + %23 = getelementptr inbounds i32, i32* %out, i64 %5 store i32 %17, i32* %23, align 4 %barrier = call i32 @goo(i32 0) ; <---------------- memory barrier. - %24 = getelementptr inbounds i32* %out, i64 %8 + %24 = getelementptr inbounds i32, i32* %out, i64 %8 store i32 %19, i32* %24, align 4 - %25 = getelementptr inbounds i32* %out, i64 %11 + %25 = getelementptr inbounds i32, i32* %out, i64 %11 store i32 %21, i32* %25, align 4 %26 = add i64 %i.019, 1 %exitcond = icmp eq i64 %26, %n diff --git a/test/Transforms/SLPVectorizer/X86/simplebb.ll b/test/Transforms/SLPVectorizer/X86/simplebb.ll index 7d682e5..a5d9ad9 100644 --- a/test/Transforms/SLPVectorizer/X86/simplebb.ll +++ b/test/Transforms/SLPVectorizer/X86/simplebb.ll @@ -9,16 +9,16 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK: ret define void @test1(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void } @@ -29,17 +29,17 @@ entry: ; CHECK: ret define void @test2(double* %a, double* %b, i8* %e) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 %c = bitcast i8* %e to double* store double %mul, double* %c, align 8 - %carrayidx5 = getelementptr inbounds i8* %e, i64 8 + %carrayidx5 = getelementptr inbounds i8, i8* %e, i64 8 %arrayidx5 = bitcast i8* %carrayidx5 to double* store double %mul5, double* %arrayidx5, align 8 ret void @@ -52,16 +52,16 @@ entry: ; CHECK: ret define void @test_volatile_load(double* %a, double* %b, double* %c) { entry: - %i0 = load volatile double* %a, align 8 - %i1 = load volatile double* %b, align 8 + %i0 = load volatile double, double* %a, align 8 + %i1 = load volatile double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void } @@ -72,16 +72,16 @@ entry: ; CHECK: ret define void @test_volatile_store(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store volatile double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store volatile double %mul5, double* %arrayidx5, align 8 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/tiny-tree.ll b/test/Transforms/SLPVectorizer/X86/tiny-tree.ll index 10c3130..6c93222 100644 --- a/test/Transforms/SLPVectorizer/X86/tiny-tree.ll +++ b/test/Transforms/SLPVectorizer/X86/tiny-tree.ll @@ -17,14 +17,14 @@ for.body: ; preds = %entry, %for.body %i.015 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %dst.addr.014 = phi double* [ %add.ptr4, %for.body ], [ %dst, %entry ] %src.addr.013 = phi double* [ %add.ptr, %for.body ], [ %src, %entry ] - %0 = load double* %src.addr.013, align 8 + %0 = load double, double* %src.addr.013, align 8 store double %0, double* %dst.addr.014, align 8 - %arrayidx2 = getelementptr inbounds double* %src.addr.013, i64 1 - %1 = load double* %arrayidx2, align 8 - %arrayidx3 = getelementptr inbounds double* %dst.addr.014, i64 1 + %arrayidx2 = getelementptr inbounds double, double* %src.addr.013, i64 1 + %1 = load double, double* %arrayidx2, align 8 + %arrayidx3 = getelementptr inbounds double, double* %dst.addr.014, i64 1 store double %1, double* %arrayidx3, align 8 - %add.ptr = getelementptr inbounds double* %src.addr.013, i64 %i.015 - %add.ptr4 = getelementptr inbounds double* %dst.addr.014, i64 %i.015 + %add.ptr = getelementptr inbounds double, double* %src.addr.013, i64 %i.015 + %add.ptr4 = getelementptr inbounds double, double* %dst.addr.014, i64 %i.015 %inc = add i64 %i.015, 1 %exitcond = icmp eq i64 %inc, %count br i1 %exitcond, label %for.end, label %for.body @@ -47,22 +47,22 @@ for.body: ; preds = %entry, %for.body %i.023 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %dst.addr.022 = phi float* [ %add.ptr8, %for.body ], [ %dst, %entry ] %src.addr.021 = phi float* [ %add.ptr, %for.body ], [ %src, %entry ] - %0 = load float* %src.addr.021, align 4 + %0 = load float, float* %src.addr.021, align 4 store float %0, float* %dst.addr.022, align 4 - %arrayidx2 = getelementptr inbounds float* %src.addr.021, i64 1 - %1 = load float* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds float* %dst.addr.022, i64 1 + %arrayidx2 = getelementptr inbounds float, float* %src.addr.021, i64 1 + %1 = load float, float* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds float, float* %dst.addr.022, i64 1 store float %1, float* %arrayidx3, align 4 - %arrayidx4 = getelementptr inbounds float* %src.addr.021, i64 2 - %2 = load float* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds float* %dst.addr.022, i64 2 + %arrayidx4 = getelementptr inbounds float, float* %src.addr.021, i64 2 + %2 = load float, float* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds float, float* %dst.addr.022, i64 2 store float %2, float* %arrayidx5, align 4 - %arrayidx6 = getelementptr inbounds float* %src.addr.021, i64 3 - %3 = load float* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds float* %dst.addr.022, i64 3 + %arrayidx6 = getelementptr inbounds float, float* %src.addr.021, i64 3 + %3 = load float, float* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds float, float* %dst.addr.022, i64 3 store float %3, float* %arrayidx7, align 4 - %add.ptr = getelementptr inbounds float* %src.addr.021, i64 %i.023 - %add.ptr8 = getelementptr inbounds float* %dst.addr.022, i64 %i.023 + %add.ptr = getelementptr inbounds float, float* %src.addr.021, i64 %i.023 + %add.ptr8 = getelementptr inbounds float, float* %dst.addr.022, i64 %i.023 %inc = add i64 %i.023, 1 %exitcond = icmp eq i64 %inc, %count br i1 %exitcond, label %for.end, label %for.body @@ -85,14 +85,14 @@ for.body: ; preds = %entry, %for.body %i.015 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %dst.addr.014 = phi double* [ %add.ptr4, %for.body ], [ %dst, %entry ] %src.addr.013 = phi double* [ %add.ptr, %for.body ], [ %src, %entry ] - %0 = load double* %src.addr.013, align 8 + %0 = load double, double* %src.addr.013, align 8 store double %0, double* %dst.addr.014, align 8 - %arrayidx2 = getelementptr inbounds double* %src.addr.013, i64 2 - %1 = load double* %arrayidx2, align 8 - %arrayidx3 = getelementptr inbounds double* %dst.addr.014, i64 1 + %arrayidx2 = getelementptr inbounds double, double* %src.addr.013, i64 2 + %1 = load double, double* %arrayidx2, align 8 + %arrayidx3 = getelementptr inbounds double, double* %dst.addr.014, i64 1 store double %1, double* %arrayidx3, align 8 - %add.ptr = getelementptr inbounds double* %src.addr.013, i64 %i.015 - %add.ptr4 = getelementptr inbounds double* %dst.addr.014, i64 %i.015 + %add.ptr = getelementptr inbounds double, double* %src.addr.013, i64 %i.015 + %add.ptr4 = getelementptr inbounds double, double* %dst.addr.014, i64 %i.015 %inc = add i64 %i.015, 1 %exitcond = icmp eq i64 %inc, %count br i1 %exitcond, label %for.end, label %for.body @@ -115,22 +115,22 @@ for.body: ; preds = %entry, %for.body %i.023 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %dst.addr.022 = phi float* [ %add.ptr8, %for.body ], [ %dst, %entry ] %src.addr.021 = phi float* [ %add.ptr, %for.body ], [ %src, %entry ] - %0 = load float* %src.addr.021, align 4 + %0 = load float, float* %src.addr.021, align 4 store float %0, float* %dst.addr.022, align 4 - %arrayidx2 = getelementptr inbounds float* %src.addr.021, i64 4 - %1 = load float* %arrayidx2, align 4 - %arrayidx3 = getelementptr inbounds float* %dst.addr.022, i64 1 + %arrayidx2 = getelementptr inbounds float, float* %src.addr.021, i64 4 + %1 = load float, float* %arrayidx2, align 4 + %arrayidx3 = getelementptr inbounds float, float* %dst.addr.022, i64 1 store float %1, float* %arrayidx3, align 4 - %arrayidx4 = getelementptr inbounds float* %src.addr.021, i64 2 - %2 = load float* %arrayidx4, align 4 - %arrayidx5 = getelementptr inbounds float* %dst.addr.022, i64 2 + %arrayidx4 = getelementptr inbounds float, float* %src.addr.021, i64 2 + %2 = load float, float* %arrayidx4, align 4 + %arrayidx5 = getelementptr inbounds float, float* %dst.addr.022, i64 2 store float %2, float* %arrayidx5, align 4 - %arrayidx6 = getelementptr inbounds float* %src.addr.021, i64 3 - %3 = load float* %arrayidx6, align 4 - %arrayidx7 = getelementptr inbounds float* %dst.addr.022, i64 3 + %arrayidx6 = getelementptr inbounds float, float* %src.addr.021, i64 3 + %3 = load float, float* %arrayidx6, align 4 + %arrayidx7 = getelementptr inbounds float, float* %dst.addr.022, i64 3 store float %3, float* %arrayidx7, align 4 - %add.ptr = getelementptr inbounds float* %src.addr.021, i64 %i.023 - %add.ptr8 = getelementptr inbounds float* %dst.addr.022, i64 %i.023 + %add.ptr = getelementptr inbounds float, float* %src.addr.021, i64 %i.023 + %add.ptr8 = getelementptr inbounds float, float* %dst.addr.022, i64 %i.023 %inc = add i64 %i.023, 1 %exitcond = icmp eq i64 %inc, %count br i1 %exitcond, label %for.end, label %for.body @@ -143,13 +143,13 @@ for.end: ; preds = %for.body, %entry ; CHECK-LABEL: store_splat ; CHECK: store <4 x float> define void @store_splat(float*, float) { - %3 = getelementptr inbounds float* %0, i64 0 + %3 = getelementptr inbounds float, float* %0, i64 0 store float %1, float* %3, align 4 - %4 = getelementptr inbounds float* %0, i64 1 + %4 = getelementptr inbounds float, float* %0, i64 1 store float %1, float* %4, align 4 - %5 = getelementptr inbounds float* %0, i64 2 + %5 = getelementptr inbounds float, float* %0, i64 2 store float %1, float* %5, align 4 - %6 = getelementptr inbounds float* %0, i64 3 + %6 = getelementptr inbounds float, float* %0, i64 3 store float %1, float* %6, align 4 ret void } diff --git a/test/Transforms/SLPVectorizer/X86/unreachable.ll b/test/Transforms/SLPVectorizer/X86/unreachable.ll index 8d60957..f29f69d 100644 --- a/test/Transforms/SLPVectorizer/X86/unreachable.ll +++ b/test/Transforms/SLPVectorizer/X86/unreachable.ll @@ -11,16 +11,16 @@ entry: br label %bb2 bb1: ; an unreachable block - %t3 = getelementptr inbounds i32* %x, i64 4 - %t4 = load i32* %t3, align 4 - %t5 = getelementptr inbounds i32* %x, i64 5 - %t6 = load i32* %t5, align 4 + %t3 = getelementptr inbounds i32, i32* %x, i64 4 + %t4 = load i32, i32* %t3, align 4 + %t5 = getelementptr inbounds i32, i32* %x, i64 5 + %t6 = load i32, i32* %t5, align 4 %bad = fadd float %bad, 0.000000e+00 ; <- an instruction with self dependency, ; but legal in unreachable code - %t7 = getelementptr inbounds i32* %x, i64 6 - %t8 = load i32* %t7, align 4 - %t9 = getelementptr inbounds i32* %x, i64 7 - %t10 = load i32* %t9, align 4 + %t7 = getelementptr inbounds i32, i32* %x, i64 6 + %t8 = load i32, i32* %t7, align 4 + %t9 = getelementptr inbounds i32, i32* %x, i64 7 + %t10 = load i32, i32* %t9, align 4 br label %bb2 bb2: @@ -29,11 +29,11 @@ bb2: %t3.0 = phi i32 [ %t8, %bb1 ], [ 2, %entry ] %t4.0 = phi i32 [ %t10, %bb1 ], [ 2, %entry ] store i32 %t1.0, i32* %x, align 4 - %t12 = getelementptr inbounds i32* %x, i64 1 + %t12 = getelementptr inbounds i32, i32* %x, i64 1 store i32 %t2.0, i32* %t12, align 4 - %t13 = getelementptr inbounds i32* %x, i64 2 + %t13 = getelementptr inbounds i32, i32* %x, i64 2 store i32 %t3.0, i32* %t13, align 4 - %t14 = getelementptr inbounds i32* %x, i64 3 + %t14 = getelementptr inbounds i32, i32* %x, i64 3 store i32 %t4.0, i32* %t14, align 4 ret void } diff --git a/test/Transforms/SLPVectorizer/XCore/no-vector-registers.ll b/test/Transforms/SLPVectorizer/XCore/no-vector-registers.ll index 66392e7..efd5386 100644 --- a/test/Transforms/SLPVectorizer/XCore/no-vector-registers.ll +++ b/test/Transforms/SLPVectorizer/XCore/no-vector-registers.ll @@ -8,16 +8,16 @@ target triple = "xcore" ; CHECK-NOT: <2 x double> define void @test1(double* %a, double* %b, double* %c) { entry: - %i0 = load double* %a, align 8 - %i1 = load double* %b, align 8 + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 %mul = fmul double %i0, %i1 - %arrayidx3 = getelementptr inbounds double* %a, i64 1 - %i3 = load double* %arrayidx3, align 8 - %arrayidx4 = getelementptr inbounds double* %b, i64 1 - %i4 = load double* %arrayidx4, align 8 + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 %mul5 = fmul double %i3, %i4 store double %mul, double* %c, align 8 - %arrayidx5 = getelementptr inbounds double* %c, i64 1 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 store double %mul5, double* %arrayidx5, align 8 ret void } diff --git a/test/Transforms/SROA/address-spaces.ll b/test/Transforms/SROA/address-spaces.ll index 847f285..004695d 100644 --- a/test/Transforms/SROA/address-spaces.ll +++ b/test/Transforms/SROA/address-spaces.ll @@ -10,7 +10,7 @@ declare void @llvm.memcpy.p1i8.p1i8.i32(i8 addrspace(1)* nocapture, i8 addrspace ; Make sure an illegal bitcast isn't introduced define void @test_address_space_1_1(<2 x i64> addrspace(1)* %a, i16 addrspace(1)* %b) { ; CHECK-LABEL: @test_address_space_1_1( -; CHECK: load <2 x i64> addrspace(1)* %a, align 2 +; CHECK: load <2 x i64>, <2 x i64> addrspace(1)* %a, align 2 ; CHECK: store <2 x i64> {{.*}}, <2 x i64> addrspace(1)* {{.*}}, align 2 ; CHECK: ret void %aa = alloca <2 x i64>, align 16 @@ -24,7 +24,7 @@ define void @test_address_space_1_1(<2 x i64> addrspace(1)* %a, i16 addrspace(1) define void @test_address_space_1_0(<2 x i64> addrspace(1)* %a, i16* %b) { ; CHECK-LABEL: @test_address_space_1_0( -; CHECK: load <2 x i64> addrspace(1)* %a, align 2 +; CHECK: load <2 x i64>, <2 x i64> addrspace(1)* %a, align 2 ; CHECK: store <2 x i64> {{.*}}, <2 x i64>* {{.*}}, align 2 ; CHECK: ret void %aa = alloca <2 x i64>, align 16 @@ -38,7 +38,7 @@ define void @test_address_space_1_0(<2 x i64> addrspace(1)* %a, i16* %b) { define void @test_address_space_0_1(<2 x i64>* %a, i16 addrspace(1)* %b) { ; CHECK-LABEL: @test_address_space_0_1( -; CHECK: load <2 x i64>* %a, align 2 +; CHECK: load <2 x i64>, <2 x i64>* %a, align 2 ; CHECK: store <2 x i64> {{.*}}, <2 x i64> addrspace(1)* {{.*}}, align 2 ; CHECK: ret void %aa = alloca <2 x i64>, align 16 @@ -60,7 +60,7 @@ for.end: %in = alloca %struct.struct_test_27.0.13, align 8 %0 = bitcast %struct.struct_test_27.0.13* %in to [5 x i64]* store [5 x i64] %in.coerce, [5 x i64]* %0, align 8 - %scevgep9 = getelementptr %struct.struct_test_27.0.13* %in, i32 0, i32 4, i32 0 + %scevgep9 = getelementptr %struct.struct_test_27.0.13, %struct.struct_test_27.0.13* %in, i32 0, i32 4, i32 0 %scevgep910 = bitcast i32* %scevgep9 to i8* call void @llvm.memcpy.p1i8.p0i8.i32(i8 addrspace(1)* undef, i8* %scevgep910, i32 16, i32 4, i1 false) ret void diff --git a/test/Transforms/SROA/alignment.ll b/test/Transforms/SROA/alignment.ll index 4f4e40c..455d142 100644 --- a/test/Transforms/SROA/alignment.ll +++ b/test/Transforms/SROA/alignment.ll @@ -5,21 +5,21 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) define void @test1({ i8, i8 }* %a, { i8, i8 }* %b) { ; CHECK-LABEL: @test1( -; CHECK: %[[gep_a0:.*]] = getelementptr inbounds { i8, i8 }* %a, i64 0, i32 0 -; CHECK: %[[a0:.*]] = load i8* %[[gep_a0]], align 16 -; CHECK: %[[gep_a1:.*]] = getelementptr inbounds { i8, i8 }* %a, i64 0, i32 1 -; CHECK: %[[a1:.*]] = load i8* %[[gep_a1]], align 1 -; CHECK: %[[gep_b0:.*]] = getelementptr inbounds { i8, i8 }* %b, i64 0, i32 0 +; CHECK: %[[gep_a0:.*]] = getelementptr inbounds { i8, i8 }, { i8, i8 }* %a, i64 0, i32 0 +; CHECK: %[[a0:.*]] = load i8, i8* %[[gep_a0]], align 16 +; CHECK: %[[gep_a1:.*]] = getelementptr inbounds { i8, i8 }, { i8, i8 }* %a, i64 0, i32 1 +; CHECK: %[[a1:.*]] = load i8, i8* %[[gep_a1]], align 1 +; CHECK: %[[gep_b0:.*]] = getelementptr inbounds { i8, i8 }, { i8, i8 }* %b, i64 0, i32 0 ; CHECK: store i8 %[[a0]], i8* %[[gep_b0]], align 16 -; CHECK: %[[gep_b1:.*]] = getelementptr inbounds { i8, i8 }* %b, i64 0, i32 1 +; CHECK: %[[gep_b1:.*]] = getelementptr inbounds { i8, i8 }, { i8, i8 }* %b, i64 0, i32 1 ; CHECK: store i8 %[[a1]], i8* %[[gep_b1]], align 1 ; CHECK: ret void entry: %alloca = alloca { i8, i8 }, align 16 - %gep_a = getelementptr { i8, i8 }* %a, i32 0, i32 0 - %gep_alloca = getelementptr { i8, i8 }* %alloca, i32 0, i32 0 - %gep_b = getelementptr { i8, i8 }* %b, i32 0, i32 0 + %gep_a = getelementptr { i8, i8 }, { i8, i8 }* %a, i32 0, i32 0 + %gep_alloca = getelementptr { i8, i8 }, { i8, i8 }* %alloca, i32 0, i32 0 + %gep_b = getelementptr { i8, i8 }, { i8, i8 }* %b, i32 0, i32 0 store i8 420, i8* %gep_alloca, align 16 @@ -31,17 +31,17 @@ entry: define void @test2() { ; CHECK-LABEL: @test2( ; CHECK: alloca i16 -; CHECK: load i8* %{{.*}} +; CHECK: load i8, i8* %{{.*}} ; CHECK: store i8 42, i8* %{{.*}} ; CHECK: ret void entry: %a = alloca { i8, i8, i8, i8 }, align 2 - %gep1 = getelementptr { i8, i8, i8, i8 }* %a, i32 0, i32 1 + %gep1 = getelementptr { i8, i8, i8, i8 }, { i8, i8, i8, i8 }* %a, i32 0, i32 1 %cast1 = bitcast i8* %gep1 to i16* store volatile i16 0, i16* %cast1 - %gep2 = getelementptr { i8, i8, i8, i8 }* %a, i32 0, i32 2 - %result = load i8* %gep2 + %gep2 = getelementptr { i8, i8, i8, i8 }, { i8, i8, i8, i8 }* %a, i32 0, i32 2 + %result = load i8, i8* %gep2 store i8 42, i8* %gep2 ret void } @@ -49,7 +49,7 @@ entry: define void @PR13920(<2 x i64>* %a, i16* %b) { ; Test that alignments on memcpy intrinsics get propagated to loads and stores. ; CHECK-LABEL: @PR13920( -; CHECK: load <2 x i64>* %a, align 2 +; CHECK: load <2 x i64>, <2 x i64>* %a, align 2 ; CHECK: store <2 x i64> {{.*}}, <2 x i64>* {{.*}}, align 2 ; CHECK: ret void @@ -79,7 +79,7 @@ entry: %a_raw = bitcast { i8*, i8*, i8* }* %a to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a_raw, i8* %x, i32 22, i32 8, i1 false) %b_raw = bitcast { i8*, i8*, i8* }* %b to i8* - %b_gep = getelementptr i8* %b_raw, i32 6 + %b_gep = getelementptr i8, i8* %b_raw, i32 6 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %b_gep, i8* %x, i32 18, i32 2, i1 false) ret void } @@ -93,28 +93,28 @@ define void @test5() { ; CHECK: alloca [9 x i8] ; CHECK: alloca [9 x i8] ; CHECK: store volatile double 0.0{{.*}}, double* %{{.*}}, align 1 -; CHECK: load volatile i16* %{{.*}}, align 1 -; CHECK: load double* %{{.*}}, align 1 +; CHECK: load volatile i16, i16* %{{.*}}, align 1 +; CHECK: load double, double* %{{.*}}, align 1 ; CHECK: store volatile double %{{.*}}, double* %{{.*}}, align 1 -; CHECK: load volatile i16* %{{.*}}, align 1 +; CHECK: load volatile i16, i16* %{{.*}}, align 1 ; CHECK: ret void entry: %a = alloca [18 x i8] - %raw1 = getelementptr inbounds [18 x i8]* %a, i32 0, i32 0 + %raw1 = getelementptr inbounds [18 x i8], [18 x i8]* %a, i32 0, i32 0 %ptr1 = bitcast i8* %raw1 to double* store volatile double 0.0, double* %ptr1, align 1 - %weird_gep1 = getelementptr inbounds [18 x i8]* %a, i32 0, i32 7 + %weird_gep1 = getelementptr inbounds [18 x i8], [18 x i8]* %a, i32 0, i32 7 %weird_cast1 = bitcast i8* %weird_gep1 to i16* - %weird_load1 = load volatile i16* %weird_cast1, align 1 + %weird_load1 = load volatile i16, i16* %weird_cast1, align 1 - %raw2 = getelementptr inbounds [18 x i8]* %a, i32 0, i32 9 + %raw2 = getelementptr inbounds [18 x i8], [18 x i8]* %a, i32 0, i32 9 %ptr2 = bitcast i8* %raw2 to double* - %d1 = load double* %ptr1, align 1 + %d1 = load double, double* %ptr1, align 1 store volatile double %d1, double* %ptr2, align 1 - %weird_gep2 = getelementptr inbounds [18 x i8]* %a, i32 0, i32 16 + %weird_gep2 = getelementptr inbounds [18 x i8], [18 x i8]* %a, i32 0, i32 16 %weird_cast2 = bitcast i8* %weird_gep2 to i16* - %weird_load2 = load volatile i16* %weird_cast2, align 1 + %weird_load2 = load volatile i16, i16* %weird_cast2, align 1 ret void } @@ -130,13 +130,13 @@ define void @test6() { entry: %a = alloca [16 x i8] - %raw1 = getelementptr inbounds [16 x i8]* %a, i32 0, i32 0 + %raw1 = getelementptr inbounds [16 x i8], [16 x i8]* %a, i32 0, i32 0 %ptr1 = bitcast i8* %raw1 to double* store volatile double 0.0, double* %ptr1, align 1 - %raw2 = getelementptr inbounds [16 x i8]* %a, i32 0, i32 8 + %raw2 = getelementptr inbounds [16 x i8], [16 x i8]* %a, i32 0, i32 8 %ptr2 = bitcast i8* %raw2 to double* - %val = load double* %ptr1, align 1 + %val = load double, double* %ptr1, align 1 store volatile double %val, double* %ptr2, align 1 ret void @@ -150,17 +150,17 @@ define void @test7(i8* %out) { entry: %a = alloca [16 x i8] - %raw1 = getelementptr inbounds [16 x i8]* %a, i32 0, i32 0 + %raw1 = getelementptr inbounds [16 x i8], [16 x i8]* %a, i32 0, i32 0 %ptr1 = bitcast i8* %raw1 to double* - %raw2 = getelementptr inbounds [16 x i8]* %a, i32 0, i32 8 + %raw2 = getelementptr inbounds [16 x i8], [16 x i8]* %a, i32 0, i32 8 %ptr2 = bitcast i8* %raw2 to double* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %raw1, i8* %out, i32 16, i32 0, i1 false) -; CHECK: %[[val2:.*]] = load double* %{{.*}}, align 1 -; CHECK: %[[val1:.*]] = load double* %{{.*}}, align 1 +; CHECK: %[[val2:.*]] = load double, double* %{{.*}}, align 1 +; CHECK: %[[val1:.*]] = load double, double* %{{.*}}, align 1 - %val1 = load double* %ptr2, align 1 - %val2 = load double* %ptr1, align 1 + %val1 = load double, double* %ptr2, align 1 + %val2 = load double, double* %ptr1, align 1 store double %val1, double* %ptr1, align 1 store double %val2, double* %ptr2, align 1 diff --git a/test/Transforms/SROA/basictest.ll b/test/Transforms/SROA/basictest.ll index e3f762a..a59192d 100644 --- a/test/Transforms/SROA/basictest.ll +++ b/test/Transforms/SROA/basictest.ll @@ -19,7 +19,7 @@ entry: call void @llvm.lifetime.start(i64 4, i8* %a1.i8) store i32 0, i32* %a1 - %v1 = load i32* %a1 + %v1 = load i32, i32* %a1 call void @llvm.lifetime.end(i64 4, i8* %a1.i8) @@ -27,7 +27,7 @@ entry: call void @llvm.lifetime.start(i64 4, i8* %a2.i8) store float 0.0, float* %a2 - %v2 = load float * %a2 + %v2 = load float , float * %a2 %v2.int = bitcast float %v2 to i32 %sum1 = add i32 %v1, %v2.int @@ -43,9 +43,9 @@ define i32 @test1() { entry: %X = alloca { i32, float } - %Y = getelementptr { i32, float }* %X, i64 0, i32 0 + %Y = getelementptr { i32, float }, { i32, float }* %X, i64 0, i32 0 store i32 0, i32* %Y - %Z = load i32* %Y + %Z = load i32, i32* %Y ret i32 %Z } @@ -61,7 +61,7 @@ entry: br label %L2 L2: - %Z = load i64* %B + %Z = load i64, i64* %B ret i64 %Z } @@ -79,48 +79,48 @@ entry: ; CHECK-NEXT: %[[test3_a6:.*]] = alloca [7 x i8] ; CHECK-NEXT: %[[test3_a7:.*]] = alloca [85 x i8] - %b = getelementptr [300 x i8]* %a, i64 0, i64 0 + %b = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %b, i8* %src, i32 300, i32 1, i1 false) -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [42 x i8]* %[[test3_a1]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [42 x i8], [42 x i8]* %[[test3_a1]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %src, i32 42 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 42 -; CHECK-NEXT: %[[test3_r1:.*]] = load i8* %[[gep]] -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 43 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [99 x i8]* %[[test3_a2]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 42 +; CHECK-NEXT: %[[test3_r1:.*]] = load i8, i8* %[[gep]] +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 43 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [99 x i8], [99 x i8]* %[[test3_a2]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 99 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 142 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 142 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 16 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 158 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [42 x i8]* %[[test3_a4]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 158 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [42 x i8], [42 x i8]* %[[test3_a4]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 42 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 200 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 200 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 207 -; CHECK-NEXT: %[[test3_r2:.*]] = load i8* %[[gep]] -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 208 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 207 +; CHECK-NEXT: %[[test3_r2:.*]] = load i8, i8* %[[gep]] +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 208 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 215 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [85 x i8]* %[[test3_a7]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 215 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [85 x i8], [85 x i8]* %[[test3_a7]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 85 ; Clobber a single element of the array, this should be promotable. - %c = getelementptr [300 x i8]* %a, i64 0, i64 42 + %c = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 42 store i8 0, i8* %c ; Make a sequence of overlapping stores to the array. These overlap both in ; forward strides and in shrinking accesses. - %overlap.1.i8 = getelementptr [300 x i8]* %a, i64 0, i64 142 - %overlap.2.i8 = getelementptr [300 x i8]* %a, i64 0, i64 143 - %overlap.3.i8 = getelementptr [300 x i8]* %a, i64 0, i64 144 - %overlap.4.i8 = getelementptr [300 x i8]* %a, i64 0, i64 145 - %overlap.5.i8 = getelementptr [300 x i8]* %a, i64 0, i64 146 - %overlap.6.i8 = getelementptr [300 x i8]* %a, i64 0, i64 147 - %overlap.7.i8 = getelementptr [300 x i8]* %a, i64 0, i64 148 - %overlap.8.i8 = getelementptr [300 x i8]* %a, i64 0, i64 149 - %overlap.9.i8 = getelementptr [300 x i8]* %a, i64 0, i64 150 + %overlap.1.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 142 + %overlap.2.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 143 + %overlap.3.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 144 + %overlap.4.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 145 + %overlap.5.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 146 + %overlap.6.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 147 + %overlap.7.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 148 + %overlap.8.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 149 + %overlap.9.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 150 %overlap.1.i16 = bitcast i8* %overlap.1.i8 to i16* %overlap.1.i32 = bitcast i8* %overlap.1.i8 to i32* %overlap.1.i64 = bitcast i8* %overlap.1.i8 to i64* @@ -133,7 +133,7 @@ entry: %overlap.8.i64 = bitcast i8* %overlap.8.i8 to i64* %overlap.9.i64 = bitcast i8* %overlap.9.i8 to i64* store i8 1, i8* %overlap.1.i8 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 0 ; CHECK-NEXT: store i8 1, i8* %[[gep]] store i16 1, i16* %overlap.1.i16 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast [16 x i8]* %[[test3_a3]] to i16* @@ -145,48 +145,48 @@ entry: ; CHECK-NEXT: %[[bitcast:.*]] = bitcast [16 x i8]* %[[test3_a3]] to i64* ; CHECK-NEXT: store i64 1, i64* %[[bitcast]] store i64 2, i64* %overlap.2.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 1 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 1 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 2, i64* %[[bitcast]] store i64 3, i64* %overlap.3.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 2 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 2 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 3, i64* %[[bitcast]] store i64 4, i64* %overlap.4.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 3 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 3 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 4, i64* %[[bitcast]] store i64 5, i64* %overlap.5.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 4 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 4 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 5, i64* %[[bitcast]] store i64 6, i64* %overlap.6.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 5 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 5 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 6, i64* %[[bitcast]] store i64 7, i64* %overlap.7.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 6 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 6 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 7, i64* %[[bitcast]] store i64 8, i64* %overlap.8.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 7 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 7 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 8, i64* %[[bitcast]] store i64 9, i64* %overlap.9.i64 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 8 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 8 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i64* ; CHECK-NEXT: store i64 9, i64* %[[bitcast]] ; Make two sequences of overlapping stores with more gaps and irregularities. - %overlap2.1.0.i8 = getelementptr [300 x i8]* %a, i64 0, i64 200 - %overlap2.1.1.i8 = getelementptr [300 x i8]* %a, i64 0, i64 201 - %overlap2.1.2.i8 = getelementptr [300 x i8]* %a, i64 0, i64 202 - %overlap2.1.3.i8 = getelementptr [300 x i8]* %a, i64 0, i64 203 + %overlap2.1.0.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 200 + %overlap2.1.1.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 201 + %overlap2.1.2.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 202 + %overlap2.1.3.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 203 - %overlap2.2.0.i8 = getelementptr [300 x i8]* %a, i64 0, i64 208 - %overlap2.2.1.i8 = getelementptr [300 x i8]* %a, i64 0, i64 209 - %overlap2.2.2.i8 = getelementptr [300 x i8]* %a, i64 0, i64 210 - %overlap2.2.3.i8 = getelementptr [300 x i8]* %a, i64 0, i64 211 + %overlap2.2.0.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 208 + %overlap2.2.1.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 209 + %overlap2.2.2.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 210 + %overlap2.2.3.i8 = getelementptr [300 x i8], [300 x i8]* %a, i64 0, i64 211 %overlap2.1.0.i16 = bitcast i8* %overlap2.1.0.i8 to i16* %overlap2.1.0.i32 = bitcast i8* %overlap2.1.0.i8 to i32* @@ -194,7 +194,7 @@ entry: %overlap2.1.2.i32 = bitcast i8* %overlap2.1.2.i8 to i32* %overlap2.1.3.i32 = bitcast i8* %overlap2.1.3.i8 to i32* store i8 1, i8* %overlap2.1.0.i8 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 0 ; CHECK-NEXT: store i8 1, i8* %[[gep]] store i16 1, i16* %overlap2.1.0.i16 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast [7 x i8]* %[[test3_a5]] to i16* @@ -203,15 +203,15 @@ entry: ; CHECK-NEXT: %[[bitcast:.*]] = bitcast [7 x i8]* %[[test3_a5]] to i32* ; CHECK-NEXT: store i32 1, i32* %[[bitcast]] store i32 2, i32* %overlap2.1.1.i32 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 1 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 1 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i32* ; CHECK-NEXT: store i32 2, i32* %[[bitcast]] store i32 3, i32* %overlap2.1.2.i32 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 2 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 2 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i32* ; CHECK-NEXT: store i32 3, i32* %[[bitcast]] store i32 4, i32* %overlap2.1.3.i32 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 3 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 3 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i32* ; CHECK-NEXT: store i32 4, i32* %[[bitcast]] @@ -224,78 +224,78 @@ entry: ; CHECK-NEXT: %[[bitcast:.*]] = bitcast [7 x i8]* %[[test3_a6]] to i32* ; CHECK-NEXT: store i32 1, i32* %[[bitcast]] store i8 1, i8* %overlap2.2.1.i8 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 1 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 1 ; CHECK-NEXT: store i8 1, i8* %[[gep]] store i16 1, i16* %overlap2.2.1.i16 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 1 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 1 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i16* ; CHECK-NEXT: store i16 1, i16* %[[bitcast]] store i32 1, i32* %overlap2.2.1.i32 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 1 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 1 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i32* ; CHECK-NEXT: store i32 1, i32* %[[bitcast]] store i32 3, i32* %overlap2.2.2.i32 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 2 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 2 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i32* ; CHECK-NEXT: store i32 3, i32* %[[bitcast]] store i32 4, i32* %overlap2.2.3.i32 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 3 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 3 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i32* ; CHECK-NEXT: store i32 4, i32* %[[bitcast]] - %overlap2.prefix = getelementptr i8* %overlap2.1.1.i8, i64 -4 + %overlap2.prefix = getelementptr i8, i8* %overlap2.1.1.i8, i64 -4 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %overlap2.prefix, i8* %src, i32 8, i32 1, i1 false) -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [42 x i8]* %[[test3_a4]], i64 0, i64 39 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [42 x i8], [42 x i8]* %[[test3_a4]], i64 0, i64 39 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %src, i32 3 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 3 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 3 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 5 ; Bridge between the overlapping areas call void @llvm.memset.p0i8.i32(i8* %overlap2.1.2.i8, i8 42, i32 8, i32 1, i1 false) -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 2 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 2 ; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* %[[gep]], i8 42, i32 5 ; ...promoted i8 store... -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* %[[gep]], i8 42, i32 2 ; Entirely within the second overlap. call void @llvm.memcpy.p0i8.p0i8.i32(i8* %overlap2.2.1.i8, i8* %src, i32 5, i32 1, i1 false) -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 1 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 1 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep]], i8* %src, i32 5 ; Trailing past the second overlap. call void @llvm.memcpy.p0i8.p0i8.i32(i8* %overlap2.2.2.i8, i8* %src, i32 8, i32 1, i1 false) -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 2 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 2 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep]], i8* %src, i32 5 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 5 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [85 x i8]* %[[test3_a7]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 5 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [85 x i8], [85 x i8]* %[[test3_a7]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 3 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %b, i32 300, i32 1, i1 false) -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [42 x i8]* %[[test3_a1]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [42 x i8], [42 x i8]* %[[test3_a1]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %[[gep]], i32 42 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 42 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 42 ; CHECK-NEXT: store i8 0, i8* %[[gep]] -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 43 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [99 x i8]* %[[test3_a2]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 43 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [99 x i8], [99 x i8]* %[[test3_a2]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 99 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 142 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [16 x i8]* %[[test3_a3]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 142 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [16 x i8], [16 x i8]* %[[test3_a3]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 16 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 158 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [42 x i8]* %[[test3_a4]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 158 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [42 x i8], [42 x i8]* %[[test3_a4]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 42 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 200 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a5]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 200 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a5]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 207 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 207 ; CHECK-NEXT: store i8 42, i8* %[[gep]] -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 208 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8]* %[[test3_a6]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 208 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test3_a6]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 215 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [85 x i8]* %[[test3_a7]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 215 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [85 x i8], [85 x i8]* %[[test3_a7]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 85 ret void @@ -314,90 +314,90 @@ entry: ; CHECK-NEXT: %[[test4_a5:.*]] = alloca [7 x i8] ; CHECK-NEXT: %[[test4_a6:.*]] = alloca [40 x i8] - %b = getelementptr [100 x i8]* %a, i64 0, i64 0 + %b = getelementptr [100 x i8], [100 x i8]* %a, i64 0, i64 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %b, i8* %src, i32 100, i32 1, i1 false) -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [20 x i8]* %[[test4_a1]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [20 x i8], [20 x i8]* %[[test4_a1]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep]], i8* %src, i32 20 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 20 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 20 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i16* -; CHECK-NEXT: %[[test4_r1:.*]] = load i16* %[[bitcast]] -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 22 -; CHECK-NEXT: %[[test4_r2:.*]] = load i8* %[[gep]] -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 23 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a2]], i64 0, i64 0 +; CHECK-NEXT: %[[test4_r1:.*]] = load i16, i16* %[[bitcast]] +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 22 +; CHECK-NEXT: %[[test4_r2:.*]] = load i8, i8* %[[gep]] +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 23 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a2]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 30 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [10 x i8]* %[[test4_a3]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 30 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [10 x i8], [10 x i8]* %[[test4_a3]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 10 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 40 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 40 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i16* -; CHECK-NEXT: %[[test4_r3:.*]] = load i16* %[[bitcast]] -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 42 -; CHECK-NEXT: %[[test4_r4:.*]] = load i8* %[[gep]] -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 43 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a4]], i64 0, i64 0 +; CHECK-NEXT: %[[test4_r3:.*]] = load i16, i16* %[[bitcast]] +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 42 +; CHECK-NEXT: %[[test4_r4:.*]] = load i8, i8* %[[gep]] +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 43 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a4]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 50 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 50 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i16* -; CHECK-NEXT: %[[test4_r5:.*]] = load i16* %[[bitcast]] -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %src, i64 52 -; CHECK-NEXT: %[[test4_r6:.*]] = load i8* %[[gep]] -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 53 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a5]], i64 0, i64 0 +; CHECK-NEXT: %[[test4_r5:.*]] = load i16, i16* %[[bitcast]] +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %src, i64 52 +; CHECK-NEXT: %[[test4_r6:.*]] = load i8, i8* %[[gep]] +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 53 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a5]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8* %src, i64 60 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [40 x i8]* %[[test4_a6]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds i8, i8* %src, i64 60 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [40 x i8], [40 x i8]* %[[test4_a6]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 40 - %a.src.1 = getelementptr [100 x i8]* %a, i64 0, i64 20 - %a.dst.1 = getelementptr [100 x i8]* %a, i64 0, i64 40 + %a.src.1 = getelementptr [100 x i8], [100 x i8]* %a, i64 0, i64 20 + %a.dst.1 = getelementptr [100 x i8], [100 x i8]* %a, i64 0, i64 40 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.dst.1, i8* %a.src.1, i32 10, i32 1, i1 false) -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a4]], i64 0, i64 0 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a2]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a4]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a2]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 ; Clobber a single element of the array, this should be promotable, and be deleted. - %c = getelementptr [100 x i8]* %a, i64 0, i64 42 + %c = getelementptr [100 x i8], [100 x i8]* %a, i64 0, i64 42 store i8 0, i8* %c - %a.src.2 = getelementptr [100 x i8]* %a, i64 0, i64 50 + %a.src.2 = getelementptr [100 x i8], [100 x i8]* %a, i64 0, i64 50 call void @llvm.memmove.p0i8.p0i8.i32(i8* %a.dst.1, i8* %a.src.2, i32 10, i32 1, i1 false) -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a4]], i64 0, i64 0 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a5]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a4]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a5]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %b, i32 100, i32 1, i1 false) -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [20 x i8]* %[[test4_a1]], i64 0, i64 0 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds [20 x i8], [20 x i8]* %[[test4_a1]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %[[gep]], i32 20 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 20 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 20 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i16* ; CHECK-NEXT: store i16 %[[test4_r1]], i16* %[[bitcast]] -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 22 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 22 ; CHECK-NEXT: store i8 %[[test4_r2]], i8* %[[gep]] -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 23 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a2]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 23 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a2]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 30 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [10 x i8]* %[[test4_a3]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 30 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [10 x i8], [10 x i8]* %[[test4_a3]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 10 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 40 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 40 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i16* ; CHECK-NEXT: store i16 %[[test4_r5]], i16* %[[bitcast]] -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 42 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 42 ; CHECK-NEXT: store i8 %[[test4_r6]], i8* %[[gep]] -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 43 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a4]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 43 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a4]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 50 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 50 ; CHECK-NEXT: %[[bitcast:.*]] = bitcast i8* %[[gep]] to i16* ; CHECK-NEXT: store i16 %[[test4_r5]], i16* %[[bitcast]] -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8* %dst, i64 52 +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds i8, i8* %dst, i64 52 ; CHECK-NEXT: store i8 %[[test4_r6]], i8* %[[gep]] -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 53 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8]* %[[test4_a5]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 53 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [7 x i8], [7 x i8]* %[[test4_a5]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 7 -; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8* %dst, i64 60 -; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [40 x i8]* %[[test4_a6]], i64 0, i64 0 +; CHECK-NEXT: %[[gep_dst:.*]] = getelementptr inbounds i8, i8* %dst, i64 60 +; CHECK-NEXT: %[[gep_src:.*]] = getelementptr inbounds [40 x i8], [40 x i8]* %[[test4_a6]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[gep_dst]], i8* %[[gep_src]], i32 40 ret void @@ -420,9 +420,9 @@ entry: %a = alloca [4 x i8] %fptr = bitcast [4 x i8]* %a to float* store float 0.0, float* %fptr - %ptr = getelementptr [4 x i8]* %a, i32 0, i32 2 + %ptr = getelementptr [4 x i8], [4 x i8]* %a, i32 0, i32 2 %iptr = bitcast i8* %ptr to i16* - %val = load i16* %iptr + %val = load i16, i16* %iptr ret i16 %val } @@ -430,15 +430,15 @@ define i32 @test6() { ; CHECK-LABEL: @test6( ; CHECK: alloca i32 ; CHECK-NEXT: store volatile i32 -; CHECK-NEXT: load i32* +; CHECK-NEXT: load i32, i32* ; CHECK-NEXT: ret i32 entry: %a = alloca [4 x i8] - %ptr = getelementptr [4 x i8]* %a, i32 0, i32 0 + %ptr = getelementptr [4 x i8], [4 x i8]* %a, i32 0, i32 0 call void @llvm.memset.p0i8.i32(i8* %ptr, i8 42, i32 4, i32 1, i1 true) %iptr = bitcast i8* %ptr to i32* - %val = load i32* %iptr + %val = load i32, i32* %iptr ret i32 %val } @@ -446,16 +446,16 @@ define void @test7(i8* %src, i8* %dst) { ; CHECK-LABEL: @test7( ; CHECK: alloca i32 ; CHECK-NEXT: bitcast i8* %src to i32* -; CHECK-NEXT: load volatile i32* +; CHECK-NEXT: load volatile i32, i32* ; CHECK-NEXT: store volatile i32 ; CHECK-NEXT: bitcast i8* %dst to i32* -; CHECK-NEXT: load volatile i32* +; CHECK-NEXT: load volatile i32, i32* ; CHECK-NEXT: store volatile i32 ; CHECK-NEXT: ret entry: %a = alloca [4 x i8] - %ptr = getelementptr [4 x i8]* %a, i32 0, i32 0 + %ptr = getelementptr [4 x i8], [4 x i8]* %a, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr, i8* %src, i32 4, i32 1, i1 true) call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %ptr, i32 4, i32 1, i1 true) ret void @@ -471,28 +471,28 @@ entry: %new = alloca %S2 ; CHECK-NOT: alloca - %s2.next.ptr = getelementptr %S2* %s2, i64 0, i32 1 - %s2.next = load %S2** %s2.next.ptr -; CHECK: %[[gep:.*]] = getelementptr %S2* %s2, i64 0, i32 1 -; CHECK-NEXT: %[[next:.*]] = load %S2** %[[gep]] + %s2.next.ptr = getelementptr %S2, %S2* %s2, i64 0, i32 1 + %s2.next = load %S2*, %S2** %s2.next.ptr +; CHECK: %[[gep:.*]] = getelementptr %S2, %S2* %s2, i64 0, i32 1 +; CHECK-NEXT: %[[next:.*]] = load %S2*, %S2** %[[gep]] - %s2.next.s1.ptr = getelementptr %S2* %s2.next, i64 0, i32 0 - %s2.next.s1 = load %S1** %s2.next.s1.ptr - %new.s1.ptr = getelementptr %S2* %new, i64 0, i32 0 + %s2.next.s1.ptr = getelementptr %S2, %S2* %s2.next, i64 0, i32 0 + %s2.next.s1 = load %S1*, %S1** %s2.next.s1.ptr + %new.s1.ptr = getelementptr %S2, %S2* %new, i64 0, i32 0 store %S1* %s2.next.s1, %S1** %new.s1.ptr - %s2.next.next.ptr = getelementptr %S2* %s2.next, i64 0, i32 1 - %s2.next.next = load %S2** %s2.next.next.ptr - %new.next.ptr = getelementptr %S2* %new, i64 0, i32 1 + %s2.next.next.ptr = getelementptr %S2, %S2* %s2.next, i64 0, i32 1 + %s2.next.next = load %S2*, %S2** %s2.next.next.ptr + %new.next.ptr = getelementptr %S2, %S2* %new, i64 0, i32 1 store %S2* %s2.next.next, %S2** %new.next.ptr -; CHECK-NEXT: %[[gep:.*]] = getelementptr %S2* %[[next]], i64 0, i32 0 -; CHECK-NEXT: %[[next_s1:.*]] = load %S1** %[[gep]] -; CHECK-NEXT: %[[gep:.*]] = getelementptr %S2* %[[next]], i64 0, i32 1 -; CHECK-NEXT: %[[next_next:.*]] = load %S2** %[[gep]] +; CHECK-NEXT: %[[gep:.*]] = getelementptr %S2, %S2* %[[next]], i64 0, i32 0 +; CHECK-NEXT: %[[next_s1:.*]] = load %S1*, %S1** %[[gep]] +; CHECK-NEXT: %[[gep:.*]] = getelementptr %S2, %S2* %[[next]], i64 0, i32 1 +; CHECK-NEXT: %[[next_next:.*]] = load %S2*, %S2** %[[gep]] - %new.s1 = load %S1** %new.s1.ptr + %new.s1 = load %S1*, %S1** %new.s1.ptr %result1 = insertvalue %S2 undef, %S1* %new.s1, 0 ; CHECK-NEXT: %[[result1:.*]] = insertvalue %S2 undef, %S1* %[[next_s1]], 0 - %new.next = load %S2** %new.next.ptr + %new.next = load %S2*, %S2** %new.next.ptr %result2 = insertvalue %S2 %result1, %S2* %new.next, 1 ; CHECK-NEXT: %[[result2:.*]] = insertvalue %S2 %[[result1]], %S2* %[[next_next]], 1 ret %S2 %result2 @@ -522,15 +522,15 @@ define i64 @test9() { entry: %a = alloca { [3 x i8] }, align 8 - %gep1 = getelementptr inbounds { [3 x i8] }* %a, i32 0, i32 0, i32 0 + %gep1 = getelementptr inbounds { [3 x i8] }, { [3 x i8] }* %a, i32 0, i32 0, i32 0 store i8 0, i8* %gep1, align 1 - %gep2 = getelementptr inbounds { [3 x i8] }* %a, i32 0, i32 0, i32 1 + %gep2 = getelementptr inbounds { [3 x i8] }, { [3 x i8] }* %a, i32 0, i32 0, i32 1 store i8 0, i8* %gep2, align 1 - %gep3 = getelementptr inbounds { [3 x i8] }* %a, i32 0, i32 0, i32 2 + %gep3 = getelementptr inbounds { [3 x i8] }, { [3 x i8] }* %a, i32 0, i32 0, i32 2 store i8 26, i8* %gep3, align 1 %cast = bitcast { [3 x i8] }* %a to { i64 }* - %elt = getelementptr inbounds { i64 }* %cast, i32 0, i32 0 - %load = load i64* %elt + %elt = getelementptr inbounds { i64 }, { i64 }* %cast, i32 0, i32 0 + %load = load i64, i64* %elt %result = and i64 %load, 16777215 ret i64 %result } @@ -542,10 +542,10 @@ define %S2* @test10() { entry: %a = alloca [8 x i8] - %ptr = getelementptr [8 x i8]* %a, i32 0, i32 0 + %ptr = getelementptr [8 x i8], [8 x i8]* %a, i32 0, i32 0 call void @llvm.memset.p0i8.i32(i8* %ptr, i8 0, i32 8, i32 1, i1 false) %s2ptrptr = bitcast i8* %ptr to %S2** - %s2ptr = load %S2** %s2ptrptr + %s2ptr = load %S2*, %S2** %s2ptrptr ret %S2* %s2ptr } @@ -559,15 +559,15 @@ entry: br i1 undef, label %good, label %bad good: - %Y = getelementptr i32* %X, i64 0 + %Y = getelementptr i32, i32* %X, i64 0 store i32 0, i32* %Y - %Z = load i32* %Y + %Z = load i32, i32* %Y ret i32 %Z bad: - %Y2 = getelementptr i32* %X, i64 1 + %Y2 = getelementptr i32, i32* %X, i64 1 store i32 0, i32* %Y2 - %Z2 = load i32* %Y2 + %Z2 = load i32, i32* %Y2 ret i32 %Z2 } @@ -582,14 +582,14 @@ entry: %b = alloca [3 x i8] ; CHECK-NOT: alloca - %a0ptr = getelementptr [3 x i8]* %a, i64 0, i32 0 + %a0ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 0 store i8 0, i8* %a0ptr - %a1ptr = getelementptr [3 x i8]* %a, i64 0, i32 1 + %a1ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 1 store i8 0, i8* %a1ptr - %a2ptr = getelementptr [3 x i8]* %a, i64 0, i32 2 + %a2ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 2 store i8 0, i8* %a2ptr %aiptr = bitcast [3 x i8]* %a to i24* - %ai = load i24* %aiptr + %ai = load i24, i24* %aiptr ; CHECK-NOT: store ; CHECK-NOT: load ; CHECK: %[[ext2:.*]] = zext i8 0 to i24 @@ -606,12 +606,12 @@ entry: %biptr = bitcast [3 x i8]* %b to i24* store i24 %ai, i24* %biptr - %b0ptr = getelementptr [3 x i8]* %b, i64 0, i32 0 - %b0 = load i8* %b0ptr - %b1ptr = getelementptr [3 x i8]* %b, i64 0, i32 1 - %b1 = load i8* %b1ptr - %b2ptr = getelementptr [3 x i8]* %b, i64 0, i32 2 - %b2 = load i8* %b2ptr + %b0ptr = getelementptr [3 x i8], [3 x i8]* %b, i64 0, i32 0 + %b0 = load i8, i8* %b0ptr + %b1ptr = getelementptr [3 x i8], [3 x i8]* %b, i64 0, i32 1 + %b1 = load i8, i8* %b1ptr + %b2ptr = getelementptr [3 x i8], [3 x i8]* %b, i64 0, i32 2 + %b2 = load i8, i8* %b2ptr ; CHECK-NOT: store ; CHECK-NOT: load ; CHECK: %[[trunc0:.*]] = trunc i24 %[[insert0]] to i8 @@ -638,15 +638,15 @@ define i32 @test13() { entry: %a = alloca [3 x i8], align 2 - %b0ptr = getelementptr [3 x i8]* %a, i64 0, i32 0 + %b0ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 0 store i8 0, i8* %b0ptr - %b1ptr = getelementptr [3 x i8]* %a, i64 0, i32 1 + %b1ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 1 store i8 0, i8* %b1ptr - %b2ptr = getelementptr [3 x i8]* %a, i64 0, i32 2 + %b2ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 2 store i8 0, i8* %b2ptr %iptrcast = bitcast [3 x i8]* %a to i16* - %iptrgep = getelementptr i16* %iptrcast, i64 1 - %i = load i16* %iptrgep + %iptrgep = getelementptr i16, i16* %iptrcast, i64 1 + %i = load i16, i16* %iptrgep %ret = zext i16 %i to i32 ret i32 %ret } @@ -666,21 +666,21 @@ entry: %a = alloca %test14.struct %p = alloca %test14.struct* %0 = bitcast %test14.struct* %a to i8* - %1 = getelementptr i8* %0, i64 12 + %1 = getelementptr i8, i8* %0, i64 12 %2 = bitcast i8* %1 to %test14.struct* - %3 = getelementptr inbounds %test14.struct* %2, i32 0, i32 0 - %4 = getelementptr inbounds %test14.struct* %a, i32 0, i32 0 + %3 = getelementptr inbounds %test14.struct, %test14.struct* %2, i32 0, i32 0 + %4 = getelementptr inbounds %test14.struct, %test14.struct* %a, i32 0, i32 0 %5 = bitcast [3 x i32]* %3 to i32* %6 = bitcast [3 x i32]* %4 to i32* - %7 = load i32* %6, align 4 + %7 = load i32, i32* %6, align 4 store i32 %7, i32* %5, align 4 - %8 = getelementptr inbounds i32* %5, i32 1 - %9 = getelementptr inbounds i32* %6, i32 1 - %10 = load i32* %9, align 4 + %8 = getelementptr inbounds i32, i32* %5, i32 1 + %9 = getelementptr inbounds i32, i32* %6, i32 1 + %10 = load i32, i32* %9, align 4 store i32 %10, i32* %8, align 4 - %11 = getelementptr inbounds i32* %5, i32 2 - %12 = getelementptr inbounds i32* %6, i32 2 - %13 = load i32* %12, align 4 + %11 = getelementptr inbounds i32, i32* %5, i32 2 + %12 = getelementptr inbounds i32, i32* %6, i32 2 + %13 = load i32, i32* %12, align 4 store i32 %13, i32* %11, align 4 ret void } @@ -707,25 +707,25 @@ loop: store i64 1879048192, i64* %l0, align 8 %bc0 = bitcast i64* %l0 to i8* - %gep0 = getelementptr i8* %bc0, i64 3 + %gep0 = getelementptr i8, i8* %bc0, i64 3 %dead0 = bitcast i8* %gep0 to i64* store i64 1879048192, i64* %l1, align 8 %bc1 = bitcast i64* %l1 to i8* - %gep1 = getelementptr i8* %bc1, i64 3 - %dead1 = getelementptr i8* %gep1, i64 1 + %gep1 = getelementptr i8, i8* %bc1, i64 3 + %dead1 = getelementptr i8, i8* %gep1, i64 1 store i64 1879048192, i64* %l2, align 8 %bc2 = bitcast i64* %l2 to i8* - %gep2.1 = getelementptr i8* %bc2, i64 1 - %gep2.2 = getelementptr i8* %bc2, i64 3 + %gep2.1 = getelementptr i8, i8* %bc2, i64 1 + %gep2.2 = getelementptr i8, i8* %bc2, i64 3 ; Note that this select should get visited multiple times due to using two ; different GEPs off the same alloca. We should only delete it once. %dead2 = select i1 %flag, i8* %gep2.1, i8* %gep2.2 store i64 1879048192, i64* %l3, align 8 %bc3 = bitcast i64* %l3 to i8* - %gep3 = getelementptr i8* %bc3, i64 3 + %gep3 = getelementptr i8, i8* %bc3, i64 3 br label %loop } @@ -735,14 +735,14 @@ define void @test16(i8* %src, i8* %dst) { ; CHECK-LABEL: @test16( ; CHECK-NOT: alloca ; CHECK: %[[srccast:.*]] = bitcast i8* %src to i24* -; CHECK-NEXT: load i24* %[[srccast]] +; CHECK-NEXT: load i24, i24* %[[srccast]] ; CHECK-NEXT: %[[dstcast:.*]] = bitcast i8* %dst to i24* ; CHECK-NEXT: store i24 0, i24* %[[dstcast]] ; CHECK-NEXT: ret void entry: %a = alloca [3 x i8] - %ptr = getelementptr [3 x i8]* %a, i32 0, i32 0 + %ptr = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr, i8* %src, i32 4, i32 1, i1 false) %cast = bitcast i8* %ptr to i24* store i24 0, i24* %cast @@ -755,14 +755,14 @@ define void @test17(i8* %src, i8* %dst) { ; the alloca. ; CHECK-LABEL: @test17( ; CHECK: %[[a:.*]] = alloca [3 x i8] -; CHECK-NEXT: %[[ptr:.*]] = getelementptr [3 x i8]* %[[a]], i32 0, i32 0 +; CHECK-NEXT: %[[ptr:.*]] = getelementptr [3 x i8], [3 x i8]* %[[a]], i32 0, i32 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[ptr]], i8* %src, ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %[[ptr]], ; CHECK-NEXT: ret void entry: %a = alloca [3 x i8] - %ptr = getelementptr [3 x i8]* %a, i32 0, i32 0 + %ptr = getelementptr [3 x i8], [3 x i8]* %a, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr, i8* %src, i32 4, i32 1, i1 true) call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %ptr, i32 4, i32 1, i1 true) ret void @@ -774,27 +774,27 @@ define void @test18(i8* %src, i8* %dst, i32 %size) { ; the variable sized intrinsic. ; CHECK-LABEL: @test18( ; CHECK: %[[a:.*]] = alloca [34 x i8] -; CHECK: %[[srcgep1:.*]] = getelementptr inbounds i8* %src, i64 4 +; CHECK: %[[srcgep1:.*]] = getelementptr inbounds i8, i8* %src, i64 4 ; CHECK-NEXT: %[[srccast1:.*]] = bitcast i8* %[[srcgep1]] to i32* -; CHECK-NEXT: %[[srcload:.*]] = load i32* %[[srccast1]] -; CHECK-NEXT: %[[agep1:.*]] = getelementptr inbounds [34 x i8]* %[[a]], i64 0, i64 0 +; CHECK-NEXT: %[[srcload:.*]] = load i32, i32* %[[srccast1]] +; CHECK-NEXT: %[[agep1:.*]] = getelementptr inbounds [34 x i8], [34 x i8]* %[[a]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %[[agep1]], i8* %src, i32 %size, -; CHECK-NEXT: %[[agep2:.*]] = getelementptr inbounds [34 x i8]* %[[a]], i64 0, i64 0 +; CHECK-NEXT: %[[agep2:.*]] = getelementptr inbounds [34 x i8], [34 x i8]* %[[a]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* %[[agep2]], i8 42, i32 %size, ; CHECK-NEXT: %[[dstcast1:.*]] = bitcast i8* %dst to i32* ; CHECK-NEXT: store i32 42, i32* %[[dstcast1]] -; CHECK-NEXT: %[[dstgep1:.*]] = getelementptr inbounds i8* %dst, i64 4 +; CHECK-NEXT: %[[dstgep1:.*]] = getelementptr inbounds i8, i8* %dst, i64 4 ; CHECK-NEXT: %[[dstcast2:.*]] = bitcast i8* %[[dstgep1]] to i32* ; CHECK-NEXT: store i32 %[[srcload]], i32* %[[dstcast2]] -; CHECK-NEXT: %[[agep3:.*]] = getelementptr inbounds [34 x i8]* %[[a]], i64 0, i64 0 +; CHECK-NEXT: %[[agep3:.*]] = getelementptr inbounds [34 x i8], [34 x i8]* %[[a]], i64 0, i64 0 ; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %[[agep3]], i32 %size, ; CHECK-NEXT: ret void entry: %a = alloca [42 x i8] - %ptr = getelementptr [42 x i8]* %a, i32 0, i32 0 + %ptr = getelementptr [42 x i8], [42 x i8]* %a, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr, i8* %src, i32 8, i32 1, i1 false) - %ptr2 = getelementptr [42 x i8]* %a, i32 0, i32 8 + %ptr2 = getelementptr [42 x i8], [42 x i8]* %a, i32 0, i32 8 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr2, i8* %src, i32 %size, i32 1, i1 false) call void @llvm.memset.p0i8.i32(i8* %ptr2, i8 42, i32 %size, i32 1, i1 false) %cast = bitcast i8* %ptr to i32* @@ -820,8 +820,8 @@ entry: %cast1 = bitcast %opaque* %x to i8* %cast2 = bitcast { i64, i8* }* %a to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %cast2, i8* %cast1, i32 16, i32 1, i1 false) - %gep = getelementptr inbounds { i64, i8* }* %a, i32 0, i32 0 - %val = load i64* %gep + %gep = getelementptr inbounds { i64, i8* }, { i64, i8* }* %a, i32 0, i32 0 + %val = load i64, i64* %gep ret i32 undef } @@ -836,18 +836,18 @@ define i32 @test20() { entry: %a = alloca [3 x i32] - %gep1 = getelementptr [3 x i32]* %a, i32 0, i32 0 + %gep1 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 0 store i32 1, i32* %gep1 - %gep2.1 = getelementptr [3 x i32]* %a, i32 0, i32 -2 - %gep2.2 = getelementptr i32* %gep2.1, i32 3 + %gep2.1 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 -2 + %gep2.2 = getelementptr i32, i32* %gep2.1, i32 3 store i32 2, i32* %gep2.2 - %gep3.1 = getelementptr [3 x i32]* %a, i32 0, i32 14 - %gep3.2 = getelementptr i32* %gep3.1, i32 -12 + %gep3.1 = getelementptr [3 x i32], [3 x i32]* %a, i32 0, i32 14 + %gep3.2 = getelementptr i32, i32* %gep3.1, i32 -12 store i32 3, i32* %gep3.2 - %load1 = load i32* %gep1 - %load2 = load i32* %gep2.2 - %load3 = load i32* %gep3.2 + %load1 = load i32, i32* %gep1 + %load2 = load i32, i32* %gep2.2 + %load3 = load i32, i32* %gep3.2 %sum1 = add i32 %load1, %load2 %sum2 = add i32 %sum1, %load3 ret i32 %sum2 @@ -865,20 +865,20 @@ define i8 @test21() { entry: %a = alloca [2305843009213693951 x i8] - %gep0 = getelementptr [2305843009213693951 x i8]* %a, i64 0, i64 2305843009213693949 + %gep0 = getelementptr [2305843009213693951 x i8], [2305843009213693951 x i8]* %a, i64 0, i64 2305843009213693949 store i8 255, i8* %gep0 - %gep1 = getelementptr [2305843009213693951 x i8]* %a, i64 0, i64 -9223372036854775807 - %gep2 = getelementptr i8* %gep1, i64 -1 + %gep1 = getelementptr [2305843009213693951 x i8], [2305843009213693951 x i8]* %a, i64 0, i64 -9223372036854775807 + %gep2 = getelementptr i8, i8* %gep1, i64 -1 call void @llvm.memset.p0i8.i64(i8* %gep2, i8 0, i64 18446744073709551615, i32 1, i1 false) - %gep3 = getelementptr i8* %gep1, i64 9223372036854775807 - %gep4 = getelementptr i8* %gep3, i64 9223372036854775807 - %gep5 = getelementptr i8* %gep4, i64 -6917529027641081857 + %gep3 = getelementptr i8, i8* %gep1, i64 9223372036854775807 + %gep4 = getelementptr i8, i8* %gep3, i64 9223372036854775807 + %gep5 = getelementptr i8, i8* %gep4, i64 -6917529027641081857 store i8 255, i8* %gep5 %cast1 = bitcast i8* %gep4 to i32* store i32 0, i32* %cast1 - %load = load i8* %gep0 - %gep6 = getelementptr i8* %gep0, i32 1 - %load2 = load i8* %gep6 + %load = load i8, i8* %gep0 + %gep6 = getelementptr i8, i8* %gep0, i32 1 + %load2 = load i8, i8* %gep6 %result = or i8 %load, %load2 ret i8 %result } @@ -895,7 +895,7 @@ define void @PR13916.1() { entry: %a = alloca i8 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %a, i32 1, i32 1, i1 false) - %tmp2 = load i8* %a + %tmp2 = load i8, i8* %a ret void } @@ -918,8 +918,8 @@ if.then: br label %if.end if.end: - %gep = getelementptr %PR13916.struct* %a, i32 0, i32 0 - %tmp2 = load i8* %gep + %gep = getelementptr %PR13916.struct, %PR13916.struct* %a, i32 0, i32 0 + %tmp2 = load i8, i8* %gep ret void } @@ -968,7 +968,7 @@ entry: store double* %c, double** %b store double* %a, double** %b store double %x, double* %c - %ret = load double* %a + %ret = load double, double* %a ; CHECK-NOT: store ; CHECK-NOT: load @@ -987,8 +987,8 @@ define void @PR14034() { entry: %a = alloca %PR14034.struct - %list = getelementptr %PR14034.struct* %a, i32 0, i32 2 - %prev = getelementptr %PR14034.list* %list, i32 0, i32 1 + %list = getelementptr %PR14034.struct, %PR14034.struct* %a, i32 0, i32 2 + %prev = getelementptr %PR14034.list, %PR14034.list* %list, i32 0, i32 1 store %PR14034.list* undef, %PR14034.list** %prev %cast0 = bitcast %PR14034.struct* undef to i8* %cast1 = bitcast %PR14034.struct* %a to i8* @@ -1008,31 +1008,31 @@ entry: ; CHECK-NOT: alloca %wrap1 = insertvalue [1 x { i32 }] undef, i32 %x, 0, 0 - %gep1 = getelementptr { { [1 x { i32 }] } }* %a1, i32 0, i32 0, i32 0 + %gep1 = getelementptr { { [1 x { i32 }] } }, { { [1 x { i32 }] } }* %a1, i32 0, i32 0, i32 0 store [1 x { i32 }] %wrap1, [1 x { i32 }]* %gep1 - %gep2 = getelementptr { { [1 x { i32 }] } }* %a1, i32 0, i32 0 + %gep2 = getelementptr { { [1 x { i32 }] } }, { { [1 x { i32 }] } }* %a1, i32 0, i32 0 %ptrcast1 = bitcast { [1 x { i32 }] }* %gep2 to { [1 x { float }] }* - %load1 = load { [1 x { float }] }* %ptrcast1 + %load1 = load { [1 x { float }] }, { [1 x { float }] }* %ptrcast1 %unwrap1 = extractvalue { [1 x { float }] } %load1, 0, 0 %wrap2 = insertvalue { {}, { float }, [0 x i8] } undef, { float } %unwrap1, 1 store { {}, { float }, [0 x i8] } %wrap2, { {}, { float }, [0 x i8] }* %a2 - %gep3 = getelementptr { {}, { float }, [0 x i8] }* %a2, i32 0, i32 1, i32 0 + %gep3 = getelementptr { {}, { float }, [0 x i8] }, { {}, { float }, [0 x i8] }* %a2, i32 0, i32 1, i32 0 %ptrcast2 = bitcast float* %gep3 to <4 x i8>* - %load3 = load <4 x i8>* %ptrcast2 + %load3 = load <4 x i8>, <4 x i8>* %ptrcast2 %valcast1 = bitcast <4 x i8> %load3 to i32 %wrap3 = insertvalue [1 x [1 x i32]] undef, i32 %valcast1, 0, 0 %wrap4 = insertvalue { [1 x [1 x i32]], {} } undef, [1 x [1 x i32]] %wrap3, 0 - %gep4 = getelementptr { [0 x i8], { [0 x double], [1 x [1 x <4 x i8>]], {} }, { { {} } } }* %a3, i32 0, i32 1 + %gep4 = getelementptr { [0 x i8], { [0 x double], [1 x [1 x <4 x i8>]], {} }, { { {} } } }, { [0 x i8], { [0 x double], [1 x [1 x <4 x i8>]], {} }, { { {} } } }* %a3, i32 0, i32 1 %ptrcast3 = bitcast { [0 x double], [1 x [1 x <4 x i8>]], {} }* %gep4 to { [1 x [1 x i32]], {} }* store { [1 x [1 x i32]], {} } %wrap4, { [1 x [1 x i32]], {} }* %ptrcast3 - %gep5 = getelementptr { [0 x i8], { [0 x double], [1 x [1 x <4 x i8>]], {} }, { { {} } } }* %a3, i32 0, i32 1, i32 1, i32 0 + %gep5 = getelementptr { [0 x i8], { [0 x double], [1 x [1 x <4 x i8>]], {} }, { { {} } } }, { [0 x i8], { [0 x double], [1 x [1 x <4 x i8>]], {} }, { { {} } } }* %a3, i32 0, i32 1, i32 1, i32 0 %ptrcast4 = bitcast [1 x <4 x i8>]* %gep5 to { {}, float, {} }* - %load4 = load { {}, float, {} }* %ptrcast4 + %load4 = load { {}, float, {} }, { {}, float, {} }* %ptrcast4 %unwrap2 = extractvalue { {}, float, {} } %load4, 1 %valcast2 = bitcast float %unwrap2 to i32 @@ -1064,14 +1064,14 @@ entry: store i32 0, i32* %X.sroa.0.0.cast2.i, align 8 ; Also use a memset to the middle 32-bits for fun. - %X.sroa.0.2.raw_idx2.i = getelementptr inbounds i8* %0, i32 2 + %X.sroa.0.2.raw_idx2.i = getelementptr inbounds i8, i8* %0, i32 2 call void @llvm.memset.p0i8.i64(i8* %X.sroa.0.2.raw_idx2.i, i8 0, i64 4, i32 1, i1 false) ; Or a memset of the whole thing. call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 8, i32 1, i1 false) ; Write to the high 32-bits with a memcpy. - %X.sroa.0.4.raw_idx4.i = getelementptr inbounds i8* %0, i32 4 + %X.sroa.0.4.raw_idx4.i = getelementptr inbounds i8, i8* %0, i32 4 %d.raw = bitcast double* %d to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %X.sroa.0.4.raw_idx4.i, i8* %d.raw, i32 4, i32 1, i1 false) @@ -1080,8 +1080,8 @@ entry: store i32 1072693248, i32* %X.sroa.0.4.cast5.i, align 4 ; Do the actual math... - %X.sroa.0.0.load1.i = load double* %X.sroa.0.i, align 8 - %accum.real.i = load double* %d, align 8 + %X.sroa.0.0.load1.i = load double, double* %X.sroa.0.i, align 8 + %accum.real.i = load double, double* %d, align 8 %add.r.i = fadd double %accum.real.i, %X.sroa.0.0.load1.i store double %add.r.i, double* %d, align 8 call void @llvm.lifetime.end(i64 -1, i8* %0) @@ -1103,17 +1103,17 @@ entry: store i64 0, i64* %0 ; CHECK-NOT: store - %phi.realp = getelementptr inbounds { float, float }* %phi, i32 0, i32 0 - %phi.real = load float* %phi.realp - %phi.imagp = getelementptr inbounds { float, float }* %phi, i32 0, i32 1 - %phi.imag = load float* %phi.imagp - ; CHECK: %[[realp:.*]] = getelementptr inbounds { float, float }* %phi, i32 0, i32 0 - ; CHECK-NEXT: %[[real:.*]] = load float* %[[realp]] - ; CHECK-NEXT: %[[imagp:.*]] = getelementptr inbounds { float, float }* %phi, i32 0, i32 1 - ; CHECK-NEXT: %[[imag:.*]] = load float* %[[imagp]] - - %real = getelementptr inbounds { float, float }* %retval, i32 0, i32 0 - %imag = getelementptr inbounds { float, float }* %retval, i32 0, i32 1 + %phi.realp = getelementptr inbounds { float, float }, { float, float }* %phi, i32 0, i32 0 + %phi.real = load float, float* %phi.realp + %phi.imagp = getelementptr inbounds { float, float }, { float, float }* %phi, i32 0, i32 1 + %phi.imag = load float, float* %phi.imagp + ; CHECK: %[[realp:.*]] = getelementptr inbounds { float, float }, { float, float }* %phi, i32 0, i32 0 + ; CHECK-NEXT: %[[real:.*]] = load float, float* %[[realp]] + ; CHECK-NEXT: %[[imagp:.*]] = getelementptr inbounds { float, float }, { float, float }* %phi, i32 0, i32 1 + ; CHECK-NEXT: %[[imag:.*]] = load float, float* %[[imagp]] + + %real = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 0 + %imag = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 1 store float %phi.real, float* %real store float %phi.imag, float* %imag ; CHECK-NEXT: %[[real_convert:.*]] = bitcast float %[[real]] to i32 @@ -1126,7 +1126,7 @@ entry: ; CHECK-NEXT: %[[real_mask:.*]] = and i64 %[[imag_insert]], -4294967296 ; CHECK-NEXT: %[[real_insert:.*]] = or i64 %[[real_mask]], %[[real_ext]] - %1 = load i64* %0, align 1 + %1 = load i64, i64* %0, align 1 ret i64 %1 ; CHECK-NEXT: ret i64 %[[real_insert]] } @@ -1141,8 +1141,8 @@ entry: %a = alloca { [16 x i8] }, align 8 ; CHECK: alloca [16 x i8], align 8 - %gep = getelementptr inbounds { [16 x i8] }* %ptr, i64 -1 -; CHECK-NEXT: getelementptr inbounds { [16 x i8] }* %ptr, i64 -1, i32 0, i64 0 + %gep = getelementptr inbounds { [16 x i8] }, { [16 x i8] }* %ptr, i64 -1 +; CHECK-NEXT: getelementptr inbounds { [16 x i8] }, { [16 x i8] }* %ptr, i64 -1, i32 0, i64 0 %cast1 = bitcast { [16 x i8 ] }* %gep to i8* %cast2 = bitcast { [16 x i8 ] }* %a to i8* @@ -1159,8 +1159,8 @@ entry: %a = alloca { [16 x i8] }, align 8 ; CHECK: alloca [16 x i8], align 8 - %gep = getelementptr inbounds { [16 x i8] } addrspace(1)* %ptr, i64 -1 -; CHECK-NEXT: getelementptr inbounds { [16 x i8] } addrspace(1)* %ptr, i16 -1, i32 0, i16 0 + %gep = getelementptr inbounds { [16 x i8] }, { [16 x i8] } addrspace(1)* %ptr, i64 -1 +; CHECK-NEXT: getelementptr inbounds { [16 x i8] }, { [16 x i8] } addrspace(1)* %ptr, i16 -1, i32 0, i16 0 %cast1 = bitcast { [16 x i8 ] } addrspace(1)* %gep to i8 addrspace(1)* %cast2 = bitcast { [16 x i8 ] }* %a to i8* @@ -1199,18 +1199,18 @@ entry: %b.i1 = bitcast <{ i1 }>* %b to i1* store i1 %x, i1* %b.i1, align 8 %b.i8 = bitcast <{ i1 }>* %b to i8* - %foo = load i8* %b.i8, align 1 + %foo = load i8, i8* %b.i8, align 1 ; CHECK-NEXT: %[[ext:.*]] = zext i1 %x to i8 ; CHECK-NEXT: store i8 %[[ext]], i8* %[[a]], align 8 -; CHECK-NEXT: {{.*}} = load i8* %[[a]], align 8 +; CHECK-NEXT: {{.*}} = load i8, i8* %[[a]], align 8 %a.i8 = bitcast <{ i1 }>* %a to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.i8, i8* %b.i8, i32 1, i32 1, i1 false) nounwind - %bar = load i8* %a.i8, align 1 - %a.i1 = getelementptr inbounds <{ i1 }>* %a, i32 0, i32 0 - %baz = load i1* %a.i1, align 1 + %bar = load i8, i8* %a.i8, align 1 + %a.i1 = getelementptr inbounds <{ i1 }>, <{ i1 }>* %a, i32 0, i32 0 + %baz = load i1, i1* %a.i1, align 1 ; CHECK-NEXT: %[[a_cast:.*]] = bitcast i8* %[[a]] to i1* -; CHECK-NEXT: {{.*}} = load i1* %[[a_cast]], align 8 +; CHECK-NEXT: {{.*}} = load i1, i1* %[[a_cast]], align 8 ret void } @@ -1226,7 +1226,7 @@ entry: %cast = bitcast <3 x i8>* %a to i32* store i32 %x, i32* %cast, align 1 - %y = load <3 x i8>* %a, align 4 + %y = load <3 x i8>, <3 x i8>* %a, align 4 ret <3 x i8> %y ; CHECK: ret <3 x i8> } @@ -1242,7 +1242,7 @@ entry: store <3 x i8> %x, <3 x i8>* %a, align 1 %cast = bitcast <3 x i8>* %a to i32* - %y = load i32* %cast, align 4 + %y = load i32, i32* %cast, align 4 ret i32 %y ; CHECK: ret i32 } @@ -1258,7 +1258,7 @@ entry: %a.i8 = bitcast i32* %a to i8* call void @llvm.memset.p0i8.i32(i8* %a.i8, i8 0, i32 %x, i32 1, i1 false) - %v = load i32* %a + %v = load i32, i32* %a ret i32 %v } @@ -1282,36 +1282,36 @@ entry: ] bb4: - %src.gep3 = getelementptr inbounds i8* %src, i32 3 - %src.3 = load i8* %src.gep3 - %tmp.gep3 = getelementptr inbounds [4 x i8]* %tmp, i32 0, i32 3 + %src.gep3 = getelementptr inbounds i8, i8* %src, i32 3 + %src.3 = load i8, i8* %src.gep3 + %tmp.gep3 = getelementptr inbounds [4 x i8], [4 x i8]* %tmp, i32 0, i32 3 store i8 %src.3, i8* %tmp.gep3 ; CHECK: store i8 br label %bb3 bb3: - %src.gep2 = getelementptr inbounds i8* %src, i32 2 - %src.2 = load i8* %src.gep2 - %tmp.gep2 = getelementptr inbounds [4 x i8]* %tmp, i32 0, i32 2 + %src.gep2 = getelementptr inbounds i8, i8* %src, i32 2 + %src.2 = load i8, i8* %src.gep2 + %tmp.gep2 = getelementptr inbounds [4 x i8], [4 x i8]* %tmp, i32 0, i32 2 store i8 %src.2, i8* %tmp.gep2 ; CHECK: store i8 br label %bb2 bb2: - %src.gep1 = getelementptr inbounds i8* %src, i32 1 - %src.1 = load i8* %src.gep1 - %tmp.gep1 = getelementptr inbounds [4 x i8]* %tmp, i32 0, i32 1 + %src.gep1 = getelementptr inbounds i8, i8* %src, i32 1 + %src.1 = load i8, i8* %src.gep1 + %tmp.gep1 = getelementptr inbounds [4 x i8], [4 x i8]* %tmp, i32 0, i32 1 store i8 %src.1, i8* %tmp.gep1 ; CHECK: store i8 br label %bb1 bb1: - %src.gep0 = getelementptr inbounds i8* %src, i32 0 - %src.0 = load i8* %src.gep0 - %tmp.gep0 = getelementptr inbounds [4 x i8]* %tmp, i32 0, i32 0 + %src.gep0 = getelementptr inbounds i8, i8* %src, i32 0 + %src.0 = load i8, i8* %src.gep0 + %tmp.gep0 = getelementptr inbounds [4 x i8], [4 x i8]* %tmp, i32 0, i32 0 store i8 %src.0, i8* %tmp.gep0 ; CHECK: store i8 @@ -1332,7 +1332,7 @@ define void @PR15805(i1 %a, i1 %b) { %c = alloca i64, align 8 %p.0.c = select i1 undef, i64* %c, i64* %c %cond.in = select i1 undef, i64* %p.0.c, i64* %c - %cond = load i64* %cond.in, align 8 + %cond = load i64, i64* %cond.in, align 8 ret void } @@ -1351,7 +1351,7 @@ define void @PR15805.1(i1 %a, i1 %b) { loop: %cond.in = select i1 undef, i64* %c, i64* %p.0.c %p.0.c = select i1 undef, i64* %c, i64* %c - %cond = load i64* %cond.in, align 8 + %cond = load i64, i64* %cond.in, align 8 br i1 undef, label %loop, label %exit exit: @@ -1373,8 +1373,8 @@ entry: %b = alloca i32, align 4 %b.cast = bitcast i32* %b to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %b.cast, i8* %a, i32 4, i32 4, i1 true) - %b.gep = getelementptr inbounds i8* %b.cast, i32 2 - load i8* %b.gep, align 2 + %b.gep = getelementptr inbounds i8, i8* %b.cast, i32 2 + load i8, i8* %b.gep, align 2 unreachable } @@ -1390,11 +1390,11 @@ define void @PR16651.2() { entry: %tv1 = alloca { <2 x float>, <2 x float> }, align 8 - %0 = getelementptr { <2 x float>, <2 x float> }* %tv1, i64 0, i32 1 + %0 = getelementptr { <2 x float>, <2 x float> }, { <2 x float>, <2 x float> }* %tv1, i64 0, i32 1 store <2 x float> undef, <2 x float>* %0, align 8 - %1 = getelementptr inbounds { <2 x float>, <2 x float> }* %tv1, i64 0, i32 1, i64 0 + %1 = getelementptr inbounds { <2 x float>, <2 x float> }, { <2 x float>, <2 x float> }* %tv1, i64 0, i32 1, i64 0 %cond105.in.i.i = select i1 undef, float* null, float* %1 - %cond105.i.i = load float* %cond105.in.i.i, align 8 + %cond105.i.i = load float, float* %cond105.in.i.i, align 8 ret void } @@ -1405,8 +1405,8 @@ define void @test23(i32 %x) { entry: %a = alloca i32, align 4 store i32 %x, i32* %a, align 4 - %gep1 = getelementptr inbounds i32* %a, i32 1 - %gep0 = getelementptr inbounds i32* %a, i32 0 + %gep1 = getelementptr inbounds i32, i32* %a, i32 1 + %gep0 = getelementptr inbounds i32, i32* %a, i32 0 %cast1 = bitcast i32* %gep1 to i8* %cast0 = bitcast i32* %gep0 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %cast1, i8* %cast0, i32 4, i32 1, i1 false) @@ -1419,7 +1419,7 @@ define void @PR18615() { ; CHECK: ret void entry: %f = alloca i8 - %gep = getelementptr i8* %f, i64 -1 + %gep = getelementptr i8, i8* %f, i64 -1 call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* %gep, i32 1, i32 1, i1 false) ret void } @@ -1427,9 +1427,9 @@ entry: define void @test24(i8* %src, i8* %dst) { ; CHECK-LABEL: @test24( ; CHECK: alloca i64, align 16 -; CHECK: load volatile i64* %{{[^,]*}}, align 1 +; CHECK: load volatile i64, i64* %{{[^,]*}}, align 1 ; CHECK: store volatile i64 %{{[^,]*}}, i64* %{{[^,]*}}, align 16 -; CHECK: load volatile i64* %{{[^,]*}}, align 16 +; CHECK: load volatile i64, i64* %{{[^,]*}}, align 16 ; CHECK: store volatile i64 %{{[^,]*}}, i64* %{{[^,]*}}, align 1 entry: @@ -1459,17 +1459,17 @@ entry: %a = alloca i64 %b = alloca i64 %a.cast = bitcast i64* %a to [2 x float]* - %a.gep1 = getelementptr [2 x float]* %a.cast, i32 0, i32 0 - %a.gep2 = getelementptr [2 x float]* %a.cast, i32 0, i32 1 + %a.gep1 = getelementptr [2 x float], [2 x float]* %a.cast, i32 0, i32 0 + %a.gep2 = getelementptr [2 x float], [2 x float]* %a.cast, i32 0, i32 1 %b.cast = bitcast i64* %b to [2 x float]* - %b.gep1 = getelementptr [2 x float]* %b.cast, i32 0, i32 0 - %b.gep2 = getelementptr [2 x float]* %b.cast, i32 0, i32 1 + %b.gep1 = getelementptr [2 x float], [2 x float]* %b.cast, i32 0, i32 0 + %b.gep2 = getelementptr [2 x float], [2 x float]* %b.cast, i32 0, i32 1 store float 0.0, float* %a.gep1 store float 1.0, float* %a.gep2 - %v = load i64* %a + %v = load i64, i64* %a store i64 %v, i64* %b - %f1 = load float* %b.gep1 - %f2 = load float* %b.gep2 + %f1 = load float, float* %b.gep1 + %f2 = load float, float* %b.gep2 %ret = fadd float %f1, %f2 ret float %ret } @@ -1482,8 +1482,8 @@ define void @test26() { ; ; CHECK-LABEL: @test26( ; CHECK-NOT: alloca -; CHECK: %[[L1:.*]] = load i32* bitcast -; CHECK: %[[L2:.*]] = load i32* bitcast +; CHECK: %[[L1:.*]] = load i32, i32* bitcast +; CHECK: %[[L2:.*]] = load i32, i32* bitcast ; CHECK: %[[F1:.*]] = bitcast i32 %[[L1]] to float ; CHECK: %[[F2:.*]] = bitcast i32 %[[L2]] to float ; CHECK: %[[SUM:.*]] = fadd float %[[F1]], %[[F2]] @@ -1496,16 +1496,16 @@ define void @test26() { entry: %a = alloca i64 %a.cast = bitcast i64* %a to [2 x float]* - %a.gep1 = getelementptr [2 x float]* %a.cast, i32 0, i32 0 - %a.gep2 = getelementptr [2 x float]* %a.cast, i32 0, i32 1 - %v1 = load i64* bitcast ([2 x float]* @complex1 to i64*) + %a.gep1 = getelementptr [2 x float], [2 x float]* %a.cast, i32 0, i32 0 + %a.gep2 = getelementptr [2 x float], [2 x float]* %a.cast, i32 0, i32 1 + %v1 = load i64, i64* bitcast ([2 x float]* @complex1 to i64*) store i64 %v1, i64* %a - %f1 = load float* %a.gep1 - %f2 = load float* %a.gep2 + %f1 = load float, float* %a.gep1 + %f2 = load float, float* %a.gep2 %sum = fadd float %f1, %f2 store float %sum, float* %a.gep1 store float %sum, float* %a.gep2 - %v2 = load i64* %a + %v2 = load i64, i64* %a store i64 %v2, i64* bitcast ([2 x float]* @complex2 to i64*) ret void } @@ -1524,9 +1524,9 @@ define float @test27() { entry: %a = alloca [12 x i8] - %gep1 = getelementptr [12 x i8]* %a, i32 0, i32 0 - %gep2 = getelementptr [12 x i8]* %a, i32 0, i32 4 - %gep3 = getelementptr [12 x i8]* %a, i32 0, i32 8 + %gep1 = getelementptr [12 x i8], [12 x i8]* %a, i32 0, i32 0 + %gep2 = getelementptr [12 x i8], [12 x i8]* %a, i32 0, i32 4 + %gep3 = getelementptr [12 x i8], [12 x i8]* %a, i32 0, i32 8 %iptr1 = bitcast i8* %gep1 to i64* %iptr2 = bitcast i8* %gep2 to i64* %fptr1 = bitcast i8* %gep1 to float* @@ -1534,10 +1534,10 @@ entry: %fptr3 = bitcast i8* %gep3 to float* store float 0.0, float* %fptr1 store float 1.0, float* %fptr2 - %v = load i64* %iptr1 + %v = load i64, i64* %iptr1 store i64 %v, i64* %iptr2 - %f1 = load float* %fptr2 - %f2 = load float* %fptr3 + %f1 = load float, float* %fptr2 + %f2 = load float, float* %fptr3 %ret = fadd float %f1, %f2 ret float %ret } @@ -1560,7 +1560,7 @@ entry: %a = alloca i32 %a.cast = bitcast i32* %a to i16* store volatile i16 42, i16* %a.cast - %load = load i32* %a + %load = load i32, i32* %a store i32 %load, i32* %a ret i32 %load } @@ -1587,9 +1587,9 @@ entry: %a.cast1 = bitcast i64* %a to i32* %a.cast2 = bitcast i64* %a to i16* store volatile i16 42, i16* %a.cast2 - %load = load i32* %a.cast1 + %load = load i32, i32* %a.cast1 store i32 %load, i32* %a.cast1 - %a.gep1 = getelementptr i32* %a.cast1, i32 1 + %a.gep1 = getelementptr i32, i32* %a.cast1, i32 1 %a.cast3 = bitcast i32* %a.gep1 to i8* store volatile i8 13, i8* %a.cast3 store i32 %load, i32* %a.gep1 diff --git a/test/Transforms/SROA/big-endian.ll b/test/Transforms/SROA/big-endian.ll index 9e87a9f..b5a04ca 100644 --- a/test/Transforms/SROA/big-endian.ll +++ b/test/Transforms/SROA/big-endian.ll @@ -16,14 +16,14 @@ entry: %b = alloca [3 x i8] ; CHECK-NOT: alloca - %a0ptr = getelementptr [3 x i8]* %a, i64 0, i32 0 + %a0ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 0 store i8 0, i8* %a0ptr - %a1ptr = getelementptr [3 x i8]* %a, i64 0, i32 1 + %a1ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 1 store i8 0, i8* %a1ptr - %a2ptr = getelementptr [3 x i8]* %a, i64 0, i32 2 + %a2ptr = getelementptr [3 x i8], [3 x i8]* %a, i64 0, i32 2 store i8 0, i8* %a2ptr %aiptr = bitcast [3 x i8]* %a to i24* - %ai = load i24* %aiptr + %ai = load i24, i24* %aiptr ; CHECK-NOT: store ; CHECK-NOT: load ; CHECK: %[[ext2:.*]] = zext i8 0 to i24 @@ -40,12 +40,12 @@ entry: %biptr = bitcast [3 x i8]* %b to i24* store i24 %ai, i24* %biptr - %b0ptr = getelementptr [3 x i8]* %b, i64 0, i32 0 - %b0 = load i8* %b0ptr - %b1ptr = getelementptr [3 x i8]* %b, i64 0, i32 1 - %b1 = load i8* %b1ptr - %b2ptr = getelementptr [3 x i8]* %b, i64 0, i32 2 - %b2 = load i8* %b2ptr + %b0ptr = getelementptr [3 x i8], [3 x i8]* %b, i64 0, i32 0 + %b0 = load i8, i8* %b0ptr + %b1ptr = getelementptr [3 x i8], [3 x i8]* %b, i64 0, i32 1 + %b1 = load i8, i8* %b1ptr + %b2ptr = getelementptr [3 x i8], [3 x i8]* %b, i64 0, i32 2 + %b2 = load i8, i8* %b2ptr ; CHECK-NOT: store ; CHECK-NOT: load ; CHECK: %[[shift0:.*]] = lshr i24 %[[insert0]], 16 @@ -72,10 +72,10 @@ entry: %a = alloca [7 x i8] ; CHECK-NOT: alloca - %a0ptr = getelementptr [7 x i8]* %a, i64 0, i32 0 - %a1ptr = getelementptr [7 x i8]* %a, i64 0, i32 1 - %a2ptr = getelementptr [7 x i8]* %a, i64 0, i32 2 - %a3ptr = getelementptr [7 x i8]* %a, i64 0, i32 3 + %a0ptr = getelementptr [7 x i8], [7 x i8]* %a, i64 0, i32 0 + %a1ptr = getelementptr [7 x i8], [7 x i8]* %a, i64 0, i32 1 + %a2ptr = getelementptr [7 x i8], [7 x i8]* %a, i64 0, i32 2 + %a3ptr = getelementptr [7 x i8], [7 x i8]* %a, i64 0, i32 3 ; CHECK-NOT: store ; CHECK-NOT: load @@ -102,7 +102,7 @@ entry: ; CHECK-NOT: load %aiptr = bitcast [7 x i8]* %a to i56* - %ai = load i56* %aiptr + %ai = load i56, i56* %aiptr %ret = zext i56 %ai to i64 ret i64 %ret ; CHECK-NEXT: %[[ext4:.*]] = zext i16 1 to i56 diff --git a/test/Transforms/SROA/fca.ll b/test/Transforms/SROA/fca.ll index e8b4c6c..6eaa73f 100644 --- a/test/Transforms/SROA/fca.ll +++ b/test/Transforms/SROA/fca.ll @@ -14,12 +14,12 @@ entry: store { i32, i32 } undef, { i32, i32 }* %a - %gep1 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 0 + %gep1 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 0 store i32 %x, i32* %gep1 - %gep2 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 1 + %gep2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 1 store i32 %y, i32* %gep2 - %result = load { i32, i32 }* %a + %result = load { i32, i32 }, { i32, i32 }* %a ret { i32, i32 } %result } @@ -30,7 +30,7 @@ define { i32, i32 } @test1(i32 %x, i32 %y) { ; CHECK-LABEL: @test1( ; CHECK: alloca ; CHECK: alloca -; CHECK: load volatile { i32, i32 }* +; CHECK: load volatile { i32, i32 }, { i32, i32 }* ; CHECK: store volatile { i32, i32 } ; CHECK: ret { i32, i32 } @@ -38,12 +38,12 @@ entry: %a = alloca { i32, i32 } %b = alloca { i32, i32 } - %gep1 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 0 + %gep1 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 0 store i32 %x, i32* %gep1 - %gep2 = getelementptr inbounds { i32, i32 }* %a, i32 0, i32 1 + %gep2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %a, i32 0, i32 1 store i32 %y, i32* %gep2 - %result = load volatile { i32, i32 }* %a + %result = load volatile { i32, i32 }, { i32, i32 }* %a store volatile { i32, i32 } %result, { i32, i32 }* %b ret { i32, i32 } %result } diff --git a/test/Transforms/SROA/phi-and-select.ll b/test/Transforms/SROA/phi-and-select.ll index f287012..e97bd66 100644 --- a/test/Transforms/SROA/phi-and-select.ll +++ b/test/Transforms/SROA/phi-and-select.ll @@ -7,12 +7,12 @@ entry: %a = alloca [2 x i32] ; CHECK-NOT: alloca - %a0 = getelementptr [2 x i32]* %a, i64 0, i32 0 - %a1 = getelementptr [2 x i32]* %a, i64 0, i32 1 + %a0 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 0 + %a1 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 1 store i32 0, i32* %a0 store i32 1, i32* %a1 - %v0 = load i32* %a0 - %v1 = load i32* %a1 + %v0 = load i32, i32* %a0 + %v1 = load i32, i32* %a1 ; CHECK-NOT: store ; CHECK-NOT: load @@ -26,7 +26,7 @@ exit: %phi = phi i32* [ %a1, %then ], [ %a0, %entry ] ; CHECK: phi i32 [ 1, %{{.*}} ], [ 0, %{{.*}} ] - %result = load i32* %phi + %result = load i32, i32* %phi ret i32 %result } @@ -36,12 +36,12 @@ entry: %a = alloca [2 x i32] ; CHECK-NOT: alloca - %a0 = getelementptr [2 x i32]* %a, i64 0, i32 0 - %a1 = getelementptr [2 x i32]* %a, i64 0, i32 1 + %a0 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 0 + %a1 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 1 store i32 0, i32* %a0 store i32 1, i32* %a1 - %v0 = load i32* %a0 - %v1 = load i32* %a1 + %v0 = load i32, i32* %a0 + %v1 = load i32, i32* %a1 ; CHECK-NOT: store ; CHECK-NOT: load @@ -49,7 +49,7 @@ entry: %select = select i1 %cond, i32* %a1, i32* %a0 ; CHECK: select i1 %{{.*}}, i32 1, i32 0 - %result = load i32* %select + %result = load i32, i32* %select ret i32 %result } @@ -62,10 +62,10 @@ entry: ; Note that we build redundant GEPs here to ensure that having different GEPs ; into the same alloca partation continues to work with PHI speculation. This ; was the underlying cause of PR13926. - %a0 = getelementptr [2 x i32]* %a, i64 0, i32 0 - %a0b = getelementptr [2 x i32]* %a, i64 0, i32 0 - %a1 = getelementptr [2 x i32]* %a, i64 0, i32 1 - %a1b = getelementptr [2 x i32]* %a, i64 0, i32 1 + %a0 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 0 + %a0b = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 0 + %a1 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 1 + %a1b = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 1 store i32 0, i32* %a0 store i32 1, i32* %a1 ; CHECK-NOT: store @@ -100,7 +100,7 @@ exit: [ %a1b, %bb4 ], [ %a0b, %bb5 ], [ %a0b, %bb6 ], [ %a1b, %bb7 ] ; CHECK: phi i32 [ 1, %{{.*}} ], [ 0, %{{.*}} ], [ 0, %{{.*}} ], [ 1, %{{.*}} ], [ 1, %{{.*}} ], [ 0, %{{.*}} ], [ 0, %{{.*}} ], [ 1, %{{.*}} ] - %result = load i32* %phi + %result = load i32, i32* %phi ret i32 %result } @@ -110,12 +110,12 @@ entry: %a = alloca [2 x i32] ; CHECK-NOT: alloca - %a0 = getelementptr [2 x i32]* %a, i64 0, i32 0 - %a1 = getelementptr [2 x i32]* %a, i64 0, i32 1 + %a0 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 0 + %a1 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 1 store i32 0, i32* %a0 store i32 1, i32* %a1 - %v0 = load i32* %a0 - %v1 = load i32* %a1 + %v0 = load i32, i32* %a0 + %v1 = load i32, i32* %a1 ; CHECK-NOT: store ; CHECK-NOT: load @@ -123,7 +123,7 @@ entry: %select = select i1 %cond, i32* %a0, i32* %a0 ; CHECK-NOT: select - %result = load i32* %select + %result = load i32, i32* %select ret i32 %result ; CHECK: ret i32 0 } @@ -134,14 +134,14 @@ entry: %a = alloca [2 x i32] ; CHECK-NOT: alloca - %a1 = getelementptr [2 x i32]* %a, i64 0, i32 1 + %a1 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 1 store i32 1, i32* %a1 ; CHECK-NOT: store %select = select i1 true, i32* %a1, i32* %b ; CHECK-NOT: select - %result = load i32* %select + %result = load i32, i32* %select ; CHECK-NOT: load ret i32 %result @@ -157,7 +157,7 @@ entry: %c = alloca i32 ; CHECK-NOT: alloca - %a1 = getelementptr [2 x i32]* %a, i64 0, i32 1 + %a1 = getelementptr [2 x i32], [2 x i32]* %a, i64 0, i32 1 store i32 1, i32* %a1 %select = select i1 true, i32* %a1, i32* %b @@ -172,10 +172,10 @@ entry: ; CHECK: call void @f(i32* %[[select2]], i32* %[[select3]]) - %result = load i32* %select + %result = load i32, i32* %select ; CHECK-NOT: load - %dead = load i32* %c + %dead = load i32, i32* %c ret i32 %result ; CHECK: ret i32 1 @@ -190,19 +190,19 @@ entry: br i1 undef, label %good, label %bad good: - %Y1 = getelementptr i32* %X, i64 0 + %Y1 = getelementptr i32, i32* %X, i64 0 store i32 0, i32* %Y1 br label %exit bad: - %Y2 = getelementptr i32* %X, i64 1 + %Y2 = getelementptr i32, i32* %X, i64 1 store i32 0, i32* %Y2 br label %exit exit: %P = phi i32* [ %Y1, %good ], [ %Y2, %bad ] ; CHECK: %[[phi:.*]] = phi i32 [ 0, %good ], - %Z2 = load i32* %P + %Z2 = load i32, i32* %P ret i32 %Z2 ; CHECK: ret i32 %[[phi]] } @@ -213,7 +213,7 @@ define i32 @test8(i32 %b, i32* %ptr) { ; CHECK-LABEL: @test8( ; CHECK-NOT: alloca ; CHECK-NOT: load -; CHECK: %[[value:.*]] = load i32* %ptr +; CHECK: %[[value:.*]] = load i32, i32* %ptr ; CHECK-NOT: load ; CHECK: %[[result:.*]] = phi i32 [ undef, %else ], [ %[[value]], %then ] ; CHECK-NEXT: ret i32 %[[result]] @@ -232,7 +232,7 @@ else: exit: %phi = phi i32* [ %bitcast, %else ], [ %ptr, %then ] - %loaded = load i32* %phi, align 4 + %loaded = load i32, i32* %phi, align 4 ret i32 %loaded } @@ -241,7 +241,7 @@ define i32 @test9(i32 %b, i32* %ptr) { ; CHECK-LABEL: @test9( ; CHECK-NOT: alloca ; CHECK-NOT: load -; CHECK: %[[value:.*]] = load i32* %ptr +; CHECK: %[[value:.*]] = load i32, i32* %ptr ; CHECK-NOT: load ; CHECK: %[[result:.*]] = select i1 %{{.*}}, i32 undef, i32 %[[value]] ; CHECK-NEXT: ret i32 %[[result]] @@ -252,7 +252,7 @@ entry: %test = icmp ne i32 %b, 0 %bitcast = bitcast float* %f to i32* %select = select i1 %test, i32* %bitcast, i32* %ptr - %loaded = load i32* %select, align 4 + %loaded = load i32, i32* %select, align 4 ret i32 %loaded } @@ -262,9 +262,9 @@ define float @test10(i32 %b, float* %ptr) { ; node. ; CHECK-LABEL: @test10( ; CHECK: %[[alloca:.*]] = alloca -; CHECK: %[[argvalue:.*]] = load float* %ptr +; CHECK: %[[argvalue:.*]] = load float, float* %ptr ; CHECK: %[[cast:.*]] = bitcast double* %[[alloca]] to float* -; CHECK: %[[allocavalue:.*]] = load float* %[[cast]] +; CHECK: %[[allocavalue:.*]] = load float, float* %[[cast]] ; CHECK: %[[result:.*]] = phi float [ %[[allocavalue]], %else ], [ %[[argvalue]], %then ] ; CHECK-NEXT: ret float %[[result]] @@ -283,7 +283,7 @@ else: exit: %phi = phi float* [ %bitcast, %else ], [ %ptr, %then ] - %loaded = load float* %phi, align 4 + %loaded = load float, float* %phi, align 4 ret float %loaded } @@ -292,8 +292,8 @@ define float @test11(i32 %b, float* %ptr) { ; CHECK-LABEL: @test11( ; CHECK: %[[alloca:.*]] = alloca ; CHECK: %[[cast:.*]] = bitcast double* %[[alloca]] to float* -; CHECK: %[[allocavalue:.*]] = load float* %[[cast]] -; CHECK: %[[argvalue:.*]] = load float* %ptr +; CHECK: %[[allocavalue:.*]] = load float, float* %[[cast]] +; CHECK: %[[argvalue:.*]] = load float, float* %ptr ; CHECK: %[[result:.*]] = select i1 %{{.*}}, float %[[allocavalue]], float %[[argvalue]] ; CHECK-NEXT: ret float %[[result]] @@ -304,7 +304,7 @@ entry: %test = icmp ne i32 %b, 0 %bitcast = bitcast double* %f to float* %select = select i1 %test, float* %bitcast, float* %ptr - %loaded = load float* %select, align 4 + %loaded = load float, float* %select, align 4 ret float %loaded } @@ -320,7 +320,7 @@ entry: %a = alloca i32 store i32 %x, i32* %a %dead = select i1 undef, i32* %a, i32* %p - %load = load i32* %a + %load = load i32, i32* %a ret i32 %load } @@ -342,7 +342,7 @@ loop: br i1 undef, label %loop, label %exit exit: - %load = load i32* %a + %load = load i32, i32* %a ret i32 %load } @@ -376,9 +376,9 @@ else: exit: %f.phi = phi i32* [ %f, %then ], [ %f.select, %else ] %g.phi = phi i32* [ %g, %then ], [ %ptr, %else ] - %f.loaded = load i32* %f.phi + %f.loaded = load i32, i32* %f.phi %g.select = select i1 %b1, i32* %g, i32* %g.phi - %g.loaded = load i32* %g.select + %g.loaded = load i32, i32* %g.select %result = add i32 %f.loaded, %g.loaded ret i32 %result } @@ -456,8 +456,8 @@ if.then: ; CHECK: %[[ext:.*]] = zext i8 1 to i64 if.end: - %tmp = load i64** %ptr - %result = load i64* %tmp + %tmp = load i64*, i64** %ptr + %result = load i64, i64* %tmp ; CHECK-NOT: load ; CHECK: %[[result:.*]] = phi i64 [ %[[ext]], %if.then ], [ 0, %entry ] @@ -488,14 +488,14 @@ then: else: %a.raw = bitcast i64* %a to i8* - %a.raw.4 = getelementptr i8* %a.raw, i64 4 + %a.raw.4 = getelementptr i8, i8* %a.raw, i64 4 %a.raw.4.f = bitcast i8* %a.raw.4 to float* br label %end ; CHECK: %[[hi_cast:.*]] = bitcast i32 %[[hi]] to float end: %a.phi.f = phi float* [ %a.f, %then ], [ %a.raw.4.f, %else ] - %f = load float* %a.phi.f + %f = load float, float* %a.phi.f ret float %f ; CHECK: %[[phi:.*]] = phi float [ %[[lo_cast]], %then ], [ %[[hi_cast]], %else ] ; CHECK-NOT: load @@ -516,19 +516,19 @@ entry: br i1 %cond, label %then, label %else then: - %0 = getelementptr inbounds [4 x float]* %arr, i64 0, i64 3 + %0 = getelementptr inbounds [4 x float], [4 x float]* %arr, i64 0, i64 3 store float 1.000000e+00, float* %0, align 4 br label %merge else: - %1 = getelementptr inbounds [4 x float]* %arr, i64 0, i64 3 + %1 = getelementptr inbounds [4 x float], [4 x float]* %arr, i64 0, i64 3 store float 2.000000e+00, float* %1, align 4 br label %merge merge: %2 = phi float* [ %0, %then ], [ %1, %else ] store float 0.000000e+00, float* %temp, align 4 - %3 = load float* %2, align 4 + %3 = load float, float* %2, align 4 ret float %3 } @@ -546,7 +546,7 @@ entry: br i1 %cond, label %then, label %else then: - %0 = getelementptr inbounds [4 x float]* %arr, i64 0, i64 3 + %0 = getelementptr inbounds [4 x float], [4 x float]* %arr, i64 0, i64 3 store float 1.000000e+00, float* %0, align 4 br label %then2 @@ -556,14 +556,14 @@ then2: br label %merge else: - %2 = getelementptr inbounds [4 x float]* %arr, i64 0, i64 3 + %2 = getelementptr inbounds [4 x float], [4 x float]* %arr, i64 0, i64 3 store float 3.000000e+00, float* %2, align 4 br label %merge merge: %3 = phi float* [ %1, %then2 ], [ %2, %else ] store float 0.000000e+00, float* %temp, align 4 - %4 = load float* %3, align 4 + %4 = load float, float* %3, align 4 ret float %4 } diff --git a/test/Transforms/SROA/slice-order-independence.ll b/test/Transforms/SROA/slice-order-independence.ll index 364ef85..7d57be6 100644 --- a/test/Transforms/SROA/slice-order-independence.ll +++ b/test/Transforms/SROA/slice-order-independence.ll @@ -13,11 +13,11 @@ define void @skipped_inttype_first({ i16*, i32 }*) { %2 = bitcast { i16*, i32 }* %0 to i8* %3 = bitcast { i16*, i32 }* %arg to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %3, i8* %2, i32 16, i32 8, i1 false) - %b = getelementptr inbounds { i16*, i32 }* %arg, i64 0, i32 0 + %b = getelementptr inbounds { i16*, i32 }, { i16*, i32 }* %arg, i64 0, i32 0 %pb0 = bitcast i16** %b to i63* - %b0 = load i63* %pb0 + %b0 = load i63, i63* %pb0 %pb1 = bitcast i16** %b to i8** - %b1 = load i8** %pb1 + %b1 = load i8*, i8** %pb1 ret void } @@ -28,10 +28,10 @@ define void @skipped_inttype_last({ i16*, i32 }*) { %2 = bitcast { i16*, i32 }* %0 to i8* %3 = bitcast { i16*, i32 }* %arg to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %3, i8* %2, i32 16, i32 8, i1 false) - %b = getelementptr inbounds { i16*, i32 }* %arg, i64 0, i32 0 + %b = getelementptr inbounds { i16*, i32 }, { i16*, i32 }* %arg, i64 0, i32 0 %pb1 = bitcast i16** %b to i8** - %b1 = load i8** %pb1 + %b1 = load i8*, i8** %pb1 %pb0 = bitcast i16** %b to i63* - %b0 = load i63* %pb0 + %b0 = load i63, i63* %pb0 ret void } diff --git a/test/Transforms/SROA/slice-width.ll b/test/Transforms/SROA/slice-width.ll index ff66dcc..6b6ab93 100644 --- a/test/Transforms/SROA/slice-width.ll +++ b/test/Transforms/SROA/slice-width.ll @@ -14,14 +14,14 @@ load_i32: ; CHECK-LABEL: load_i32: ; CHECK-NOT: bitcast {{.*}} to i1 ; CHECK-NOT: zext i1 - %r0 = load i32* %arg + %r0 = load i32, i32* %arg br label %load_i1 load_i1: ; CHECK-LABEL: load_i1: ; CHECK: bitcast {{.*}} to i1 %p1 = bitcast i32* %arg to i1* - %t1 = load i1* %p1 + %t1 = load i1, i1* %p1 ret void } @@ -42,16 +42,16 @@ define void @memcpy_fp80_padding() { call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x_i8, i8* bitcast (%union.Foo* @foo_copy_source to i8*), i32 32, i32 16, i1 false) ; Access a slice of the alloca to trigger SROA. - %mid_p = getelementptr %union.Foo* %x, i32 0, i32 1 - %elt = load i64* %mid_p + %mid_p = getelementptr %union.Foo, %union.Foo* %x, i32 0, i32 1 + %elt = load i64, i64* %mid_p store i64 %elt, i64* @i64_sink ret void } ; CHECK-LABEL: define void @memcpy_fp80_padding ; CHECK: alloca x86_fp80 ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32 -; CHECK: load i64* getelementptr inbounds (%union.Foo* @foo_copy_source, i64 0, i32 1) -; CHECK: load i64* getelementptr inbounds (%union.Foo* @foo_copy_source, i64 0, i32 2) +; CHECK: load i64, i64* getelementptr inbounds (%union.Foo, %union.Foo* @foo_copy_source, i64 0, i32 1) +; CHECK: load i64, i64* getelementptr inbounds (%union.Foo, %union.Foo* @foo_copy_source, i64 0, i32 2) define void @memset_fp80_padding() { %x = alloca %union.Foo @@ -61,8 +61,8 @@ define void @memset_fp80_padding() { call void @llvm.memset.p0i8.i32(i8* %x_i8, i8 -1, i32 32, i32 16, i1 false) ; Access a slice of the alloca to trigger SROA. - %mid_p = getelementptr %union.Foo* %x, i32 0, i32 1 - %elt = load i64* %mid_p + %mid_p = getelementptr %union.Foo, %union.Foo* %x, i32 0, i32 1 + %elt = load i64, i64* %mid_p store i64 %elt, i64* @i64_sink ret void } @@ -89,8 +89,8 @@ entry: ; The following block does nothing; but appears to confuse SROA %unused1 = bitcast %S.vec3float* %tmp1 to %U.vec3float* - %unused2 = getelementptr inbounds %U.vec3float* %unused1, i32 0, i32 0 - %unused3 = load <4 x float>* %unused2, align 1 + %unused2 = getelementptr inbounds %U.vec3float, %U.vec3float* %unused1, i32 0, i32 0 + %unused3 = load <4 x float>, <4 x float>* %unused2, align 1 ; Create a second temporary and copy %tmp1 into it %tmp2 = alloca %S.vec3float, align 4 diff --git a/test/Transforms/SROA/vector-conversion.ll b/test/Transforms/SROA/vector-conversion.ll index 08d7960..91ae5be 100644 --- a/test/Transforms/SROA/vector-conversion.ll +++ b/test/Transforms/SROA/vector-conversion.ll @@ -10,7 +10,7 @@ define <4 x i64> @vector_ptrtoint({<2 x i32*>, <2 x i32*>} %x) { ; CHECK-NOT: store %cast = bitcast {<2 x i32*>, <2 x i32*>}* %a to <4 x i64>* - %vec = load <4 x i64>* %cast + %vec = load <4 x i64>, <4 x i64>* %cast ; CHECK-NOT: load ; CHECK: ptrtoint @@ -26,7 +26,7 @@ define <4 x i32*> @vector_inttoptr({<2 x i64>, <2 x i64>} %x) { ; CHECK-NOT: store %cast = bitcast {<2 x i64>, <2 x i64>}* %a to <4 x i32*>* - %vec = load <4 x i32*>* %cast + %vec = load <4 x i32*>, <4 x i32*>* %cast ; CHECK-NOT: load ; CHECK: inttoptr @@ -42,7 +42,7 @@ define <2 x i64> @vector_ptrtointbitcast({<1 x i32*>, <1 x i32*>} %x) { ; CHECK-NOT: store %cast = bitcast {<1 x i32*>, <1 x i32*>}* %a to <2 x i64>* - %vec = load <2 x i64>* %cast + %vec = load <2 x i64>, <2 x i64>* %cast ; CHECK-NOT: load ; CHECK: ptrtoint ; CHECK: bitcast diff --git a/test/Transforms/SROA/vector-lifetime-intrinsic.ll b/test/Transforms/SROA/vector-lifetime-intrinsic.ll index 30c93b0..37cf394 100644 --- a/test/Transforms/SROA/vector-lifetime-intrinsic.ll +++ b/test/Transforms/SROA/vector-lifetime-intrinsic.ll @@ -18,7 +18,7 @@ bb: call void @llvm.lifetime.start(i64 16, i8* %tmp8) store <4 x float> %arg1, <4 x float>* %tmp, align 16 %tmp17 = bitcast <4 x float>* %tmp to <3 x float>* - %tmp18 = load <3 x float>* %tmp17 + %tmp18 = load <3 x float>, <3 x float>* %tmp17 %tmp20 = bitcast <4 x float>* %tmp to i8* call void @llvm.lifetime.end(i64 16, i8* %tmp20) call void @wombat3(<3 x float> %tmp18) diff --git a/test/Transforms/SROA/vector-promotion.ll b/test/Transforms/SROA/vector-promotion.ll index c20c635..2d9b26b 100644 --- a/test/Transforms/SROA/vector-promotion.ll +++ b/test/Transforms/SROA/vector-promotion.ll @@ -9,18 +9,18 @@ entry: %a = alloca [2 x <4 x i32>] ; CHECK-NOT: alloca - %a.x = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0 + %a.x = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0 store <4 x i32> %x, <4 x i32>* %a.x - %a.y = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1 + %a.y = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1 store <4 x i32> %y, <4 x i32>* %a.y ; CHECK-NOT: store - %a.tmp1 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 - %tmp1 = load i32* %a.tmp1 - %a.tmp2 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 - %tmp2 = load i32* %a.tmp2 - %a.tmp3 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 - %tmp3 = load i32* %a.tmp3 + %a.tmp1 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 + %tmp1 = load i32, i32* %a.tmp1 + %a.tmp2 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 + %tmp2 = load i32, i32* %a.tmp2 + %a.tmp3 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 + %tmp3 = load i32, i32* %a.tmp3 ; CHECK-NOT: load ; CHECK: extractelement <4 x i32> %x, i32 2 ; CHECK-NEXT: extractelement <4 x i32> %y, i32 3 @@ -40,19 +40,19 @@ entry: %a = alloca [2 x <4 x i32>] ; CHECK-NOT: alloca - %a.x = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0 + %a.x = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0 store <4 x i32> %x, <4 x i32>* %a.x - %a.y = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1 + %a.y = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1 store <4 x i32> %y, <4 x i32>* %a.y ; CHECK-NOT: store - %a.tmp1 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 - %tmp1 = load i32* %a.tmp1 - %a.tmp2 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 - %tmp2 = load i32* %a.tmp2 - %a.tmp3 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 + %a.tmp1 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 + %tmp1 = load i32, i32* %a.tmp1 + %a.tmp2 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 + %tmp2 = load i32, i32* %a.tmp2 + %a.tmp3 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 %a.tmp3.cast = bitcast i32* %a.tmp3 to <2 x i32>* - %tmp3.vec = load <2 x i32>* %a.tmp3.cast + %tmp3.vec = load <2 x i32>, <2 x i32>* %a.tmp3.cast %tmp3 = extractelement <2 x i32> %tmp3.vec, i32 0 ; CHECK-NOT: load ; CHECK: %[[extract1:.*]] = extractelement <4 x i32> %x, i32 2 @@ -74,9 +74,9 @@ entry: %a = alloca [2 x <4 x i32>] ; CHECK-NOT: alloca - %a.x = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0 + %a.x = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0 store <4 x i32> %x, <4 x i32>* %a.x - %a.y = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1 + %a.y = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1 store <4 x i32> %y, <4 x i32>* %a.y ; CHECK-NOT: store @@ -84,14 +84,14 @@ entry: call void @llvm.memset.p0i8.i32(i8* %a.y.cast, i8 0, i32 16, i32 1, i1 false) ; CHECK-NOT: memset - %a.tmp1 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 + %a.tmp1 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 %a.tmp1.cast = bitcast i32* %a.tmp1 to i8* call void @llvm.memset.p0i8.i32(i8* %a.tmp1.cast, i8 -1, i32 4, i32 1, i1 false) - %tmp1 = load i32* %a.tmp1 - %a.tmp2 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 - %tmp2 = load i32* %a.tmp2 - %a.tmp3 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 - %tmp3 = load i32* %a.tmp3 + %tmp1 = load i32, i32* %a.tmp1 + %a.tmp2 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 + %tmp2 = load i32, i32* %a.tmp2 + %a.tmp3 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 + %tmp3 = load i32, i32* %a.tmp3 ; CHECK-NOT: load ; CHECK: %[[insert:.*]] = insertelement <4 x i32> %x, i32 -1, i32 2 ; CHECK-NEXT: extractelement <4 x i32> %[[insert]], i32 2 @@ -112,9 +112,9 @@ entry: %a = alloca [2 x <4 x i32>] ; CHECK-NOT: alloca - %a.x = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0 + %a.x = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0 store <4 x i32> %x, <4 x i32>* %a.x - %a.y = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1 + %a.y = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1 store <4 x i32> %y, <4 x i32>* %a.y ; CHECK-NOT: store @@ -123,20 +123,20 @@ entry: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.y.cast, i8* %z.cast, i32 16, i32 1, i1 false) ; CHECK-NOT: memcpy - %a.tmp1 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 + %a.tmp1 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 %a.tmp1.cast = bitcast i32* %a.tmp1 to i8* - %z.tmp1 = getelementptr inbounds <4 x i32>* %z, i64 0, i64 2 + %z.tmp1 = getelementptr inbounds <4 x i32>, <4 x i32>* %z, i64 0, i64 2 %z.tmp1.cast = bitcast i32* %z.tmp1 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.tmp1.cast, i8* %z.tmp1.cast, i32 4, i32 1, i1 false) - %tmp1 = load i32* %a.tmp1 - %a.tmp2 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 - %tmp2 = load i32* %a.tmp2 - %a.tmp3 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 - %tmp3 = load i32* %a.tmp3 + %tmp1 = load i32, i32* %a.tmp1 + %a.tmp2 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 + %tmp2 = load i32, i32* %a.tmp2 + %a.tmp3 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 + %tmp3 = load i32, i32* %a.tmp3 ; CHECK-NOT: memcpy -; CHECK: %[[load:.*]] = load <4 x i32>* %z -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds <4 x i32>* %z, i64 0, i64 2 -; CHECK-NEXT: %[[element_load:.*]] = load i32* %[[gep]] +; CHECK: %[[load:.*]] = load <4 x i32>, <4 x i32>* %z +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds <4 x i32>, <4 x i32>* %z, i64 0, i64 2 +; CHECK-NEXT: %[[element_load:.*]] = load i32, i32* %[[gep]] ; CHECK-NEXT: %[[insert:.*]] = insertelement <4 x i32> %x, i32 %[[element_load]], i32 2 ; CHECK-NEXT: extractelement <4 x i32> %[[insert]], i32 2 ; CHECK-NEXT: extractelement <4 x i32> %[[load]], i32 3 @@ -159,9 +159,9 @@ entry: %a = alloca [2 x <4 x i32>] ; CHECK-NOT: alloca - %a.x = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0 + %a.x = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0 store <4 x i32> %x, <4 x i32>* %a.x - %a.y = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1 + %a.y = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1 store <4 x i32> %y, <4 x i32>* %a.y ; CHECK-NOT: store @@ -170,20 +170,20 @@ entry: call void @llvm.memcpy.p0i8.p1i8.i32(i8* %a.y.cast, i8 addrspace(1)* %z.cast, i32 16, i32 1, i1 false) ; CHECK-NOT: memcpy - %a.tmp1 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 + %a.tmp1 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 %a.tmp1.cast = bitcast i32* %a.tmp1 to i8* - %z.tmp1 = getelementptr inbounds <4 x i32> addrspace(1)* %z, i16 0, i16 2 + %z.tmp1 = getelementptr inbounds <4 x i32>, <4 x i32> addrspace(1)* %z, i16 0, i16 2 %z.tmp1.cast = bitcast i32 addrspace(1)* %z.tmp1 to i8 addrspace(1)* call void @llvm.memcpy.p0i8.p1i8.i32(i8* %a.tmp1.cast, i8 addrspace(1)* %z.tmp1.cast, i32 4, i32 1, i1 false) - %tmp1 = load i32* %a.tmp1 - %a.tmp2 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 - %tmp2 = load i32* %a.tmp2 - %a.tmp3 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 - %tmp3 = load i32* %a.tmp3 + %tmp1 = load i32, i32* %a.tmp1 + %a.tmp2 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 + %tmp2 = load i32, i32* %a.tmp2 + %a.tmp3 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 + %tmp3 = load i32, i32* %a.tmp3 ; CHECK-NOT: memcpy -; CHECK: %[[load:.*]] = load <4 x i32> addrspace(1)* %z -; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds <4 x i32> addrspace(1)* %z, i64 0, i64 2 -; CHECK-NEXT: %[[element_load:.*]] = load i32 addrspace(1)* %[[gep]] +; CHECK: %[[load:.*]] = load <4 x i32>, <4 x i32> addrspace(1)* %z +; CHECK-NEXT: %[[gep:.*]] = getelementptr inbounds <4 x i32>, <4 x i32> addrspace(1)* %z, i64 0, i64 2 +; CHECK-NEXT: %[[element_load:.*]] = load i32, i32 addrspace(1)* %[[gep]] ; CHECK-NEXT: %[[insert:.*]] = insertelement <4 x i32> %x, i32 %[[element_load]], i32 2 ; CHECK-NEXT: extractelement <4 x i32> %[[insert]], i32 2 ; CHECK-NEXT: extractelement <4 x i32> %[[load]], i32 3 @@ -205,9 +205,9 @@ entry: %a = alloca [2 x <4 x i32>] ; CHECK-NOT: alloca - %a.x = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0 + %a.x = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0 store <4 x i32> %x, <4 x i32>* %a.x - %a.y = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1 + %a.y = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1 store <4 x i32> %y, <4 x i32>* %a.y ; CHECK-NOT: store @@ -216,18 +216,18 @@ entry: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.x.cast, i8* %a.y.cast, i32 16, i32 1, i1 false) ; CHECK-NOT: memcpy - %a.tmp1 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 + %a.tmp1 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 0, i64 2 %a.tmp1.cast = bitcast i32* %a.tmp1 to i8* - %z.tmp1 = getelementptr inbounds <4 x i32>* %z, i64 0, i64 2 + %z.tmp1 = getelementptr inbounds <4 x i32>, <4 x i32>* %z, i64 0, i64 2 %z.tmp1.cast = bitcast i32* %z.tmp1 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %z.tmp1.cast, i8* %a.tmp1.cast, i32 4, i32 1, i1 false) - %tmp1 = load i32* %a.tmp1 - %a.tmp2 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 - %tmp2 = load i32* %a.tmp2 - %a.tmp3 = getelementptr inbounds [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 - %tmp3 = load i32* %a.tmp3 + %tmp1 = load i32, i32* %a.tmp1 + %a.tmp2 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 3 + %tmp2 = load i32, i32* %a.tmp2 + %a.tmp3 = getelementptr inbounds [2 x <4 x i32>], [2 x <4 x i32>]* %a, i64 0, i64 1, i64 0 + %tmp3 = load i32, i32* %a.tmp3 ; CHECK-NOT: memcpy -; CHECK: %[[gep:.*]] = getelementptr inbounds <4 x i32>* %z, i64 0, i64 2 +; CHECK: %[[gep:.*]] = getelementptr inbounds <4 x i32>, <4 x i32>* %z, i64 0, i64 2 ; CHECK-NEXT: %[[extract:.*]] = extractelement <4 x i32> %y, i32 2 ; CHECK-NEXT: store i32 %[[extract]], i32* %[[gep]] ; CHECK-NEXT: extractelement <4 x i32> %y, i32 2 @@ -250,14 +250,14 @@ define i64 @test6(<4 x i64> %x, <4 x i64> %y, i64 %n) { ; The old scalarrepl pass would wrongly drop the store to the second alloca. ; PR13254 %tmp = alloca { <4 x i64>, <4 x i64> } - %p0 = getelementptr inbounds { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 0 + %p0 = getelementptr inbounds { <4 x i64>, <4 x i64> }, { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 0 store <4 x i64> %x, <4 x i64>* %p0 ; CHECK: store <4 x i64> %x, - %p1 = getelementptr inbounds { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 1 + %p1 = getelementptr inbounds { <4 x i64>, <4 x i64> }, { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 1 store <4 x i64> %y, <4 x i64>* %p1 ; CHECK: store <4 x i64> %y, - %addr = getelementptr inbounds { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 0, i64 %n - %res = load i64* %addr, align 4 + %addr = getelementptr inbounds { <4 x i64>, <4 x i64> }, { <4 x i64>, <4 x i64> }* %tmp, i32 0, i32 0, i64 %n + %res = load i64, i64* %addr, align 4 ret i64 %res } @@ -267,27 +267,27 @@ entry: %a = alloca <4 x i32> ; CHECK-NOT: alloca - %a.gep0 = getelementptr <4 x i32>* %a, i32 0, i32 0 + %a.gep0 = getelementptr <4 x i32>, <4 x i32>* %a, i32 0, i32 0 %a.cast0 = bitcast i32* %a.gep0 to <2 x i32>* store <2 x i32> <i32 0, i32 0>, <2 x i32>* %a.cast0 ; CHECK-NOT: store ; CHECK: select <4 x i1> <i1 true, i1 true, i1 false, i1 false> - %a.gep1 = getelementptr <4 x i32>* %a, i32 0, i32 1 + %a.gep1 = getelementptr <4 x i32>, <4 x i32>* %a, i32 0, i32 1 %a.cast1 = bitcast i32* %a.gep1 to <2 x i32>* store <2 x i32> <i32 1, i32 1>, <2 x i32>* %a.cast1 ; CHECK-NEXT: select <4 x i1> <i1 false, i1 true, i1 true, i1 false> - %a.gep2 = getelementptr <4 x i32>* %a, i32 0, i32 2 + %a.gep2 = getelementptr <4 x i32>, <4 x i32>* %a, i32 0, i32 2 %a.cast2 = bitcast i32* %a.gep2 to <2 x i32>* store <2 x i32> <i32 2, i32 2>, <2 x i32>* %a.cast2 ; CHECK-NEXT: select <4 x i1> <i1 false, i1 false, i1 true, i1 true> - %a.gep3 = getelementptr <4 x i32>* %a, i32 0, i32 3 + %a.gep3 = getelementptr <4 x i32>, <4 x i32>* %a, i32 0, i32 3 store i32 3, i32* %a.gep3 ; CHECK-NEXT: insertelement <4 x i32> - %ret = load <4 x i32>* %a + %ret = load <4 x i32>, <4 x i32>* %a ret <4 x i32> %ret ; CHECK-NEXT: ret <4 x i32> @@ -301,20 +301,20 @@ entry: store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %a ; CHECK-NOT: store - %a.gep0 = getelementptr <4 x i32>* %a, i32 0, i32 0 + %a.gep0 = getelementptr <4 x i32>, <4 x i32>* %a, i32 0, i32 0 %a.cast0 = bitcast i32* %a.gep0 to <2 x i32>* - %first = load <2 x i32>* %a.cast0 + %first = load <2 x i32>, <2 x i32>* %a.cast0 ; CHECK-NOT: load ; CHECK: %[[extract1:.*]] = shufflevector <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32> undef, <2 x i32> <i32 0, i32 1> - %a.gep1 = getelementptr <4 x i32>* %a, i32 0, i32 1 + %a.gep1 = getelementptr <4 x i32>, <4 x i32>* %a, i32 0, i32 1 %a.cast1 = bitcast i32* %a.gep1 to <2 x i32>* - %second = load <2 x i32>* %a.cast1 + %second = load <2 x i32>, <2 x i32>* %a.cast1 ; CHECK-NEXT: %[[extract2:.*]] = shufflevector <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32> undef, <2 x i32> <i32 1, i32 2> - %a.gep2 = getelementptr <4 x i32>* %a, i32 0, i32 2 + %a.gep2 = getelementptr <4 x i32>, <4 x i32>* %a, i32 0, i32 2 %a.cast2 = bitcast i32* %a.gep2 to <2 x i32>* - %third = load <2 x i32>* %a.cast2 + %third = load <2 x i32>, <2 x i32>* %a.cast2 ; CHECK-NEXT: %[[extract3:.*]] = shufflevector <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32> undef, <2 x i32> <i32 2, i32 3> %tmp = shufflevector <2 x i32> %first, <2 x i32> %second, <2 x i32> <i32 0, i32 2> @@ -334,28 +334,28 @@ entry: %a = alloca <4 x float> ; CHECK-NOT: alloca - %a.gep0 = getelementptr <4 x float>* %a, i32 0, i32 0 + %a.gep0 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 0 %a.cast0 = bitcast float* %a.gep0 to i8* call void @llvm.memset.p0i8.i32(i8* %a.cast0, i8 0, i32 8, i32 0, i1 false) ; CHECK-NOT: store ; CHECK: select <4 x i1> <i1 true, i1 true, i1 false, i1 false> - %a.gep1 = getelementptr <4 x float>* %a, i32 0, i32 1 + %a.gep1 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 1 %a.cast1 = bitcast float* %a.gep1 to i8* call void @llvm.memset.p0i8.i32(i8* %a.cast1, i8 1, i32 8, i32 0, i1 false) ; CHECK-NEXT: select <4 x i1> <i1 false, i1 true, i1 true, i1 false> - %a.gep2 = getelementptr <4 x float>* %a, i32 0, i32 2 + %a.gep2 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 2 %a.cast2 = bitcast float* %a.gep2 to i8* call void @llvm.memset.p0i8.i32(i8* %a.cast2, i8 3, i32 8, i32 0, i1 false) ; CHECK-NEXT: select <4 x i1> <i1 false, i1 false, i1 true, i1 true> - %a.gep3 = getelementptr <4 x float>* %a, i32 0, i32 3 + %a.gep3 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 3 %a.cast3 = bitcast float* %a.gep3 to i8* call void @llvm.memset.p0i8.i32(i8* %a.cast3, i8 7, i32 4, i32 0, i1 false) ; CHECK-NEXT: insertelement <4 x float> - %ret = load <4 x float>* %a + %ret = load <4 x float>, <4 x float>* %a ret <4 x float> %ret ; CHECK-NEXT: ret <4 x float> @@ -367,35 +367,35 @@ entry: %a = alloca <4 x float> ; CHECK-NOT: alloca - %a.gep0 = getelementptr <4 x float>* %a, i32 0, i32 0 + %a.gep0 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 0 %a.cast0 = bitcast float* %a.gep0 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.cast0, i8* %x, i32 8, i32 0, i1 false) ; CHECK: %[[xptr:.*]] = bitcast i8* %x to <2 x float>* -; CHECK-NEXT: %[[x:.*]] = load <2 x float>* %[[xptr]] +; CHECK-NEXT: %[[x:.*]] = load <2 x float>, <2 x float>* %[[xptr]] ; CHECK-NEXT: %[[expand_x:.*]] = shufflevector <2 x float> %[[x]], <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef> ; CHECK-NEXT: select <4 x i1> <i1 true, i1 true, i1 false, i1 false> - %a.gep1 = getelementptr <4 x float>* %a, i32 0, i32 1 + %a.gep1 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 1 %a.cast1 = bitcast float* %a.gep1 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.cast1, i8* %y, i32 8, i32 0, i1 false) ; CHECK-NEXT: %[[yptr:.*]] = bitcast i8* %y to <2 x float>* -; CHECK-NEXT: %[[y:.*]] = load <2 x float>* %[[yptr]] +; CHECK-NEXT: %[[y:.*]] = load <2 x float>, <2 x float>* %[[yptr]] ; CHECK-NEXT: %[[expand_y:.*]] = shufflevector <2 x float> %[[y]], <2 x float> undef, <4 x i32> <i32 undef, i32 0, i32 1, i32 undef> ; CHECK-NEXT: select <4 x i1> <i1 false, i1 true, i1 true, i1 false> - %a.gep2 = getelementptr <4 x float>* %a, i32 0, i32 2 + %a.gep2 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 2 %a.cast2 = bitcast float* %a.gep2 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.cast2, i8* %z, i32 8, i32 0, i1 false) ; CHECK-NEXT: %[[zptr:.*]] = bitcast i8* %z to <2 x float>* -; CHECK-NEXT: %[[z:.*]] = load <2 x float>* %[[zptr]] +; CHECK-NEXT: %[[z:.*]] = load <2 x float>, <2 x float>* %[[zptr]] ; CHECK-NEXT: %[[expand_z:.*]] = shufflevector <2 x float> %[[z]], <2 x float> undef, <4 x i32> <i32 undef, i32 undef, i32 0, i32 1> ; CHECK-NEXT: select <4 x i1> <i1 false, i1 false, i1 true, i1 true> - %a.gep3 = getelementptr <4 x float>* %a, i32 0, i32 3 + %a.gep3 = getelementptr <4 x float>, <4 x float>* %a, i32 0, i32 3 %a.cast3 = bitcast float* %a.gep3 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a.cast3, i8* %f, i32 4, i32 0, i1 false) ; CHECK-NEXT: %[[fptr:.*]] = bitcast i8* %f to float* -; CHECK-NEXT: %[[f:.*]] = load float* %[[fptr]] +; CHECK-NEXT: %[[f:.*]] = load float, float* %[[fptr]] ; CHECK-NEXT: %[[insert_f:.*]] = insertelement <4 x float> call void @llvm.memcpy.p0i8.p0i8.i32(i8* %out, i8* %a.cast2, i32 8, i32 0, i1 false) @@ -403,7 +403,7 @@ entry: ; CHECK-NEXT: %[[extract_out:.*]] = shufflevector <4 x float> %[[insert_f]], <4 x float> undef, <2 x i32> <i32 2, i32 3> ; CHECK-NEXT: store <2 x float> %[[extract_out]], <2 x float>* %[[outptr]] - %ret = load <4 x float>* %a + %ret = load <4 x float>, <4 x float>* %a ret <4 x float> %ret ; CHECK-NEXT: ret <4 x float> %[[insert_f]] @@ -419,7 +419,7 @@ entry: store <3 x i8> undef, <3 x i8>* %retval, align 4 %cast = bitcast <3 x i8>* %retval to i32* - %load = load i32* %cast, align 4 + %load = load i32, i32* %cast, align 4 ret i32 %load ; CHECK: ret i32 } @@ -437,7 +437,7 @@ entry: ; CHECK-NOT: store %cast = bitcast i32* %a to <2 x i8>* - %vec = load <2 x i8>* %cast + %vec = load <2 x i8>, <2 x i8>* %cast ; CHECK-NOT: load ret <2 x i8> %vec @@ -459,7 +459,7 @@ entry: store <2 x i8> %x, <2 x i8>* %cast ; CHECK-NOT: store - %int = load i32* %a + %int = load i32, i32* %a ; CHECK-NOT: load ret i32 %int @@ -477,18 +477,18 @@ entry: %a.cast = bitcast [2 x i64]* %a to [2 x <2 x i32>]* ; CHECK-NOT: alloca - %a.x = getelementptr inbounds [2 x <2 x i32>]* %a.cast, i64 0, i64 0 + %a.x = getelementptr inbounds [2 x <2 x i32>], [2 x <2 x i32>]* %a.cast, i64 0, i64 0 store <2 x i32> %x, <2 x i32>* %a.x - %a.y = getelementptr inbounds [2 x <2 x i32>]* %a.cast, i64 0, i64 1 + %a.y = getelementptr inbounds [2 x <2 x i32>], [2 x <2 x i32>]* %a.cast, i64 0, i64 1 store <2 x i32> %y, <2 x i32>* %a.y ; CHECK-NOT: store - %a.tmp1 = getelementptr inbounds [2 x <2 x i32>]* %a.cast, i64 0, i64 0, i64 1 - %tmp1 = load i32* %a.tmp1 - %a.tmp2 = getelementptr inbounds [2 x <2 x i32>]* %a.cast, i64 0, i64 1, i64 1 - %tmp2 = load i32* %a.tmp2 - %a.tmp3 = getelementptr inbounds [2 x <2 x i32>]* %a.cast, i64 0, i64 1, i64 0 - %tmp3 = load i32* %a.tmp3 + %a.tmp1 = getelementptr inbounds [2 x <2 x i32>], [2 x <2 x i32>]* %a.cast, i64 0, i64 0, i64 1 + %tmp1 = load i32, i32* %a.tmp1 + %a.tmp2 = getelementptr inbounds [2 x <2 x i32>], [2 x <2 x i32>]* %a.cast, i64 0, i64 1, i64 1 + %tmp2 = load i32, i32* %a.tmp2 + %a.tmp3 = getelementptr inbounds [2 x <2 x i32>], [2 x <2 x i32>]* %a.cast, i64 0, i64 1, i64 0 + %tmp3 = load i32, i32* %a.tmp3 ; CHECK-NOT: load ; CHECK: extractelement <2 x i32> %x, i32 1 ; CHECK-NEXT: extractelement <2 x i32> %y, i32 1 @@ -515,9 +515,9 @@ entry: store <2 x i32> %x, <2 x i32>* %a.vec ; CHECK-NOT: store - %tmp1 = load i32* %a.i32 - %a.tmp2 = getelementptr inbounds i32* %a.i32, i64 1 - %tmp2 = load i32* %a.tmp2 + %tmp1 = load i32, i32* %a.i32 + %a.tmp2 = getelementptr inbounds i32, i32* %a.i32, i64 1 + %tmp2 = load i32, i32* %a.tmp2 ; CHECK-NOT: load ; CHECK: extractelement <2 x i32> %x, i32 0 ; CHECK-NEXT: extractelement <2 x i32> %x, i32 1 @@ -539,13 +539,13 @@ entry: ; CHECK-NOT: alloca store i32 %x, i32* %a.i32 - %a.tmp2 = getelementptr inbounds i32* %a.i32, i64 1 + %a.tmp2 = getelementptr inbounds i32, i32* %a.i32, i64 1 store i32 %y, i32* %a.tmp2 ; CHECK-NOT: store ; CHECK: %[[V1:.*]] = insertelement <2 x i32> undef, i32 %x, i32 0 ; CHECK-NEXT: %[[V2:.*]] = insertelement <2 x i32> %[[V1]], i32 %y, i32 1 - %result = load <2 x i32>* %a.vec + %result = load <2 x i32>, <2 x i32>* %a.vec ; CHECK-NOT: load ret <2 x i32> %result @@ -564,13 +564,13 @@ entry: ; CHECK-NOT: alloca store <4 x i16> %x, <4 x i16>* %a.vec2 - %a.tmp2 = getelementptr inbounds i32* %a.i32, i64 1 + %a.tmp2 = getelementptr inbounds i32, i32* %a.i32, i64 1 store i32 %y, i32* %a.tmp2 ; CHECK-NOT: store ; CHECK: %[[V1:.*]] = bitcast <4 x i16> %x to <2 x i32> ; CHECK-NEXT: %[[V2:.*]] = insertelement <2 x i32> %[[V1]], i32 %y, i32 1 - %result = load <2 x i32>* %a.vec1 + %result = load <2 x i32>, <2 x i32>* %a.vec1 ; CHECK-NOT: load ret <2 x i32> %result @@ -590,7 +590,7 @@ entry: ; CHECK-NOT: alloca store <4 x i16> %x, <4 x i16>* %a.vec2 - %a.tmp2 = getelementptr inbounds i32* %a.i32, i64 1 + %a.tmp2 = getelementptr inbounds i32, i32* %a.i32, i64 1 store i32 %y, i32* %a.tmp2 ; CHECK-NOT: store ; CHECK: %[[V1:.*]] = bitcast i32 %y to <2 x i16> @@ -598,7 +598,7 @@ entry: ; CHECK-NEXT: %[[V3:.*]] = select <4 x i1> <i1 false, i1 false, i1 true, i1 true>, <4 x i16> %[[V2]], <4 x i16> %x ; CHECK-NEXT: %[[V4:.*]] = bitcast <4 x i16> %[[V3]] to <2 x float> - %result = load <2 x float>* %a.vec1 + %result = load <2 x float>, <2 x float>* %a.vec1 ; CHECK-NOT: load ret <2 x float> %result @@ -616,7 +616,7 @@ define <4 x float> @test12() { %cast2 = bitcast <3 x i32>* %a to <3 x float>* %cast3 = bitcast <3 x float>* %cast2 to <4 x float>* - %vec = load <4 x float>* %cast3 + %vec = load <4 x float>, <4 x float>* %cast3 ; CHECK-NOT: load ; CHECK: %[[ret:.*]] = bitcast <4 x i32> undef to <4 x float> diff --git a/test/Transforms/SROA/vectors-of-pointers.ll b/test/Transforms/SROA/vectors-of-pointers.ll index 7e995b9..ff09e95 100644 --- a/test/Transforms/SROA/vectors-of-pointers.ll +++ b/test/Transforms/SROA/vectors-of-pointers.ll @@ -20,6 +20,6 @@ if.then.i.i.i.i.i237: unreachable bb0.exit257: - %0 = load <2 x i32*>* %Args.i, align 16 + %0 = load <2 x i32*>, <2 x i32*>* %Args.i, align 16 unreachable } diff --git a/test/Transforms/SampleProfile/branch.ll b/test/Transforms/SampleProfile/branch.ll index 6391fc5..a2d1fc3 100644 --- a/test/Transforms/SampleProfile/branch.ll +++ b/test/Transforms/SampleProfile/branch.ll @@ -32,18 +32,18 @@ define i32 @main(i32 %argc, i8** nocapture readonly %argv) #0 { ; CHECK: Printing analysis 'Branch Probability Analysis' for function 'main': entry: - tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !13, metadata !{}), !dbg !27 - tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !14, metadata !{}), !dbg !27 + tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !13, metadata !MDExpression()), !dbg !27 + tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !14, metadata !MDExpression()), !dbg !27 %cmp = icmp slt i32 %argc, 2, !dbg !28 br i1 %cmp, label %return, label %if.end, !dbg !28 ; CHECK: edge entry -> return probability is 1 / 2 = 50% ; CHECK: edge entry -> if.end probability is 1 / 2 = 50% if.end: ; preds = %entry - %arrayidx = getelementptr inbounds i8** %argv, i64 1, !dbg !30 - %0 = load i8** %arrayidx, align 8, !dbg !30, !tbaa !31 + %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1, !dbg !30 + %0 = load i8*, i8** %arrayidx, align 8, !dbg !30, !tbaa !31 %call = tail call i32 @atoi(i8* %0) #4, !dbg !30 - tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !17, metadata !{}), !dbg !30 + tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !17, metadata !MDExpression()), !dbg !30 %cmp1 = icmp sgt i32 %call, 100, !dbg !35 br i1 %cmp1, label %for.body, label %if.end6, !dbg !35 ; CHECK: edge if.end -> for.body probability is 1 / 2 = 50% @@ -55,14 +55,14 @@ for.body: ; preds = %if.end, %for.body %add = fadd double %s.015, 3.049000e+00, !dbg !36 %conv = sitofp i32 %u.016 to double, !dbg !36 %add4 = fadd double %add, %conv, !dbg !36 - tail call void @llvm.dbg.value(metadata double %add4, i64 0, metadata !18, metadata !{}), !dbg !36 + tail call void @llvm.dbg.value(metadata double %add4, i64 0, metadata !18, metadata !MDExpression()), !dbg !36 %div = fdiv double 3.940000e+00, %s.015, !dbg !37 %mul = fmul double %div, 3.200000e-01, !dbg !37 %add5 = fadd double %add4, %mul, !dbg !37 %sub = fsub double %add4, %add5, !dbg !37 - tail call void @llvm.dbg.value(metadata double %sub, i64 0, metadata !18, metadata !{}), !dbg !37 + tail call void @llvm.dbg.value(metadata double %sub, i64 0, metadata !18, metadata !MDExpression()), !dbg !37 %inc = add nsw i32 %u.016, 1, !dbg !38 - tail call void @llvm.dbg.value(metadata i32 %inc, i64 0, metadata !21, metadata !{}), !dbg !38 + tail call void @llvm.dbg.value(metadata i32 %inc, i64 0, metadata !21, metadata !MDExpression()), !dbg !38 %exitcond = icmp eq i32 %inc, %call, !dbg !38 br i1 %exitcond, label %if.end6, label %for.body, !dbg !38 ; CHECK: edge for.body -> if.end6 probability is 1 / 10227 = 0.00977804 @@ -70,7 +70,7 @@ for.body: ; preds = %if.end, %for.body if.end6: ; preds = %for.body, %if.end %result.0 = phi double [ 0.000000e+00, %if.end ], [ %sub, %for.body ] - %call7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i64 0, i64 0), double %result.0), !dbg !39 + %call7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %result.0), !dbg !39 br label %return, !dbg !40 ; CHECK: edge if.end6 -> return probability is 16 / 16 = 100% [HOT edge] @@ -98,36 +98,36 @@ attributes #4 = { nounwind readonly } !llvm.module.flags = !{!25, !42} !llvm.ident = !{!26} -!0 = !{!"0x11\004\00clang version 3.4 (trunk 192896) (llvm/trunk 192895)\001\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./branch.cc] [DW_LANG_C_plus_plus] -!1 = !{!"branch.cc", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 192896) (llvm/trunk 192895)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "branch.cc", directory: ".") !2 = !{i32 0} !3 = !{!4} -!4 = !{!"0x2e\00main\00main\00\004\000\001\000\006\00256\001\004", !1, !5, !6, null, i32 (i32, i8**)* @main, null, null, !12} ; [ DW_TAG_subprogram ] [line 4] [def] [main] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./branch.cc] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "main", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 (i32, i8**)* @main, variables: !12) +!5 = !MDFile(filename: "branch.cc", directory: ".") +!6 = !MDSubroutineType(types: !7) !7 = !{!8, !8, !9} -!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 = !{!"0xf\00\000\0064\0064\000\000", null, null, !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ] -!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char] -!11 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) !12 = !{!13, !14, !15, !17, !18, !21, !23} -!13 = !{!"0x101\00argc\0016777220\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [argc] [line 4] -!14 = !{!"0x101\00argv\0033554436\000", !4, !5, !9} ; [ DW_TAG_arg_variable ] [argv] [line 4] -!15 = !{!"0x100\00result\007\000", !4, !5, !16} ; [ DW_TAG_auto_variable ] [result] [line 7] -!16 = !{!"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] -!17 = !{!"0x100\00limit\008\000", !4, !5, !8} ; [ DW_TAG_auto_variable ] [limit] [line 8] -!18 = !{!"0x100\00s\0010\000", !19, !5, !16} ; [ DW_TAG_auto_variable ] [s] [line 10] -!19 = !{!"0xb\009\000\000", !1, !20} ; [ DW_TAG_lexical_block ] [./branch.cc] -!20 = !{!"0xb\009\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [./branch.cc] -!21 = !{!"0x100\00u\0011\000", !22, !5, !8} ; [ DW_TAG_auto_variable ] [u] [line 11] -!22 = !{!"0xb\0011\000\000", !1, !19} ; [ DW_TAG_lexical_block ] [./branch.cc] -!23 = !{!"0x100\00x\0012\000", !24, !5, !16} ; [ DW_TAG_auto_variable ] [x] [line 12] -!24 = !{!"0xb\0011\000\000", !1, !22} ; [ DW_TAG_lexical_block ] [./branch.cc] +!13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 4, arg: 1, scope: !4, file: !5, type: !8) +!14 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 4, arg: 2, scope: !4, file: !5, type: !9) +!15 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "result", line: 7, scope: !4, file: !5, type: !16) +!16 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) +!17 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "limit", line: 8, scope: !4, file: !5, type: !8) +!18 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "s", line: 10, scope: !19, file: !5, type: !16) +!19 = distinct !MDLexicalBlock(line: 9, column: 0, file: !1, scope: !20) +!20 = distinct !MDLexicalBlock(line: 9, column: 0, file: !1, scope: !4) +!21 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "u", line: 11, scope: !22, file: !5, type: !8) +!22 = distinct !MDLexicalBlock(line: 11, column: 0, file: !1, scope: !19) +!23 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 12, scope: !24, file: !5, type: !16) +!24 = distinct !MDLexicalBlock(line: 11, column: 0, file: !1, scope: !22) !25 = !{i32 2, !"Dwarf Version", i32 4} !26 = !{!"clang version 3.4 (trunk 192896) (llvm/trunk 192895)"} !27 = !MDLocation(line: 4, scope: !4) !28 = !MDLocation(line: 5, scope: !29) -!29 = !{!"0xb\005\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [./branch.cc] +!29 = distinct !MDLexicalBlock(line: 5, column: 0, file: !1, scope: !4) !30 = !MDLocation(line: 8, scope: !4) !31 = !{!32, !32, i64 0} !32 = !{!"any pointer", !33, i64 0} @@ -140,4 +140,4 @@ attributes #4 = { nounwind readonly } !39 = !MDLocation(line: 20, scope: !4) !40 = !MDLocation(line: 21, scope: !4) !41 = !MDLocation(line: 22, scope: !4) -!42 = !{i32 1, !"Debug Info Version", i32 2} +!42 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/SampleProfile/calls.ll b/test/Transforms/SampleProfile/calls.ll index d566609..7576dcb 100644 --- a/test/Transforms/SampleProfile/calls.ll +++ b/test/Transforms/SampleProfile/calls.ll @@ -30,8 +30,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, !dbg !11 - %1 = load i32* %y.addr, align 4, !dbg !11 + %0 = load i32, i32* %x.addr, align 4, !dbg !11 + %1 = load i32, i32* %y.addr, align 4, !dbg !11 %add = add nsw i32 %0, %1, !dbg !11 ret i32 %add, !dbg !11 } @@ -47,7 +47,7 @@ entry: br label %while.cond, !dbg !13 while.cond: ; preds = %if.end, %entry - %0 = load i32* %i, align 4, !dbg !14 + %0 = load i32, i32* %i, align 4, !dbg !14 %inc = add nsw i32 %0, 1, !dbg !14 store i32 %inc, i32* %i, align 4, !dbg !14 %cmp = icmp slt i32 %0, 400000000, !dbg !14 @@ -56,7 +56,7 @@ while.cond: ; preds = %if.end, %entry ; CHECK: edge while.cond -> while.end probability is 1 / 5392 = 0.018546% while.body: ; preds = %while.cond - %1 = load i32* %i, align 4, !dbg !16 + %1 = load i32, i32* %i, align 4, !dbg !16 %cmp1 = icmp ne i32 %1, 100, !dbg !16 br i1 %cmp1, label %if.then, label %if.else, !dbg !16 ; Without discriminator information, the profiler used to think that @@ -68,8 +68,8 @@ while.body: ; preds = %while.cond if.then: ; preds = %while.body - %2 = load i32* %i, align 4, !dbg !18 - %3 = load i32* %s, align 4, !dbg !18 + %2 = load i32, i32* %i, align 4, !dbg !18 + %3 = load i32, i32* %s, align 4, !dbg !18 %call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18 store i32 %call, i32* %s, align 4, !dbg !18 br label %if.end, !dbg !18 @@ -82,8 +82,8 @@ if.end: ; preds = %if.else, %if.then br label %while.cond, !dbg !22 while.end: ; preds = %while.cond - %4 = load i32* %s, align 4, !dbg !24 - %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24 + %4 = load i32, i32* %s, align 4, !dbg !24 + %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24 ret i32 0, !dbg !25 } @@ -92,29 +92,29 @@ declare i32 @printf(i8*, ...) #2 !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !{!"0x11\004\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [./calls.cc] [DW_LANG_C_plus_plus] -!1 = !{!"calls.cc", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "calls.cc", directory: ".") !2 = !{} !3 = !{!4, !7} -!4 = !{!"0x2e\00sum\00sum\00\003\000\001\000\006\00256\000\003", !1, !5, !6, null, i32 (i32, i32)* @_Z3sumii, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [sum] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [./calls.cc] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!7 = !{!"0x2e\00main\00main\00\007\000\001\000\006\00256\000\007", !1, !5, !6, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 7] [def] [main] +!4 = !MDSubprogram(name: "sum", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 (i32, i32)* @_Z3sumii, variables: !2) +!5 = !MDFile(filename: "calls.cc", directory: ".") +!6 = !MDSubroutineType(types: !2) +!7 = !MDSubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) !8 = !{i32 2, !"Dwarf Version", i32 4} -!9 = !{i32 1, !"Debug Info Version", i32 2} +!9 = !{i32 1, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5 "} !11 = !MDLocation(line: 4, scope: !4) !12 = !MDLocation(line: 8, scope: !7) !13 = !MDLocation(line: 9, scope: !7) !14 = !MDLocation(line: 9, scope: !15) -!15 = !{!"0xb\001", !1, !7} ; [ DW_TAG_lexical_block ] [./calls.cc] +!15 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !7) !16 = !MDLocation(line: 10, scope: !17) -!17 = !{!"0xb\0010\000\000", !1, !7} ; [ DW_TAG_lexical_block ] [./calls.cc] +!17 = distinct !MDLexicalBlock(line: 10, column: 0, file: !1, scope: !7) !18 = !MDLocation(line: 10, scope: !19) -!19 = !{!"0xb\001", !1, !17} ; [ DW_TAG_lexical_block ] [./calls.cc] +!19 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !17) !20 = !MDLocation(line: 10, scope: !21) -!21 = !{!"0xb\002", !1, !17} ; [ DW_TAG_lexical_block ] [./calls.cc] +!21 = !MDLexicalBlockFile(discriminator: 2, file: !1, scope: !17) !22 = !MDLocation(line: 10, scope: !23) -!23 = !{!"0xb\003", !1, !17} ; [ DW_TAG_lexical_block ] [./calls.cc] +!23 = !MDLexicalBlockFile(discriminator: 3, file: !1, scope: !17) !24 = !MDLocation(line: 11, scope: !7) !25 = !MDLocation(line: 12, scope: !7) diff --git a/test/Transforms/SampleProfile/discriminator.ll b/test/Transforms/SampleProfile/discriminator.ll index cafc69d..1f3a12f 100644 --- a/test/Transforms/SampleProfile/discriminator.ll +++ b/test/Transforms/SampleProfile/discriminator.ll @@ -31,33 +31,33 @@ entry: br label %while.cond, !dbg !11 while.cond: ; preds = %if.end, %entry - %0 = load i32* %i.addr, align 4, !dbg !12 + %0 = load i32, i32* %i.addr, align 4, !dbg !12 %cmp = icmp slt i32 %0, 100, !dbg !12 br i1 %cmp, label %while.body, label %while.end, !dbg !12 ; CHECK: edge while.cond -> while.body probability is 100 / 101 = 99.0099% [HOT edge] ; CHECK: edge while.cond -> while.end probability is 1 / 101 = 0.990099% while.body: ; preds = %while.cond - %1 = load i32* %i.addr, align 4, !dbg !14 + %1 = load i32, i32* %i.addr, align 4, !dbg !14 %cmp1 = icmp slt i32 %1, 50, !dbg !14 br i1 %cmp1, label %if.then, label %if.end, !dbg !14 ; CHECK: edge while.body -> if.then probability is 5 / 100 = 5% ; CHECK: edge while.body -> if.end probability is 95 / 100 = 95% [HOT edge] if.then: ; preds = %while.body - %2 = load i32* %x, align 4, !dbg !17 + %2 = load i32, i32* %x, align 4, !dbg !17 %dec = add nsw i32 %2, -1, !dbg !17 store i32 %dec, i32* %x, align 4, !dbg !17 br label %if.end, !dbg !17 if.end: ; preds = %if.then, %while.body - %3 = load i32* %i.addr, align 4, !dbg !19 + %3 = load i32, i32* %i.addr, align 4, !dbg !19 %inc = add nsw i32 %3, 1, !dbg !19 store i32 %inc, i32* %i.addr, align 4, !dbg !19 br label %while.cond, !dbg !20 while.end: ; preds = %while.cond - %4 = load i32* %x, align 4, !dbg !21 + %4 = load i32, i32* %x, align 4, !dbg !21 ret i32 %4, !dbg !21 } @@ -66,25 +66,25 @@ while.end: ; preds = %while.cond !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !{!"0x11\0012\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [discriminator.c] [DW_LANG_C99] -!1 = !{!"discriminator.c", !"."} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "discriminator.c", directory: ".") !2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, i32 (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [discriminator.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!5 = !MDFile(filename: "discriminator.c", directory: ".") +!6 = !MDSubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 4} -!8 = !{i32 1, !"Debug Info Version", i32 2} +!8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5 "} !10 = !MDLocation(line: 2, scope: !4) !11 = !MDLocation(line: 3, scope: !4) !12 = !MDLocation(line: 3, scope: !13) -!13 = !{!"0xb\001", !1, !4} ; [ DW_TAG_lexical_block ] [discriminator.c] +!13 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !4) !14 = !MDLocation(line: 4, scope: !15) -!15 = !{!"0xb\004\000\001", !1, !16} ; [ DW_TAG_lexical_block ] [discriminator.c] -!16 = !{!"0xb\003\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [discriminator.c] +!15 = distinct !MDLexicalBlock(line: 4, column: 0, file: !1, scope: !16) +!16 = distinct !MDLexicalBlock(line: 3, column: 0, file: !1, scope: !4) !17 = !MDLocation(line: 4, scope: !18) -!18 = !{!"0xb\001", !1, !15} ; [ DW_TAG_lexical_block ] [discriminator.c] +!18 = !MDLexicalBlockFile(discriminator: 1, file: !1, scope: !15) !19 = !MDLocation(line: 5, scope: !16) !20 = !MDLocation(line: 6, scope: !16) !21 = !MDLocation(line: 7, scope: !4) diff --git a/test/Transforms/SampleProfile/fnptr.ll b/test/Transforms/SampleProfile/fnptr.ll index 096033b..07c3c75 100644 --- a/test/Transforms/SampleProfile/fnptr.ll +++ b/test/Transforms/SampleProfile/fnptr.ll @@ -114,7 +114,7 @@ for.inc12: ; preds = %for.inc for.end14: ; preds = %for.inc12 %S.2.lcssa.lcssa = phi double [ %S.2.lcssa, %for.inc12 ] - %call15 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8]* @.str, i64 0, i64 0), double %S.2.lcssa.lcssa), !dbg !24 + %call15 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %S.2.lcssa.lcssa), !dbg !24 ret i32 0, !dbg !25 } @@ -127,20 +127,20 @@ declare i32 @printf(i8* nocapture readonly, ...) #1 !llvm.module.flags = !{!0} !llvm.ident = !{!1} -!0 = !{i32 2, !"Debug Info Version", i32 2} +!0 = !{i32 2, !"Debug Info Version", i32 3} !1 = !{!"clang version 3.6.0 "} !2 = !MDLocation(line: 9, column: 3, scope: !3) -!3 = !{!"0x2e\00foo\00foo\00\008\000\001\000\000\00256\001\008", !4, !5, !6, null, double (i32)* @_Z3fooi, null, null, !7} ; [ DW_TAG_subprogram ] [line 8] [def] [foo] -!4 = !{!"fnptr.cc", !"."} -!5 = !{!"0x29", !4} ; [ DW_TAG_file_type ] [./fnptr.cc] -!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 ] +!3 = !MDSubprogram(name: "foo", line: 8, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 8, file: !4, scope: !5, type: !6, function: double (i32)* @_Z3fooi, variables: !7) +!4 = !MDFile(filename: "fnptr.cc", directory: ".") +!5 = !MDFile(filename: "fnptr.cc", directory: ".") +!6 = !MDSubroutineType(types: !7) !7 = !{} !8 = !MDLocation(line: 9, column: 14, scope: !3) !9 = !MDLocation(line: 13, column: 3, scope: !10) -!10 = !{!"0x2e\00bar\00bar\00\0012\000\001\000\000\00256\001\0012", !4, !5, !6, null, double (i32)* @_Z3bari, null, null, !7} ; [ DW_TAG_subprogram ] [line 12] [def] [bar] +!10 = !MDSubprogram(name: "bar", line: 12, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !4, scope: !5, type: !6, function: double (i32)* @_Z3bari, variables: !7) !11 = !MDLocation(line: 13, column: 14, scope: !10) !12 = !MDLocation(line: 19, column: 3, scope: !13) -!13 = !{!"0x2e\00main\00main\00\0016\000\001\000\000\00256\001\0016", !4, !5, !6, null, i32 ()* @main, null, null, !7} ; [ DW_TAG_subprogram ] [line 16] [def] [main] +!13 = !MDSubprogram(name: "main", line: 16, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 16, file: !4, scope: !5, type: !6, function: i32 ()* @main, variables: !7) !14 = !MDLocation(line: 20, column: 5, scope: !13) !15 = !MDLocation(line: 21, column: 15, scope: !13) !16 = !MDLocation(line: 22, column: 11, scope: !13) diff --git a/test/Transforms/SampleProfile/propagate.ll b/test/Transforms/SampleProfile/propagate.ll index 594645f..fc9dedb 100644 --- a/test/Transforms/SampleProfile/propagate.ll +++ b/test/Transforms/SampleProfile/propagate.ll @@ -51,14 +51,14 @@ entry: store i32 %x, i32* %x.addr, align 4 store i32 %y, i32* %y.addr, align 4 store i64 %N, i64* %N.addr, align 8 - %0 = load i32* %x.addr, align 4, !dbg !11 - %1 = load i32* %y.addr, align 4, !dbg !11 + %0 = load i32, i32* %x.addr, align 4, !dbg !11 + %1 = load i32, i32* %y.addr, align 4, !dbg !11 %cmp = icmp slt i32 %0, %1, !dbg !11 br i1 %cmp, label %if.then, label %if.else, !dbg !11 if.then: ; preds = %entry - %2 = load i32* %y.addr, align 4, !dbg !13 - %3 = load i32* %x.addr, align 4, !dbg !13 + %2 = load i32, i32* %y.addr, align 4, !dbg !13 + %3 = load i32, i32* %x.addr, align 4, !dbg !13 %sub = sub nsw i32 %2, %3, !dbg !13 %conv = sext i32 %sub to i64, !dbg !13 store i64 %conv, i64* %retval, !dbg !13 @@ -69,16 +69,16 @@ if.else: ; preds = %entry br label %for.cond, !dbg !15 for.cond: ; preds = %for.inc16, %if.else - %4 = load i64* %i, align 8, !dbg !15 - %5 = load i64* %N.addr, align 8, !dbg !15 + %4 = load i64, i64* %i, align 8, !dbg !15 + %5 = load i64, i64* %N.addr, align 8, !dbg !15 %cmp1 = icmp slt i64 %4, %5, !dbg !15 br i1 %cmp1, label %for.body, label %for.end18, !dbg !15 ; CHECK: edge for.cond -> for.body probability is 10 / 11 = 90.9091% [HOT edge] ; CHECK: edge for.cond -> for.end18 probability is 1 / 11 = 9.09091% for.body: ; preds = %for.cond - %6 = load i64* %i, align 8, !dbg !18 - %7 = load i64* %N.addr, align 8, !dbg !18 + %6 = load i64, i64* %i, align 8, !dbg !18 + %7 = load i64, i64* %N.addr, align 8, !dbg !18 %div = sdiv i64 %7, 3, !dbg !18 %cmp2 = icmp sgt i64 %6, %div, !dbg !18 br i1 %cmp2, label %if.then3, label %if.end, !dbg !18 @@ -86,14 +86,14 @@ for.body: ; preds = %for.cond ; CHECK: edge for.body -> if.end probability is 4 / 5 = 80% if.then3: ; preds = %for.body - %8 = load i32* %x.addr, align 4, !dbg !21 + %8 = load i32, i32* %x.addr, align 4, !dbg !21 %dec = add nsw i32 %8, -1, !dbg !21 store i32 %dec, i32* %x.addr, align 4, !dbg !21 br label %if.end, !dbg !21 if.end: ; preds = %if.then3, %for.body - %9 = load i64* %i, align 8, !dbg !22 - %10 = load i64* %N.addr, align 8, !dbg !22 + %9 = load i64, i64* %i, align 8, !dbg !22 + %10 = load i64, i64* %N.addr, align 8, !dbg !22 %div4 = sdiv i64 %10, 4, !dbg !22 %cmp5 = icmp sgt i64 %9, %div4, !dbg !22 br i1 %cmp5, label %if.then6, label %if.else7, !dbg !22 @@ -101,10 +101,10 @@ if.end: ; preds = %if.then3, %for.body ; CHECK: edge if.end -> if.else7 probability is 6339 / 6342 = 99.9527% [HOT edge] if.then6: ; preds = %if.end - %11 = load i32* %y.addr, align 4, !dbg !24 + %11 = load i32, i32* %y.addr, align 4, !dbg !24 %inc = add nsw i32 %11, 1, !dbg !24 store i32 %inc, i32* %y.addr, align 4, !dbg !24 - %12 = load i32* %x.addr, align 4, !dbg !26 + %12 = load i32, i32* %x.addr, align 4, !dbg !26 %add = add nsw i32 %12, 3, !dbg !26 store i32 %add, i32* %x.addr, align 4, !dbg !26 br label %if.end15, !dbg !27 @@ -114,26 +114,26 @@ if.else7: ; preds = %if.end br label %for.cond8, !dbg !28 for.cond8: ; preds = %for.inc, %if.else7 - %13 = load i32* %j, align 4, !dbg !28 + %13 = load i32, i32* %j, align 4, !dbg !28 %conv9 = zext i32 %13 to i64, !dbg !28 - %14 = load i64* %i, align 8, !dbg !28 + %14 = load i64, i64* %i, align 8, !dbg !28 %cmp10 = icmp slt i64 %conv9, %14, !dbg !28 br i1 %cmp10, label %for.body11, label %for.end, !dbg !28 ; CHECK: edge for.cond8 -> for.body11 probability is 16191 / 16192 = 99.9938% [HOT edge] ; CHECK: edge for.cond8 -> for.end probability is 1 / 16192 = 0.00617589% for.body11: ; preds = %for.cond8 - %15 = load i32* %j, align 4, !dbg !31 - %16 = load i32* %x.addr, align 4, !dbg !31 + %15 = load i32, i32* %j, align 4, !dbg !31 + %16 = load i32, i32* %x.addr, align 4, !dbg !31 %add12 = add i32 %16, %15, !dbg !31 store i32 %add12, i32* %x.addr, align 4, !dbg !31 - %17 = load i32* %y.addr, align 4, !dbg !33 + %17 = load i32, i32* %y.addr, align 4, !dbg !33 %sub13 = sub nsw i32 %17, 3, !dbg !33 store i32 %sub13, i32* %y.addr, align 4, !dbg !33 br label %for.inc, !dbg !34 for.inc: ; preds = %for.body11 - %18 = load i32* %j, align 4, !dbg !28 + %18 = load i32, i32* %j, align 4, !dbg !28 %inc14 = add i32 %18, 1, !dbg !28 store i32 %inc14, i32* %j, align 4, !dbg !28 br label %for.cond8, !dbg !28 @@ -145,7 +145,7 @@ if.end15: ; preds = %for.end, %if.then6 br label %for.inc16, !dbg !35 for.inc16: ; preds = %if.end15 - %19 = load i64* %i, align 8, !dbg !15 + %19 = load i64, i64* %i, align 8, !dbg !15 %inc17 = add nsw i64 %19, 1, !dbg !15 store i64 %inc17, i64* %i, align 8, !dbg !15 br label %for.cond, !dbg !15 @@ -154,15 +154,15 @@ for.end18: ; preds = %for.cond br label %if.end19 if.end19: ; preds = %for.end18 - %20 = load i32* %y.addr, align 4, !dbg !36 - %21 = load i32* %x.addr, align 4, !dbg !36 + %20 = load i32, i32* %y.addr, align 4, !dbg !36 + %21 = load i32, i32* %x.addr, align 4, !dbg !36 %mul = mul nsw i32 %20, %21, !dbg !36 %conv20 = sext i32 %mul to i64, !dbg !36 store i64 %conv20, i64* %retval, !dbg !36 br label %return, !dbg !36 return: ; preds = %if.end19, %if.then - %22 = load i64* %retval, !dbg !37 + %22 = load i64, i64* %retval, !dbg !37 ret i64 %22, !dbg !37 } @@ -177,14 +177,14 @@ entry: store i32 5678, i32* %x, align 4, !dbg !38 store i32 1234, i32* %y, align 4, !dbg !39 store i64 999999, i64* %N, align 8, !dbg !40 - %0 = load i32* %x, align 4, !dbg !41 - %1 = load i32* %y, align 4, !dbg !41 - %2 = load i64* %N, align 8, !dbg !41 - %3 = load i32* %x, align 4, !dbg !41 - %4 = load i32* %y, align 4, !dbg !41 - %5 = load i64* %N, align 8, !dbg !41 + %0 = load i32, i32* %x, align 4, !dbg !41 + %1 = load i32, i32* %y, align 4, !dbg !41 + %2 = load i64, i64* %N, align 8, !dbg !41 + %3 = load i32, i32* %x, align 4, !dbg !41 + %4 = load i32, i32* %y, align 4, !dbg !41 + %5 = load i64, i64* %N, align 8, !dbg !41 %call = call i64 @_Z3fooiil(i32 %3, i32 %4, i64 %5), !dbg !41 - %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([24 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i64 %2, i64 %call), !dbg !41 + %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i64 %2, i64 %call), !dbg !41 ret i32 0, !dbg !42 } @@ -198,39 +198,39 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !{!"0x11\004\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [propagate.cc] [DW_LANG_C_plus_plus] -!1 = !{!"propagate.cc", !"."} -!2 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "propagate.cc", directory: ".") +!2 = !{} !3 = !{!4, !7} -!4 = !{!"0x2e\00foo\00foo\00\003\000\001\000\006\00256\000\003", !1, !5, !6, null, i64 (i32, i32, i64)* @_Z3fooiil, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [foo] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [propagate.cc] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!7 = !{!"0x2e\00main\00main\00\0024\000\001\000\006\00256\000\0024", !1, !5, !6, null, i32 ()* @main, null, null, !2} ; [ DW_TAG_subprogram ] [line 24] [def] [main] +!4 = !MDSubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i64 (i32, i32, i64)* @_Z3fooiil, variables: !2) +!5 = !MDFile(filename: "propagate.cc", directory: ".") +!6 = !MDSubroutineType(types: !{null}) +!7 = !MDSubprogram(name: "main", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) !8 = !{i32 2, !"Dwarf Version", i32 4} -!9 = !{i32 1, !"Debug Info Version", i32 2} +!9 = !{i32 1, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5 "} !11 = !MDLocation(line: 4, scope: !12) -!12 = !{!"0xb\004\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [propagate.cc] +!12 = distinct !MDLexicalBlock(line: 4, column: 0, file: !1, scope: !4) !13 = !MDLocation(line: 5, scope: !14) -!14 = !{!"0xb\004\000\000", !1, !12} ; [ DW_TAG_lexical_block ] [propagate.cc] +!14 = distinct !MDLexicalBlock(line: 4, column: 0, file: !1, scope: !12) !15 = !MDLocation(line: 7, scope: !16) -!16 = !{!"0xb\007\000\000", !1, !17} ; [ DW_TAG_lexical_block ] [propagate.cc] -!17 = !{!"0xb\006\000\000", !1, !12} ; [ DW_TAG_lexical_block ] [propagate.cc] +!16 = distinct !MDLexicalBlock(line: 7, column: 0, file: !1, scope: !17) +!17 = distinct !MDLexicalBlock(line: 6, column: 0, file: !1, scope: !12) !18 = !MDLocation(line: 8, scope: !19) -!19 = !{!"0xb\008\000\000", !1, !20} ; [ DW_TAG_lexical_block ] [propagate.cc] -!20 = !{!"0xb\007\000\000", !1, !16} ; [ DW_TAG_lexical_block ] [propagate.cc] +!19 = distinct !MDLexicalBlock(line: 8, column: 0, file: !1, scope: !20) +!20 = distinct !MDLexicalBlock(line: 7, column: 0, file: !1, scope: !16) !21 = !MDLocation(line: 9, scope: !19) !22 = !MDLocation(line: 10, scope: !23) -!23 = !{!"0xb\0010\000\000", !1, !20} ; [ DW_TAG_lexical_block ] [propagate.cc] +!23 = distinct !MDLexicalBlock(line: 10, column: 0, file: !1, scope: !20) !24 = !MDLocation(line: 11, scope: !25) -!25 = !{!"0xb\0010\000\000", !1, !23} ; [ DW_TAG_lexical_block ] [propagate.cc] +!25 = distinct !MDLexicalBlock(line: 10, column: 0, file: !1, scope: !23) !26 = !MDLocation(line: 12, scope: !25) !27 = !MDLocation(line: 13, scope: !25) !28 = !MDLocation(line: 14, scope: !29) -!29 = !{!"0xb\0014\000\000", !1, !30} ; [ DW_TAG_lexical_block ] [propagate.cc] -!30 = !{!"0xb\0013\000\000", !1, !23} ; [ DW_TAG_lexical_block ] [propagate.cc] +!29 = distinct !MDLexicalBlock(line: 14, column: 0, file: !1, scope: !30) +!30 = distinct !MDLexicalBlock(line: 13, column: 0, file: !1, scope: !23) !31 = !MDLocation(line: 15, scope: !32) -!32 = !{!"0xb\0014\000\000", !1, !29} ; [ DW_TAG_lexical_block ] [propagate.cc] +!32 = distinct !MDLexicalBlock(line: 14, column: 0, file: !1, scope: !29) !33 = !MDLocation(line: 16, scope: !32) !34 = !MDLocation(line: 17, scope: !32) !35 = !MDLocation(line: 19, scope: !20) diff --git a/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll b/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll index 7116199..336c0a9 100644 --- a/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll +++ b/test/Transforms/ScalarRepl/2003-05-29-ArrayFail.ll @@ -5,9 +5,9 @@ target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i32 @test() nounwind { %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1] - %Y = getelementptr [4 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=1] + %Y = getelementptr [4 x i32], [4 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=1] ; Must preserve arrayness! - %Z = getelementptr i32* %Y, i64 1 ; <i32*> [#uses=1] - %A = load i32* %Z ; <i32> [#uses=1] + %Z = getelementptr i32, i32* %Y, i64 1 ; <i32*> [#uses=1] + %A = load i32, i32* %Z ; <i32> [#uses=1] ret i32 %A } diff --git a/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll b/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll index 3f28cb1..c5ca428 100644 --- a/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll +++ b/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll @@ -4,8 +4,8 @@ define i8* @test() { %A = alloca [30 x i8] ; <[30 x i8]*> [#uses=1] - %B = getelementptr [30 x i8]* %A, i64 0, i64 0 ; <i8*> [#uses=2] - %C = getelementptr i8* %B, i64 1 ; <i8*> [#uses=1] + %B = getelementptr [30 x i8], [30 x i8]* %A, i64 0, i64 0 ; <i8*> [#uses=2] + %C = getelementptr i8, i8* %B, i64 1 ; <i8*> [#uses=1] store i8 0, i8* %B ret i8* %C } diff --git a/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll b/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll index 77c7b54..ce65273 100644 --- a/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll +++ b/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll @@ -7,9 +7,9 @@ declare void @.iter_2(i32 (i8*)*, i8*) define i32 @main() { %d = alloca %T ; <{ [80 x i8], i32, i32 }*> [#uses=2] - %tmp.0 = getelementptr %T* %d, i64 0, i32 2 ; <i32*> [#uses=1] + %tmp.0 = getelementptr %T, %T* %d, i64 0, i32 2 ; <i32*> [#uses=1] store i32 0, i32* %tmp.0 - %tmp.1 = getelementptr %T* %d, i64 0, i32 0, i64 0 ; <i8*> [#uses=1] + %tmp.1 = getelementptr %T, %T* %d, i64 0, i32 0, i64 0 ; <i8*> [#uses=1] call void @.iter_2( i32 (i8*)* @.callback_1, i8* %tmp.1 ) ret i32 0 } diff --git a/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll b/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll index 99c9fb9..2701fda 100644 --- a/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll +++ b/test/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll @@ -5,14 +5,14 @@ define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind { %vsiidx = alloca [2 x <4 x i32>], align 16 ; <[2 x <4 x i32>]*> [#uses=3] %tmp = call <4 x i32> @llvm.x86.sse2.cvttps2dq( <4 x float> %v0 ) ; <<4 x i32>> [#uses=2] %tmp.upgrd.1 = bitcast <4 x i32> %tmp to <2 x i64> ; <<2 x i64>> [#uses=0] - %tmp.upgrd.2 = getelementptr [2 x <4 x i32>]* %vsiidx, i32 0, i32 0 ; <<4 x i32>*> [#uses=1] + %tmp.upgrd.2 = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* %vsiidx, i32 0, i32 0 ; <<4 x i32>*> [#uses=1] store <4 x i32> %tmp, <4 x i32>* %tmp.upgrd.2 %tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq( <4 x float> %v1 ) ; <<4 x i32>> [#uses=2] %tmp10.upgrd.3 = bitcast <4 x i32> %tmp10 to <2 x i64> ; <<2 x i64>> [#uses=0] - %tmp14 = getelementptr [2 x <4 x i32>]* %vsiidx, i32 0, i32 1 ; <<4 x i32>*> [#uses=1] + %tmp14 = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* %vsiidx, i32 0, i32 1 ; <<4 x i32>*> [#uses=1] store <4 x i32> %tmp10, <4 x i32>* %tmp14 - %tmp15 = getelementptr [2 x <4 x i32>]* %vsiidx, i32 0, i32 0, i32 4 ; <i32*> [#uses=1] - %tmp.upgrd.4 = load i32* %tmp15 ; <i32> [#uses=1] + %tmp15 = getelementptr [2 x <4 x i32>], [2 x <4 x i32>]* %vsiidx, i32 0, i32 0, i32 4 ; <i32*> [#uses=1] + %tmp.upgrd.4 = load i32, i32* %tmp15 ; <i32> [#uses=1] ret i32 %tmp.upgrd.4 } diff --git a/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll b/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll index cf96c4c..966b179 100644 --- a/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll +++ b/test/Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll @@ -11,12 +11,12 @@ target triple = "i686-apple-darwin8" define void @_Z4testP9UnionTypePS0_(%struct.UnionType* %p, %struct.UnionType** %pointerToUnion) { entry: %tmp = alloca %struct.UnionType, align 8 - %tmp2 = getelementptr %struct.UnionType* %tmp, i32 0, i32 0, i32 0 - %tmp13 = getelementptr %struct.UnionType* %p, i32 0, i32 0, i32 0 + %tmp2 = getelementptr %struct.UnionType, %struct.UnionType* %tmp, i32 0, i32 0, i32 0 + %tmp13 = getelementptr %struct.UnionType, %struct.UnionType* %p, i32 0, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp2, i8* %tmp13, i32 8, i32 0, i1 false) - %tmp5 = load %struct.UnionType** %pointerToUnion - %tmp56 = getelementptr %struct.UnionType* %tmp5, i32 0, i32 0, i32 0 - %tmp7 = getelementptr %struct.UnionType* %tmp, i32 0, i32 0, i32 0 + %tmp5 = load %struct.UnionType*, %struct.UnionType** %pointerToUnion + %tmp56 = getelementptr %struct.UnionType, %struct.UnionType* %tmp5, i32 0, i32 0, i32 0 + %tmp7 = getelementptr %struct.UnionType, %struct.UnionType* %tmp, i32 0, i32 0, i32 0 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp56, i8* %tmp7, i32 8, i32 0, i1 false) ret void } diff --git a/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll b/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll index 48abffe..28f503a 100644 --- a/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll +++ b/test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll @@ -1,5 +1,11 @@ ; RUN: opt < %s -scalarrepl -S | not grep shr +; FIXME: I think this test is no longer valid. +; It was working because SROA was aborting when +; no datalayout was supplied +; XFAIL: * + + %struct.S = type { i16 } define zeroext i1 @f(i16 signext %b) { @@ -10,21 +16,21 @@ entry: %tmp = alloca i32 ; <i32*> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i16 %b, i16* %b_addr - %tmp1 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1] - %tmp2 = load i16* %b_addr, align 2 ; <i16> [#uses=1] + %tmp1 = getelementptr %struct.S, %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1] + %tmp2 = load i16, i16* %b_addr, align 2 ; <i16> [#uses=1] store i16 %tmp2, i16* %tmp1, align 2 - %tmp3 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1] + %tmp3 = getelementptr %struct.S, %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1] %tmp34 = bitcast i16* %tmp3 to [2 x i1]* ; <[2 x i1]*> [#uses=1] - %tmp5 = getelementptr [2 x i1]* %tmp34, i32 0, i32 1 ; <i1*> [#uses=1] - %tmp6 = load i1* %tmp5, align 1 ; <i1> [#uses=1] + %tmp5 = getelementptr [2 x i1], [2 x i1]* %tmp34, i32 0, i32 1 ; <i1*> [#uses=1] + %tmp6 = load i1, i1* %tmp5, align 1 ; <i1> [#uses=1] %tmp67 = zext i1 %tmp6 to i32 ; <i32> [#uses=1] store i32 %tmp67, i32* %tmp, align 4 - %tmp8 = load i32* %tmp, align 4 ; <i32> [#uses=1] + %tmp8 = load i32, i32* %tmp, align 4 ; <i32> [#uses=1] store i32 %tmp8, i32* %retval, align 4 br label %return return: ; preds = %entry - %retval9 = load i32* %retval ; <i32> [#uses=1] + %retval9 = load i32, i32* %retval ; <i32> [#uses=1] %retval910 = trunc i32 %retval9 to i1 ; <i1> [#uses=1] ret i1 %retval910 } diff --git a/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll b/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll index a53f3de..99366b3 100644 --- a/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll +++ b/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll @@ -10,10 +10,10 @@ entry: %T3 = bitcast [1 x %struct.T]* %s to i32* store i32 -61184, i32* %T3 - %tmp16 = getelementptr [1 x %struct.T]* %s, i32 0, i32 0 ; <%struct.T*> [#uses=1] - %tmp17 = getelementptr %struct.T* %tmp16, i32 0, i32 1 ; <[3 x i8]*> [#uses=1] + %tmp16 = getelementptr [1 x %struct.T], [1 x %struct.T]* %s, i32 0, i32 0 ; <%struct.T*> [#uses=1] + %tmp17 = getelementptr %struct.T, %struct.T* %tmp16, i32 0, i32 1 ; <[3 x i8]*> [#uses=1] %tmp1718 = bitcast [3 x i8]* %tmp17 to i32* ; <i32*> [#uses=1] - %tmp19 = load i32* %tmp1718, align 4 ; <i32> [#uses=1] + %tmp19 = load i32, i32* %tmp1718, align 4 ; <i32> [#uses=1] %mask = and i32 %tmp19, 16777215 ; <i32> [#uses=2] %mask2324 = trunc i32 %mask to i8 ; <i8> [#uses=1] ret i8 %mask2324 diff --git a/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll b/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll index 7f8ef83..f37b6529 100644 --- a/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll +++ b/test/Transforms/ScalarRepl/2008-02-28-SubElementExtractCrash.ll @@ -6,11 +6,11 @@ target triple = "i686-apple-darwin8" define i32 @main(i32 %argc, i8** %argv) { entry: %c = alloca %struct..0anon ; <%struct..0anon*> [#uses=2] - %tmp2 = getelementptr %struct..0anon* %c, i32 0, i32 0 ; <<1 x i64>*> [#uses=1] + %tmp2 = getelementptr %struct..0anon, %struct..0anon* %c, i32 0, i32 0 ; <<1 x i64>*> [#uses=1] store <1 x i64> zeroinitializer, <1 x i64>* %tmp2, align 8 - %tmp7 = getelementptr %struct..0anon* %c, i32 0, i32 0 ; <<1 x i64>*> [#uses=1] + %tmp7 = getelementptr %struct..0anon, %struct..0anon* %c, i32 0, i32 0 ; <<1 x i64>*> [#uses=1] %tmp78 = bitcast <1 x i64>* %tmp7 to [2 x i32]* ; <[2 x i32]*> [#uses=1] - %tmp9 = getelementptr [2 x i32]* %tmp78, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp10 = load i32* %tmp9, align 4 ; <i32> [#uses=0] + %tmp9 = getelementptr [2 x i32], [2 x i32]* %tmp78, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp10 = load i32, i32* %tmp9, align 4 ; <i32> [#uses=0] unreachable } diff --git a/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll b/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll index ce70a1b..d1f3312 100644 --- a/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll +++ b/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll @@ -14,8 +14,8 @@ define i32 @foo() { ; And store it store { i32, i32 } %res2, { i32, i32 }* %target ; Actually use %target, so it doesn't get removed altogether - %ptr = getelementptr { i32, i32 }* %target, i32 0, i32 0 - %val = load i32* %ptr + %ptr = getelementptr { i32, i32 }, { i32, i32 }* %target, i32 0, i32 0 + %val = load i32, i32* %ptr ret i32 %val } @@ -27,7 +27,7 @@ define i32 @bar() { ; And store it store [ 2 x i32 ] %res2, [ 2 x i32 ]* %target ; Actually use %target, so it doesn't get removed altogether - %ptr = getelementptr [ 2 x i32 ]* %target, i32 0, i32 0 - %val = load i32* %ptr + %ptr = getelementptr [ 2 x i32 ], [ 2 x i32 ]* %target, i32 0, i32 0 + %val = load i32, i32* %ptr ret i32 %val } diff --git a/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll b/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll index b2a9d43..c0ff25f 100644 --- a/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll +++ b/test/Transforms/ScalarRepl/2008-08-22-out-of-range-array-promote.ll @@ -13,8 +13,8 @@ entry: %r1 = bitcast %struct.x* %r to i8* %s2 = bitcast %struct.x* %s to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %r1, i8* %s2, i32 12, i32 8, i1 false) - %1 = getelementptr %struct.x* %r, i32 0, i32 0, i32 1 - %2 = load i32* %1, align 4 + %1 = getelementptr %struct.x, %struct.x* %r, i32 0, i32 0, i32 1 + %2 = load i32, i32* %1, align 4 ret i32 %2 } diff --git a/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll b/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll index 7554b7f..16d9108 100644 --- a/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll +++ b/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll @@ -12,11 +12,11 @@ target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define void @main(%struct.two* %D, i16 %V) { entry: %S = alloca %struct.two - %S.2 = getelementptr %struct.two* %S, i32 0, i32 1 + %S.2 = getelementptr %struct.two, %struct.two* %S, i32 0, i32 1 store i16 %V, i16* %S.2 ; This gep is effectively a bitcast to i8*, but is sometimes generated ; because the type of the first element in %struct.two is i8. - %tmpS = getelementptr %struct.two* %S, i32 0, i32 0, i32 0 + %tmpS = getelementptr %struct.two, %struct.two* %S, i32 0, i32 0, i32 0 %tmpD = bitcast %struct.two* %D to i8* call void @llvm.memmove.p0i8.p0i8.i32(i8* %tmpD, i8* %tmpS, i32 4, i32 1, i1 false) ret void diff --git a/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll b/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll index 3c8a364..f0af1ca 100644 --- a/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll +++ b/test/Transforms/ScalarRepl/2009-02-02-ScalarPromoteOutOfRange.ll @@ -6,11 +6,11 @@ target triple = "i386-pc-linux-gnu" define i32 @f(i32 %x, i32 %y) { %instance = alloca %pair - %first = getelementptr %pair* %instance, i32 0, i32 0 + %first = getelementptr %pair, %pair* %instance, i32 0, i32 0 %cast = bitcast [1 x i32]* %first to i32* store i32 %x, i32* %cast - %second = getelementptr %pair* %instance, i32 0, i32 1 + %second = getelementptr %pair, %pair* %instance, i32 0, i32 1 store i32 %y, i32* %second - %v = load i32* %cast + %v = load i32, i32* %cast ret i32 %v } diff --git a/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll b/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll index 67228a7..56375ff 100644 --- a/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll +++ b/test/Transforms/ScalarRepl/2009-02-05-LoadFCA.ll @@ -9,7 +9,7 @@ entry: %tmp = alloca { i64, i64 }, align 8 ; <{ i64, i64 }*> [#uses=2] store { i64, i64 } %0, { i64, i64 }* %tmp %1 = bitcast { i64, i64 }* %tmp to %struct.anon* ; <%struct.anon*> [#uses=1] - %2 = load %struct.anon* %1, align 8 ; <%struct.anon> [#uses=1] + %2 = load %struct.anon, %struct.anon* %1, align 8 ; <%struct.anon> [#uses=1] %tmp3 = extractvalue %struct.anon %2, 0 ret i32 %tmp3 } diff --git a/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll b/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll index a4182d4..025578c 100644 --- a/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll +++ b/test/Transforms/ScalarRepl/2009-03-04-MemCpyAlign.ll @@ -9,7 +9,7 @@ target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define void @f(i8* %p) nounwind { entry: %s = alloca %struct.st, align 4 ; <%struct.st*> [#uses=2] - %0 = getelementptr %struct.st* %s, i32 0, i32 0 ; <i16*> [#uses=1] + %0 = getelementptr %struct.st, %struct.st* %s, i32 0, i32 0 ; <i16*> [#uses=1] store i16 1, i16* %0, align 4 %s1 = bitcast %struct.st* %s to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %s1, i32 2, i32 1, i1 false) diff --git a/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll b/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll index 1f92191..d1cc424 100644 --- a/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll +++ b/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll @@ -25,37 +25,37 @@ entry: %tmp2 = alloca %struct.int16x8x2_t %0 = alloca %struct.int16x8x2_t %"alloca point" = bitcast i32 0 to i32 - %1 = getelementptr inbounds %struct.int16x8_t* %tmp_addr, i32 0, i32 0 + %1 = getelementptr inbounds %struct.int16x8_t, %struct.int16x8_t* %tmp_addr, i32 0, i32 0 store <8 x i16> %tmp.0, <8 x i16>* %1 store %struct.int16x8x2_t* %dst, %struct.int16x8x2_t** %dst_addr - %2 = getelementptr inbounds %struct.int16x8_t* %__ax, i32 0, i32 0 - %3 = getelementptr inbounds %struct.int16x8_t* %tmp_addr, i32 0, i32 0 - %4 = load <8 x i16>* %3, align 16 + %2 = getelementptr inbounds %struct.int16x8_t, %struct.int16x8_t* %__ax, i32 0, i32 0 + %3 = getelementptr inbounds %struct.int16x8_t, %struct.int16x8_t* %tmp_addr, i32 0, i32 0 + %4 = load <8 x i16>, <8 x i16>* %3, align 16 store <8 x i16> %4, <8 x i16>* %2, align 16 - %5 = getelementptr inbounds %struct.int16x8_t* %__bx, i32 0, i32 0 - %6 = getelementptr inbounds %struct.int16x8_t* %tmp_addr, i32 0, i32 0 - %7 = load <8 x i16>* %6, align 16 + %5 = getelementptr inbounds %struct.int16x8_t, %struct.int16x8_t* %__bx, i32 0, i32 0 + %6 = getelementptr inbounds %struct.int16x8_t, %struct.int16x8_t* %tmp_addr, i32 0, i32 0 + %7 = load <8 x i16>, <8 x i16>* %6, align 16 store <8 x i16> %7, <8 x i16>* %5, align 16 - %8 = getelementptr inbounds %struct.int16x8_t* %__ax, i32 0, i32 0 - %9 = load <8 x i16>* %8, align 16 - %10 = getelementptr inbounds %struct.int16x8_t* %__bx, i32 0, i32 0 - %11 = load <8 x i16>* %10, align 16 - %12 = getelementptr inbounds %union..0anon* %__rv, i32 0, i32 0 + %8 = getelementptr inbounds %struct.int16x8_t, %struct.int16x8_t* %__ax, i32 0, i32 0 + %9 = load <8 x i16>, <8 x i16>* %8, align 16 + %10 = getelementptr inbounds %struct.int16x8_t, %struct.int16x8_t* %__bx, i32 0, i32 0 + %11 = load <8 x i16>, <8 x i16>* %10, align 16 + %12 = getelementptr inbounds %union..0anon, %union..0anon* %__rv, i32 0, i32 0 %13 = bitcast %struct.int16x8x2_t* %12 to %struct.__neon_int16x8x2_t* %14 = shufflevector <8 x i16> %9, <8 x i16> %11, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14> - %15 = getelementptr inbounds %struct.__neon_int16x8x2_t* %13, i32 0, i32 0 + %15 = getelementptr inbounds %struct.__neon_int16x8x2_t, %struct.__neon_int16x8x2_t* %13, i32 0, i32 0 store <8 x i16> %14, <8 x i16>* %15 %16 = shufflevector <8 x i16> %9, <8 x i16> %11, <8 x i32> <i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15> - %17 = getelementptr inbounds %struct.__neon_int16x8x2_t* %13, i32 0, i32 1 + %17 = getelementptr inbounds %struct.__neon_int16x8x2_t, %struct.__neon_int16x8x2_t* %13, i32 0, i32 1 store <8 x i16> %16, <8 x i16>* %17 - %18 = getelementptr inbounds %union..0anon* %__rv, i32 0, i32 0 + %18 = getelementptr inbounds %union..0anon, %union..0anon* %__rv, i32 0, i32 0 %19 = bitcast %struct.int16x8x2_t* %0 to i8* %20 = bitcast %struct.int16x8x2_t* %18 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %19, i8* %20, i32 32, i32 16, i1 false) %tmp21 = bitcast %struct.int16x8x2_t* %tmp2 to i8* %21 = bitcast %struct.int16x8x2_t* %0 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp21, i8* %21, i32 32, i32 16, i1 false) - %22 = load %struct.int16x8x2_t** %dst_addr, align 4 + %22 = load %struct.int16x8x2_t*, %struct.int16x8x2_t** %dst_addr, align 4 %23 = bitcast %struct.int16x8x2_t* %22 to i8* %tmp22 = bitcast %struct.int16x8x2_t* %tmp2 to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %23, i8* %tmp22, i32 32, i32 16, i1 false) diff --git a/test/Transforms/ScalarRepl/2011-05-06-CapturedAlloca.ll b/test/Transforms/ScalarRepl/2011-05-06-CapturedAlloca.ll index 816cb60..997d03b 100644 --- a/test/Transforms/ScalarRepl/2011-05-06-CapturedAlloca.ll +++ b/test/Transforms/ScalarRepl/2011-05-06-CapturedAlloca.ll @@ -17,7 +17,7 @@ entry: %tmp = bitcast [4 x i32]* %l_10 to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp, i8* bitcast ([4 x i32]* @func_1.l_10 to i8*), i64 16, i32 16, i1 false) ; CHECK: call void @llvm.memcpy - %arrayidx = getelementptr inbounds [4 x i32]* %l_10, i64 0, i64 0 + %arrayidx = getelementptr inbounds [4 x i32], [4 x i32]* %l_10, i64 0, i64 0 %call = call i32* @noop(i32* %arrayidx) store i32 0, i32* %call ret i32 0 diff --git a/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll b/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll index 4596885..dee27f8 100644 --- a/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll +++ b/test/Transforms/ScalarRepl/2011-06-08-VectorExtractValue.ll @@ -16,12 +16,12 @@ define void @main() uwtable ssp { entry: %ref.tmp2 = alloca %0, align 16 %tmpcast = bitcast %0* %ref.tmp2 to %struct.Point_3* - %0 = getelementptr %0* %ref.tmp2, i64 0, i32 0 + %0 = getelementptr %0, %0* %ref.tmp2, i64 0, i32 0 store <2 x float> zeroinitializer, <2 x float>* %0, align 16 - %1 = getelementptr inbounds %struct.Point_3* %tmpcast, i64 0, i32 0 - %base.i.i.i = getelementptr inbounds %struct.PointC3* %1, i64 0, i32 0 - %arrayidx.i.i.i.i = getelementptr inbounds %struct.array* %base.i.i.i, i64 0, i32 0, i64 0 - %tmp5.i.i = load float* %arrayidx.i.i.i.i, align 4 + %1 = getelementptr inbounds %struct.Point_3, %struct.Point_3* %tmpcast, i64 0, i32 0 + %base.i.i.i = getelementptr inbounds %struct.PointC3, %struct.PointC3* %1, i64 0, i32 0 + %arrayidx.i.i.i.i = getelementptr inbounds %struct.array, %struct.array* %base.i.i.i, i64 0, i32 0, i64 0 + %tmp5.i.i = load float, float* %arrayidx.i.i.i.i, align 4 ret void } @@ -33,9 +33,9 @@ define void @test1() uwtable ssp { entry: %ref.tmp2 = alloca {<2 x float>, float}, align 16 %tmpcast = bitcast {<2 x float>, float}* %ref.tmp2 to float* - %0 = getelementptr {<2 x float>, float}* %ref.tmp2, i64 0, i32 0 + %0 = getelementptr {<2 x float>, float}, {<2 x float>, float}* %ref.tmp2, i64 0, i32 0 store <2 x float> zeroinitializer, <2 x float>* %0, align 16 - %tmp5.i.i = load float* %tmpcast, align 4 + %tmp5.i.i = load float, float* %tmpcast, align 4 ret void } @@ -50,12 +50,12 @@ define float @test2() uwtable ssp { entry: %ref.tmp2 = alloca {<2 x float>, float}, align 16 %tmpcast = bitcast {<2 x float>, float}* %ref.tmp2 to float* - %tmpcast2 = getelementptr {<2 x float>, float}* %ref.tmp2, i64 0, i32 1 - %0 = getelementptr {<2 x float>, float}* %ref.tmp2, i64 0, i32 0 + %tmpcast2 = getelementptr {<2 x float>, float}, {<2 x float>, float}* %ref.tmp2, i64 0, i32 1 + %0 = getelementptr {<2 x float>, float}, {<2 x float>, float}* %ref.tmp2, i64 0, i32 0 store <2 x float> zeroinitializer, <2 x float>* %0, align 16 store float 1.0, float* %tmpcast2, align 4 - %r1 = load float* %tmpcast, align 4 - %r2 = load float* %tmpcast2, align 4 + %r1 = load float, float* %tmpcast, align 4 + %r2 = load float, float* %tmpcast2, align 4 %r = fadd float %r1, %r2 ret float %r } @@ -69,7 +69,7 @@ entry: %ai = alloca { <2 x float>, <2 x float> }, align 8 store { <2 x float>, <2 x float> } {<2 x float> <float 0.0, float 1.0>, <2 x float> <float 2.0, float 3.0>}, { <2 x float>, <2 x float> }* %ai, align 8 %tmpcast = bitcast { <2 x float>, <2 x float> }* %ai to [4 x float]* - %arrayidx = getelementptr inbounds [4 x float]* %tmpcast, i64 0, i64 3 - %f = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds [4 x float], [4 x float]* %tmpcast, i64 0, i64 3 + %f = load float, float* %arrayidx, align 4 ret float %f } diff --git a/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll b/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll index f8530d6..af6d1f3 100644 --- a/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll +++ b/test/Transforms/ScalarRepl/2011-06-17-VectorPartialMemset.ll @@ -14,7 +14,7 @@ entry: %a = alloca <4 x float>, align 16 %p = bitcast <4 x float>* %a to i8* call void @llvm.memset.p0i8.i32(i8* %p, i8 0, i32 3, i32 16, i1 false) - %vec = load <4 x float>* %a, align 8 + %vec = load <4 x float>, <4 x float>* %a, align 8 %val = extractelement <4 x float> %vec, i32 0 ret float %val } @@ -29,7 +29,7 @@ entry: %p = bitcast { <4 x float> }* %a to i8* call void @llvm.memset.p0i8.i32(i8* %p, i8 0, i32 16, i32 16, i1 false) %q = bitcast { <4 x float> }* %a to [2 x <2 x float>]* - %arrayidx = getelementptr inbounds [2 x <2 x float>]* %q, i32 0, i32 0 + %arrayidx = getelementptr inbounds [2 x <2 x float>], [2 x <2 x float>]* %q, i32 0, i32 0 store <2 x float> undef, <2 x float>* %arrayidx, align 8 ret void } diff --git a/test/Transforms/ScalarRepl/2011-09-22-PHISpeculateInvoke.ll b/test/Transforms/ScalarRepl/2011-09-22-PHISpeculateInvoke.ll index 5f4d0fc..9a24662f 100644 --- a/test/Transforms/ScalarRepl/2011-09-22-PHISpeculateInvoke.ll +++ b/test/Transforms/ScalarRepl/2011-09-22-PHISpeculateInvoke.ll @@ -25,7 +25,7 @@ else: ; preds = %2 join: ; preds = %then, %else %storemerge.in = phi i32* [ %retptr2, %else ], [ %retptr1, %then ] - %storemerge = load i32* %storemerge.in + %storemerge = load i32, i32* %storemerge.in %x3 = call i32 @extern_fn2(i32 %storemerge) ret void diff --git a/test/Transforms/ScalarRepl/2011-10-22-VectorCrash.ll b/test/Transforms/ScalarRepl/2011-10-22-VectorCrash.ll index e445636..c9c1a14 100644 --- a/test/Transforms/ScalarRepl/2011-10-22-VectorCrash.ll +++ b/test/Transforms/ScalarRepl/2011-10-22-VectorCrash.ll @@ -11,7 +11,7 @@ define void @test() nounwind { entry: %u = alloca %union.anon, align 16 %u164 = bitcast %union.anon* %u to [4 x i32]* - %arrayidx165 = getelementptr inbounds [4 x i32]* %u164, i32 0, i32 0 + %arrayidx165 = getelementptr inbounds [4 x i32], [4 x i32]* %u164, i32 0, i32 0 store i32 undef, i32* %arrayidx165, align 4 %v186 = bitcast %union.anon* %u to <4 x float>* store <4 x float> undef, <4 x float>* %v186, align 16 diff --git a/test/Transforms/ScalarRepl/2011-11-11-EmptyStruct.ll b/test/Transforms/ScalarRepl/2011-11-11-EmptyStruct.ll index da707b7..51d1d14 100644 --- a/test/Transforms/ScalarRepl/2011-11-11-EmptyStruct.ll +++ b/test/Transforms/ScalarRepl/2011-11-11-EmptyStruct.ll @@ -13,13 +13,13 @@ define double @test() nounwind uwtable ssp { entry: %retval = alloca %struct.S, align 8 %ret = alloca %struct.S, align 8 - %b = getelementptr inbounds %struct.S* %ret, i32 0, i32 1 + %b = getelementptr inbounds %struct.S, %struct.S* %ret, i32 0, i32 1 store double 1.000000e+00, double* %b, align 8 %0 = bitcast %struct.S* %retval to i8* %1 = bitcast %struct.S* %ret to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 8, i32 8, i1 false) %2 = bitcast %struct.S* %retval to double* - %3 = load double* %2, align 1 + %3 = load double, double* %2, align 1 ret double %3 } diff --git a/test/Transforms/ScalarRepl/AggregatePromote.ll b/test/Transforms/ScalarRepl/AggregatePromote.ll index 16b3273..f6dfdf5 100644 --- a/test/Transforms/ScalarRepl/AggregatePromote.ll +++ b/test/Transforms/ScalarRepl/AggregatePromote.ll @@ -10,7 +10,7 @@ define i64 @test1(i64 %X) { %B = bitcast i64* %A to i32* ; <i32*> [#uses=1] %C = bitcast i32* %B to i8* ; <i8*> [#uses=1] store i8 0, i8* %C - %Y = load i64* %A ; <i64> [#uses=1] + %Y = load i64, i64* %A ; <i64> [#uses=1] ret i64 %Y } @@ -18,22 +18,22 @@ define i8 @test2(i64 %X) { %X_addr = alloca i64 ; <i64*> [#uses=2] store i64 %X, i64* %X_addr %tmp.0 = bitcast i64* %X_addr to i32* ; <i32*> [#uses=1] - %tmp.1 = getelementptr i32* %tmp.0, i32 1 ; <i32*> [#uses=1] + %tmp.1 = getelementptr i32, i32* %tmp.0, i32 1 ; <i32*> [#uses=1] %tmp.2 = bitcast i32* %tmp.1 to i8* ; <i8*> [#uses=1] - %tmp.3 = getelementptr i8* %tmp.2, i32 3 ; <i8*> [#uses=1] - %tmp.2.upgrd.1 = load i8* %tmp.3 ; <i8> [#uses=1] + %tmp.3 = getelementptr i8, i8* %tmp.2, i32 3 ; <i8*> [#uses=1] + %tmp.2.upgrd.1 = load i8, i8* %tmp.3 ; <i8> [#uses=1] ret i8 %tmp.2.upgrd.1 } define i16 @crafty(i64 %X) { %a = alloca { i64 } ; <{ i64 }*> [#uses=2] - %tmp.0 = getelementptr { i64 }* %a, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp.0 = getelementptr { i64 }, { i64 }* %a, i32 0, i32 0 ; <i64*> [#uses=1] store i64 %X, i64* %tmp.0 %tmp.3 = bitcast { i64 }* %a to [4 x i16]* ; <[4 x i16]*> [#uses=2] - %tmp.4 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1] - %tmp.5 = load i16* %tmp.4 ; <i16> [#uses=1] - %tmp.8 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1] - %tmp.9 = load i16* %tmp.8 ; <i16> [#uses=1] + %tmp.4 = getelementptr [4 x i16], [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1] + %tmp.5 = load i16, i16* %tmp.4 ; <i16> [#uses=1] + %tmp.8 = getelementptr [4 x i16], [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1] + %tmp.9 = load i16, i16* %tmp.8 ; <i16> [#uses=1] %tmp.10 = or i16 %tmp.9, %tmp.5 ; <i16> [#uses=1] ret i16 %tmp.10 } @@ -42,10 +42,10 @@ define i16 @crafty2(i64 %X) { %a = alloca i64 ; <i64*> [#uses=2] store i64 %X, i64* %a %tmp.3 = bitcast i64* %a to [4 x i16]* ; <[4 x i16]*> [#uses=2] - %tmp.4 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1] - %tmp.5 = load i16* %tmp.4 ; <i16> [#uses=1] - %tmp.8 = getelementptr [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1] - %tmp.9 = load i16* %tmp.8 ; <i16> [#uses=1] + %tmp.4 = getelementptr [4 x i16], [4 x i16]* %tmp.3, i32 0, i32 3 ; <i16*> [#uses=1] + %tmp.5 = load i16, i16* %tmp.4 ; <i16> [#uses=1] + %tmp.8 = getelementptr [4 x i16], [4 x i16]* %tmp.3, i32 0, i32 2 ; <i16*> [#uses=1] + %tmp.9 = load i16, i16* %tmp.8 ; <i16> [#uses=1] %tmp.10 = or i16 %tmp.9, %tmp.5 ; <i16> [#uses=1] ret i16 %tmp.10 } diff --git a/test/Transforms/ScalarRepl/DifferingTypes.ll b/test/Transforms/ScalarRepl/DifferingTypes.ll index 933c47f..3860f6c 100644 --- a/test/Transforms/ScalarRepl/DifferingTypes.ll +++ b/test/Transforms/ScalarRepl/DifferingTypes.ll @@ -10,7 +10,7 @@ define i32 @testfunc(i32 %i, i8 %j) { store i32 %i, i32* %I %P = bitcast i32* %I to i8* ; <i8*> [#uses=1] store i8 %j, i8* %P - %t = load i32* %I ; <i32> [#uses=1] + %t = load i32, i32* %I ; <i32> [#uses=1] ret i32 %t } diff --git a/test/Transforms/ScalarRepl/address-space.ll b/test/Transforms/ScalarRepl/address-space.ll index d8efc17..b8b90ef 100644 --- a/test/Transforms/ScalarRepl/address-space.ll +++ b/test/Transforms/ScalarRepl/address-space.ll @@ -7,22 +7,22 @@ target triple = "x86_64-apple-darwin10" %struct.anon = type { [1 x float] } ; CHECK-LABEL: define void @Test( -; CHECK: load float addrspace(2)* +; CHECK: load float, float addrspace(2)* ; CHECK-NEXT: fsub float ; CHECK: store float {{.*}}, float addrspace(2)* define void @Test(%struct.anon addrspace(2)* %pPtr) nounwind { entry: %s = alloca %struct.anon, align 4 ; <%struct.anon*> [#uses=3] - %arrayidx = getelementptr inbounds %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1] + %arrayidx = getelementptr inbounds %struct.anon, %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1] %tmp1 = bitcast %struct.anon* %s to i8* ; <i8*> [#uses=1] %tmp2 = bitcast %struct.anon addrspace(2)* %arrayidx to i8 addrspace(2)* ; <i8 addrspace(2)*> [#uses=1] call void @llvm.memcpy.p0i8.p2i8.i64(i8* %tmp1, i8 addrspace(2)* %tmp2, i64 4, i32 4, i1 false) - %tmp3 = getelementptr inbounds %struct.anon* %s, i32 0, i32 0 ; <[1 x float]*> [#uses=1] - %arrayidx4 = getelementptr inbounds [1 x float]* %tmp3, i32 0, i64 0 ; <float*> [#uses=2] - %tmp5 = load float* %arrayidx4 ; <float> [#uses=1] + %tmp3 = getelementptr inbounds %struct.anon, %struct.anon* %s, i32 0, i32 0 ; <[1 x float]*> [#uses=1] + %arrayidx4 = getelementptr inbounds [1 x float], [1 x float]* %tmp3, i32 0, i64 0 ; <float*> [#uses=2] + %tmp5 = load float, float* %arrayidx4 ; <float> [#uses=1] %sub = fsub float %tmp5, 5.000000e+00 ; <float> [#uses=1] store float %sub, float* %arrayidx4 - %arrayidx7 = getelementptr inbounds %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1] + %arrayidx7 = getelementptr inbounds %struct.anon, %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1] %tmp8 = bitcast %struct.anon addrspace(2)* %arrayidx7 to i8 addrspace(2)* ; <i8 addrspace(2)*> [#uses=1] %tmp9 = bitcast %struct.anon* %s to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p2i8.p0i8.i64(i8 addrspace(2)* %tmp8, i8* %tmp9, i64 4, i32 4, i1 false) diff --git a/test/Transforms/ScalarRepl/arraytest.ll b/test/Transforms/ScalarRepl/arraytest.ll index 06a928c..486e725 100644 --- a/test/Transforms/ScalarRepl/arraytest.ll +++ b/test/Transforms/ScalarRepl/arraytest.ll @@ -3,9 +3,9 @@ target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i32 @test() { %X = alloca [4 x i32] ; <[4 x i32]*> [#uses=1] - %Y = getelementptr [4 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=2] + %Y = getelementptr [4 x i32], [4 x i32]* %X, i64 0, i64 0 ; <i32*> [#uses=2] store i32 0, i32* %Y - %Z = load i32* %Y ; <i32> [#uses=1] + %Z = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %Z } diff --git a/test/Transforms/ScalarRepl/badarray.ll b/test/Transforms/ScalarRepl/badarray.ll index 480e12b..6f5bc95 100644 --- a/test/Transforms/ScalarRepl/badarray.ll +++ b/test/Transforms/ScalarRepl/badarray.ll @@ -10,9 +10,9 @@ define i32 @test1() { ; CHECK-LABEL: @test1( ; CHECK-NOT: = alloca %X = alloca [4 x i32] - %Y = getelementptr [4 x i32]* %X, i64 0, i64 6 ; <i32*> [#uses=2] + %Y = getelementptr [4 x i32], [4 x i32]* %X, i64 0, i64 6 ; <i32*> [#uses=2] store i32 0, i32* %Y - %Z = load i32* %Y ; <i32> [#uses=1] + %Z = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %Z } @@ -24,7 +24,7 @@ entry: ; CHECK-NOT: = alloca %yx2.i = alloca float, align 4 ; <float*> [#uses=1] %yx26.i = bitcast float* %yx2.i to i64* ; <i64*> [#uses=1] - %0 = load i64* %yx26.i, align 8 ; <i64> [#uses=0] + %0 = load i64, i64* %yx26.i, align 8 ; <i64> [#uses=0] unreachable } @@ -38,9 +38,9 @@ entry: ; CHECK-NOT: = alloca ; CHECK: store i64 %var_1 = alloca %padded, align 8 ; <%padded*> [#uses=3] - %0 = getelementptr inbounds %padded* %var_1, i32 0, i32 0 ; <%base*> [#uses=2] + %0 = getelementptr inbounds %padded, %padded* %var_1, i32 0, i32 0 ; <%base*> [#uses=2] - %p2 = getelementptr inbounds %base* %0, i32 0, i32 1, i32 0 ; <i8*> [#uses=1] + %p2 = getelementptr inbounds %base, %base* %0, i32 0, i32 1, i32 0 ; <i8*> [#uses=1] store i8 72, i8* %p2, align 1 ; 72 -> a[0]. diff --git a/test/Transforms/ScalarRepl/basictest.ll b/test/Transforms/ScalarRepl/basictest.ll index af3c237..35d4d3b 100644 --- a/test/Transforms/ScalarRepl/basictest.ll +++ b/test/Transforms/ScalarRepl/basictest.ll @@ -3,9 +3,9 @@ target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i32 @test1() { %X = alloca { i32, float } ; <{ i32, float }*> [#uses=1] - %Y = getelementptr { i32, float }* %X, i64 0, i32 0 ; <i32*> [#uses=2] + %Y = getelementptr { i32, float }, { i32, float }* %X, i64 0, i32 0 ; <i32*> [#uses=2] store i32 0, i32* %Y - %Z = load i32* %Y ; <i32> [#uses=1] + %Z = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %Z ; CHECK-LABEL: @test1( ; CHECK-NOT: alloca @@ -21,7 +21,7 @@ define i64 @test2(i64 %X) { br label %L2 L2: - %Z = load i64* %B ; <i32> [#uses=1] + %Z = load i64, i64* %B ; <i32> [#uses=1] ret i64 %Z ; CHECK-LABEL: @test2( ; CHECK-NOT: alloca diff --git a/test/Transforms/ScalarRepl/bitfield-sroa.ll b/test/Transforms/ScalarRepl/bitfield-sroa.ll index 3728658..52986b0 100644 --- a/test/Transforms/ScalarRepl/bitfield-sroa.ll +++ b/test/Transforms/ScalarRepl/bitfield-sroa.ll @@ -7,11 +7,11 @@ define i8 @foo(i64 %A) { %ALL = alloca %t, align 8 %tmp59172 = bitcast %t* %ALL to i64* store i64 %A, i64* %tmp59172, align 8 - %C = getelementptr %t* %ALL, i32 0, i32 0, i32 1 + %C = getelementptr %t, %t* %ALL, i32 0, i32 0, i32 1 %D = bitcast i16* %C to i32* - %E = load i32* %D, align 4 + %E = load i32, i32* %D, align 4 %F = bitcast %t* %ALL to i8* - %G = load i8* %F, align 8 + %G = load i8, i8* %F, align 8 ret i8 %G } diff --git a/test/Transforms/ScalarRepl/copy-aggregate.ll b/test/Transforms/ScalarRepl/copy-aggregate.ll index 51ba810..97977db 100644 --- a/test/Transforms/ScalarRepl/copy-aggregate.ll +++ b/test/Transforms/ScalarRepl/copy-aggregate.ll @@ -10,10 +10,10 @@ define i32 @test1(i64 %V) nounwind { %Y = bitcast {{i32,i32}}* %X to i64* store i64 %V, i64* %Y - %A = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 0 - %B = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 1 - %a = load i32* %A - %b = load i32* %B + %A = getelementptr {{i32,i32}}, {{i32,i32}}* %X, i32 0, i32 0, i32 0 + %B = getelementptr {{i32,i32}}, {{i32,i32}}* %X, i32 0, i32 0, i32 1 + %a = load i32, i32* %A + %b = load i32, i32* %B %c = add i32 %a, %b ret i32 %c } @@ -26,10 +26,10 @@ define float @test2(i128 %V) nounwind { %Y = bitcast {[4 x float]}* %X to i128* store i128 %V, i128* %Y - %A = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 0 - %B = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 3 - %a = load float* %A - %b = load float* %B + %A = getelementptr {[4 x float]}, {[4 x float]}* %X, i32 0, i32 0, i32 0 + %B = getelementptr {[4 x float]}, {[4 x float]}* %X, i32 0, i32 0, i32 3 + %a = load float, float* %A + %b = load float, float* %B %c = fadd float %a, %b ret float %c } @@ -40,13 +40,13 @@ define i64 @test3(i32 %a, i32 %b) nounwind { ; CHECK-NOT: alloca %X = alloca {{i32, i32}} - %A = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 0 - %B = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 1 + %A = getelementptr {{i32,i32}}, {{i32,i32}}* %X, i32 0, i32 0, i32 0 + %B = getelementptr {{i32,i32}}, {{i32,i32}}* %X, i32 0, i32 0, i32 1 store i32 %a, i32* %A store i32 %b, i32* %B %Y = bitcast {{i32,i32}}* %X to i64* - %Z = load i64* %Y + %Z = load i64, i64* %Y ret i64 %Z } @@ -55,13 +55,13 @@ define i128 @test4(float %a, float %b) nounwind { ; CHECK: test4 ; CHECK-NOT: alloca %X = alloca {[4 x float]} - %A = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 0 - %B = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 3 + %A = getelementptr {[4 x float]}, {[4 x float]}* %X, i32 0, i32 0, i32 0 + %B = getelementptr {[4 x float]}, {[4 x float]}* %X, i32 0, i32 0, i32 3 store float %a, float* %A store float %b, float* %B %Y = bitcast {[4 x float]}* %X to i128* - %V = load i128* %Y + %V = load i128, i128* %Y ret i128 %V } diff --git a/test/Transforms/ScalarRepl/crash.ll b/test/Transforms/ScalarRepl/crash.ll index 8c60dce..72e9f09 100644 --- a/test/Transforms/ScalarRepl/crash.ll +++ b/test/Transforms/ScalarRepl/crash.ll @@ -11,7 +11,7 @@ entry: unreachable for.cond: ; preds = %for.cond - %tmp1.i = load i32** %l_72, align 8 + %tmp1.i = load i32*, i32** %l_72, align 8 store i32* %tmp1.i, i32** %l_72, align 8 br label %for.cond @@ -22,15 +22,15 @@ if.end: ; No predecessors! define void @test2() { %E = alloca { { i32, float, double, i64 }, { i32, float, double, i64 } } ; <{ { i32, float, double, i64 }, { i32, float, double, i64 } }*> [#uses=1] - %tmp.151 = getelementptr { { i32, float, double, i64 }, { i32, float, double, i64 } }* %E, i64 0, i32 1, i32 3 ; <i64*> [#uses=0] + %tmp.151 = getelementptr { { i32, float, double, i64 }, { i32, float, double, i64 } }, { { i32, float, double, i64 }, { i32, float, double, i64 } }* %E, i64 0, i32 1, i32 3 ; <i64*> [#uses=0] ret void } define i32 @test3() { %X = alloca { [4 x i32] } ; <{ [4 x i32] }*> [#uses=1] - %Y = getelementptr { [4 x i32] }* %X, i64 0, i32 0, i64 2 ; <i32*> [#uses=2] + %Y = getelementptr { [4 x i32] }, { [4 x i32] }* %X, i64 0, i32 0, i64 2 ; <i32*> [#uses=2] store i32 4, i32* %Y - %Z = load i32* %Y ; <i32> [#uses=1] + %Z = load i32, i32* %Y ; <i32> [#uses=1] ret i32 %Z } @@ -102,11 +102,11 @@ bb9131: ; preds = %bb1365 ret void bb9875: ; preds = %bb1365 %source_ptr9884 = bitcast i8** %source_ptr to i8** ; <i8**> [#uses=1] - %tmp9885 = load i8** %source_ptr9884 ; <i8*> [#uses=0] + %tmp9885 = load i8*, i8** %source_ptr9884 ; <i8*> [#uses=0] ret void bb10249: ; preds = %bb1365 %source_ptr10257 = bitcast i8** %source_ptr to i16** ; <i16**> [#uses=1] - %tmp10258 = load i16** %source_ptr10257 ; <i16*> [#uses=0] + %tmp10258 = load i16*, i16** %source_ptr10257 ; <i16*> [#uses=0] ret void cond_next10377: ; preds = %bb1365 ret void @@ -125,10 +125,10 @@ entry: %this_addr.i = alloca %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"**> [#uses=3] %tmp = alloca %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>", align 4 ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1] store %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* %tmp, %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i - %tmp.i = load %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1] + %tmp.i = load %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*, %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1] %tmp.i.upgrd.1 = bitcast %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* %tmp.i to %"struct.__gnu_cxx::bitmap_allocator<char>"* ; <%"struct.__gnu_cxx::bitmap_allocator<char>"*> [#uses=0] - %tmp1.i = load %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1] - %tmp.i.upgrd.2 = getelementptr %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* %tmp1.i, i32 0, i32 0 ; <%"struct.__gnu_cxx::bitmap_allocator<char>::_Alloc_block"**> [#uses=0] + %tmp1.i = load %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*, %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"** %this_addr.i ; <%"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"*> [#uses=1] + %tmp.i.upgrd.2 = getelementptr %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>", %"struct.__gnu_cxx::balloc::_Inclusive_between<__gnu_cxx::bitmap_allocator<char>::_Alloc_block*>"* %tmp1.i, i32 0, i32 0 ; <%"struct.__gnu_cxx::bitmap_allocator<char>::_Alloc_block"**> [#uses=0] unreachable } @@ -161,8 +161,8 @@ cond_next: ; preds = %cond_true br i1 false, label %cond_next34, label %cond_next79 cond_next34: ; preds = %cond_next - %i.2.reload22 = load i32* null ; <i32> [#uses=1] - %tmp51 = getelementptr %struct.aal_spanbucket_t* %SB, i32 0, i32 2, i32 0, i32 0, i32 %i.2.reload22, i32 1 + %i.2.reload22 = load i32, i32* null ; <i32> [#uses=1] + %tmp51 = getelementptr %struct.aal_spanbucket_t, %struct.aal_spanbucket_t* %SB, i32 0, i32 2, i32 0, i32 0, i32 %i.2.reload22, i32 1 ; <i16*> [#uses=0] ret void @@ -180,7 +180,7 @@ cond_next79: ; preds = %cond_next, %entry define void @test8() { entry: %v = alloca %struct.c37304a__vrec - %0 = getelementptr %struct.c37304a__vrec* %v, i32 0, i32 0 + %0 = getelementptr %struct.c37304a__vrec, %struct.c37304a__vrec* %v, i32 0, i32 0 store i8 8, i8* %0, align 1 unreachable } @@ -193,7 +193,7 @@ entry: define i32 @test9() { entry: %.compoundliteral = alloca %0 - %tmp228 = getelementptr %0* %.compoundliteral, i32 0, i32 7 + %tmp228 = getelementptr %0, %0* %.compoundliteral, i32 0, i32 7 %tmp229 = bitcast [0 x i16]* %tmp228 to i8* call void @llvm.memset.p0i8.i64(i8* %tmp229, i8 0, i64 0, i32 2, i1 false) unreachable @@ -207,7 +207,7 @@ declare void @llvm.memset.i64(i8* nocapture, i8, i64, i32) nounwind define void @test10() { entry: %w = alloca %wrapper, align 8 ; <%wrapper*> [#uses=1] - %0 = getelementptr %wrapper* %w, i64 0, i32 0 ; <i1*> + %0 = getelementptr %wrapper, %wrapper* %w, i64 0, i32 0 ; <i1*> store i1 true, i1* %0 ret void } @@ -220,8 +220,8 @@ entry: %a = alloca %struct.singlebool, align 1 ; <%struct.singlebool*> [#uses=2] %storetmp.i = bitcast %struct.singlebool* %a to i1* ; <i1*> [#uses=1] store i1 true, i1* %storetmp.i - %tmp = getelementptr %struct.singlebool* %a, i64 0, i32 0 ; <i8*> [#uses=1] - %tmp1 = load i8* %tmp ; <i8> [#uses=1] + %tmp = getelementptr %struct.singlebool, %struct.singlebool* %a, i64 0, i32 0 ; <i8*> [#uses=1] + %tmp1 = load i8, i8* %tmp ; <i8> [#uses=1] ret i8 %tmp1 } @@ -246,7 +246,7 @@ define void @test12() { bb4.i: %malloccall = tail call i8* @malloc(i32 0) %0 = bitcast i8* %malloccall to [0 x %struct.Item]* - %.sub.i.c.i = getelementptr [0 x %struct.Item]* %0, i32 0, i32 0 ; <%struct.Item*> [#uses=0] + %.sub.i.c.i = getelementptr [0 x %struct.Item], [0 x %struct.Item]* %0, i32 0, i32 0 ; <%struct.Item*> [#uses=0] unreachable } declare noalias i8* @malloc(i32) @@ -268,13 +268,13 @@ define fastcc void @test() optsize inlinehint ssp align 2 { entry: %alloc.0.0 = alloca <4 x float>, align 16 %bitcast = bitcast <4 x float>* %alloc.0.0 to [4 x float]* - %idx3 = getelementptr inbounds [4 x float]* %bitcast, i32 0, i32 3 + %idx3 = getelementptr inbounds [4 x float], [4 x float]* %bitcast, i32 0, i32 3 store float 0.000000e+00, float* %idx3, align 4 br label %for.body10 for.body10: ; preds = %for.body10, %entry %loopidx = phi i32 [ 0, %entry ], [ undef, %for.body10 ] - %unusedidx = getelementptr inbounds <4 x float>* %alloc.0.0, i32 0, i32 %loopidx + %unusedidx = getelementptr inbounds <4 x float>, <4 x float>* %alloc.0.0, i32 0, i32 %loopidx br i1 undef, label %for.end, label %for.body10 for.end: ; preds = %for.body10 diff --git a/test/Transforms/ScalarRepl/debuginfo-preserved.ll b/test/Transforms/ScalarRepl/debuginfo-preserved.ll index b0c459e..80ce25e 100644 --- a/test/Transforms/ScalarRepl/debuginfo-preserved.ll +++ b/test/Transforms/ScalarRepl/debuginfo-preserved.ll @@ -17,22 +17,22 @@ entry: %b.addr = alloca i32, align 4 %c = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !6, metadata !{}), !dbg !7 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !6, metadata !MDExpression()), !dbg !7 store i32 %b, i32* %b.addr, align 4 - call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !8, metadata !{}), !dbg !9 - call void @llvm.dbg.declare(metadata i32* %c, metadata !10, metadata !{}), !dbg !12 - %tmp = load i32* %a.addr, align 4, !dbg !13 + call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !8, metadata !MDExpression()), !dbg !9 + call void @llvm.dbg.declare(metadata i32* %c, metadata !10, metadata !MDExpression()), !dbg !12 + %tmp = load i32, i32* %a.addr, align 4, !dbg !13 store i32 %tmp, i32* %c, align 4, !dbg !13 - %tmp1 = load i32* %a.addr, align 4, !dbg !14 - %tmp2 = load i32* %b.addr, align 4, !dbg !14 + %tmp1 = load i32, i32* %a.addr, align 4, !dbg !14 + %tmp2 = load i32, i32* %b.addr, align 4, !dbg !14 %add = add nsw i32 %tmp1, %tmp2, !dbg !14 store i32 %add, i32* %a.addr, align 4, !dbg !14 - %tmp3 = load i32* %c, align 4, !dbg !15 - %tmp4 = load i32* %b.addr, align 4, !dbg !15 + %tmp3 = load i32, i32* %c, align 4, !dbg !15 + %tmp4 = load i32, i32* %b.addr, align 4, !dbg !15 %sub = sub nsw i32 %tmp3, %tmp4, !dbg !15 store i32 %sub, i32* %b.addr, align 4, !dbg !15 - %tmp5 = load i32* %a.addr, align 4, !dbg !16 - %tmp6 = load i32* %b.addr, align 4, !dbg !16 + %tmp5 = load i32, i32* %a.addr, align 4, !dbg !16 + %tmp6 = load i32, i32* %b.addr, align 4, !dbg !16 %add7 = add nsw i32 %tmp5, %tmp6, !dbg !16 ret i32 %add7, !dbg !16 } @@ -42,24 +42,24 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!20} -!0 = !{!"0x11\0012\00clang version 3.0 (trunk 131941)\000\00\000\00\000", !18, !19, !19, !17, null, null} ; [ DW_TAG_compile_unit ] -!1 = !{!"0x2e\00f\00f\00\001\000\001\000\006\00256\000\001", !18, !2, !3, null, i32 (i32, i32)* @f, null, null, null} ; [ DW_TAG_subprogram ] [line 1] [def] [f] -!2 = !{!"0x29", !18} ; [ DW_TAG_file_type ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !18, !2, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 131941)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !17) +!1 = !MDSubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !18, scope: !2, type: !3, function: i32 (i32, i32)* @f) +!2 = !MDFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b") +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !0} ; [ DW_TAG_base_type ] -!6 = !{!"0x101\00a\0016777217\000", !1, !2, !5} ; [ DW_TAG_arg_variable ] +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 1, arg: 1, scope: !1, file: !2, type: !5) !7 = !MDLocation(line: 1, column: 11, scope: !1) -!8 = !{!"0x101\00b\0033554433\000", !1, !2, !5} ; [ DW_TAG_arg_variable ] +!8 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 1, arg: 2, scope: !1, file: !2, type: !5) !9 = !MDLocation(line: 1, column: 18, scope: !1) -!10 = !{!"0x100\00c\002\000", !11, !2, !5} ; [ DW_TAG_auto_variable ] -!11 = !{!"0xb\001\0021\000", !18, !1} ; [ DW_TAG_lexical_block ] +!10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 2, scope: !11, file: !2, type: !5) +!11 = distinct !MDLexicalBlock(line: 1, column: 21, file: !18, scope: !1) !12 = !MDLocation(line: 2, column: 9, scope: !11) !13 = !MDLocation(line: 2, column: 14, scope: !11) !14 = !MDLocation(line: 3, column: 5, scope: !11) !15 = !MDLocation(line: 4, column: 5, scope: !11) !16 = !MDLocation(line: 5, column: 5, scope: !11) !17 = !{!1} -!18 = !{!"/d/j/debug-test.c", !"/Volumes/Data/b"} +!18 = !MDFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b") !19 = !{i32 0} -!20 = !{i32 1, !"Debug Info Version", i32 2} +!20 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/ScalarRepl/inline-vector.ll b/test/Transforms/ScalarRepl/inline-vector.ll index f7c70dc..5d856c6 100644 --- a/test/Transforms/ScalarRepl/inline-vector.ll +++ b/test/Transforms/ScalarRepl/inline-vector.ll @@ -30,20 +30,20 @@ for.body: ; preds = %for.cond %tmp3 = bitcast %struct.Vector4* %vector to i8* call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp2, i8* %tmp3, i32 16, i32 16, i1 false) %0 = bitcast %struct.Vector4* %agg.tmp to [2 x i64]* - %1 = load [2 x i64]* %0, align 16 + %1 = load [2 x i64], [2 x i64]* %0, align 16 %tmp2.i = extractvalue [2 x i64] %1, 0 %tmp3.i = zext i64 %tmp2.i to i128 %tmp10.i = bitcast i128 %tmp3.i to <4 x float> %sub.i.i = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %tmp10.i %2 = bitcast %struct.Vector4* %vector to <4 x float>* store <4 x float> %sub.i.i, <4 x float>* %2, align 16 - %tmp4 = load i32* %i, align 4 + %tmp4 = load i32, i32* %i, align 4 %inc = add nsw i32 %tmp4, 1 br label %for.cond for.end: ; preds = %for.cond - %x = getelementptr inbounds %struct.Vector4* %vector, i32 0, i32 0 - %tmp5 = load float* %x, align 16 + %x = getelementptr inbounds %struct.Vector4, %struct.Vector4* %vector, i32 0, i32 0 + %tmp5 = load float, float* %x, align 16 %conv = fpext float %tmp5 to double %call = call i32 (...)* @printf(double %conv) nounwind ret void diff --git a/test/Transforms/ScalarRepl/lifetime.ll b/test/Transforms/ScalarRepl/lifetime.ll index 47cb854..c0ddfb5 100644 --- a/test/Transforms/ScalarRepl/lifetime.ll +++ b/test/Transforms/ScalarRepl/lifetime.ll @@ -11,9 +11,9 @@ declare void @llvm.lifetime.end(i64, i8*) define void @test1() { ; CHECK-LABEL: @test1( %A = alloca %t1 - %A1 = getelementptr %t1* %A, i32 0, i32 0 - %A2 = getelementptr %t1* %A, i32 0, i32 1 - %A3 = getelementptr %t1* %A, i32 0, i32 2 + %A1 = getelementptr %t1, %t1* %A, i32 0, i32 0 + %A2 = getelementptr %t1, %t1* %A, i32 0, i32 1 + %A3 = getelementptr %t1, %t1* %A, i32 0, i32 2 %B = bitcast i32* %A1 to i8* store i32 0, i32* %A1 call void @llvm.lifetime.start(i64 -1, i8* %B) @@ -24,13 +24,13 @@ define void @test1() { define void @test2() { ; CHECK-LABEL: @test2( %A = alloca %t1 - %A1 = getelementptr %t1* %A, i32 0, i32 0 - %A2 = getelementptr %t1* %A, i32 0, i32 1 - %A3 = getelementptr %t1* %A, i32 0, i32 2 + %A1 = getelementptr %t1, %t1* %A, i32 0, i32 0 + %A2 = getelementptr %t1, %t1* %A, i32 0, i32 1 + %A3 = getelementptr %t1, %t1* %A, i32 0, i32 2 %B = bitcast i32* %A2 to i8* store i32 0, i32* %A2 call void @llvm.lifetime.start(i64 -1, i8* %B) - %C = load i32* %A2 + %C = load i32, i32* %A2 ret void ; CHECK: ret void } @@ -38,13 +38,13 @@ define void @test2() { define void @test3() { ; CHECK-LABEL: @test3( %A = alloca %t1 - %A1 = getelementptr %t1* %A, i32 0, i32 0 - %A2 = getelementptr %t1* %A, i32 0, i32 1 - %A3 = getelementptr %t1* %A, i32 0, i32 2 + %A1 = getelementptr %t1, %t1* %A, i32 0, i32 0 + %A2 = getelementptr %t1, %t1* %A, i32 0, i32 1 + %A3 = getelementptr %t1, %t1* %A, i32 0, i32 2 %B = bitcast i32* %A2 to i8* store i32 0, i32* %A2 call void @llvm.lifetime.start(i64 6, i8* %B) - %C = load i32* %A2 + %C = load i32, i32* %A2 ret void ; CHECK-NEXT: ret void } @@ -52,13 +52,13 @@ define void @test3() { define void @test4() { ; CHECK-LABEL: @test4( %A = alloca %t1 - %A1 = getelementptr %t1* %A, i32 0, i32 0 - %A2 = getelementptr %t1* %A, i32 0, i32 1 - %A3 = getelementptr %t1* %A, i32 0, i32 2 + %A1 = getelementptr %t1, %t1* %A, i32 0, i32 0 + %A2 = getelementptr %t1, %t1* %A, i32 0, i32 1 + %A3 = getelementptr %t1, %t1* %A, i32 0, i32 2 %B = bitcast i32* %A2 to i8* store i32 0, i32* %A2 call void @llvm.lifetime.start(i64 1, i8* %B) - %C = load i32* %A2 + %C = load i32, i32* %A2 ret void ; CHECK-NEXT: ret void } @@ -72,25 +72,25 @@ define void @test5() { ; CHECK: alloca{{.*}}i8 ; CHECK: alloca{{.*}}i8 - %A21 = getelementptr %t2* %A, i32 0, i32 1, i32 0 - %A22 = getelementptr %t2* %A, i32 0, i32 1, i32 1 - %A23 = getelementptr %t2* %A, i32 0, i32 1, i32 2 - %A24 = getelementptr %t2* %A, i32 0, i32 1, i32 3 + %A21 = getelementptr %t2, %t2* %A, i32 0, i32 1, i32 0 + %A22 = getelementptr %t2, %t2* %A, i32 0, i32 1, i32 1 + %A23 = getelementptr %t2, %t2* %A, i32 0, i32 1, i32 2 + %A24 = getelementptr %t2, %t2* %A, i32 0, i32 1, i32 3 ; CHECK-NOT: store i8 1 store i8 1, i8* %A21 store i8 2, i8* %A22 store i8 3, i8* %A23 store i8 4, i8* %A24 - %A1 = getelementptr %t2* %A, i32 0, i32 0 - %A2 = getelementptr %t2* %A, i32 0, i32 1, i32 1 - %A3 = getelementptr %t2* %A, i32 0, i32 2 + %A1 = getelementptr %t2, %t2* %A, i32 0, i32 0 + %A2 = getelementptr %t2, %t2* %A, i32 0, i32 1, i32 1 + %A3 = getelementptr %t2, %t2* %A, i32 0, i32 2 store i8 0, i8* %A2 call void @llvm.lifetime.start(i64 5, i8* %A2) ; CHECK: llvm.lifetime{{.*}}i64 1 ; CHECK: llvm.lifetime{{.*}}i64 1 ; CHECK: llvm.lifetime{{.*}}i64 1 - %C = load i8* %A2 + %C = load i8, i8* %A2 ret void } @@ -103,10 +103,10 @@ define void @test6() { ; CHECK: alloca i8 ; CHECK: alloca i8 - %A11 = getelementptr %t3* %A, i32 0, i32 0, i32 0 - %A12 = getelementptr %t3* %A, i32 0, i32 0, i32 1 - %A13 = getelementptr %t3* %A, i32 0, i32 0, i32 2 - %A14 = getelementptr %t3* %A, i32 0, i32 0, i32 3 + %A11 = getelementptr %t3, %t3* %A, i32 0, i32 0, i32 0 + %A12 = getelementptr %t3, %t3* %A, i32 0, i32 0, i32 1 + %A13 = getelementptr %t3, %t3* %A, i32 0, i32 0, i32 2 + %A14 = getelementptr %t3, %t3* %A, i32 0, i32 0, i32 3 store i16 11, i16* %A11 store i16 12, i16* %A12 store i16 13, i16* %A13 @@ -116,10 +116,10 @@ define void @test6() { ; CHECK-NOT: store i16 13 ; CHECK-NOT: store i16 14 - %A21 = getelementptr %t3* %A, i32 0, i32 1, i32 0 - %A22 = getelementptr %t3* %A, i32 0, i32 1, i32 1 - %A23 = getelementptr %t3* %A, i32 0, i32 1, i32 2 - %A24 = getelementptr %t3* %A, i32 0, i32 1, i32 3 + %A21 = getelementptr %t3, %t3* %A, i32 0, i32 1, i32 0 + %A22 = getelementptr %t3, %t3* %A, i32 0, i32 1, i32 1 + %A23 = getelementptr %t3, %t3* %A, i32 0, i32 1, i32 2 + %A24 = getelementptr %t3, %t3* %A, i32 0, i32 1, i32 3 store i8 21, i8* %A21 store i8 22, i8* %A22 store i8 23, i8* %A23 diff --git a/test/Transforms/ScalarRepl/load-store-aggregate.ll b/test/Transforms/ScalarRepl/load-store-aggregate.ll index c5008ac..88299f3 100644 --- a/test/Transforms/ScalarRepl/load-store-aggregate.ll +++ b/test/Transforms/ScalarRepl/load-store-aggregate.ll @@ -11,21 +11,21 @@ target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 define i32 @test(%struct.foo* %P) { entry: %L = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=2] - %V = load %struct.foo* %P + %V = load %struct.foo, %struct.foo* %P store %struct.foo %V, %struct.foo* %L - %tmp4 = getelementptr %struct.foo* %L, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp5 = load i32* %tmp4 ; <i32> [#uses=1] + %tmp4 = getelementptr %struct.foo, %struct.foo* %L, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp5 = load i32, i32* %tmp4 ; <i32> [#uses=1] ret i32 %tmp5 } define %struct.foo @test2(i32 %A, i32 %B) { entry: %L = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=2] - %L.0 = getelementptr %struct.foo* %L, i32 0, i32 0 + %L.0 = getelementptr %struct.foo, %struct.foo* %L, i32 0, i32 0 store i32 %A, i32* %L.0 - %L.1 = getelementptr %struct.foo* %L, i32 0, i32 1 + %L.1 = getelementptr %struct.foo, %struct.foo* %L, i32 0, i32 1 store i32 %B, i32* %L.1 - %V = load %struct.foo* %L + %V = load %struct.foo, %struct.foo* %L ret %struct.foo %V } diff --git a/test/Transforms/ScalarRepl/memcpy-align.ll b/test/Transforms/ScalarRepl/memcpy-align.ll index 6046e12..29a1bb8 100644 --- a/test/Transforms/ScalarRepl/memcpy-align.ll +++ b/test/Transforms/ScalarRepl/memcpy-align.ll @@ -15,7 +15,7 @@ entry: %tmp = bitcast %struct.anon* %x0 to i8* ; <i8*> [#uses=1] call void @llvm.memset.p0i8.i32(i8* %tmp, i8 0, i32 4, i32 4, i1 false) %tmp1 = bitcast %struct.anon* %x0 to i8* ; <i8*> [#uses=1] - call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%0* @c, i32 + call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%0, %0* @c, i32 0, i32 0, i32 0, i32 0), i8* %tmp1, i32 4, i32 4, i1 false) ret void diff --git a/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll b/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll index 8ac1d25..e8088c1 100644 --- a/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll +++ b/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll @@ -12,10 +12,10 @@ target triple = "powerpc-apple-darwin8.8.0" define i32 @test1(%struct.foo* %P) { entry: %L = alloca %struct.foo, align 2 ; <%struct.foo*> [#uses=1] - %L2 = getelementptr %struct.foo* %L, i32 0, i32 0 ; <i8*> [#uses=2] - %tmp13 = getelementptr %struct.foo* %P, i32 0, i32 0 ; <i8*> [#uses=1] + %L2 = getelementptr %struct.foo, %struct.foo* %L, i32 0, i32 0 ; <i8*> [#uses=2] + %tmp13 = getelementptr %struct.foo, %struct.foo* %P, i32 0, i32 0 ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i32( i8* %L2, i8* %tmp13, i32 2, i32 1, i1 false) - %tmp5 = load i8* %L2 ; <i8> [#uses=1] + %tmp5 = load i8, i8* %L2 ; <i8> [#uses=1] %tmp56 = sext i8 %tmp5 to i32 ; <i32> [#uses=1] ret i32 %tmp56 } diff --git a/test/Transforms/ScalarRepl/memset-aggregate.ll b/test/Transforms/ScalarRepl/memset-aggregate.ll index 3a5c37c..98e2ddd 100644 --- a/test/Transforms/ScalarRepl/memset-aggregate.ll +++ b/test/Transforms/ScalarRepl/memset-aggregate.ll @@ -15,8 +15,8 @@ entry: %L2 = bitcast %struct.foo* %L to i8* ; <i8*> [#uses=1] %tmp13 = bitcast %struct.foo* %P to i8* ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i32(i8* %L2, i8* %tmp13, i32 8, i32 4, i1 false) - %tmp4 = getelementptr %struct.foo* %L, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp5 = load i32* %tmp4 ; <i32> [#uses=1] + %tmp4 = getelementptr %struct.foo, %struct.foo* %L, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp5 = load i32, i32* %tmp4 ; <i32> [#uses=1] ret i32 %tmp5 } @@ -26,8 +26,8 @@ entry: %L = alloca [4 x %struct.foo], align 16 ; <[4 x %struct.foo]*> [#uses=2] %L12 = bitcast [4 x %struct.foo]* %L to i8* ; <i8*> [#uses=1] call void @llvm.memset.p0i8.i32(i8* %L12, i8 0, i32 32, i32 16, i1 false) - %tmp4 = getelementptr [4 x %struct.foo]* %L, i32 0, i32 0, i32 0 ; <i32*> [#uses=1] - %tmp5 = load i32* %tmp4 ; <i32> [#uses=1] + %tmp4 = getelementptr [4 x %struct.foo], [4 x %struct.foo]* %L, i32 0, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp5 = load i32, i32* %tmp4 ; <i32> [#uses=1] ret i32 %tmp5 } @@ -37,12 +37,12 @@ entry: %B = alloca %struct.bar, align 16 ; <%struct.bar*> [#uses=4] %B1 = bitcast %struct.bar* %B to i8* ; <i8*> [#uses=1] call void @llvm.memset.p0i8.i32(i8* %B1, i8 1, i32 24, i32 16, i1 false) - %tmp3 = getelementptr %struct.bar* %B, i32 0, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp3 = getelementptr %struct.bar, %struct.bar* %B, i32 0, i32 0, i32 0 ; <i32*> [#uses=1] store i32 1, i32* %tmp3 - %tmp4 = getelementptr %struct.bar* %B, i32 0, i32 2 ; <double*> [#uses=1] + %tmp4 = getelementptr %struct.bar, %struct.bar* %B, i32 0, i32 2 ; <double*> [#uses=1] store double 1.000000e+01, double* %tmp4 - %tmp6 = getelementptr %struct.bar* %B, i32 0, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp7 = load i32* %tmp6 ; <i32> [#uses=1] + %tmp6 = getelementptr %struct.bar, %struct.bar* %B, i32 0, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp7 = load i32, i32* %tmp6 ; <i32> [#uses=1] ret i32 %tmp7 } @@ -52,13 +52,13 @@ entry: define i16 @test4() nounwind { entry: %A = alloca %struct.f, align 8 ; <%struct.f*> [#uses=3] - %0 = getelementptr %struct.f* %A, i32 0, i32 0 ; <i32*> [#uses=1] + %0 = getelementptr %struct.f, %struct.f* %A, i32 0, i32 0 ; <i32*> [#uses=1] store i32 1, i32* %0, align 8 - %1 = getelementptr %struct.f* %A, i32 0, i32 1 ; <i32*> [#uses=1] + %1 = getelementptr %struct.f, %struct.f* %A, i32 0, i32 1 ; <i32*> [#uses=1] %2 = bitcast i32* %1 to i8* ; <i8*> [#uses=1] call void @llvm.memset.p0i8.i32(i8* %2, i8 2, i32 12, i32 4, i1 false) - %3 = getelementptr %struct.f* %A, i32 0, i32 2 ; <i32*> [#uses=1] - %4 = load i32* %3, align 8 ; <i32> [#uses=1] + %3 = getelementptr %struct.f, %struct.f* %A, i32 0, i32 2 ; <i32*> [#uses=1] + %4 = load i32, i32* %3, align 8 ; <i32> [#uses=1] %retval12 = trunc i32 %4 to i16 ; <i16> [#uses=1] ret i16 %retval12 } diff --git a/test/Transforms/ScalarRepl/negative-memset.ll b/test/Transforms/ScalarRepl/negative-memset.ll index e52ab46..458d961 100644 --- a/test/Transforms/ScalarRepl/negative-memset.ll +++ b/test/Transforms/ScalarRepl/negative-memset.ll @@ -12,7 +12,7 @@ entry: store i32 0, i32* %retval %0 = bitcast [1 x i8]* %buff to i8* call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 1, i32 1, i1 false) - %arraydecay = getelementptr inbounds [1 x i8]* %buff, i32 0, i32 0 + %arraydecay = getelementptr inbounds [1 x i8], [1 x i8]* %buff, i32 0, i32 0 call void @llvm.memset.p0i8.i32(i8* %arraydecay, i8 -1, i32 -8, i32 1, i1 false) ; Negative 8! ret i32 0 } diff --git a/test/Transforms/ScalarRepl/nonzero-first-index.ll b/test/Transforms/ScalarRepl/nonzero-first-index.ll index b2e93fe..da757b0 100644 --- a/test/Transforms/ScalarRepl/nonzero-first-index.ll +++ b/test/Transforms/ScalarRepl/nonzero-first-index.ll @@ -12,9 +12,9 @@ define i32 @test1() { ; CHECK-NOT: = i160 ; CHECK: ret i32 undef %A = alloca %nested - %B = getelementptr %nested* %A, i32 0, i32 1, i32 0 - %C = getelementptr i32* %B, i32 2 - %D = load i32* %C + %B = getelementptr %nested, %nested* %A, i32 0, i32 1, i32 0 + %C = getelementptr i32, i32* %B, i32 2 + %D = load i32, i32* %C ret i32 %D } @@ -23,9 +23,9 @@ define i32 @test2() { ; CHECK-LABEL: @test2( ; CHECK: i160 %A = alloca %nested - %B = getelementptr %nested* %A, i32 0, i32 1, i32 0 - %C = getelementptr i32* %B, i32 4 - %D = load i32* %C + %B = getelementptr %nested, %nested* %A, i32 0, i32 1, i32 0 + %C = getelementptr i32, i32* %B, i32 4 + %D = load i32, i32* %C ret i32 %D } @@ -36,8 +36,8 @@ define i32 @test3() { ; CHECK: ret i32 undef %A = alloca %nested %B = bitcast %nested* %A to i32* - %C = getelementptr i32* %B, i32 2 - %D = load i32* %C + %C = getelementptr i32, i32* %B, i32 2 + %D = load i32, i32* %C ret i32 %D } @@ -47,7 +47,7 @@ define i32 @test4() { ; CHECK: i160 %A = alloca %nested %B = bitcast %nested* %A to i32* - %C = getelementptr i32* %B, i32 -1 - %D = load i32* %C + %C = getelementptr i32, i32* %B, i32 -1 + %D = load i32, i32* %C ret i32 %D } diff --git a/test/Transforms/ScalarRepl/not-a-vector.ll b/test/Transforms/ScalarRepl/not-a-vector.ll index 67fefb4..04c1f93 100644 --- a/test/Transforms/ScalarRepl/not-a-vector.ll +++ b/test/Transforms/ScalarRepl/not-a-vector.ll @@ -8,12 +8,12 @@ define double @test(double %A, double %B) { %C = bitcast [7 x i64]* %ARR to double* store double %A, double* %C - %D = getelementptr [7 x i64]* %ARR, i32 0, i32 4 + %D = getelementptr [7 x i64], [7 x i64]* %ARR, i32 0, i32 4 %E = bitcast i64* %D to double* store double %B, double* %E - %F = getelementptr double* %C, i32 4 - %G = load double* %F + %F = getelementptr double, double* %C, i32 4 + %G = load double, double* %F ret double %G } diff --git a/test/Transforms/ScalarRepl/phi-cycle.ll b/test/Transforms/ScalarRepl/phi-cycle.ll index 05d9382..6089936 100644 --- a/test/Transforms/ScalarRepl/phi-cycle.ll +++ b/test/Transforms/ScalarRepl/phi-cycle.ll @@ -11,9 +11,9 @@ target triple = "x86_64-unknown-linux-gnu" define i32 @main(i32 %argc, i8** nocapture %argv) nounwind uwtable { entry: %f = alloca %struct.foo, align 4 - %x.i = getelementptr inbounds %struct.foo* %f, i64 0, i32 0 + %x.i = getelementptr inbounds %struct.foo, %struct.foo* %f, i64 0, i32 0 store i32 1, i32* %x.i, align 4 - %y.i = getelementptr inbounds %struct.foo* %f, i64 0, i32 1 + %y.i = getelementptr inbounds %struct.foo, %struct.foo* %f, i64 0, i32 1 br label %while.cond.i ; CHECK: while.cond.i: @@ -67,10 +67,10 @@ while.cond.backedge.i: ; preds = %if.end.i, %while.bo ; CHECK: func.exit: ; CHECK-NOT: load -; CHECK: %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str, i64 0, i64 0), i32 %tmp) [[NUW:#[0-9]+]] +; CHECK: %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %tmp) [[NUW:#[0-9]+]] func.exit: ; preds = %while.body.i.func.exit_crit_edge, %while.cond.i.func.exit_crit_edge - %tmp3 = load i32* %x.i, align 4 - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str, i64 0, i64 0), i32 %tmp3) nounwind + %tmp3 = load i32, i32* %x.i, align 4 + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %tmp3) nounwind ret i32 0 } diff --git a/test/Transforms/ScalarRepl/phi-select.ll b/test/Transforms/ScalarRepl/phi-select.ll index a5da2dc..a6c7135 100644 --- a/test/Transforms/ScalarRepl/phi-select.ll +++ b/test/Transforms/ScalarRepl/phi-select.ll @@ -13,14 +13,14 @@ define i32 @test1(i32 %x) nounwind readnone ssp { entry: %a = alloca %struct.X, align 8 ; <%struct.X*> [#uses=2] %b = alloca %struct.X, align 8 ; <%struct.X*> [#uses=2] - %0 = getelementptr inbounds %struct.X* %a, i64 0, i32 0 ; <i32*> [#uses=1] + %0 = getelementptr inbounds %struct.X, %struct.X* %a, i64 0, i32 0 ; <i32*> [#uses=1] store i32 1, i32* %0, align 8 - %1 = getelementptr inbounds %struct.X* %b, i64 0, i32 0 ; <i32*> [#uses=1] + %1 = getelementptr inbounds %struct.X, %struct.X* %b, i64 0, i32 0 ; <i32*> [#uses=1] store i32 2, i32* %1, align 8 %2 = icmp eq i32 %x, 0 ; <i1> [#uses=1] %p.0 = select i1 %2, %struct.X* %b, %struct.X* %a ; <%struct.X*> [#uses=1] - %3 = getelementptr inbounds %struct.X* %p.0, i64 0, i32 0 ; <i32*> [#uses=1] - %4 = load i32* %3, align 8 ; <i32> [#uses=1] + %3 = getelementptr inbounds %struct.X, %struct.X* %p.0, i64 0, i32 0 ; <i32*> [#uses=1] + %4 = load i32, i32* %3, align 8 ; <i32> [#uses=1] ret i32 %4 } @@ -30,16 +30,16 @@ entry: define i32 @test2(i1 %c) { entry: %A = alloca {i32, i32} - %B = getelementptr {i32, i32}* %A, i32 0, i32 0 + %B = getelementptr {i32, i32}, {i32, i32}* %A, i32 0, i32 0 store i32 1, i32* %B br i1 %c, label %T, label %F T: - %C = getelementptr {i32, i32}* %A, i32 0, i32 1 + %C = getelementptr {i32, i32}, {i32, i32}* %A, i32 0, i32 1 store i32 2, i32* %C br label %F F: %X = phi i32* [%B, %entry], [%C, %T] - %Q = load i32* %X + %Q = load i32, i32* %X ret i32 %Q } @@ -49,13 +49,13 @@ F: ; rdar://8904039 define i32 @test3(i1 %c) { %A = alloca {i32, i32} - %B = getelementptr {i32, i32}* %A, i32 0, i32 0 + %B = getelementptr {i32, i32}, {i32, i32}* %A, i32 0, i32 0 store i32 1, i32* %B - %C = getelementptr {i32, i32}* %A, i32 0, i32 1 + %C = getelementptr {i32, i32}, {i32, i32}* %A, i32 0, i32 1 store i32 2, i32* %C %X = select i1 %c, i32* %B, i32* %C - %Q = load i32* %X + %Q = load i32, i32* %X ret i32 %Q } @@ -65,14 +65,14 @@ entry: %A = alloca %PairTy ; CHECK-LABEL: @test4( ; CHECK: %A = alloca %PairTy - %B = getelementptr %PairTy* %A, i32 0, i32 0 + %B = getelementptr %PairTy, %PairTy* %A, i32 0, i32 0 store i32 1, i32* %B - %C = getelementptr %PairTy* %A, i32 0, i32 1 + %C = getelementptr %PairTy, %PairTy* %A, i32 0, i32 1 store i32 2, i32* %B %X = select i1 %c, i32* %B, i32* %C %Y = bitcast i32* %X to i64* - %Q = load i64* %Y + %Q = load i64, i64* %Y ret i64 %Q } @@ -91,7 +91,7 @@ entry: %p.0 = select i1 false, i32* %b, i32* %P store i32 123, i32* %p.0 - %r = load i32* %b, align 8 + %r = load i32, i32* %b, align 8 ret i32 %r ; CHECK-LABEL: @test5( @@ -105,7 +105,7 @@ define i32 @test6(i32 %x, i1 %c) nounwind readnone ssp { store i32 1, i32* %a, align 8 store i32 2, i32* %b, align 8 %p.0 = select i1 %c, i32* %b, i32* %a - %r = load i32* %p.0, align 8 + %r = load i32, i32* %p.0, align 8 ret i32 %r ; CHECK-LABEL: @test6( ; CHECK-NEXT: %r = select i1 %c, i32 2, i32 1 @@ -122,7 +122,7 @@ define i32 @test7(i32 %x, i1 %c) nounwind readnone ssp { store i32 0, i32* %a - %r = load i32* %p.0, align 8 + %r = load i32, i32* %p.0, align 8 ret i32 %r ; CHECK-LABEL: @test7( ; CHECK-NOT: alloca i32 @@ -148,6 +148,6 @@ T: br label %Cont Cont: %p.0 = phi i32* [%b, %entry],[%a, %T] - %r = load i32* %p.0, align 8 + %r = load i32, i32* %p.0, align 8 ret i32 %r } diff --git a/test/Transforms/ScalarRepl/phinodepromote.ll b/test/Transforms/ScalarRepl/phinodepromote.ll index 9c6e8b9..c3af624 100644 --- a/test/Transforms/ScalarRepl/phinodepromote.ll +++ b/test/Transforms/ScalarRepl/phinodepromote.ll @@ -21,14 +21,14 @@ entry: %mem_tmp.1 = alloca i32 ; <i32*> [#uses=3] store i32 0, i32* %mem_tmp.0 store i32 1, i32* %mem_tmp.1 - %tmp.1.i = load i32* %mem_tmp.1 ; <i32> [#uses=1] - %tmp.3.i = load i32* %mem_tmp.0 ; <i32> [#uses=1] + %tmp.1.i = load i32, i32* %mem_tmp.1 ; <i32> [#uses=1] + %tmp.3.i = load i32, i32* %mem_tmp.0 ; <i32> [#uses=1] %tmp.4.i = icmp sle i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1] br i1 %tmp.4.i, label %cond_true.i, label %cond_continue.i cond_true.i: ; preds = %entry br label %cond_continue.i cond_continue.i: ; preds = %cond_true.i, %entry %mem_tmp.i.0 = phi i32* [ %mem_tmp.1, %cond_true.i ], [ %mem_tmp.0, %entry ] ; <i32*> [#uses=1] - %tmp.3 = load i32* %mem_tmp.i.0 ; <i32> [#uses=1] + %tmp.3 = load i32, i32* %mem_tmp.i.0 ; <i32> [#uses=1] ret i32 %tmp.3 } diff --git a/test/Transforms/ScalarRepl/select_promote.ll b/test/Transforms/ScalarRepl/select_promote.ll index d6b2b75..b4ef8c4 100644 --- a/test/Transforms/ScalarRepl/select_promote.ll +++ b/test/Transforms/ScalarRepl/select_promote.ll @@ -8,11 +8,11 @@ define i32 @main() { %mem_tmp.1 = alloca i32 ; <i32*> [#uses=3] store i32 0, i32* %mem_tmp.0 store i32 1, i32* %mem_tmp.1 - %tmp.1.i = load i32* %mem_tmp.1 ; <i32> [#uses=1] - %tmp.3.i = load i32* %mem_tmp.0 ; <i32> [#uses=1] + %tmp.1.i = load i32, i32* %mem_tmp.1 ; <i32> [#uses=1] + %tmp.3.i = load i32, i32* %mem_tmp.0 ; <i32> [#uses=1] %tmp.4.i = icmp sle i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1] %mem_tmp.i.0 = select i1 %tmp.4.i, i32* %mem_tmp.1, i32* %mem_tmp.0 ; <i32*> [#uses=1] - %tmp.3 = load i32* %mem_tmp.i.0 ; <i32> [#uses=1] + %tmp.3 = load i32, i32* %mem_tmp.i.0 ; <i32> [#uses=1] ret i32 %tmp.3 } diff --git a/test/Transforms/ScalarRepl/sroa-fca.ll b/test/Transforms/ScalarRepl/sroa-fca.ll index 2df3b9b..c6e7c23 100644 --- a/test/Transforms/ScalarRepl/sroa-fca.ll +++ b/test/Transforms/ScalarRepl/sroa-fca.ll @@ -6,7 +6,7 @@ define i64 @test({i32, i32} %A) { %Y = bitcast i64* %X to {i32,i32}* store {i32,i32} %A, {i32,i32}* %Y - %Q = load i64* %X + %Q = load i64, i64* %X ret i64 %Q } @@ -15,7 +15,7 @@ define {i32,i32} @test2(i64 %A) { %Y = bitcast i64* %X to {i32,i32}* store i64 %A, i64* %X - %Q = load {i32,i32}* %Y + %Q = load {i32,i32}, {i32,i32}* %Y ret {i32,i32} %Q } diff --git a/test/Transforms/ScalarRepl/sroa_two.ll b/test/Transforms/ScalarRepl/sroa_two.ll index d8aa26d..f2285ef 100644 --- a/test/Transforms/ScalarRepl/sroa_two.ll +++ b/test/Transforms/ScalarRepl/sroa_two.ll @@ -2,12 +2,12 @@ define i32 @test(i32 %X) { %Arr = alloca [2 x i32] ; <[2 x i32]*> [#uses=3] - %tmp.0 = getelementptr [2 x i32]* %Arr, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp.0 = getelementptr [2 x i32], [2 x i32]* %Arr, i32 0, i32 0 ; <i32*> [#uses=1] store i32 1, i32* %tmp.0 - %tmp.1 = getelementptr [2 x i32]* %Arr, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp.1 = getelementptr [2 x i32], [2 x i32]* %Arr, i32 0, i32 1 ; <i32*> [#uses=1] store i32 2, i32* %tmp.1 - %tmp.3 = getelementptr [2 x i32]* %Arr, i32 0, i32 %X ; <i32*> [#uses=1] - %tmp.4 = load i32* %tmp.3 ; <i32> [#uses=1] + %tmp.3 = getelementptr [2 x i32], [2 x i32]* %Arr, i32 0, i32 %X ; <i32*> [#uses=1] + %tmp.4 = load i32, i32* %tmp.3 ; <i32> [#uses=1] ret i32 %tmp.4 } diff --git a/test/Transforms/ScalarRepl/union-fp-int.ll b/test/Transforms/ScalarRepl/union-fp-int.ll index 6a49918..fa64b60 100644 --- a/test/Transforms/ScalarRepl/union-fp-int.ll +++ b/test/Transforms/ScalarRepl/union-fp-int.ll @@ -8,7 +8,7 @@ define i32 @test(float %X) { %X_addr = alloca float ; <float*> [#uses=2] store float %X, float* %X_addr %X_addr.upgrd.1 = bitcast float* %X_addr to i32* ; <i32*> [#uses=1] - %tmp = load i32* %X_addr.upgrd.1 ; <i32> [#uses=1] + %tmp = load i32, i32* %X_addr.upgrd.1 ; <i32> [#uses=1] ret i32 %tmp } diff --git a/test/Transforms/ScalarRepl/union-packed.ll b/test/Transforms/ScalarRepl/union-packed.ll index b272abf..741de76 100644 --- a/test/Transforms/ScalarRepl/union-packed.ll +++ b/test/Transforms/ScalarRepl/union-packed.ll @@ -8,7 +8,7 @@ define <4 x i32> @test(<4 x float> %X) { %X_addr = alloca <4 x float> ; <<4 x float>*> [#uses=2] store <4 x float> %X, <4 x float>* %X_addr %X_addr.upgrd.1 = bitcast <4 x float>* %X_addr to <4 x i32>* ; <<4 x i32>*> [#uses=1] - %tmp = load <4 x i32>* %X_addr.upgrd.1 ; <<4 x i32>> [#uses=1] + %tmp = load <4 x i32>, <4 x i32>* %X_addr.upgrd.1 ; <<4 x i32>> [#uses=1] ret <4 x i32> %tmp } diff --git a/test/Transforms/ScalarRepl/union-pointer.ll b/test/Transforms/ScalarRepl/union-pointer.ll index f0dc141..6a5db1c 100644 --- a/test/Transforms/ScalarRepl/union-pointer.ll +++ b/test/Transforms/ScalarRepl/union-pointer.ll @@ -14,7 +14,7 @@ define i8* @test(i16* %X) { %X_addr = alloca i16* ; <i16**> [#uses=2] store i16* %X, i16** %X_addr %X_addr.upgrd.1 = bitcast i16** %X_addr to i8** ; <i8**> [#uses=1] - %tmp = load i8** %X_addr.upgrd.1 ; <i8*> [#uses=1] + %tmp = load i8*, i8** %X_addr.upgrd.1 ; <i8*> [#uses=1] ret i8* %tmp } @@ -26,7 +26,7 @@ define i8 addrspace(1)* @test_as1(i16 addrspace(1)* %x) { %x_addr = alloca i16 addrspace(1)* store i16 addrspace(1)* %x, i16 addrspace(1)** %x_addr %x_addr.upgrd.1 = bitcast i16 addrspace(1)** %x_addr to i8 addrspace(1)** - %tmp = load i8 addrspace(1)** %x_addr.upgrd.1 + %tmp = load i8 addrspace(1)*, i8 addrspace(1)** %x_addr.upgrd.1 ret i8 addrspace(1)* %tmp } @@ -36,10 +36,10 @@ define i8 addrspace(1)* @test_as1_array(i16 addrspace(1)* %x) { ; CHECK-NEXT: %2 = inttoptr i16 %1 to i8 addrspace(1)* ; CHECK-NEXT: ret i8 addrspace(1)* %2 %as_ptr_array = alloca [4 x i16 addrspace(1)*] - %elem1 = getelementptr [4 x i16 addrspace(1)*]* %as_ptr_array, i32 0, i32 1 + %elem1 = getelementptr [4 x i16 addrspace(1)*], [4 x i16 addrspace(1)*]* %as_ptr_array, i32 0, i32 1 store i16 addrspace(1)* %x, i16 addrspace(1)** %elem1 %elem1.cast = bitcast i16 addrspace(1)** %elem1 to i8 addrspace(1)** - %tmp = load i8 addrspace(1)** %elem1.cast + %tmp = load i8 addrspace(1)*, i8 addrspace(1)** %elem1.cast ret i8 addrspace(1)* %tmp } @@ -54,17 +54,17 @@ define void @test2(i64 %Op.0) { %tmp.upgrd.2 = call i64 @_Z3foov( ) ; <i64> [#uses=1] %tmp1.upgrd.3 = bitcast %struct.Val* %tmp1 to i64* ; <i64*> [#uses=1] store i64 %tmp.upgrd.2, i64* %tmp1.upgrd.3 - %tmp.upgrd.4 = getelementptr %struct.Val* %tmp, i32 0, i32 0 ; <i32**> [#uses=1] - %tmp2 = getelementptr %struct.Val* %tmp1, i32 0, i32 0 ; <i32**> [#uses=1] - %tmp.upgrd.5 = load i32** %tmp2 ; <i32*> [#uses=1] + %tmp.upgrd.4 = getelementptr %struct.Val, %struct.Val* %tmp, i32 0, i32 0 ; <i32**> [#uses=1] + %tmp2 = getelementptr %struct.Val, %struct.Val* %tmp1, i32 0, i32 0 ; <i32**> [#uses=1] + %tmp.upgrd.5 = load i32*, i32** %tmp2 ; <i32*> [#uses=1] store i32* %tmp.upgrd.5, i32** %tmp.upgrd.4 - %tmp3 = getelementptr %struct.Val* %tmp, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp4 = getelementptr %struct.Val* %tmp1, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp.upgrd.6 = load i32* %tmp4 ; <i32> [#uses=1] + %tmp3 = getelementptr %struct.Val, %struct.Val* %tmp, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp4 = getelementptr %struct.Val, %struct.Val* %tmp1, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp.upgrd.6 = load i32, i32* %tmp4 ; <i32> [#uses=1] store i32 %tmp.upgrd.6, i32* %tmp3 %tmp7 = bitcast %struct.Val* %tmp to { i64 }* ; <{ i64 }*> [#uses=1] - %tmp8 = getelementptr { i64 }* %tmp7, i32 0, i32 0 ; <i64*> [#uses=1] - %tmp9 = load i64* %tmp8 ; <i64> [#uses=1] + %tmp8 = getelementptr { i64 }, { i64 }* %tmp7, i32 0, i32 0 ; <i64*> [#uses=1] + %tmp9 = load i64, i64* %tmp8 ; <i64> [#uses=1] call void @_Z3bar3ValS_( i64 %Op.0, i64 %tmp9 ) ret void } diff --git a/test/Transforms/ScalarRepl/vector_memcpy.ll b/test/Transforms/ScalarRepl/vector_memcpy.ll index dfba9e2..031ad5e 100644 --- a/test/Transforms/ScalarRepl/vector_memcpy.ll +++ b/test/Transforms/ScalarRepl/vector_memcpy.ll @@ -10,7 +10,7 @@ define <16 x float> @foo(<16 x float> %A) nounwind { %s = bitcast <16 x float>* %tmp to i8* %s2 = bitcast <16 x float>* %tmp2 to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %s2, i8* %s, i64 64, i32 16, i1 false) - %R = load <16 x float>* %tmp2 + %R = load <16 x float>, <16 x float>* %tmp2 ret <16 x float> %R } @@ -20,7 +20,7 @@ define <16 x float> @foo2(<16 x float> %A) nounwind { %s2 = bitcast <16 x float>* %tmp2 to i8* call void @llvm.memset.p0i8.i64(i8* %s2, i8 0, i64 64, i32 16, i1 false) - %R = load <16 x float>* %tmp2 + %R = load <16 x float>, <16 x float>* %tmp2 ret <16 x float> %R } diff --git a/test/Transforms/ScalarRepl/vector_promote.ll b/test/Transforms/ScalarRepl/vector_promote.ll index 8ca1ed5..3c2377f 100644 --- a/test/Transforms/ScalarRepl/vector_promote.ll +++ b/test/Transforms/ScalarRepl/vector_promote.ll @@ -5,18 +5,18 @@ target triple = "x86_64-apple-darwin10.0.0" define void @test1(<4 x float>* %F, float %f) { entry: %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3] - %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2] + %tmp = load <4 x float>, <4 x float>* %F ; <<4 x float>> [#uses=2] %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1] store <4 x float> %tmp3, <4 x float>* %G - %G.upgrd.1 = getelementptr <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1] + %G.upgrd.1 = getelementptr <4 x float>, <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1] store float %f, float* %G.upgrd.1 - %tmp4 = load <4 x float>* %G ; <<4 x float>> [#uses=2] + %tmp4 = load <4 x float>, <4 x float>* %G ; <<4 x float>> [#uses=2] %tmp6 = fadd <4 x float> %tmp4, %tmp4 ; <<4 x float>> [#uses=1] store <4 x float> %tmp6, <4 x float>* %F ret void ; CHECK-LABEL: @test1( ; CHECK-NOT: alloca -; CHECK: %tmp = load <4 x float>* %F +; CHECK: %tmp = load <4 x float>, <4 x float>* %F ; CHECK: fadd <4 x float> %tmp, %tmp ; CHECK-NEXT: insertelement <4 x float> %tmp3, float %f, i32 0 } @@ -24,18 +24,18 @@ entry: define void @test2(<4 x float>* %F, float %f) { entry: %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3] - %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2] + %tmp = load <4 x float>, <4 x float>* %F ; <<4 x float>> [#uses=2] %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1] store <4 x float> %tmp3, <4 x float>* %G - %tmp.upgrd.2 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1] + %tmp.upgrd.2 = getelementptr <4 x float>, <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1] store float %f, float* %tmp.upgrd.2 - %tmp4 = load <4 x float>* %G ; <<4 x float>> [#uses=2] + %tmp4 = load <4 x float>, <4 x float>* %G ; <<4 x float>> [#uses=2] %tmp6 = fadd <4 x float> %tmp4, %tmp4 ; <<4 x float>> [#uses=1] store <4 x float> %tmp6, <4 x float>* %F ret void ; CHECK-LABEL: @test2( ; CHECK-NOT: alloca -; CHECK: %tmp = load <4 x float>* %F +; CHECK: %tmp = load <4 x float>, <4 x float>* %F ; CHECK: fadd <4 x float> %tmp, %tmp ; CHECK-NEXT: insertelement <4 x float> %tmp3, float %f, i32 2 } @@ -43,16 +43,16 @@ entry: define void @test3(<4 x float>* %F, float* %f) { entry: %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2] - %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2] + %tmp = load <4 x float>, <4 x float>* %F ; <<4 x float>> [#uses=2] %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1] store <4 x float> %tmp3, <4 x float>* %G - %tmp.upgrd.3 = getelementptr <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1] - %tmp.upgrd.4 = load float* %tmp.upgrd.3 ; <float> [#uses=1] + %tmp.upgrd.3 = getelementptr <4 x float>, <4 x float>* %G, i32 0, i32 2 ; <float*> [#uses=1] + %tmp.upgrd.4 = load float, float* %tmp.upgrd.3 ; <float> [#uses=1] store float %tmp.upgrd.4, float* %f ret void ; CHECK-LABEL: @test3( ; CHECK-NOT: alloca -; CHECK: %tmp = load <4 x float>* %F +; CHECK: %tmp = load <4 x float>, <4 x float>* %F ; CHECK: fadd <4 x float> %tmp, %tmp ; CHECK-NEXT: extractelement <4 x float> %tmp3, i32 2 } @@ -60,26 +60,26 @@ entry: define void @test4(<4 x float>* %F, float* %f) { entry: %G = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2] - %tmp = load <4 x float>* %F ; <<4 x float>> [#uses=2] + %tmp = load <4 x float>, <4 x float>* %F ; <<4 x float>> [#uses=2] %tmp3 = fadd <4 x float> %tmp, %tmp ; <<4 x float>> [#uses=1] store <4 x float> %tmp3, <4 x float>* %G - %G.upgrd.5 = getelementptr <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1] - %tmp.upgrd.6 = load float* %G.upgrd.5 ; <float> [#uses=1] + %G.upgrd.5 = getelementptr <4 x float>, <4 x float>* %G, i32 0, i32 0 ; <float*> [#uses=1] + %tmp.upgrd.6 = load float, float* %G.upgrd.5 ; <float> [#uses=1] store float %tmp.upgrd.6, float* %f ret void ; CHECK-LABEL: @test4( ; CHECK-NOT: alloca -; CHECK: %tmp = load <4 x float>* %F +; CHECK: %tmp = load <4 x float>, <4 x float>* %F ; CHECK: fadd <4 x float> %tmp, %tmp ; CHECK-NEXT: extractelement <4 x float> %tmp3, i32 0 } define i32 @test5(float %X) { ;; should turn into bitcast. %X_addr = alloca [4 x float] - %X1 = getelementptr [4 x float]* %X_addr, i32 0, i32 2 + %X1 = getelementptr [4 x float], [4 x float]* %X_addr, i32 0, i32 2 store float %X, float* %X1 %a = bitcast float* %X1 to i32* - %tmp = load i32* %a + %tmp = load i32, i32* %a ret i32 %tmp ; CHECK-LABEL: @test5( ; CHECK-NEXT: bitcast float %X to i32 @@ -90,7 +90,7 @@ define i64 @test6(<2 x float> %X) { %X_addr = alloca <2 x float> store <2 x float> %X, <2 x float>* %X_addr %P = bitcast <2 x float>* %X_addr to i64* - %tmp = load i64* %P + %tmp = load i64, i64* %P ret i64 %tmp ; CHECK-LABEL: @test6( ; CHECK: bitcast <2 x float> %X to i64 @@ -104,7 +104,7 @@ entry: %memtmp = alloca %struct.test7, align 16 %0 = bitcast %struct.test7* %memtmp to <4 x i32>* store <4 x i32> zeroinitializer, <4 x i32>* %0, align 16 - %1 = getelementptr inbounds %struct.test7* %memtmp, i64 0, i32 0, i64 5 + %1 = getelementptr inbounds %struct.test7, %struct.test7* %memtmp, i64 0, i32 0, i64 5 store i32 0, i32* %1, align 4 ret void ; CHECK-LABEL: @test7( @@ -121,14 +121,14 @@ entry: %__a = alloca <1 x i64>, align 8 %tmp = alloca <1 x i64>, align 8 store <1 x i64> %a, <1 x i64>* %a.addr, align 8 - %0 = load <1 x i64>* %a.addr, align 8 + %0 = load <1 x i64>, <1 x i64>* %a.addr, align 8 store <1 x i64> %0, <1 x i64>* %__a, align 8 - %1 = load <1 x i64>* %__a, align 8 + %1 = load <1 x i64>, <1 x i64>* %__a, align 8 %2 = bitcast <1 x i64> %1 to <8 x i8> %3 = bitcast <8 x i8> %2 to <1 x i64> %vshl_n = shl <1 x i64> %3, <i64 4> store <1 x i64> %vshl_n, <1 x i64>* %tmp - %4 = load <1 x i64>* %tmp + %4 = load <1 x i64>, <1 x i64>* %tmp ret <1 x i64> %4 ; CHECK-LABEL: @test8( ; CHECK-NOT: alloca diff --git a/test/Transforms/ScalarRepl/vectors-with-mismatched-elements.ll b/test/Transforms/ScalarRepl/vectors-with-mismatched-elements.ll index c3fbdf5..1548831 100644 --- a/test/Transforms/ScalarRepl/vectors-with-mismatched-elements.ll +++ b/test/Transforms/ScalarRepl/vectors-with-mismatched-elements.ll @@ -18,10 +18,10 @@ define <2 x i64> @foo() nounwind { entry: %retval = alloca <3 x i32>, align 16 %z = alloca <4 x i32>, align 16 - %tmp = load <4 x i32>* %z + %tmp = load <4 x i32>, <4 x i32>* %z %tmp1 = shufflevector <4 x i32> %tmp, <4 x i32> undef, <3 x i32> <i32 0, i32 1, i32 2> store <3 x i32> %tmp1, <3 x i32>* %retval %0 = bitcast <3 x i32>* %retval to <2 x i64>* - %1 = load <2 x i64>* %0, align 1 + %1 = load <2 x i64>, <2 x i64>* %0, align 1 ret <2 x i64> %1 } diff --git a/test/Transforms/ScalarRepl/volatile.ll b/test/Transforms/ScalarRepl/volatile.ll index d506cdf..2a600b3 100644 --- a/test/Transforms/ScalarRepl/volatile.ll +++ b/test/Transforms/ScalarRepl/volatile.ll @@ -2,12 +2,12 @@ define i32 @voltest(i32 %T) { %A = alloca {i32, i32} - %B = getelementptr {i32,i32}* %A, i32 0, i32 0 + %B = getelementptr {i32,i32}, {i32,i32}* %A, i32 0, i32 0 store volatile i32 %T, i32* %B ; CHECK: store volatile - %C = getelementptr {i32,i32}* %A, i32 0, i32 1 - %X = load volatile i32* %C + %C = getelementptr {i32,i32}, {i32,i32}* %A, i32 0, i32 1 + %X = load volatile i32, i32* %C ; CHECK: load volatile ret i32 %X } diff --git a/test/Transforms/Scalarizer/basic.ll b/test/Transforms/Scalarizer/basic.ll index a94cf9f..150eb7d 100644 --- a/test/Transforms/Scalarizer/basic.ll +++ b/test/Transforms/Scalarizer/basic.ll @@ -19,15 +19,15 @@ define void @f1(<4 x float> %init, <4 x float> *%base, i32 %count) { ; CHECK: %acc.i2 = phi float [ %init.i2, %entry ], [ %sel.i2, %loop ] ; CHECK: %acc.i3 = phi float [ %init.i3, %entry ], [ %sel.i3, %loop ] ; CHECK: %nexti = sub i32 %i, 1 -; CHECK: %ptr = getelementptr <4 x float>* %base, i32 %i +; CHECK: %ptr = getelementptr <4 x float>, <4 x float>* %base, i32 %i ; CHECK: %ptr.i0 = bitcast <4 x float>* %ptr to float* -; CHECK: %val.i0 = load float* %ptr.i0, align 16 -; CHECK: %ptr.i1 = getelementptr float* %ptr.i0, i32 1 -; CHECK: %val.i1 = load float* %ptr.i1, align 4 -; CHECK: %ptr.i2 = getelementptr float* %ptr.i0, i32 2 -; CHECK: %val.i2 = load float* %ptr.i2, align 8 -; CHECK: %ptr.i3 = getelementptr float* %ptr.i0, i32 3 -; CHECK: %val.i3 = load float* %ptr.i3, align 4 +; CHECK: %val.i0 = load float, float* %ptr.i0, align 16 +; CHECK: %ptr.i1 = getelementptr float, float* %ptr.i0, i32 1 +; CHECK: %val.i1 = load float, float* %ptr.i1, align 4 +; CHECK: %ptr.i2 = getelementptr float, float* %ptr.i0, i32 2 +; CHECK: %val.i2 = load float, float* %ptr.i2, align 8 +; CHECK: %ptr.i3 = getelementptr float, float* %ptr.i0, i32 3 +; CHECK: %val.i3 = load float, float* %ptr.i3, align 4 ; CHECK: %add.i0 = fadd float %val.i0, %val.i2 ; CHECK: %add.i1 = fadd float %val.i1, %val.i3 ; CHECK: %add.i2 = fadd float %acc.i0, %acc.i2 @@ -65,8 +65,8 @@ loop: %acc = phi <4 x float> [ %init, %entry ], [ %sel, %loop ] %nexti = sub i32 %i, 1 - %ptr = getelementptr <4 x float> *%base, i32 %i - %val = load <4 x float> *%ptr + %ptr = getelementptr <4 x float>, <4 x float> *%base, i32 %i + %val = load <4 x float> , <4 x float> *%ptr %dval = bitcast <4 x float> %val to <2 x double> %dacc = bitcast <4 x float> %acc to <2 x double> %shuffle1 = shufflevector <2 x double> %dval, <2 x double> %dacc, @@ -105,15 +105,15 @@ define void @f2(<4 x i32> %init, <4 x i8> *%base, i32 %count) { ; CHECK: %acc.i2 = phi i32 [ %init.i2, %entry ], [ %sel.i2, %loop ] ; CHECK: %acc.i3 = phi i32 [ %init.i3, %entry ], [ %sel.i3, %loop ] ; CHECK: %nexti = sub i32 %i, 1 -; CHECK: %ptr = getelementptr <4 x i8>* %base, i32 %i +; CHECK: %ptr = getelementptr <4 x i8>, <4 x i8>* %base, i32 %i ; CHECK: %ptr.i0 = bitcast <4 x i8>* %ptr to i8* -; CHECK: %val.i0 = load i8* %ptr.i0, align 4 -; CHECK: %ptr.i1 = getelementptr i8* %ptr.i0, i32 1 -; CHECK: %val.i1 = load i8* %ptr.i1, align 1 -; CHECK: %ptr.i2 = getelementptr i8* %ptr.i0, i32 2 -; CHECK: %val.i2 = load i8* %ptr.i2, align 2 -; CHECK: %ptr.i3 = getelementptr i8* %ptr.i0, i32 3 -; CHECK: %val.i3 = load i8* %ptr.i3, align 1 +; CHECK: %val.i0 = load i8, i8* %ptr.i0, align 4 +; CHECK: %ptr.i1 = getelementptr i8, i8* %ptr.i0, i32 1 +; CHECK: %val.i1 = load i8, i8* %ptr.i1, align 1 +; CHECK: %ptr.i2 = getelementptr i8, i8* %ptr.i0, i32 2 +; CHECK: %val.i2 = load i8, i8* %ptr.i2, align 2 +; CHECK: %ptr.i3 = getelementptr i8, i8* %ptr.i0, i32 3 +; CHECK: %val.i3 = load i8, i8* %ptr.i3, align 1 ; CHECK: %ext.i0 = sext i8 %val.i0 to i32 ; CHECK: %ext.i1 = sext i8 %val.i1 to i32 ; CHECK: %ext.i2 = sext i8 %val.i2 to i32 @@ -150,8 +150,8 @@ loop: %acc = phi <4 x i32> [ %init, %entry ], [ %sel, %loop ] %nexti = sub i32 %i, 1 - %ptr = getelementptr <4 x i8> *%base, i32 %i - %val = load <4 x i8> *%ptr + %ptr = getelementptr <4 x i8>, <4 x i8> *%base, i32 %i + %val = load <4 x i8> , <4 x i8> *%ptr %ext = sext <4 x i8> %val to <4 x i32> %add = add <4 x i32> %ext, %acc %cmp = icmp slt <4 x i32> %add, <i32 -10, i32 -11, i32 -12, i32 -13> @@ -172,16 +172,16 @@ exit: ; Check that !tbaa information is preserved. define void @f3(<4 x i32> *%src, <4 x i32> *%dst) { ; CHECK-LABEL: @f3( -; CHECK: %val.i0 = load i32* %src.i0, align 16, !tbaa ![[TAG:[0-9]*]] -; CHECK: %val.i1 = load i32* %src.i1, align 4, !tbaa ![[TAG]] -; CHECK: %val.i2 = load i32* %src.i2, align 8, !tbaa ![[TAG]] -; CHECK: %val.i3 = load i32* %src.i3, align 4, !tbaa ![[TAG]] +; CHECK: %val.i0 = load i32, i32* %src.i0, align 16, !tbaa ![[TAG:[0-9]*]] +; CHECK: %val.i1 = load i32, i32* %src.i1, align 4, !tbaa ![[TAG]] +; CHECK: %val.i2 = load i32, i32* %src.i2, align 8, !tbaa ![[TAG]] +; CHECK: %val.i3 = load i32, i32* %src.i3, align 4, !tbaa ![[TAG]] ; CHECK: store i32 %add.i0, i32* %dst.i0, align 16, !tbaa ![[TAG:[0-9]*]] ; CHECK: store i32 %add.i1, i32* %dst.i1, align 4, !tbaa ![[TAG]] ; CHECK: store i32 %add.i2, i32* %dst.i2, align 8, !tbaa ![[TAG]] ; CHECK: store i32 %add.i3, i32* %dst.i3, align 4, !tbaa ![[TAG]] ; CHECK: ret void - %val = load <4 x i32> *%src, !tbaa !1 + %val = load <4 x i32> , <4 x i32> *%src, !tbaa !1 %add = add <4 x i32> %val, %val store <4 x i32> %add, <4 x i32> *%dst, !tbaa !2 ret void @@ -190,16 +190,16 @@ define void @f3(<4 x i32> *%src, <4 x i32> *%dst) { ; Check that !tbaa.struct information is preserved. define void @f4(<4 x i32> *%src, <4 x i32> *%dst) { ; CHECK-LABEL: @f4( -; CHECK: %val.i0 = load i32* %src.i0, align 16, !tbaa.struct ![[TAG:[0-9]*]] -; CHECK: %val.i1 = load i32* %src.i1, align 4, !tbaa.struct ![[TAG]] -; CHECK: %val.i2 = load i32* %src.i2, align 8, !tbaa.struct ![[TAG]] -; CHECK: %val.i3 = load i32* %src.i3, align 4, !tbaa.struct ![[TAG]] +; CHECK: %val.i0 = load i32, i32* %src.i0, align 16, !tbaa.struct ![[TAG:[0-9]*]] +; CHECK: %val.i1 = load i32, i32* %src.i1, align 4, !tbaa.struct ![[TAG]] +; CHECK: %val.i2 = load i32, i32* %src.i2, align 8, !tbaa.struct ![[TAG]] +; CHECK: %val.i3 = load i32, i32* %src.i3, align 4, !tbaa.struct ![[TAG]] ; CHECK: store i32 %add.i0, i32* %dst.i0, align 16, !tbaa.struct ![[TAG]] ; CHECK: store i32 %add.i1, i32* %dst.i1, align 4, !tbaa.struct ![[TAG]] ; CHECK: store i32 %add.i2, i32* %dst.i2, align 8, !tbaa.struct ![[TAG]] ; CHECK: store i32 %add.i3, i32* %dst.i3, align 4, !tbaa.struct ![[TAG]] ; CHECK: ret void - %val = load <4 x i32> *%src, !tbaa.struct !5 + %val = load <4 x i32> , <4 x i32> *%src, !tbaa.struct !5 %add = add <4 x i32> %val, %val store <4 x i32> %add, <4 x i32> *%dst, !tbaa.struct !5 ret void @@ -208,10 +208,10 @@ define void @f4(<4 x i32> *%src, <4 x i32> *%dst) { ; Check that llvm.mem.parallel_loop_access information is preserved. define void @f5(i32 %count, <4 x i32> *%src, <4 x i32> *%dst) { ; CHECK-LABEL: @f5( -; CHECK: %val.i0 = load i32* %this_src.i0, align 16, !llvm.mem.parallel_loop_access ![[TAG:[0-9]*]] -; CHECK: %val.i1 = load i32* %this_src.i1, align 4, !llvm.mem.parallel_loop_access ![[TAG]] -; CHECK: %val.i2 = load i32* %this_src.i2, align 8, !llvm.mem.parallel_loop_access ![[TAG]] -; CHECK: %val.i3 = load i32* %this_src.i3, align 4, !llvm.mem.parallel_loop_access ![[TAG]] +; CHECK: %val.i0 = load i32, i32* %this_src.i0, align 16, !llvm.mem.parallel_loop_access ![[TAG:[0-9]*]] +; CHECK: %val.i1 = load i32, i32* %this_src.i1, align 4, !llvm.mem.parallel_loop_access ![[TAG]] +; CHECK: %val.i2 = load i32, i32* %this_src.i2, align 8, !llvm.mem.parallel_loop_access ![[TAG]] +; CHECK: %val.i3 = load i32, i32* %this_src.i3, align 4, !llvm.mem.parallel_loop_access ![[TAG]] ; CHECK: store i32 %add.i0, i32* %this_dst.i0, align 16, !llvm.mem.parallel_loop_access ![[TAG]] ; CHECK: store i32 %add.i1, i32* %this_dst.i1, align 4, !llvm.mem.parallel_loop_access ![[TAG]] ; CHECK: store i32 %add.i2, i32* %this_dst.i2, align 8, !llvm.mem.parallel_loop_access ![[TAG]] @@ -222,9 +222,9 @@ entry: loop: %index = phi i32 [ 0, %entry ], [ %next_index, %loop ] - %this_src = getelementptr <4 x i32> *%src, i32 %index - %this_dst = getelementptr <4 x i32> *%dst, i32 %index - %val = load <4 x i32> *%this_src, !llvm.mem.parallel_loop_access !3 + %this_src = getelementptr <4 x i32>, <4 x i32> *%src, i32 %index + %this_dst = getelementptr <4 x i32>, <4 x i32> *%dst, i32 %index + %val = load <4 x i32> , <4 x i32> *%this_src, !llvm.mem.parallel_loop_access !3 %add = add <4 x i32> %val, %val store <4 x i32> %add, <4 x i32> *%this_dst, !llvm.mem.parallel_loop_access !3 %next_index = add i32 %index, -1 @@ -261,7 +261,7 @@ define void @f7(<4 x i32> *%src, <4 x i32> *%dst) { ; CHECK-LABEL: @f7( ; CHECK-NOT: !foo ; CHECK: ret void - %val = load <4 x i32> *%src, !foo !5 + %val = load <4 x i32> , <4 x i32> *%src, !foo !5 %add = add <4 x i32> %val, %val store <4 x i32> %add, <4 x i32> *%dst, !foo !5 ret void @@ -272,18 +272,18 @@ define void @f8(<4 x float *> *%dest, <4 x float *> %ptr0, <4 x i32> %i0, float *%other) { ; CHECK-LABEL: @f8( ; CHECK: %dest.i0 = bitcast <4 x float*>* %dest to float** -; CHECK: %dest.i1 = getelementptr float** %dest.i0, i32 1 -; CHECK: %dest.i2 = getelementptr float** %dest.i0, i32 2 -; CHECK: %dest.i3 = getelementptr float** %dest.i0, i32 3 +; CHECK: %dest.i1 = getelementptr float*, float** %dest.i0, i32 1 +; CHECK: %dest.i2 = getelementptr float*, float** %dest.i0, i32 2 +; CHECK: %dest.i3 = getelementptr float*, float** %dest.i0, i32 3 ; CHECK: %i0.i1 = extractelement <4 x i32> %i0, i32 1 ; CHECK: %i0.i3 = extractelement <4 x i32> %i0, i32 3 ; CHECK: %ptr0.i0 = extractelement <4 x float*> %ptr0, i32 0 -; CHECK: %val.i0 = getelementptr float* %ptr0.i0, i32 100 -; CHECK: %val.i1 = getelementptr float* %other, i32 %i0.i1 +; CHECK: %val.i0 = getelementptr float, float* %ptr0.i0, i32 100 +; CHECK: %val.i1 = getelementptr float, float* %other, i32 %i0.i1 ; CHECK: %ptr0.i2 = extractelement <4 x float*> %ptr0, i32 2 -; CHECK: %val.i2 = getelementptr float* %ptr0.i2, i32 100 +; CHECK: %val.i2 = getelementptr float, float* %ptr0.i2, i32 100 ; CHECK: %ptr0.i3 = extractelement <4 x float*> %ptr0, i32 3 -; CHECK: %val.i3 = getelementptr float* %ptr0.i3, i32 %i0.i3 +; CHECK: %val.i3 = getelementptr float, float* %ptr0.i3, i32 %i0.i3 ; CHECK: store float* %val.i0, float** %dest.i0, align 32 ; CHECK: store float* %val.i1, float** %dest.i1, align 8 ; CHECK: store float* %val.i2, float** %dest.i2, align 16 @@ -292,7 +292,7 @@ define void @f8(<4 x float *> *%dest, <4 x float *> %ptr0, <4 x i32> %i0, %i1 = insertelement <4 x i32> %i0, i32 100, i32 0 %i2 = insertelement <4 x i32> %i1, i32 100, i32 2 %ptr1 = insertelement <4 x float *> %ptr0, float *%other, i32 1 - %val = getelementptr <4 x float *> %ptr1, <4 x i32> %i2 + %val = getelementptr float, <4 x float *> %ptr1, <4 x i32> %i2 store <4 x float *> %val, <4 x float *> *%dest ret void } @@ -301,23 +301,23 @@ define void @f8(<4 x float *> *%dest, <4 x float *> %ptr0, <4 x i32> %i0, define void @f9(<4 x float> *%dest, <4 x float> *%src) { ; CHECK: @f9( ; CHECK: %dest.i0 = bitcast <4 x float>* %dest to float* -; CHECK: %dest.i1 = getelementptr float* %dest.i0, i32 1 -; CHECK: %dest.i2 = getelementptr float* %dest.i0, i32 2 -; CHECK: %dest.i3 = getelementptr float* %dest.i0, i32 3 +; CHECK: %dest.i1 = getelementptr float, float* %dest.i0, i32 1 +; CHECK: %dest.i2 = getelementptr float, float* %dest.i0, i32 2 +; CHECK: %dest.i3 = getelementptr float, float* %dest.i0, i32 3 ; CHECK: %src.i0 = bitcast <4 x float>* %src to float* -; CHECK: %val.i0 = load float* %src.i0, align 4 -; CHECK: %src.i1 = getelementptr float* %src.i0, i32 1 -; CHECK: %val.i1 = load float* %src.i1, align 4 -; CHECK: %src.i2 = getelementptr float* %src.i0, i32 2 -; CHECK: %val.i2 = load float* %src.i2, align 4 -; CHECK: %src.i3 = getelementptr float* %src.i0, i32 3 -; CHECK: %val.i3 = load float* %src.i3, align 4 +; CHECK: %val.i0 = load float, float* %src.i0, align 4 +; CHECK: %src.i1 = getelementptr float, float* %src.i0, i32 1 +; CHECK: %val.i1 = load float, float* %src.i1, align 4 +; CHECK: %src.i2 = getelementptr float, float* %src.i0, i32 2 +; CHECK: %val.i2 = load float, float* %src.i2, align 4 +; CHECK: %src.i3 = getelementptr float, float* %src.i0, i32 3 +; CHECK: %val.i3 = load float, float* %src.i3, align 4 ; CHECK: store float %val.i0, float* %dest.i0, align 8 ; CHECK: store float %val.i1, float* %dest.i1, align 4 ; CHECK: store float %val.i2, float* %dest.i2, align 8 ; CHECK: store float %val.i3, float* %dest.i3, align 4 ; CHECK: ret void - %val = load <4 x float> *%src, align 4 + %val = load <4 x float> , <4 x float> *%src, align 4 store <4 x float> %val, <4 x float> *%dest, align 8 ret void } @@ -326,23 +326,23 @@ define void @f9(<4 x float> *%dest, <4 x float> *%src) { define void @f10(<4 x float> *%dest, <4 x float> *%src) { ; CHECK: @f10( ; CHECK: %dest.i0 = bitcast <4 x float>* %dest to float* -; CHECK: %dest.i1 = getelementptr float* %dest.i0, i32 1 -; CHECK: %dest.i2 = getelementptr float* %dest.i0, i32 2 -; CHECK: %dest.i3 = getelementptr float* %dest.i0, i32 3 +; CHECK: %dest.i1 = getelementptr float, float* %dest.i0, i32 1 +; CHECK: %dest.i2 = getelementptr float, float* %dest.i0, i32 2 +; CHECK: %dest.i3 = getelementptr float, float* %dest.i0, i32 3 ; CHECK: %src.i0 = bitcast <4 x float>* %src to float* -; CHECK: %val.i0 = load float* %src.i0, align 1 -; CHECK: %src.i1 = getelementptr float* %src.i0, i32 1 -; CHECK: %val.i1 = load float* %src.i1, align 1 -; CHECK: %src.i2 = getelementptr float* %src.i0, i32 2 -; CHECK: %val.i2 = load float* %src.i2, align 1 -; CHECK: %src.i3 = getelementptr float* %src.i0, i32 3 -; CHECK: %val.i3 = load float* %src.i3, align 1 +; CHECK: %val.i0 = load float, float* %src.i0, align 1 +; CHECK: %src.i1 = getelementptr float, float* %src.i0, i32 1 +; CHECK: %val.i1 = load float, float* %src.i1, align 1 +; CHECK: %src.i2 = getelementptr float, float* %src.i0, i32 2 +; CHECK: %val.i2 = load float, float* %src.i2, align 1 +; CHECK: %src.i3 = getelementptr float, float* %src.i0, i32 3 +; CHECK: %val.i3 = load float, float* %src.i3, align 1 ; CHECK: store float %val.i0, float* %dest.i0, align 2 ; CHECK: store float %val.i1, float* %dest.i1, align 2 ; CHECK: store float %val.i2, float* %dest.i2, align 2 ; CHECK: store float %val.i3, float* %dest.i3, align 2 ; CHECK: ret void - %val = load <4 x float> *%src, align 1 + %val = load <4 x float> , <4 x float> *%src, align 1 store <4 x float> %val, <4 x float> *%dest, align 2 ret void } @@ -350,13 +350,13 @@ define void @f10(<4 x float> *%dest, <4 x float> *%src) { ; Test that sub-byte loads aren't scalarized. define void @f11(<32 x i1> *%dest, <32 x i1> *%src0) { ; CHECK: @f11( -; CHECK: %val0 = load <32 x i1>* %src0 -; CHECK: %val1 = load <32 x i1>* %src1 +; CHECK: %val0 = load <32 x i1>, <32 x i1>* %src0 +; CHECK: %val1 = load <32 x i1>, <32 x i1>* %src1 ; CHECK: store <32 x i1> %and, <32 x i1>* %dest ; CHECK: ret void - %src1 = getelementptr <32 x i1> *%src0, i32 1 - %val0 = load <32 x i1> *%src0 - %val1 = load <32 x i1> *%src1 + %src1 = getelementptr <32 x i1>, <32 x i1> *%src0, i32 1 + %val0 = load <32 x i1> , <32 x i1> *%src0 + %val1 = load <32 x i1> , <32 x i1> *%src1 %and = and <32 x i1> %val0, %val1 store <32 x i1> %and, <32 x i1> *%dest ret void @@ -375,7 +375,7 @@ define void @f12(<4 x i32> *%dest, <4 x i32> *%src, i32 %index) { ; CHECK-DAG: %val2.i2 = shl i32 3, %val1.i2 ; CHECK-DAG: %val2.i3 = shl i32 4, %val1.i3 ; CHECK: ret void - %val0 = load <4 x i32> *%src + %val0 = load <4 x i32> , <4 x i32> *%src %val1 = insertelement <4 x i32> %val0, i32 1, i32 %index %val2 = shl <4 x i32> <i32 1, i32 2, i32 3, i32 4>, %val1 store <4 x i32> %val2, <4 x i32> *%dest @@ -387,27 +387,27 @@ define void @f13(<4 x float *> *%dest, <4 x [4 x float] *> %ptr, <4 x i32> %i, float *%other) { ; CHECK-LABEL: @f13( ; CHECK: %dest.i0 = bitcast <4 x float*>* %dest to float** -; CHECK: %dest.i1 = getelementptr float** %dest.i0, i32 1 -; CHECK: %dest.i2 = getelementptr float** %dest.i0, i32 2 -; CHECK: %dest.i3 = getelementptr float** %dest.i0, i32 3 +; CHECK: %dest.i1 = getelementptr float*, float** %dest.i0, i32 1 +; CHECK: %dest.i2 = getelementptr float*, float** %dest.i0, i32 2 +; CHECK: %dest.i3 = getelementptr float*, float** %dest.i0, i32 3 ; CHECK: %i.i0 = extractelement <4 x i32> %i, i32 0 ; CHECK: %ptr.i0 = extractelement <4 x [4 x float]*> %ptr, i32 0 -; CHECK: %val.i0 = getelementptr inbounds [4 x float]* %ptr.i0, i32 0, i32 %i.i0 +; CHECK: %val.i0 = getelementptr inbounds [4 x float], [4 x float]* %ptr.i0, i32 0, i32 %i.i0 ; CHECK: %i.i1 = extractelement <4 x i32> %i, i32 1 ; CHECK: %ptr.i1 = extractelement <4 x [4 x float]*> %ptr, i32 1 -; CHECK: %val.i1 = getelementptr inbounds [4 x float]* %ptr.i1, i32 1, i32 %i.i1 +; CHECK: %val.i1 = getelementptr inbounds [4 x float], [4 x float]* %ptr.i1, i32 1, i32 %i.i1 ; CHECK: %i.i2 = extractelement <4 x i32> %i, i32 2 ; CHECK: %ptr.i2 = extractelement <4 x [4 x float]*> %ptr, i32 2 -; CHECK: %val.i2 = getelementptr inbounds [4 x float]* %ptr.i2, i32 2, i32 %i.i2 +; CHECK: %val.i2 = getelementptr inbounds [4 x float], [4 x float]* %ptr.i2, i32 2, i32 %i.i2 ; CHECK: %i.i3 = extractelement <4 x i32> %i, i32 3 ; CHECK: %ptr.i3 = extractelement <4 x [4 x float]*> %ptr, i32 3 -; CHECK: %val.i3 = getelementptr inbounds [4 x float]* %ptr.i3, i32 3, i32 %i.i3 +; CHECK: %val.i3 = getelementptr inbounds [4 x float], [4 x float]* %ptr.i3, i32 3, i32 %i.i3 ; CHECK: store float* %val.i0, float** %dest.i0, align 32 ; CHECK: store float* %val.i1, float** %dest.i1, align 8 ; CHECK: store float* %val.i2, float** %dest.i2, align 16 ; CHECK: store float* %val.i3, float** %dest.i3, align 8 ; CHECK: ret void - %val = getelementptr inbounds <4 x [4 x float] *> %ptr, + %val = getelementptr inbounds [4 x float], <4 x [4 x float] *> %ptr, <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32> %i store <4 x float *> %val, <4 x float *> *%dest diff --git a/test/Transforms/Scalarizer/dbginfo.ll b/test/Transforms/Scalarizer/dbginfo.ll index ed65aaa..2bc9335 100644 --- a/test/Transforms/Scalarizer/dbginfo.ll +++ b/test/Transforms/Scalarizer/dbginfo.ll @@ -5,28 +5,28 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define void @f1(<4 x i32>* nocapture %a, <4 x i32>* nocapture readonly %b, <4 x i32>* nocapture readonly %c) #0 { ; CHECK: @f1( ; CHECK: %a.i0 = bitcast <4 x i32>* %a to i32* -; CHECK: %a.i1 = getelementptr i32* %a.i0, i32 1 -; CHECK: %a.i2 = getelementptr i32* %a.i0, i32 2 -; CHECK: %a.i3 = getelementptr i32* %a.i0, i32 3 +; CHECK: %a.i1 = getelementptr i32, i32* %a.i0, i32 1 +; CHECK: %a.i2 = getelementptr i32, i32* %a.i0, i32 2 +; CHECK: %a.i3 = getelementptr i32, i32* %a.i0, i32 3 ; CHECK: %c.i0 = bitcast <4 x i32>* %c to i32* -; CHECK: %c.i1 = getelementptr i32* %c.i0, i32 1 -; CHECK: %c.i2 = getelementptr i32* %c.i0, i32 2 -; CHECK: %c.i3 = getelementptr i32* %c.i0, i32 3 +; CHECK: %c.i1 = getelementptr i32, i32* %c.i0, i32 1 +; CHECK: %c.i2 = getelementptr i32, i32* %c.i0, i32 2 +; CHECK: %c.i3 = getelementptr i32, i32* %c.i0, i32 3 ; CHECK: %b.i0 = bitcast <4 x i32>* %b to i32* -; CHECK: %b.i1 = getelementptr i32* %b.i0, i32 1 -; CHECK: %b.i2 = getelementptr i32* %b.i0, i32 2 -; CHECK: %b.i3 = getelementptr i32* %b.i0, i32 3 +; CHECK: %b.i1 = getelementptr i32, i32* %b.i0, i32 1 +; CHECK: %b.i2 = getelementptr i32, i32* %b.i0, i32 2 +; CHECK: %b.i3 = getelementptr i32, i32* %b.i0, i32 3 ; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %a, i64 0, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} ; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %b, i64 0, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} ; CHECK: tail call void @llvm.dbg.value(metadata <4 x i32>* %c, i64 0, metadata !{{[0-9]+}}, metadata {{.*}}), !dbg !{{[0-9]+}} -; CHECK: %bval.i0 = load i32* %b.i0, align 16, !dbg ![[TAG1:[0-9]+]], !tbaa ![[TAG2:[0-9]+]] -; CHECK: %bval.i1 = load i32* %b.i1, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] -; CHECK: %bval.i2 = load i32* %b.i2, align 8, !dbg ![[TAG1]], !tbaa ![[TAG2]] -; CHECK: %bval.i3 = load i32* %b.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] -; CHECK: %cval.i0 = load i32* %c.i0, align 16, !dbg ![[TAG1]], !tbaa ![[TAG2]] -; CHECK: %cval.i1 = load i32* %c.i1, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] -; CHECK: %cval.i2 = load i32* %c.i2, align 8, !dbg ![[TAG1]], !tbaa ![[TAG2]] -; CHECK: %cval.i3 = load i32* %c.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] +; CHECK: %bval.i0 = load i32, i32* %b.i0, align 16, !dbg ![[TAG1:[0-9]+]], !tbaa ![[TAG2:[0-9]+]] +; CHECK: %bval.i1 = load i32, i32* %b.i1, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] +; CHECK: %bval.i2 = load i32, i32* %b.i2, align 8, !dbg ![[TAG1]], !tbaa ![[TAG2]] +; CHECK: %bval.i3 = load i32, i32* %b.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] +; CHECK: %cval.i0 = load i32, i32* %c.i0, align 16, !dbg ![[TAG1]], !tbaa ![[TAG2]] +; CHECK: %cval.i1 = load i32, i32* %c.i1, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] +; CHECK: %cval.i2 = load i32, i32* %c.i2, align 8, !dbg ![[TAG1]], !tbaa ![[TAG2]] +; CHECK: %cval.i3 = load i32, i32* %c.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] ; CHECK: %add.i0 = add i32 %bval.i0, %cval.i0, !dbg ![[TAG1]] ; CHECK: %add.i1 = add i32 %bval.i1, %cval.i1, !dbg ![[TAG1]] ; CHECK: %add.i2 = add i32 %bval.i2, %cval.i2, !dbg ![[TAG1]] @@ -37,11 +37,11 @@ define void @f1(<4 x i32>* nocapture %a, <4 x i32>* nocapture readonly %b, <4 x ; CHECK: store i32 %add.i3, i32* %a.i3, align 4, !dbg ![[TAG1]], !tbaa ![[TAG2]] ; CHECK: ret void entry: - tail call void @llvm.dbg.value(metadata <4 x i32>* %a, i64 0, metadata !15, metadata !{}), !dbg !20 - tail call void @llvm.dbg.value(metadata <4 x i32>* %b, i64 0, metadata !16, metadata !{}), !dbg !20 - tail call void @llvm.dbg.value(metadata <4 x i32>* %c, i64 0, metadata !17, metadata !{}), !dbg !20 - %bval = load <4 x i32>* %b, align 16, !dbg !21, !tbaa !22 - %cval = load <4 x i32>* %c, align 16, !dbg !21, !tbaa !22 + tail call void @llvm.dbg.value(metadata <4 x i32>* %a, i64 0, metadata !15, metadata !MDExpression()), !dbg !20 + tail call void @llvm.dbg.value(metadata <4 x i32>* %b, i64 0, metadata !16, metadata !MDExpression()), !dbg !20 + tail call void @llvm.dbg.value(metadata <4 x i32>* %c, i64 0, metadata !17, metadata !MDExpression()), !dbg !20 + %bval = load <4 x i32>, <4 x i32>* %b, align 16, !dbg !21, !tbaa !22 + %cval = load <4 x i32>, <4 x i32>* %c, align 16, !dbg !21, !tbaa !22 %add = add <4 x i32> %bval, %cval, !dbg !21 store <4 x i32> %add, <4 x i32>* %a, align 16, !dbg !21, !tbaa !22 ret void, !dbg !25 @@ -57,24 +57,24 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!18, !26} !llvm.ident = !{!19} -!0 = !{!"0x11\0012\00clang version 3.4 (trunk 194134) (llvm/trunk 194126)\001\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/home/richards/llvm/build//tmp/add.c] [DW_LANG_C99] -!1 = !{!"/tmp/add.c", !"/home/richards/llvm/build"} +!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 194134) (llvm/trunk 194126)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build") !2 = !{i32 0} !3 = !{!4} -!4 = !{!"0x2e\00f1\00f1\00\003\000\001\000\006\00256\001\004", !1, !5, !6, null, void (<4 x i32>*, <4 x i32>*, <4 x i32>*)* @f1, null, null, !14} ; [ DW_TAG_subprogram ] [line 3] [def] [scope 4] [f] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/home/richards/llvm/build//tmp/add.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "f1", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: void (<4 x i32>*, <4 x i32>*, <4 x i32>*)* @f1, variables: !14) +!5 = !MDFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build") +!6 = !MDSubroutineType(types: !7) !7 = !{null, !8, !8, !8} -!8 = !{!"0xf\00\000\0064\0064\000\000", null, null, !9} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from V4SI] -!9 = !{!"0x16\00V4SI\001\000\000\000\000", !1, null, !10} ; [ DW_TAG_typedef ] [V4SI] [line 1, size 0, align 0, offset 0] [from ] -!10 = !{!"0x1\00\000\00128\00128\000\002048", null, null, !11, !12, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 128, align 128, offset 0] [vector] [from int] -!11 = !{!"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] +!8 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9) +!9 = !MDDerivedType(tag: DW_TAG_typedef, name: "V4SI", line: 1, file: !1, baseType: !10) +!10 = !MDCompositeType(tag: DW_TAG_array_type, size: 128, align: 128, flags: DIFlagVector, baseType: !11, elements: !12) +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{!13} -!13 = !{!"0x21\000\004"} ; [ DW_TAG_subrange_type ] [0, 3] +!13 = !MDSubrange(count: 4) !14 = !{!15, !16, !17} -!15 = !{!"0x101\00a\0016777219\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 3] -!16 = !{!"0x101\00b\0033554435\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [b] [line 3] -!17 = !{!"0x101\00c\0050331651\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [c] [line 3] +!15 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !4, file: !5, type: !8) +!16 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 3, arg: 2, scope: !4, file: !5, type: !8) +!17 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 3, arg: 3, scope: !4, file: !5, type: !8) !18 = !{i32 2, !"Dwarf Version", i32 4} !19 = !{!"clang version 3.4 (trunk 194134) (llvm/trunk 194126)"} !20 = !MDLocation(line: 3, scope: !4) @@ -83,4 +83,4 @@ attributes #1 = { nounwind readnone } !23 = !{!"omnipotent char", !24, i64 0} !24 = !{!"Simple C/C++ TBAA"} !25 = !MDLocation(line: 6, scope: !4) -!26 = !{i32 1, !"Debug Info Version", i32 2} +!26 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/Scalarizer/no-data-layout.ll b/test/Transforms/Scalarizer/no-data-layout.ll deleted file mode 100644 index 3eaf669..0000000 --- a/test/Transforms/Scalarizer/no-data-layout.ll +++ /dev/null @@ -1,25 +0,0 @@ -; RUN: opt %s -scalarizer -scalarize-load-store -S | FileCheck %s - -; Test the handling of loads and stores when no data layout is available. -define void @f1(<4 x float> *%dest, <4 x float> *%src) { -; CHECK: @f1( -; CHECK: %val = load <4 x float>* %src, align 4 -; CHECK: %val.i0 = extractelement <4 x float> %val, i32 0 -; CHECK: %add.i0 = fadd float %val.i0, %val.i0 -; CHECK: %val.i1 = extractelement <4 x float> %val, i32 1 -; CHECK: %add.i1 = fadd float %val.i1, %val.i1 -; CHECK: %val.i2 = extractelement <4 x float> %val, i32 2 -; CHECK: %add.i2 = fadd float %val.i2, %val.i2 -; CHECK: %val.i3 = extractelement <4 x float> %val, i32 3 -; CHECK: %add.i3 = fadd float %val.i3, %val.i3 -; CHECK: %add.upto0 = insertelement <4 x float> undef, float %add.i0, i32 0 -; CHECK: %add.upto1 = insertelement <4 x float> %add.upto0, float %add.i1, i32 1 -; CHECK: %add.upto2 = insertelement <4 x float> %add.upto1, float %add.i2, i32 2 -; CHECK: %add = insertelement <4 x float> %add.upto2, float %add.i3, i32 3 -; CHECK: store <4 x float> %add, <4 x float>* %dest, align 8 -; CHECK: ret void - %val = load <4 x float> *%src, align 4 - %add = fadd <4 x float> %val, %val - store <4 x float> %add, <4 x float> *%dest, align 8 - ret void -} diff --git a/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll b/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll index d054a3b..9ee492d 100644 --- a/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll +++ b/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll @@ -21,25 +21,25 @@ define void @sum_of_array(i32 %x, i32 %y, float* nocapture %output) { .preheader: %0 = sext i32 %y to i64 %1 = sext i32 %x to i64 - %2 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 + %2 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 %3 = addrspacecast float addrspace(3)* %2 to float* - %4 = load float* %3, align 4 + %4 = load float, float* %3, align 4 %5 = fadd float %4, 0.000000e+00 %6 = add i32 %y, 1 %7 = sext i32 %6 to i64 - %8 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %7 + %8 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %7 %9 = addrspacecast float addrspace(3)* %8 to float* - %10 = load float* %9, align 4 + %10 = load float, float* %9, align 4 %11 = fadd float %5, %10 %12 = add i32 %x, 1 %13 = sext i32 %12 to i64 - %14 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %0 + %14 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %0 %15 = addrspacecast float addrspace(3)* %14 to float* - %16 = load float* %15, align 4 + %16 = load float, float* %15, align 4 %17 = fadd float %11, %16 - %18 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %7 + %18 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %7 %19 = addrspacecast float addrspace(3)* %18 to float* - %20 = load float* %19, align 4 + %20 = load float, float* %19, align 4 %21 = fadd float %17, %20 store float %21, float* %output, align 4 ret void @@ -51,10 +51,10 @@ define void @sum_of_array(i32 %x, i32 %y, float* nocapture %output) { ; PTX: ld.shared.f32 {{%f[0-9]+}}, {{\[}}[[BASE_REG]]+132{{\]}} ; IR-LABEL: @sum_of_array( -; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 1 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 32 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 33 +; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 1 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 32 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 33 ; @sum_of_array2 is very similar to @sum_of_array. The only difference is in ; the order of "sext" and "add" when computing the array indices. @sum_of_array @@ -66,23 +66,23 @@ define void @sum_of_array2(i32 %x, i32 %y, float* nocapture %output) { .preheader: %0 = sext i32 %y to i64 %1 = sext i32 %x to i64 - %2 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 + %2 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 %3 = addrspacecast float addrspace(3)* %2 to float* - %4 = load float* %3, align 4 + %4 = load float, float* %3, align 4 %5 = fadd float %4, 0.000000e+00 %6 = add i64 %0, 1 - %7 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %6 + %7 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %6 %8 = addrspacecast float addrspace(3)* %7 to float* - %9 = load float* %8, align 4 + %9 = load float, float* %8, align 4 %10 = fadd float %5, %9 %11 = add i64 %1, 1 - %12 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %0 + %12 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %0 %13 = addrspacecast float addrspace(3)* %12 to float* - %14 = load float* %13, align 4 + %14 = load float, float* %13, align 4 %15 = fadd float %10, %14 - %16 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %6 + %16 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %6 %17 = addrspacecast float addrspace(3)* %16 to float* - %18 = load float* %17, align 4 + %18 = load float, float* %17, align 4 %19 = fadd float %15, %18 store float %19, float* %output, align 4 ret void @@ -94,10 +94,10 @@ define void @sum_of_array2(i32 %x, i32 %y, float* nocapture %output) { ; PTX: ld.shared.f32 {{%f[0-9]+}}, {{\[}}[[BASE_REG]]+132{{\]}} ; IR-LABEL: @sum_of_array2( -; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 1 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 32 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 33 +; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 1 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 32 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 33 ; This function loads @@ -114,25 +114,25 @@ define void @sum_of_array3(i32 %x, i32 %y, float* nocapture %output) { .preheader: %0 = zext i32 %y to i64 %1 = zext i32 %x to i64 - %2 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 + %2 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 %3 = addrspacecast float addrspace(3)* %2 to float* - %4 = load float* %3, align 4 + %4 = load float, float* %3, align 4 %5 = fadd float %4, 0.000000e+00 %6 = add nuw i32 %y, 1 %7 = zext i32 %6 to i64 - %8 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %7 + %8 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %7 %9 = addrspacecast float addrspace(3)* %8 to float* - %10 = load float* %9, align 4 + %10 = load float, float* %9, align 4 %11 = fadd float %5, %10 %12 = add nuw i32 %x, 1 %13 = zext i32 %12 to i64 - %14 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %0 + %14 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %0 %15 = addrspacecast float addrspace(3)* %14 to float* - %16 = load float* %15, align 4 + %16 = load float, float* %15, align 4 %17 = fadd float %11, %16 - %18 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %7 + %18 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %13, i64 %7 %19 = addrspacecast float addrspace(3)* %18 to float* - %20 = load float* %19, align 4 + %20 = load float, float* %19, align 4 %21 = fadd float %17, %20 store float %21, float* %output, align 4 ret void @@ -144,10 +144,10 @@ define void @sum_of_array3(i32 %x, i32 %y, float* nocapture %output) { ; PTX: ld.shared.f32 {{%f[0-9]+}}, {{\[}}[[BASE_REG]]+132{{\]}} ; IR-LABEL: @sum_of_array3( -; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 1 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 32 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 33 +; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 1 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 32 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 33 ; This function loads @@ -162,23 +162,23 @@ define void @sum_of_array4(i32 %x, i32 %y, float* nocapture %output) { .preheader: %0 = zext i32 %y to i64 %1 = zext i32 %x to i64 - %2 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 + %2 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %0 %3 = addrspacecast float addrspace(3)* %2 to float* - %4 = load float* %3, align 4 + %4 = load float, float* %3, align 4 %5 = fadd float %4, 0.000000e+00 %6 = add i64 %0, 1 - %7 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %6 + %7 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %1, i64 %6 %8 = addrspacecast float addrspace(3)* %7 to float* - %9 = load float* %8, align 4 + %9 = load float, float* %8, align 4 %10 = fadd float %5, %9 %11 = add i64 %1, 1 - %12 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %0 + %12 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %0 %13 = addrspacecast float addrspace(3)* %12 to float* - %14 = load float* %13, align 4 + %14 = load float, float* %13, align 4 %15 = fadd float %10, %14 - %16 = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %6 + %16 = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %11, i64 %6 %17 = addrspacecast float addrspace(3)* %16 to float* - %18 = load float* %17, align 4 + %18 = load float, float* %17, align 4 %19 = fadd float %15, %18 store float %19, float* %output, align 4 ret void @@ -190,7 +190,7 @@ define void @sum_of_array4(i32 %x, i32 %y, float* nocapture %output) { ; PTX: ld.shared.f32 {{%f[0-9]+}}, {{\[}}[[BASE_REG]]+132{{\]}} ; IR-LABEL: @sum_of_array4( -; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 1 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 32 -; IR: getelementptr float addrspace(3)* [[BASE_PTR]], i64 33 +; IR: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]] addrspace(3)* @array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 1 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 32 +; IR: getelementptr float, float addrspace(3)* [[BASE_PTR]], i64 33 diff --git a/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll b/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll index ea0d3f5..574f6e9 100644 --- a/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll +++ b/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll @@ -20,11 +20,11 @@ define double* @struct(i32 %i) { entry: %add = add nsw i32 %i, 5 %idxprom = sext i32 %add to i64 - %p = getelementptr inbounds [1024 x %struct.S]* @struct_array, i64 0, i64 %idxprom, i32 1 + %p = getelementptr inbounds [1024 x %struct.S], [1024 x %struct.S]* @struct_array, i64 0, i64 %idxprom, i32 1 ret double* %p } ; CHECK-LABEL: @struct( -; CHECK: getelementptr [1024 x %struct.S]* @struct_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i32 1 +; CHECK: getelementptr [1024 x %struct.S], [1024 x %struct.S]* @struct_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i32 1 ; We should be able to trace into sext(a + b) if a + b is non-negative ; (e.g., used as an index of an inbounds GEP) and one of a and b is @@ -36,15 +36,15 @@ entry: %2 = add i32 %j, -2 ; However, inbound sext(j + -2) != sext(j) + -2, e.g., j = INT_MIN %3 = sext i32 %2 to i64 - %p = getelementptr inbounds [32 x [32 x float]]* @float_2d_array, i64 0, i64 %1, i64 %3 + %p = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %1, i64 %3 ret float* %p } ; CHECK-LABEL: @sext_add( ; CHECK-NOT: = add ; CHECK: add i32 %j, -2 ; CHECK: sext -; CHECK: getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; CHECK: getelementptr float* %{{[a-zA-Z0-9]+}}, i64 32 +; CHECK: getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; CHECK: getelementptr float, float* %{{[a-zA-Z0-9]+}}, i64 32 ; We should be able to trace into sext/zext if it can be distributed to both ; operands, e.g., sext (add nsw a, b) == add nsw (sext a), (sext b) @@ -60,12 +60,12 @@ define float* @ext_add_no_overflow(i64 %a, i32 %b, i64 %c, i32 %d) { %d1 = add nuw i32 %d, 1 %d2 = zext i32 %d1 to i64 %j = add i64 %c, %d2 ; j = c + zext(d +nuw 1) - %p = getelementptr inbounds [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 %j + %p = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 %j ret float* %p } ; CHECK-LABEL: @ext_add_no_overflow( -; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; CHECK: getelementptr float* [[BASE_PTR]], i64 33 +; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; CHECK: getelementptr float, float* [[BASE_PTR]], i64 33 ; Verifies we handle nested sext/zext correctly. define void @sext_zext(i32 %a, i32 %b, float** %out1, float** %out2) { @@ -76,7 +76,7 @@ entry: %3 = add nsw i32 %b, 2 %4 = sext i32 %3 to i48 %5 = zext i48 %4 to i64 ; zext(sext(b +nsw 2)) != zext(sext(b)) + 2 - %p1 = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %2, i64 %5 + %p1 = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %2, i64 %5 store float* %p1, float** %out1 %6 = add nuw i32 %a, 3 %7 = zext i32 %6 to i48 @@ -84,15 +84,15 @@ entry: %9 = add nsw i32 %b, 4 %10 = zext i32 %9 to i48 %11 = sext i48 %10 to i64 ; sext(zext(b +nsw 4)) != zext(b) + 4 - %p2 = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %8, i64 %11 + %p2 = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %8, i64 %11 store float* %p2, float** %out2 ret void } ; CHECK-LABEL: @sext_zext( -; CHECK: [[BASE_PTR_1:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; CHECK: getelementptr float* [[BASE_PTR_1]], i64 32 -; CHECK: [[BASE_PTR_2:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; CHECK: getelementptr float* [[BASE_PTR_2]], i64 96 +; CHECK: [[BASE_PTR_1:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; CHECK: getelementptr float, float* [[BASE_PTR_1]], i64 32 +; CHECK: [[BASE_PTR_2:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; CHECK: getelementptr float, float* [[BASE_PTR_2]], i64 96 ; Similar to @ext_add_no_overflow, we should be able to trace into s/zext if ; its operand is an OR and the two operands of the OR have no common bits. @@ -105,12 +105,12 @@ entry: %b3.ext = sext i32 %b3 to i64 %i = add i64 %a, %b2.ext %j = add i64 %a, %b3.ext - %p = getelementptr inbounds [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 %j + %p = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 %j ret float* %p } ; CHECK-LABEL: @sext_or( -; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} -; CHECK: getelementptr float* [[BASE_PTR]], i64 32 +; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 %{{[a-zA-Z0-9]+}} +; CHECK: getelementptr float, float* [[BASE_PTR]], i64 32 ; The subexpression (b + 5) is used in both "i = a + (b + 5)" and "*out = b + ; 5". When extracting the constant offset 5, make sure "*out = b + 5" isn't @@ -119,13 +119,13 @@ define float* @expr(i64 %a, i64 %b, i64* %out) { entry: %b5 = add i64 %b, 5 %i = add i64 %b5, %a - %p = getelementptr inbounds [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 0 + %p = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 0 store i64 %b5, i64* %out ret float* %p } ; CHECK-LABEL: @expr( -; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 0 -; CHECK: getelementptr float* [[BASE_PTR]], i64 160 +; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %{{[a-zA-Z0-9]+}}, i64 0 +; CHECK: getelementptr float, float* [[BASE_PTR]], i64 160 ; CHECK: store i64 %b5, i64* %out ; d + sext(a +nsw (b +nsw (c +nsw 8))) => (d + sext(a) + sext(b) + sext(c)) + 8 @@ -136,26 +136,26 @@ entry: %2 = add nsw i32 %a, %1 %3 = sext i32 %2 to i64 %i = add i64 %d, %3 - %p = getelementptr inbounds [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %i + %p = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %i ret float* %p } ; CHECK-LABEL: @sext_expr( ; CHECK: sext i32 ; CHECK: sext i32 ; CHECK: sext i32 -; CHECK: getelementptr float* %{{[a-zA-Z0-9]+}}, i64 8 +; CHECK: getelementptr float, float* %{{[a-zA-Z0-9]+}}, i64 8 ; Verifies we handle "sub" correctly. define float* @sub(i64 %i, i64 %j) { %i2 = sub i64 %i, 5 ; i - 5 %j2 = sub i64 5, %j ; 5 - i - %p = getelementptr inbounds [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i2, i64 %j2 + %p = getelementptr inbounds [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i2, i64 %j2 ret float* %p } ; CHECK-LABEL: @sub( ; CHECK: %[[j2:[a-zA-Z0-9]+]] = sub i64 0, %j -; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 %[[j2]] -; CHECK: getelementptr float* [[BASE_PTR]], i64 -155 +; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 %i, i64 %[[j2]] +; CHECK: getelementptr float, float* [[BASE_PTR]], i64 -155 %struct.Packed = type <{ [3 x i32], [8 x i64] }> ; <> means packed @@ -167,13 +167,13 @@ entry: %idxprom = sext i32 %add to i64 %add1 = add nsw i32 %i, 1 %idxprom2 = sext i32 %add1 to i64 - %arrayidx3 = getelementptr inbounds [1024 x %struct.Packed]* %s, i64 0, i64 %idxprom2, i32 1, i64 %idxprom + %arrayidx3 = getelementptr inbounds [1024 x %struct.Packed], [1024 x %struct.Packed]* %s, i64 0, i64 %idxprom2, i32 1, i64 %idxprom ret i64* %arrayidx3 } ; CHECK-LABEL: @packed_struct( -; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [1024 x %struct.Packed]* %s, i64 0, i64 %{{[a-zA-Z0-9]+}}, i32 1, i64 %{{[a-zA-Z0-9]+}} +; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [1024 x %struct.Packed], [1024 x %struct.Packed]* %s, i64 0, i64 %{{[a-zA-Z0-9]+}}, i32 1, i64 %{{[a-zA-Z0-9]+}} ; CHECK: [[CASTED_PTR:%[a-zA-Z0-9]+]] = bitcast i64* [[BASE_PTR]] to i8* -; CHECK: %uglygep = getelementptr i8* [[CASTED_PTR]], i64 100 +; CHECK: %uglygep = getelementptr i8, i8* [[CASTED_PTR]], i64 100 ; CHECK: bitcast i8* %uglygep to i64* ; We shouldn't be able to extract the 8 from "zext(a +nuw (b + 8))", @@ -183,11 +183,11 @@ entry: %0 = add i32 %b, 8 %1 = add nuw i32 %a, %0 %i = zext i32 %1 to i64 - %p = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %i + %p = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %i ret float* %p } ; CHECK-LABEL: zext_expr( -; CHECK: getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %i +; CHECK: getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %i ; Per http://llvm.org/docs/LangRef.html#id181, the indices of a off-bound gep ; should be considered sign-extended to the pointer size. Therefore, @@ -200,11 +200,11 @@ entry: define float* @i32_add(i32 %a) { entry: %i = add i32 %a, 8 - %p = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i32 %i + %p = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i32 %i ret float* %p } ; CHECK-LABEL: @i32_add( -; CHECK: getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %{{[a-zA-Z0-9]+}} +; CHECK: getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %{{[a-zA-Z0-9]+}} ; CHECK-NOT: getelementptr ; Verifies that we compute the correct constant offset when the index is @@ -216,23 +216,23 @@ entry: %0 = add nsw nuw i1 %a, 1 %1 = sext i1 %0 to i4 %2 = zext i4 %1 to i64 ; zext (sext i1 1 to i4) to i64 = 15 - %p = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %2 + %p = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %2 ret float* %p } ; CHECK-LABEL: @apint( -; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %{{[a-zA-Z0-9]+}} -; CHECK: getelementptr float* [[BASE_PTR]], i64 15 +; CHECK: [[BASE_PTR:%[a-zA-Z0-9]+]] = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %{{[a-zA-Z0-9]+}} +; CHECK: getelementptr float, float* [[BASE_PTR]], i64 15 ; Do not trace into binary operators other than ADD, SUB, and OR. define float* @and(i64 %a) { entry: %0 = shl i64 %a, 2 %1 = and i64 %0, 1 - %p = getelementptr [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %1 + %p = getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array, i64 0, i64 0, i64 %1 ret float* %p } ; CHECK-LABEL: @and( -; CHECK: getelementptr [32 x [32 x float]]* @float_2d_array +; CHECK: getelementptr [32 x [32 x float]], [32 x [32 x float]]* @float_2d_array ; CHECK-NOT: getelementptr ; The code that rebuilds an OR expression used to be buggy, and failed on this @@ -247,9 +247,9 @@ entry: ; ((a << 2) + 12) and 1 have no common bits. Therefore, ; SeparateConstOffsetFromGEP is able to extract the 12. ; TODO(jingyue): We could reassociate the expression to combine 12 and 1. - %p = getelementptr float* %ptr, i64 %or -; CHECK: [[PTR:%[a-zA-Z0-9]+]] = getelementptr float* %ptr, i64 [[OR]] -; CHECK: getelementptr float* [[PTR]], i64 12 + %p = getelementptr float, float* %ptr, i64 %or +; CHECK: [[PTR:%[a-zA-Z0-9]+]] = getelementptr float, float* %ptr, i64 [[OR]] +; CHECK: getelementptr float, float* [[PTR]], i64 12 ret float* %p ; CHECK-NEXT: ret } @@ -269,10 +269,10 @@ define %struct2* @sign_mod_unsign(%struct0* %ptr, i64 %idx) { entry: %arrayidx = add nsw i64 %idx, -2 ; CHECK-NOT: add - %ptr2 = getelementptr inbounds %struct0* %ptr, i64 0, i32 3, i64 %arrayidx, i32 1 -; CHECK: [[PTR:%[a-zA-Z0-9]+]] = getelementptr %struct0* %ptr, i64 0, i32 3, i64 %idx, i32 1 + %ptr2 = getelementptr inbounds %struct0, %struct0* %ptr, i64 0, i32 3, i64 %arrayidx, i32 1 +; CHECK: [[PTR:%[a-zA-Z0-9]+]] = getelementptr %struct0, %struct0* %ptr, i64 0, i32 3, i64 %idx, i32 1 ; CHECK: [[PTR1:%[a-zA-Z0-9]+]] = bitcast %struct2* [[PTR]] to i8* -; CHECK: getelementptr i8* [[PTR1]], i64 -64 +; CHECK: getelementptr i8, i8* [[PTR1]], i64 -64 ; CHECK: bitcast ret %struct2* %ptr2 ; CHECK-NEXT: ret diff --git a/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll b/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll index fbfb100..0626ea1 100644 --- a/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll +++ b/test/Transforms/SimplifyCFG/2003-08-17-FoldSwitch-dbg.ll @@ -9,7 +9,7 @@ @.str = internal constant [4 x i8] c"a.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] @.str1 = internal constant [6 x i8] c"/tmp/\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @.str2 = internal constant [55 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build 00)\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] -@llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] +@llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8], [6 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([55 x i8], [55 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind diff --git a/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll b/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll index 90be680..8fd1fae 100644 --- a/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll +++ b/test/Transforms/SimplifyCFG/2005-06-16-PHICrash.ll @@ -30,7 +30,7 @@ endif.0: ; preds = %loopentry.0 %tmp.14 = sext i8 %tmp.1 to i32 ; <i32> [#uses=1] %tmp.16 = zext i8 %l_88173906 to i32 ; <i32> [#uses=1] %tmp.17 = icmp sgt i32 %tmp.14, %tmp.16 ; <i1> [#uses=1] - %tmp.19 = load i32* @g_59182229 ; <i32> [#uses=2] + %tmp.19 = load i32, i32* @g_59182229 ; <i32> [#uses=2] br i1 %tmp.17, label %cond_true, label %cond_false cond_true: ; preds = %endif.0 %tmp.20 = icmp ne i32 %tmp.19, 1 ; <i1> [#uses=1] @@ -53,7 +53,7 @@ loopentry.1: ; preds = %endif.3, %else.2 %tmp.29 = icmp sgt i32 %i.1.1, 99 ; <i1> [#uses=1] br i1 %tmp.29, label %endif.2, label %no_exit.1 no_exit.1: ; preds = %loopentry.1 - %tmp.30 = load i32* @g_38098584 ; <i32> [#uses=1] + %tmp.30 = load i32, i32* @g_38098584 ; <i32> [#uses=1] %tmp.31 = icmp eq i32 %tmp.30, 0 ; <i1> [#uses=1] br i1 %tmp.31, label %else.3, label %then.3 then.3: ; preds = %no_exit.1 diff --git a/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll b/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll index c30bfa1..c459867 100644 --- a/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll +++ b/test/Transforms/SimplifyCFG/2005-08-01-PHIUpdateFail.ll @@ -58,7 +58,7 @@ then.2.i: ; preds = %endif.1.i, %then.1.i getfree.exit: ; preds = %endif.1.i, %then.1.i ret void endif.1: ; preds = %read_min.exit - %tmp.27.i = getelementptr i32* null, i32 0 ; <i32*> [#uses=0] + %tmp.27.i = getelementptr i32, i32* null, i32 0 ; <i32*> [#uses=0] br i1 false, label %loopexit.0.i15, label %no_exit.0.i14 no_exit.0.i14: ; preds = %endif.1 ret void diff --git a/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll b/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll index 907261b..2606e08 100644 --- a/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll +++ b/test/Transforms/SimplifyCFG/2005-12-03-IncorrectPHIFold.ll @@ -36,8 +36,8 @@ entry: %guess = alloca %struct.anon* ; <%struct.anon**> [#uses=7] %guess1 = alloca %struct.anon* ; <%struct.anon**> [#uses=7] %point5 = alloca %struct.anon* ; <%struct.anon**> [#uses=3] - %tmp = load %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp1 = load %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1] + %tmp = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] + %tmp1 = load %struct.anon*, %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1] %tmp.upgrd.1 = call i32 @bc_compare( %struct.anon* %tmp, %struct.anon* %tmp1 ) ; <i32> [#uses=2] %tmp.upgrd.2 = icmp slt i32 %tmp.upgrd.1, 0 ; <i1> [#uses=1] br i1 %tmp.upgrd.2, label %cond_true, label %cond_false @@ -48,26 +48,26 @@ cond_false: ; preds = %entry br i1 %tmp5, label %cond_true6, label %cond_next13 cond_true6: ; preds = %cond_false call void @free_num( %struct.anon** %num ) - %tmp8 = load %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1] + %tmp8 = load %struct.anon*, %struct.anon** @_zero_ ; <%struct.anon*> [#uses=1] %tmp9 = call %struct.anon* @copy_num( %struct.anon* %tmp8 ) ; <%struct.anon*> [#uses=1] store %struct.anon* %tmp9, %struct.anon** %num ret i32 1 cond_next13: ; preds = %cond_false - %tmp15 = load %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp16 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] + %tmp15 = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] + %tmp16 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] %tmp17 = call i32 @bc_compare( %struct.anon* %tmp15, %struct.anon* %tmp16 ) ; <i32> [#uses=2] %tmp19 = icmp eq i32 %tmp17, 0 ; <i1> [#uses=1] br i1 %tmp19, label %cond_true20, label %cond_next27 cond_true20: ; preds = %cond_next13 call void @free_num( %struct.anon** %num ) - %tmp22 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] + %tmp22 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] %tmp23 = call %struct.anon* @copy_num( %struct.anon* %tmp22 ) ; <%struct.anon*> [#uses=1] store %struct.anon* %tmp23, %struct.anon** %num ret i32 1 cond_next27: ; preds = %cond_next13 - %tmp29 = load %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp30 = getelementptr %struct.anon* %tmp29, i32 0, i32 2 ; <i32*> [#uses=1] - %tmp31 = load i32* %tmp30 ; <i32> [#uses=2] + %tmp29 = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] + %tmp30 = getelementptr %struct.anon, %struct.anon* %tmp29, i32 0, i32 2 ; <i32*> [#uses=1] + %tmp31 = load i32, i32* %tmp30 ; <i32> [#uses=2] %tmp33 = icmp sge i32 %tmp31, %scale ; <i1> [#uses=1] %max = select i1 %tmp33, i32 %tmp31, i32 %scale ; <i32> [#uses=4] %tmp35 = add i32 %max, 2 ; <i32> [#uses=0] @@ -75,29 +75,29 @@ cond_next27: ; preds = %cond_next13 call void @init_num( %struct.anon** %guess1 ) %tmp36 = call %struct.anon* @new_num( i32 1, i32 1 ) ; <%struct.anon*> [#uses=2] store %struct.anon* %tmp36, %struct.anon** %point5 - %tmp.upgrd.3 = getelementptr %struct.anon* %tmp36, i32 0, i32 4, i32 1 ; <i8*> [#uses=1] + %tmp.upgrd.3 = getelementptr %struct.anon, %struct.anon* %tmp36, i32 0, i32 4, i32 1 ; <i8*> [#uses=1] store i8 5, i8* %tmp.upgrd.3 %tmp39 = icmp slt i32 %tmp17, 0 ; <i1> [#uses=1] br i1 %tmp39, label %cond_true40, label %cond_false43 cond_true40: ; preds = %cond_next27 - %tmp41 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] + %tmp41 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] %tmp42 = call %struct.anon* @copy_num( %struct.anon* %tmp41 ) ; <%struct.anon*> [#uses=1] store %struct.anon* %tmp42, %struct.anon** %guess br label %bb80.outer cond_false43: ; preds = %cond_next27 call void @int2num( %struct.anon** %guess, i32 10 ) - %tmp45 = load %struct.anon** %num ; <%struct.anon*> [#uses=1] - %tmp46 = getelementptr %struct.anon* %tmp45, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp47 = load i32* %tmp46 ; <i32> [#uses=1] + %tmp45 = load %struct.anon*, %struct.anon** %num ; <%struct.anon*> [#uses=1] + %tmp46 = getelementptr %struct.anon, %struct.anon* %tmp45, i32 0, i32 1 ; <i32*> [#uses=1] + %tmp47 = load i32, i32* %tmp46 ; <i32> [#uses=1] call void @int2num( %struct.anon** %guess1, i32 %tmp47 ) - %tmp48 = load %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] - %tmp49 = load %struct.anon** %point5 ; <%struct.anon*> [#uses=1] + %tmp48 = load %struct.anon*, %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] + %tmp49 = load %struct.anon*, %struct.anon** %point5 ; <%struct.anon*> [#uses=1] call void @bc_multiply( %struct.anon* %tmp48, %struct.anon* %tmp49, %struct.anon** %guess1, i32 %max ) - %tmp51 = load %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] - %tmp52 = getelementptr %struct.anon* %tmp51, i32 0, i32 2 ; <i32*> [#uses=1] + %tmp51 = load %struct.anon*, %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] + %tmp52 = getelementptr %struct.anon, %struct.anon* %tmp51, i32 0, i32 2 ; <i32*> [#uses=1] store i32 0, i32* %tmp52 - %tmp53 = load %struct.anon** %guess ; <%struct.anon*> [#uses=1] - %tmp54 = load %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] + %tmp53 = load %struct.anon*, %struct.anon** %guess ; <%struct.anon*> [#uses=1] + %tmp54 = load %struct.anon*, %struct.anon** %guess1 ; <%struct.anon*> [#uses=1] call void @bc_raise( %struct.anon* %tmp53, %struct.anon* %tmp54, %struct.anon** %guess, i32 %max ) br label %bb80.outer bb80.outer: ; preds = %cond_true83, %cond_false43, %cond_true40 @@ -113,8 +113,8 @@ cond_true83: ; preds = %bb80 ; CHECK: bb86 bb86: ; preds = %bb80 call void @free_num( %struct.anon** %num ) - %tmp88 = load %struct.anon** %guess ; <%struct.anon*> [#uses=1] - %tmp89 = load %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] + %tmp88 = load %struct.anon*, %struct.anon** %guess ; <%struct.anon*> [#uses=1] + %tmp89 = load %struct.anon*, %struct.anon** @_one_ ; <%struct.anon*> [#uses=1] %tmp92 = call i32 @bc_divide( %struct.anon* %tmp88, %struct.anon* %tmp89, %struct.anon** %num, i32 %max ) ; <i32> [#uses=0] call void @free_num( %struct.anon** %guess ) call void @free_num( %struct.anon** %guess1 ) diff --git a/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll b/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll index 70fbddf..0820e9c 100644 --- a/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll +++ b/test/Transforms/SimplifyCFG/2006-08-03-Crash.ll @@ -34,7 +34,7 @@ target triple = "powerpc-apple-darwin8" define void @fold_builtin_classify() { entry: - %tmp63 = load i32* null ; <i32> [#uses=1] + %tmp63 = load i32, i32* null ; <i32> [#uses=1] switch i32 %tmp63, label %bb276 [ i32 414, label %bb145 i32 417, label %bb @@ -42,54 +42,54 @@ entry: bb: ; preds = %entry ret void bb145: ; preds = %entry - %tmp146 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] - %tmp148 = getelementptr %struct.tree_node* %tmp146, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] - %tmp149 = load %struct.tree_node** %tmp148 ; <%struct.tree_node*> [#uses=1] + %tmp146 = load %struct.tree_node*, %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] + %tmp148 = getelementptr %struct.tree_node, %struct.tree_node* %tmp146, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] + %tmp149 = load %struct.tree_node*, %struct.tree_node** %tmp148 ; <%struct.tree_node*> [#uses=1] %tmp150 = bitcast %struct.tree_node* %tmp149 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] - %tmp151 = getelementptr %struct.tree_type* %tmp150, i32 0, i32 6 ; <i16*> [#uses=1] + %tmp151 = getelementptr %struct.tree_type, %struct.tree_type* %tmp150, i32 0, i32 6 ; <i16*> [#uses=1] %tmp151.upgrd.1 = bitcast i16* %tmp151 to i32* ; <i32*> [#uses=1] - %tmp152 = load i32* %tmp151.upgrd.1 ; <i32> [#uses=1] + %tmp152 = load i32, i32* %tmp151.upgrd.1 ; <i32> [#uses=1] %tmp154 = lshr i32 %tmp152, 16 ; <i32> [#uses=1] %tmp154.mask = and i32 %tmp154, 127 ; <i32> [#uses=1] %gep.upgrd.2 = zext i32 %tmp154.mask to i64 ; <i64> [#uses=1] - %tmp155 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.2 ; <i8*> [#uses=1] - %tmp156 = load i8* %tmp155 ; <i8> [#uses=1] + %tmp155 = getelementptr [35 x i8], [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.2 ; <i8*> [#uses=1] + %tmp156 = load i8, i8* %tmp155 ; <i8> [#uses=1] %tmp157 = icmp eq i8 %tmp156, 4 ; <i1> [#uses=1] br i1 %tmp157, label %cond_next241, label %cond_true158 cond_true158: ; preds = %bb145 - %tmp172 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] - %tmp174 = getelementptr %struct.tree_node* %tmp172, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] - %tmp175 = load %struct.tree_node** %tmp174 ; <%struct.tree_node*> [#uses=1] + %tmp172 = load %struct.tree_node*, %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] + %tmp174 = getelementptr %struct.tree_node, %struct.tree_node* %tmp172, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] + %tmp175 = load %struct.tree_node*, %struct.tree_node** %tmp174 ; <%struct.tree_node*> [#uses=1] %tmp176 = bitcast %struct.tree_node* %tmp175 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] - %tmp177 = getelementptr %struct.tree_type* %tmp176, i32 0, i32 6 ; <i16*> [#uses=1] + %tmp177 = getelementptr %struct.tree_type, %struct.tree_type* %tmp176, i32 0, i32 6 ; <i16*> [#uses=1] %tmp177.upgrd.3 = bitcast i16* %tmp177 to i32* ; <i32*> [#uses=1] - %tmp178 = load i32* %tmp177.upgrd.3 ; <i32> [#uses=1] + %tmp178 = load i32, i32* %tmp177.upgrd.3 ; <i32> [#uses=1] %tmp180 = lshr i32 %tmp178, 16 ; <i32> [#uses=1] %tmp180.mask = and i32 %tmp180, 127 ; <i32> [#uses=1] %gep.upgrd.4 = zext i32 %tmp180.mask to i64 ; <i64> [#uses=1] - %tmp181 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.4 ; <i8*> [#uses=1] - %tmp182 = load i8* %tmp181 ; <i8> [#uses=1] + %tmp181 = getelementptr [35 x i8], [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.4 ; <i8*> [#uses=1] + %tmp182 = load i8, i8* %tmp181 ; <i8> [#uses=1] %tmp183 = icmp eq i8 %tmp182, 8 ; <i1> [#uses=1] br i1 %tmp183, label %cond_next241, label %cond_true184 cond_true184: ; preds = %cond_true158 - %tmp185 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] - %tmp187 = getelementptr %struct.tree_node* %tmp185, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] - %tmp188 = load %struct.tree_node** %tmp187 ; <%struct.tree_node*> [#uses=1] + %tmp185 = load %struct.tree_node*, %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] + %tmp187 = getelementptr %struct.tree_node, %struct.tree_node* %tmp185, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] + %tmp188 = load %struct.tree_node*, %struct.tree_node** %tmp187 ; <%struct.tree_node*> [#uses=1] %tmp189 = bitcast %struct.tree_node* %tmp188 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] - %tmp190 = getelementptr %struct.tree_type* %tmp189, i32 0, i32 6 ; <i16*> [#uses=1] + %tmp190 = getelementptr %struct.tree_type, %struct.tree_type* %tmp189, i32 0, i32 6 ; <i16*> [#uses=1] %tmp190.upgrd.5 = bitcast i16* %tmp190 to i32* ; <i32*> [#uses=1] - %tmp191 = load i32* %tmp190.upgrd.5 ; <i32> [#uses=1] + %tmp191 = load i32, i32* %tmp190.upgrd.5 ; <i32> [#uses=1] %tmp193 = lshr i32 %tmp191, 16 ; <i32> [#uses=1] %tmp193.mask = and i32 %tmp193, 127 ; <i32> [#uses=1] %gep.upgrd.6 = zext i32 %tmp193.mask to i64 ; <i64> [#uses=1] - %tmp194 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.6 ; <i8*> [#uses=1] - %tmp195 = load i8* %tmp194 ; <i8> [#uses=1] + %tmp194 = getelementptr [35 x i8], [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.6 ; <i8*> [#uses=1] + %tmp195 = load i8, i8* %tmp194 ; <i8> [#uses=1] %tmp196 = icmp eq i8 %tmp195, 4 ; <i1> [#uses=1] br i1 %tmp196, label %cond_next241, label %cond_true197 cond_true197: ; preds = %cond_true184 ret void cond_next241: ; preds = %cond_true184, %cond_true158, %bb145 - %tmp245 = load i32* null ; <i32> [#uses=0] + %tmp245 = load i32, i32* null ; <i32> [#uses=0] ret void bb276: ; preds = %entry ret void diff --git a/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll b/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll index af865ce..dcf2412 100644 --- a/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll +++ b/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll @@ -45,42 +45,42 @@ entry: store %struct.trie_s* %t, %struct.trie_s** %t_addr store %struct.FILE* %f, %struct.FILE** %f_addr store i32 0, i32* %wstate - %tmp = getelementptr %struct.charsequence* %cs, i64 0, i32 0 ; <i8**> [#uses=1] - %tmp1 = getelementptr %struct.charsequence* @C.0.2294, i64 0, i32 0 ; <i8**> [#uses=1] - %tmp.upgrd.5 = load i8** %tmp1 ; <i8*> [#uses=1] + %tmp = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 0 ; <i8**> [#uses=1] + %tmp1 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 0 ; <i8**> [#uses=1] + %tmp.upgrd.5 = load i8*, i8** %tmp1 ; <i8*> [#uses=1] store i8* %tmp.upgrd.5, i8** %tmp - %tmp.upgrd.6 = getelementptr %struct.charsequence* %cs, i64 0, i32 1 ; <i32*> [#uses=1] - %tmp2 = getelementptr %struct.charsequence* @C.0.2294, i64 0, i32 1 ; <i32*> [#uses=1] - %tmp.upgrd.7 = load i32* %tmp2 ; <i32> [#uses=1] + %tmp.upgrd.6 = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 1 ; <i32*> [#uses=1] + %tmp2 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 1 ; <i32*> [#uses=1] + %tmp.upgrd.7 = load i32, i32* %tmp2 ; <i32> [#uses=1] store i32 %tmp.upgrd.7, i32* %tmp.upgrd.6 - %tmp3 = getelementptr %struct.charsequence* %cs, i64 0, i32 2 ; <i32*> [#uses=1] - %tmp4 = getelementptr %struct.charsequence* @C.0.2294, i64 0, i32 2 ; <i32*> [#uses=1] - %tmp5 = load i32* %tmp4 ; <i32> [#uses=1] + %tmp3 = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 2 ; <i32*> [#uses=1] + %tmp4 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 2 ; <i32*> [#uses=1] + %tmp5 = load i32, i32* %tmp4 ; <i32> [#uses=1] store i32 %tmp5, i32* %tmp3 br label %bb33 bb: ; preds = %bb33 - %tmp.upgrd.8 = load %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] + %tmp.upgrd.8 = load %struct.FILE*, %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] %tmp.upgrd.9 = call i32 @_IO_getc( %struct.FILE* %tmp.upgrd.8 ) ; <i32> [#uses=1] %tmp6 = call i32 @tolower( i32 %tmp.upgrd.9 ) ; <i32> [#uses=1] %tmp6.upgrd.10 = trunc i32 %tmp6 to i8 ; <i8> [#uses=1] store i8 %tmp6.upgrd.10, i8* %c - %tmp7 = load i32* %wstate ; <i32> [#uses=1] + %tmp7 = load i32, i32* %wstate ; <i32> [#uses=1] %tmp.upgrd.11 = icmp ne i32 %tmp7, 0 ; <i1> [#uses=1] br i1 %tmp.upgrd.11, label %cond_true, label %cond_false cond_true: ; preds = %bb - %tmp.upgrd.12 = load i8* %c ; <i8> [#uses=1] + %tmp.upgrd.12 = load i8, i8* %c ; <i8> [#uses=1] %tmp8 = icmp sle i8 %tmp.upgrd.12, 96 ; <i1> [#uses=1] br i1 %tmp8, label %cond_true9, label %cond_next cond_true9: ; preds = %cond_true br label %bb16 cond_next: ; preds = %cond_true - %tmp10 = load i8* %c ; <i8> [#uses=1] + %tmp10 = load i8, i8* %c ; <i8> [#uses=1] %tmp11 = icmp sgt i8 %tmp10, 122 ; <i1> [#uses=1] br i1 %tmp11, label %cond_true12, label %cond_next13 cond_true12: ; preds = %cond_next br label %bb16 cond_next13: ; preds = %cond_next - %tmp14 = load i8* %c ; <i8> [#uses=1] + %tmp14 = load i8, i8* %c ; <i8> [#uses=1] %tmp14.upgrd.13 = sext i8 %tmp14 to i32 ; <i32> [#uses=1] %tmp1415 = trunc i32 %tmp14.upgrd.13 to i8 ; <i8> [#uses=1] call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp1415 ) @@ -88,26 +88,26 @@ cond_next13: ; preds = %cond_next bb16: ; preds = %cond_true12, %cond_true9 %tmp17 = call i8* @charsequence_val( %struct.charsequence* %cs ) ; <i8*> [#uses=1] store i8* %tmp17, i8** %str - %tmp.upgrd.14 = load %struct.trie_s** %t_addr ; <%struct.trie_s*> [#uses=1] - %tmp18 = load i8** %str ; <i8*> [#uses=1] + %tmp.upgrd.14 = load %struct.trie_s*, %struct.trie_s** %t_addr ; <%struct.trie_s*> [#uses=1] + %tmp18 = load i8*, i8** %str ; <i8*> [#uses=1] %tmp19 = call %struct.trie_s* @trie_insert( %struct.trie_s* %tmp.upgrd.14, i8* %tmp18 ) ; <%struct.trie_s*> [#uses=0] - %tmp20 = load i8** %str ; <i8*> [#uses=1] + %tmp20 = load i8*, i8** %str ; <i8*> [#uses=1] call void @free( i8* %tmp20 ) store i32 0, i32* %wstate br label %bb21 bb21: ; preds = %bb16, %cond_next13 br label %cond_next32 cond_false: ; preds = %bb - %tmp22 = load i8* %c ; <i8> [#uses=1] + %tmp22 = load i8, i8* %c ; <i8> [#uses=1] %tmp23 = icmp sgt i8 %tmp22, 96 ; <i1> [#uses=1] br i1 %tmp23, label %cond_true24, label %cond_next31 cond_true24: ; preds = %cond_false - %tmp25 = load i8* %c ; <i8> [#uses=1] + %tmp25 = load i8, i8* %c ; <i8> [#uses=1] %tmp26 = icmp sle i8 %tmp25, 122 ; <i1> [#uses=1] br i1 %tmp26, label %cond_true27, label %cond_next30 cond_true27: ; preds = %cond_true24 call void @charsequence_reset( %struct.charsequence* %cs ) - %tmp28 = load i8* %c ; <i8> [#uses=1] + %tmp28 = load i8, i8* %c ; <i8> [#uses=1] %tmp28.upgrd.15 = sext i8 %tmp28 to i32 ; <i32> [#uses=1] %tmp2829 = trunc i32 %tmp28.upgrd.15 to i8 ; <i8> [#uses=1] call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp2829 ) @@ -120,7 +120,7 @@ cond_next31: ; preds = %cond_next30, %cond_false cond_next32: ; preds = %cond_next31, %bb21 br label %bb33 bb33: ; preds = %cond_next32, %entry - %tmp34 = load %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] + %tmp34 = load %struct.FILE*, %struct.FILE** %f_addr ; <%struct.FILE*> [#uses=1] %tmp35 = call i32 @feof( %struct.FILE* %tmp34 ) ; <i32> [#uses=1] %tmp36 = icmp eq i32 %tmp35, 0 ; <i1> [#uses=1] br i1 %tmp36, label %bb, label %bb37 diff --git a/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll b/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll index 8e15637..7625d93 100644 --- a/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll +++ b/test/Transforms/SimplifyCFG/2008-01-02-hoist-fp-add.ll @@ -8,7 +8,7 @@ target triple = "i686-apple-darwin8" define void @test(i32 %X, i32 %Y, i32 %Z) { entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] - %tmp = load i32* @G, align 8 ; <i32> [#uses=2] + %tmp = load i32, i32* @G, align 8 ; <i32> [#uses=2] %tmp3 = icmp eq i32 %X, %Y ; <i1> [#uses=1] %tmp34 = zext i1 %tmp3 to i8 ; <i8> [#uses=1] %toBool = icmp ne i8 %tmp34, 0 ; <i1> [#uses=1] diff --git a/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll b/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll index 9b6084f..2ef49bf 100644 --- a/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll +++ b/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll @@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu" define i32 @main() nounwind { entry: - %l = load i32* @g_37, align 4 ; <i32> [#uses=1] + %l = load i32, i32* @g_37, align 4 ; <i32> [#uses=1] %cmpa = icmp ne i32 %l, 0 ; <i1> [#uses=3] br i1 %cmpa, label %func_1.exit, label %mooseblock @@ -29,7 +29,7 @@ cowblock: ; preds = %beeblock, %monkeyblock func_1.exit: ; preds = %cowblock, %entry %outval = phi i32 [ %cowval, %cowblock ], [ 1, %entry ] ; <i32> [#uses=1] - %pout = tail call i32 (i8*, ...)* @printf( i8* noalias getelementptr ([4 x i8]* @.str, i32 0, i32 0), i32 %outval ) nounwind ; <i32> [#uses=0] + %pout = tail call i32 (i8*, ...)* @printf( i8* noalias getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %outval ) nounwind ; <i32> [#uses=0] ret i32 0 } diff --git a/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll b/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll index ac9622d..6b216f5 100644 --- a/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll +++ b/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll @@ -4,7 +4,7 @@ define i32 @func_127(i32 %p_129) nounwind { entry: - load i32* @g_103, align 4 ; <i32>:0 [#uses=1] + load i32, i32* @g_103, align 4 ; <i32>:0 [#uses=1] icmp eq i32 %0, 0 ; <i1>:1 [#uses=2] br i1 %1, label %bb6.preheader, label %entry.return_crit_edge diff --git a/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll b/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll index 419feb6..faf3f5f 100644 --- a/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll +++ b/test/Transforms/SimplifyCFG/2009-05-12-externweak.ll @@ -18,7 +18,7 @@ bb: ; preds = %bb4 br i1 icmp ne (i32* @i, i32* null), label %bb1, label %bb2 bb1: ; preds = %bb - %0 = load i32* @i, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* @i, align 4 ; <i32> [#uses=1] br label %bb3 bb2: ; preds = %bb diff --git a/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll b/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll index 076cb58..cfbe219 100644 --- a/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll +++ b/test/Transforms/SimplifyCFG/AArch64/prefer-fma.ll @@ -5,9 +5,9 @@ ; Function Attrs: nounwind define double @_Z3fooRdS_S_S_(double* dereferenceable(8) %x, double* dereferenceable(8) %y, double* dereferenceable(8) %a) #0 { entry: - %0 = load double* %y, align 8 + %0 = load double, double* %y, align 8 %cmp = fcmp oeq double %0, 0.000000e+00 - %1 = load double* %x, align 8 + %1 = load double, double* %x, align 8 br i1 %cmp, label %if.then, label %if.else ; fadd (const, (fmul x, y)) @@ -15,7 +15,7 @@ if.then: ; preds = %entry ; CHECK-LABEL: if.then: ; CHECK: %3 = fmul fast double %1, %2 ; CHECK-NEXT: %mul = fadd fast double 1.000000e+00, %3 - %2 = load double* %a, align 8 + %2 = load double, double* %a, align 8 %3 = fmul fast double %1, %2 %mul = fadd fast double 1.000000e+00, %3 store double %mul, double* %y, align 8 @@ -26,16 +26,16 @@ if.else: ; preds = %entry ; CHECK-LABEL: if.else: ; CHECK: %mul1 = fmul fast double %1, %2 ; CHECK-NEXT: %sub1 = fsub fast double %mul1, %0 - %4 = load double* %a, align 8 + %4 = load double, double* %a, align 8 %mul1 = fmul fast double %1, %4 %sub1 = fsub fast double %mul1, %0 store double %sub1, double* %y, align 8 br label %if.end if.end: ; preds = %if.else, %if.then - %5 = load double* %y, align 8 + %5 = load double, double* %y, align 8 %cmp2 = fcmp oeq double %5, 2.000000e+00 - %6 = load double* %x, align 8 + %6 = load double, double* %x, align 8 br i1 %cmp2, label %if.then2, label %if.else2 ; fsub (x, (fmul y, z)) @@ -43,7 +43,7 @@ if.then2: ; preds = %entry ; CHECK-LABEL: if.then2: ; CHECK: %7 = fmul fast double %5, 3.000000e+00 ; CHECK-NEXT: %mul2 = fsub fast double %6, %7 - %7 = load double* %a, align 8 + %7 = load double, double* %a, align 8 %8 = fmul fast double %6, 3.0000000e+00 %mul2 = fsub fast double %7, %8 store double %mul2, double* %y, align 8 @@ -62,10 +62,10 @@ if.else2: ; preds = %entry br label %if.end2 if.end2: ; preds = %if.else, %if.then - %9 = load double* %x, align 8 - %10 = load double* %y, align 8 + %9 = load double, double* %x, align 8 + %10 = load double, double* %y, align 8 %add = fadd fast double %9, %10 - %11 = load double* %a, align 8 + %11 = load double, double* %a, align 8 %add2 = fadd fast double %add, %11 ret double %add2 } diff --git a/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll b/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll index aba08dc..32a0202 100644 --- a/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll +++ b/test/Transforms/SimplifyCFG/EmptyBlockMerge.ll @@ -6,7 +6,7 @@ declare void @foo() define void @cprop_test12(i32* %data) { bb0: - %reg108 = load i32* %data ; <i32> [#uses=2] + %reg108 = load i32, i32* %data ; <i32> [#uses=2] %cond218 = icmp ne i32 %reg108, 5 ; <i1> [#uses=1] br i1 %cond218, label %bb3, label %bb2 bb2: ; preds = %bb0 diff --git a/test/Transforms/SimplifyCFG/MagicPointer.ll b/test/Transforms/SimplifyCFG/MagicPointer.ll index b8b8cbd..7789600 100644 --- a/test/Transforms/SimplifyCFG/MagicPointer.ll +++ b/test/Transforms/SimplifyCFG/MagicPointer.ll @@ -33,7 +33,7 @@ entry: br i1 %tobool, label %if.then, label %if.else if.then: ; preds = %entry - %call = call i32 @puts(i8* getelementptr inbounds ([5 x i8]* @.str, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end21 if.else: ; preds = %entry @@ -41,7 +41,7 @@ if.else: ; preds = %entry br i1 %cmp, label %if.then2, label %if.else4 if.then2: ; preds = %if.else - %call3 = call i32 @puts(i8* getelementptr inbounds ([4 x i8]* @.str1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call3 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end20 if.else4: ; preds = %if.else @@ -53,7 +53,7 @@ lor.lhs.false: ; preds = %if.else4 br i1 %cmp8, label %if.then9, label %if.else11 if.then9: ; preds = %lor.lhs.false, %if.else4 - %call10 = call i32 @puts(i8* getelementptr inbounds ([4 x i8]* @.str2, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call10 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end19 if.else11: ; preds = %lor.lhs.false @@ -61,7 +61,7 @@ if.else11: ; preds = %lor.lhs.false br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %if.else11 - %call15 = call i32 @puts(i8* getelementptr inbounds ([5 x i8]* @.str3, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call15 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str3, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end if.else16: ; preds = %if.else11 @@ -99,7 +99,7 @@ entry: br i1 %tobool, label %if.then, label %if.else if.then: ; preds = %entry - %call = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([5 x i8] addrspace(1)* @.str_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([5 x i8], [5 x i8] addrspace(1)* @.str_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end21 if.else: ; preds = %entry @@ -107,7 +107,7 @@ if.else: ; preds = %entry br i1 %cmp, label %if.then2, label %if.else4 if.then2: ; preds = %if.else - %call3 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([4 x i8] addrspace(1)* @.str1_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call3 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([4 x i8], [4 x i8] addrspace(1)* @.str1_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end20 if.else4: ; preds = %if.else @@ -119,7 +119,7 @@ lor.lhs.false: ; preds = %if.else4 br i1 %cmp8, label %if.then9, label %if.else11 if.then9: ; preds = %lor.lhs.false, %if.else4 - %call10 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([4 x i8] addrspace(1)* @.str2_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call10 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([4 x i8], [4 x i8] addrspace(1)* @.str2_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end19 if.else11: ; preds = %lor.lhs.false @@ -127,7 +127,7 @@ if.else11: ; preds = %lor.lhs.false br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %if.else11 - %call15 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([5 x i8] addrspace(1)* @.str3_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] + %call15 = call i32 @puts_as1(i8 addrspace(1)* getelementptr inbounds ([5 x i8], [5 x i8] addrspace(1)* @.str3_as1, i64 0, i64 0)) nounwind ; <i32> [#uses=0] br label %if.end if.else16: ; preds = %if.else11 diff --git a/test/Transforms/SimplifyCFG/PR17073.ll b/test/Transforms/SimplifyCFG/PR17073.ll index 8dc9fb2..e6e98b2 100644 --- a/test/Transforms/SimplifyCFG/PR17073.ll +++ b/test/Transforms/SimplifyCFG/PR17073.ll @@ -18,7 +18,7 @@ target triple = "i386-apple-macosx10.9.0" ; CHECK-NOT: select i1 %tobool, i32* null, i32* select (i1 icmp eq (i64 urem (i64 2, i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64)), i64 0), i32* null, i32* @a) define i32* @can_trap1() { entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %exit, label %block1 @@ -38,7 +38,7 @@ exit: ; CHECK-NOT: select i1 %tobool, i32* select (i1 icmp eq (i64 urem (i64 2, i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64)), i64 0), i32* null, i32* @a), i32* null define i32* @can_trap2() { entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %exit, label %block1 @@ -57,7 +57,7 @@ exit: ; CHECK: select i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a), i32* select (i1 icmp eq (i64 add (i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64), i64 2), i64 0), i32* null, i32* @a), i32* null define i32* @cannot_trap() { entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %exit, label %block1 diff --git a/test/Transforms/SimplifyCFG/SpeculativeExec.ll b/test/Transforms/SimplifyCFG/SpeculativeExec.ll index 31de3c8..c23a96d 100644 --- a/test/Transforms/SimplifyCFG/SpeculativeExec.ll +++ b/test/Transforms/SimplifyCFG/SpeculativeExec.ll @@ -34,11 +34,11 @@ define i8* @test4(i1* %dummy, i8* %a, i8* %b) { ; CHECK-LABEL: @test4( entry: - %cond1 = load volatile i1* %dummy + %cond1 = load volatile i1, i1* %dummy br i1 %cond1, label %if, label %end if: - %cond2 = load volatile i1* %dummy + %cond2 = load volatile i1, i1* %dummy br i1 %cond2, label %then, label %end then: diff --git a/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll b/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll index 22599b3..f3e5506 100644 --- a/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll +++ b/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll @@ -9,8 +9,8 @@ target triple = "x86_64-apple-darwin12.0.0" ; CHECK: entry: ; CHECK-NEXT: sub i3 %arg, -4 ; CHECK-NEXT: zext i3 %switch.tableidx to i4 -; CHECK-NEXT: getelementptr inbounds [8 x i64]* @switch.table, i32 0, i4 %switch.tableidx.zext -; CHECK-NEXT: load i64* %switch.gep +; CHECK-NEXT: getelementptr inbounds [8 x i64], [8 x i64]* @switch.table, i32 0, i4 %switch.tableidx.zext +; CHECK-NEXT: load i64, i64* %switch.gep ; CHECK-NEXT: add i64 ; CHECK-NEXT: ret i64 define i64 @test(i3 %arg) { diff --git a/test/Transforms/SimplifyCFG/X86/switch-table-bug.ll b/test/Transforms/SimplifyCFG/X86/switch-table-bug.ll index d0b8ab2..2600870 100644 --- a/test/Transforms/SimplifyCFG/X86/switch-table-bug.ll +++ b/test/Transforms/SimplifyCFG/X86/switch-table-bug.ll @@ -8,8 +8,8 @@ target triple = "x86_64-apple-darwin12.0.0" ; CHECK: entry: ; CHECK-NEXT: sub i2 %0, -2 ; CHECK-NEXT: zext i2 %switch.tableidx to i3 -; CHECK-NEXT: getelementptr inbounds [4 x i64]* @switch.table, i32 0, i3 %switch.tableidx.zext -; CHECK-NEXT: load i64* %switch.gep +; CHECK-NEXT: getelementptr inbounds [4 x i64], [4 x i64]* @switch.table, i32 0, i3 %switch.tableidx.zext +; CHECK-NEXT: load i64, i64* %switch.gep ; CHECK-NEXT: ret i64 %switch.load define i64 @_TFO6reduce1E5toRawfS0_FT_Si(i2) { entry: diff --git a/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll b/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll index ea3b575..cdc0488 100644 --- a/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll +++ b/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll @@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu" ; CHECK: @switch.table1 = private unnamed_addr constant [4 x float] [float 0x40091EB860000000, float 0x3FF3BE76C0000000, float 0x4012449BA0000000, float 0x4001AE1480000000] ; The table for @foostring -; CHECK: @switch.table2 = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str3, i64 0, i64 0)] +; CHECK: @switch.table2 = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0)] ; The table for @earlyreturncrash ; CHECK: @switch.table3 = private unnamed_addr constant [4 x i32] [i32 42, i32 9, i32 88, i32 5] @@ -58,8 +58,8 @@ return: ; CHECK-NEXT: %0 = icmp ult i32 %switch.tableidx, 7 ; CHECK-NEXT: br i1 %0, label %switch.lookup, label %return ; CHECK: switch.lookup: -; CHECK-NEXT: %switch.gep = getelementptr inbounds [7 x i32]* @switch.table, i32 0, i32 %switch.tableidx -; CHECK-NEXT: %switch.load = load i32* %switch.gep +; CHECK-NEXT: %switch.gep = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table, i32 0, i32 %switch.tableidx +; CHECK-NEXT: %switch.load = load i32, i32* %switch.gep ; CHECK-NEXT: ret i32 %switch.load ; CHECK: return: ; CHECK-NEXT: ret i32 15 @@ -97,8 +97,8 @@ sw.epilog: ; CHECK-NEXT: %switch.shiftamt = mul i32 %switch.tableidx, 8 ; CHECK-NEXT: %switch.downshift = lshr i32 89655594, %switch.shiftamt ; CHECK-NEXT: %switch.masked = trunc i32 %switch.downshift to i8 -; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x float]* @switch.table1, i32 0, i32 %switch.tableidx -; CHECK-NEXT: %switch.load = load float* %switch.gep +; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x float], [4 x float]* @switch.table1, i32 0, i32 %switch.tableidx +; CHECK-NEXT: %switch.load = load float, float* %switch.gep ; CHECK-NEXT: br label %sw.epilog ; CHECK: sw.epilog: ; CHECK-NEXT: %a.0 = phi i8 [ %switch.masked, %switch.lookup ], [ 7, %entry ] @@ -131,11 +131,11 @@ sw.bb3: br label %return sw.default: br label %return return: - %retval.0 = phi i8* [ getelementptr inbounds ([6 x i8]* @.str4, i64 0, i64 0), %sw.default ], - [ getelementptr inbounds ([4 x i8]* @.str3, i64 0, i64 0), %sw.bb3 ], - [ getelementptr inbounds ([4 x i8]* @.str2, i64 0, i64 0), %sw.bb2 ], - [ getelementptr inbounds ([4 x i8]* @.str1, i64 0, i64 0), %sw.bb1 ], - [ getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), %entry ] + %retval.0 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str4, i64 0, i64 0), %sw.default ], + [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str3, i64 0, i64 0), %sw.bb3 ], + [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str2, i64 0, i64 0), %sw.bb2 ], + [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i64 0, i64 0), %sw.bb1 ], + [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %entry ] ret i8* %retval.0 ; CHECK-LABEL: @foostring( @@ -144,8 +144,8 @@ return: ; CHECK-NEXT: %0 = icmp ult i32 %switch.tableidx, 4 ; CHECK-NEXT: br i1 %0, label %switch.lookup, label %return ; CHECK: switch.lookup: -; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i8*]* @switch.table2, i32 0, i32 %switch.tableidx -; CHECK-NEXT: %switch.load = load i8** %switch.gep +; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table2, i32 0, i32 %switch.tableidx +; CHECK-NEXT: %switch.load = load i8*, i8** %switch.gep ; CHECK-NEXT: ret i8* %switch.load } @@ -173,8 +173,8 @@ sw.epilog: ; CHECK-LABEL: @earlyreturncrash( ; CHECK: switch.lookup: -; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32]* @switch.table3, i32 0, i32 %switch.tableidx -; CHECK-NEXT: %switch.load = load i32* %switch.gep +; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table3, i32 0, i32 %switch.tableidx +; CHECK-NEXT: %switch.load = load i32, i32* %switch.gep ; CHECK-NEXT: ret i32 %switch.load ; CHECK: sw.epilog: ; CHECK-NEXT: ret i32 7 @@ -749,7 +749,7 @@ return: ; CHECK-LABEL: @cprop( ; CHECK: switch.lookup: -; CHECK: %switch.gep = getelementptr inbounds [7 x i32]* @switch.table5, i32 0, i32 %switch.tableidx +; CHECK: %switch.gep = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table5, i32 0, i32 %switch.tableidx } define i32 @unreachable_case(i32 %x) { @@ -778,7 +778,7 @@ return: ; CHECK-LABEL: @unreachable_case( ; CHECK: switch.lookup: -; CHECK: getelementptr inbounds [9 x i32]* @switch.table6, i32 0, i32 %switch.tableidx +; CHECK: getelementptr inbounds [9 x i32], [9 x i32]* @switch.table6, i32 0, i32 %switch.tableidx } define i32 @unreachable_default(i32 %x) { @@ -805,8 +805,8 @@ return: ; CHECK-NEXT: %switch.tableidx = sub i32 %x, 0 ; CHECK-NOT: icmp ; CHECK-NOT: br 1i -; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32]* @switch.table7, i32 0, i32 %switch.tableidx -; CHECK-NEXT: %switch.load = load i32* %switch.gep +; CHECK-NEXT: %switch.gep = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table7, i32 0, i32 %switch.tableidx +; CHECK-NEXT: %switch.load = load i32, i32* %switch.gep ; CHECK-NEXT: ret i32 %switch.load } @@ -996,10 +996,10 @@ sw.bb2: sw.default: br label %return return: - %retval.0 = phi i32* [ getelementptr inbounds ([3 x i32]* @dllimport_d, i32 0, i32 0), %sw.default ], - [ getelementptr inbounds ([3 x i32]* @dllimport_c, i32 0, i32 0), %sw.bb2 ], - [ getelementptr inbounds ([3 x i32]* @dllimport_b, i32 0, i32 0), %sw.bb1 ], - [ getelementptr inbounds ([3 x i32]* @dllimport_a, i32 0, i32 0), %entry ] + %retval.0 = phi i32* [ getelementptr inbounds ([3 x i32], [3 x i32]* @dllimport_d, i32 0, i32 0), %sw.default ], + [ getelementptr inbounds ([3 x i32], [3 x i32]* @dllimport_c, i32 0, i32 0), %sw.bb2 ], + [ getelementptr inbounds ([3 x i32], [3 x i32]* @dllimport_b, i32 0, i32 0), %sw.bb1 ], + [ getelementptr inbounds ([3 x i32], [3 x i32]* @dllimport_a, i32 0, i32 0), %entry ] ret i32* %retval.0 ; CHECK-LABEL: @dllimport( ; CHECK: switch i32 diff --git a/test/Transforms/SimplifyCFG/attr-noduplicate.ll b/test/Transforms/SimplifyCFG/attr-noduplicate.ll index 523aa51..5f8456b 100644 --- a/test/Transforms/SimplifyCFG/attr-noduplicate.ll +++ b/test/Transforms/SimplifyCFG/attr-noduplicate.ll @@ -8,8 +8,8 @@ ; CHECK-NOT: call void @barrier define void @noduplicate(i32 %cond, i32* %out) { entry: - %out1 = getelementptr i32* %out, i32 1 - %out2 = getelementptr i32* %out, i32 2 + %out1 = getelementptr i32, i32* %out, i32 1 + %out2 = getelementptr i32, i32* %out, i32 2 %cmp = icmp eq i32 %cond, 0 br i1 %cmp, label %if.then, label %if.end diff --git a/test/Transforms/SimplifyCFG/basictest.ll b/test/Transforms/SimplifyCFG/basictest.ll index 5d9dad4..d228499 100644 --- a/test/Transforms/SimplifyCFG/basictest.ll +++ b/test/Transforms/SimplifyCFG/basictest.ll @@ -50,7 +50,7 @@ define i8 @test6f() { ; CHECK: alloca i8, align 1 ; CHECK-NEXT: call i8 @test6g ; CHECK-NEXT: icmp eq i8 %tmp, 0 -; CHECK-NEXT: load i8* %r, align 1{{$}} +; CHECK-NEXT: load i8, i8* %r, align 1{{$}} bb0: %r = alloca i8, align 1 @@ -58,7 +58,7 @@ bb0: %tmp1 = icmp eq i8 %tmp, 0 br i1 %tmp1, label %bb2, label %bb1 bb1: - %tmp3 = load i8* %r, align 1, !range !2, !tbaa !1 + %tmp3 = load i8, i8* %r, align 1, !range !2, !tbaa !1 %tmp4 = icmp eq i8 %tmp3, 1 br i1 %tmp4, label %bb2, label %bb3 bb2: diff --git a/test/Transforms/SimplifyCFG/branch-fold-dbg.ll b/test/Transforms/SimplifyCFG/branch-fold-dbg.ll index f715a0c..3ddd351f 100644 --- a/test/Transforms/SimplifyCFG/branch-fold-dbg.ll +++ b/test/Transforms/SimplifyCFG/branch-fold-dbg.ll @@ -24,7 +24,7 @@ BB2: ; preds = %BB1 ;CHECK-NEXT: icmp eq BB3: ; preds = %BB2 - %6 = getelementptr inbounds [5 x %0]* @0, i32 0, i32 %0, !dbg !6 + %6 = getelementptr inbounds [5 x %0], [5 x %0]* @0, i32 0, i32 %0, !dbg !6 call void @llvm.dbg.value(metadata %0* %6, i64 0, metadata !7, metadata !{}), !dbg !12 %7 = icmp eq %0* %6, null, !dbg !13 br i1 %7, label %BB5, label %BB4, !dbg !13 @@ -41,19 +41,19 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.sp = !{!0} -!0 = !{!"0x2e\00foo\00foo\00\00231\000\001\000\006\00256\000\000", !15, !1, !3, null, void (i32)* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 231] [def] [scope 0] [foo] -!1 = !{!"0x29", !15} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00clang (trunk 129006)\001\00\000\00\000", !15, !4, !4, null, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !15, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "foo", line: 231, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !15, scope: !1, type: !3, function: void (i32)* @foo) +!1 = !MDFile(filename: "a.c", directory: "/private/tmp") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang (trunk 129006)", isOptimized: true, emissionKind: 0, file: !15, enums: !4, retainedTypes: !4) +!3 = !MDSubroutineType(types: !4) !4 = !{null} !5 = !MDLocation(line: 131, column: 2, scope: !0) !6 = !MDLocation(line: 134, column: 2, scope: !0) -!7 = !{!"0x100\00bar\00232\000", !8, !1, !9} ; [ DW_TAG_auto_variable ] -!8 = !{!"0xb\00231\001\003", !15, !0} ; [ DW_TAG_lexical_block ] -!9 = !{!"0xf\00\000\0032\0032\000\000", null, !2, !10} ; [ DW_TAG_pointer_type ] -!10 = !{!"0x26\00\000\000\000\000\000", null, !2, !11} ; [ DW_TAG_const_type ] -!11 = !{!"0x24\00unsigned int\000\0032\0032\000\000\007", null, !2} ; [ DW_TAG_base_type ] +!7 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "bar", line: 232, scope: !8, file: !1, type: !9) +!8 = distinct !MDLexicalBlock(line: 231, column: 1, file: !15, scope: !0) +!9 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !2, baseType: !10) +!10 = !MDDerivedType(tag: DW_TAG_const_type, scope: !2, baseType: !11) +!11 = !MDBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) !12 = !MDLocation(line: 232, column: 40, scope: !8) !13 = !MDLocation(line: 234, column: 2, scope: !8) !14 = !MDLocation(line: 274, column: 1, scope: !8) -!15 = !{!"a.c", !"/private/tmp"} +!15 = !MDFile(filename: "a.c", directory: "/private/tmp") diff --git a/test/Transforms/SimplifyCFG/branch-fold-threshold.ll b/test/Transforms/SimplifyCFG/branch-fold-threshold.ll index 878c0a4..fad5fce 100644 --- a/test/Transforms/SimplifyCFG/branch-fold-threshold.ll +++ b/test/Transforms/SimplifyCFG/branch-fold-threshold.ll @@ -19,7 +19,7 @@ lor.lhs.false: ; AGGRESSIVE-NOT: br i1 cond.false: - %0 = load i32* %input, align 4 + %0 = load i32, i32* %input, align 4 br label %cond.end cond.end: diff --git a/test/Transforms/SimplifyCFG/branch-phi-thread.ll b/test/Transforms/SimplifyCFG/branch-phi-thread.ll index c19ba69..4c1b7e6 100644 --- a/test/Transforms/SimplifyCFG/branch-phi-thread.ll +++ b/test/Transforms/SimplifyCFG/branch-phi-thread.ll @@ -51,7 +51,7 @@ E: br i1 %C, label %T, label %F T: ; preds = %A, %E call void @f3( ) - %XX = load i32* %AP ; <i32> [#uses=1] + %XX = load i32, i32* %AP ; <i32> [#uses=1] store i32 %XX, i32* %BP br i1 %C, label %B, label %A A: ; preds = %T diff --git a/test/Transforms/SimplifyCFG/dbginfo.ll b/test/Transforms/SimplifyCFG/dbginfo.ll index 1a9f20a..12aec91 100644 --- a/test/Transforms/SimplifyCFG/dbginfo.ll +++ b/test/Transforms/SimplifyCFG/dbginfo.ll @@ -58,7 +58,7 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram947 to { }*)) store %struct.__false_type* %this, %struct.__false_type** %this_addr - %0 = load %struct.__false_type** %this_addr, align 4 ; <%struct.__false_type*> [#uses=1] + %0 = load %struct.__false_type*, %struct.__false_type** %this_addr, align 4 ; <%struct.__false_type*> [#uses=1] call void @_ZN9__gnu_cxx13new_allocatorIP5SceneED2Ev(%struct.__false_type* %0) nounwind br label %bb diff --git a/test/Transforms/SimplifyCFG/duplicate-landingpad.ll b/test/Transforms/SimplifyCFG/duplicate-landingpad.ll new file mode 100644 index 0000000..5402877 --- /dev/null +++ b/test/Transforms/SimplifyCFG/duplicate-landingpad.ll @@ -0,0 +1,110 @@ +; RUN: opt < %s -simplifycfg -S | FileCheck %s +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" + +declare i32 @__gxx_personality_v0(...) +declare void @fn() + + +; CHECK-LABEL: @test1 +define void @test1() { +entry: +; CHECK-LABEL: entry: +; CHECK: to label %invoke2 unwind label %lpad2 + invoke void @fn() + to label %invoke2 unwind label %lpad1 + +invoke2: +; CHECK-LABEL: invoke2: +; CHECK: to label %invoke.cont unwind label %lpad2 + invoke void @fn() + to label %invoke.cont unwind label %lpad2 + +invoke.cont: + ret void + +lpad1: + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + br label %shared_resume + +lpad2: +; CHECK-LABEL: lpad2: +; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 +; CHECK-NEXT: cleanup +; CHECK-NEXT: call void @fn() +; CHECK-NEXT: ret void + %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + br label %shared_resume + +shared_resume: + call void @fn() + ret void +} + +; Don't trigger if blocks aren't the same/empty +define void @neg1() { +; CHECK-LABEL: @neg1 +entry: +; CHECK-LABEL: entry: +; CHECK: to label %invoke2 unwind label %lpad1 + invoke void @fn() + to label %invoke2 unwind label %lpad1 + +invoke2: +; CHECK-LABEL: invoke2: +; CHECK: to label %invoke.cont unwind label %lpad2 + invoke void @fn() + to label %invoke.cont unwind label %lpad2 + +invoke.cont: + ret void + +lpad1: + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + filter [0 x i8*] zeroinitializer + call void @fn() + br label %shared_resume + +lpad2: + %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + br label %shared_resume + +shared_resume: + call void @fn() + ret void +} + +; Should not trigger when the landing pads are not the exact same +define void @neg2() { +; CHECK-LABEL: @neg2 +entry: +; CHECK-LABEL: entry: +; CHECK: to label %invoke2 unwind label %lpad1 + invoke void @fn() + to label %invoke2 unwind label %lpad1 + +invoke2: +; CHECK-LABEL: invoke2: +; CHECK: to label %invoke.cont unwind label %lpad2 + invoke void @fn() + to label %invoke.cont unwind label %lpad2 + +invoke.cont: + ret void + +lpad1: + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + filter [0 x i8*] zeroinitializer + br label %shared_resume + +lpad2: + %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + br label %shared_resume + +shared_resume: + call void @fn() + ret void +} diff --git a/test/Transforms/SimplifyCFG/hoist-common-code.ll b/test/Transforms/SimplifyCFG/hoist-common-code.ll index 5c83e2a..c1ca605 100644 --- a/test/Transforms/SimplifyCFG/hoist-common-code.ll +++ b/test/Transforms/SimplifyCFG/hoist-common-code.ll @@ -6,12 +6,12 @@ define void @test(i1 %P, i32* %Q) { br i1 %P, label %T, label %F T: ; preds = %0 store i32 1, i32* %Q - %A = load i32* %Q ; <i32> [#uses=1] + %A = load i32, i32* %Q ; <i32> [#uses=1] call void @bar( i32 %A ) ret void F: ; preds = %0 store i32 1, i32* %Q - %B = load i32* %Q ; <i32> [#uses=1] + %B = load i32, i32* %Q ; <i32> [#uses=1] call void @bar( i32 %B ) ret void } diff --git a/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll b/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll index 869ce09..ac5ab60 100644 --- a/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll +++ b/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll @@ -1,8 +1,8 @@ ; RUN: opt -simplifycfg -S < %s | FileCheck %s define i32 @foo(i32 %i) nounwind ssp { - call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !6, metadata !{}), !dbg !7 - call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !9, metadata !{}), !dbg !11 + call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !6, metadata !MDExpression()), !dbg !7 + call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !9, metadata !MDExpression()), !dbg !11 %1 = icmp ne i32 %i, 0, !dbg !12 ;CHECK: call i32 (...)* @bar() ;CHECK-NEXT: llvm.dbg.value @@ -10,12 +10,12 @@ define i32 @foo(i32 %i) nounwind ssp { ; <label>:2 ; preds = %0 %3 = call i32 (...)* @bar(), !dbg !13 - call void @llvm.dbg.value(metadata i32 %3, i64 0, metadata !9, metadata !{}), !dbg !13 + call void @llvm.dbg.value(metadata i32 %3, i64 0, metadata !9, metadata !MDExpression()), !dbg !13 br label %6, !dbg !15 ; <label>:4 ; preds = %0 %5 = call i32 (...)* @bar(), !dbg !16 - call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !9, metadata !{}), !dbg !16 + call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !9, metadata !MDExpression()), !dbg !16 br label %6, !dbg !18 ; <label>:6 ; preds = %4, %2 @@ -32,25 +32,25 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.module.flags = !{!21} !llvm.dbg.sp = !{!0} -!0 = !{!"0x2e\00foo\00foo\00\002\000\001\000\006\00256\000\000", !20, !1, !3, null, i32 (i32)* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 0] [foo] -!1 = !{!"0x29", !20} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00clang\001\00\000\00\000", !20, !8, !8, null, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !20, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !20, scope: !1, type: !3, function: i32 (i32)* @foo) +!1 = !MDFile(filename: "b.c", directory: "/private/tmp") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: 0, file: !20, enums: !8, retainedTypes: !8) +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", null, !2} ; [ DW_TAG_base_type ] -!6 = !{!"0x101\00i\0016777218\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 2, arg: 1, scope: !0, file: !1, type: !5) !7 = !MDLocation(line: 2, column: 13, scope: !0) !8 = !{i32 0} -!9 = !{!"0x100\00k\003\000", !10, !1, !5} ; [ DW_TAG_auto_variable ] -!10 = !{!"0xb\002\0016\000", !20, !0} ; [ DW_TAG_lexical_block ] +!9 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "k", line: 3, scope: !10, file: !1, type: !5) +!10 = distinct !MDLexicalBlock(line: 2, column: 16, file: !20, scope: !0) !11 = !MDLocation(line: 3, column: 12, scope: !10) !12 = !MDLocation(line: 4, column: 3, scope: !10) !13 = !MDLocation(line: 5, column: 5, scope: !14) -!14 = !{!"0xb\004\0010\001", !20, !10} ; [ DW_TAG_lexical_block ] +!14 = distinct !MDLexicalBlock(line: 4, column: 10, file: !20, scope: !10) !15 = !MDLocation(line: 6, column: 3, scope: !14) !16 = !MDLocation(line: 7, column: 5, scope: !17) -!17 = !{!"0xb\006\0010\002", !20, !10} ; [ DW_TAG_lexical_block ] +!17 = distinct !MDLexicalBlock(line: 6, column: 10, file: !20, scope: !10) !18 = !MDLocation(line: 8, column: 3, scope: !17) !19 = !MDLocation(line: 9, column: 3, scope: !10) -!20 = !{!"b.c", !"/private/tmp"} -!21 = !{i32 1, !"Debug Info Version", i32 2} +!20 = !MDFile(filename: "b.c", directory: "/private/tmp") +!21 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/SimplifyCFG/hoist-with-range.ll b/test/Transforms/SimplifyCFG/hoist-with-range.ll index 7ca3ff2..0a2b282 100644 --- a/test/Transforms/SimplifyCFG/hoist-with-range.ll +++ b/test/Transforms/SimplifyCFG/hoist-with-range.ll @@ -2,15 +2,15 @@ define void @foo(i1 %c, i8* %p) { ; CHECK: if: -; CHECK-NEXT: load i8* %p, !range !0 +; CHECK-NEXT: load i8, i8* %p, !range !0 ; CHECK: !0 = !{i8 0, i8 1, i8 3, i8 5} if: br i1 %c, label %then, label %else then: - %t = load i8* %p, !range !0 + %t = load i8, i8* %p, !range !0 br label %out else: - %e = load i8* %p, !range !1 + %e = load i8, i8* %p, !range !1 br label %out out: ret void diff --git a/test/Transforms/SimplifyCFG/indirectbr.ll b/test/Transforms/SimplifyCFG/indirectbr.ll index d0020d0..67e23d2 100644 --- a/test/Transforms/SimplifyCFG/indirectbr.ll +++ b/test/Transforms/SimplifyCFG/indirectbr.ll @@ -17,7 +17,7 @@ entry: store i8* blockaddress(@indbrtest0, %BB1), i8** %P store i8* blockaddress(@indbrtest0, %BB2), i8** %P call void @foo() - %t = load i8** %Q + %t = load i8*, i8** %Q indirectbr i8* %t, [label %BB0, label %BB1, label %BB2, label %BB0, label %BB1, label %BB2] BB0: call void @A() @@ -42,7 +42,7 @@ define void @indbrtest1(i8** %P, i8** %Q) { entry: store i8* blockaddress(@indbrtest1, %BB0), i8** %P call void @foo() - %t = load i8** %Q + %t = load i8*, i8** %Q indirectbr i8* %t, [label %BB0, label %BB0] BB0: call void @A() @@ -192,8 +192,8 @@ escape-string.top: xlab8x: ; preds = %xlab5x %xvaluex = call i32 @xselectorx() - %xblkx.x = getelementptr [9 x i8*]* @xblkx.bbs, i32 0, i32 %xvaluex - %xblkx.load = load i8** %xblkx.x + %xblkx.x = getelementptr [9 x i8*], [9 x i8*]* @xblkx.bbs, i32 0, i32 %xvaluex + %xblkx.load = load i8*, i8** %xblkx.x indirectbr i8* %xblkx.load, [label %xblkx.begin, label %xblkx.begin3, label %xblkx.begin4, label %xblkx.begin5, label %xblkx.begin6, label %xblkx.begin7, label %xblkx.begin8, label %xblkx.begin9, label %xblkx.end] xblkx.begin: diff --git a/test/Transforms/SimplifyCFG/iterative-simplify.ll b/test/Transforms/SimplifyCFG/iterative-simplify.ll index a397411..60728b9 100644 --- a/test/Transforms/SimplifyCFG/iterative-simplify.ll +++ b/test/Transforms/SimplifyCFG/iterative-simplify.ll @@ -17,13 +17,13 @@ cond_true: ; preds = %entry br label %bb bb: ; preds = %cond_next, %cond_true - %tmp = load i32* %z ; <i32> [#uses=1] + %tmp = load i32, i32* %z ; <i32> [#uses=1] %tmp1 = sub i32 %tmp, 16384 ; <i32> [#uses=1] store i32 %tmp1, i32* %z - %tmp2 = load i32* %i ; <i32> [#uses=1] + %tmp2 = load i32, i32* %i ; <i32> [#uses=1] %tmp3 = add i32 %tmp2, 1 ; <i32> [#uses=1] store i32 %tmp3, i32* %i - %tmp4 = load i32* %i ; <i32> [#uses=1] + %tmp4 = load i32, i32* %i ; <i32> [#uses=1] %tmp5 = icmp sgt i32 %tmp4, 262144 ; <i1> [#uses=1] %tmp56 = zext i1 %tmp5 to i8 ; <i8> [#uses=1] %toBool7 = icmp ne i8 %tmp56, 0 ; <i1> [#uses=1] @@ -34,7 +34,7 @@ cond_true8: ; preds = %bb unreachable cond_next: ; preds = %bb - %tmp9 = load i32* %z ; <i32> [#uses=1] + %tmp9 = load i32, i32* %z ; <i32> [#uses=1] %tmp10 = icmp ne i32 %tmp9, 0 ; <i1> [#uses=1] %tmp1011 = zext i1 %tmp10 to i8 ; <i8> [#uses=1] %toBool12 = icmp ne i8 %tmp1011, 0 ; <i1> [#uses=1] @@ -53,13 +53,13 @@ cond_true15: ; preds = %cond_false br label %bb17 bb17: ; preds = %cond_next27, %cond_true15 - %tmp18 = load i32* %z16 ; <i32> [#uses=1] + %tmp18 = load i32, i32* %z16 ; <i32> [#uses=1] %tmp19 = sub i32 %tmp18, 16384 ; <i32> [#uses=1] store i32 %tmp19, i32* %z16 - %tmp20 = load i32* %i ; <i32> [#uses=1] + %tmp20 = load i32, i32* %i ; <i32> [#uses=1] %tmp21 = add i32 %tmp20, 1 ; <i32> [#uses=1] store i32 %tmp21, i32* %i - %tmp22 = load i32* %i ; <i32> [#uses=1] + %tmp22 = load i32, i32* %i ; <i32> [#uses=1] %tmp23 = icmp sgt i32 %tmp22, 262144 ; <i1> [#uses=1] %tmp2324 = zext i1 %tmp23 to i8 ; <i8> [#uses=1] %toBool25 = icmp ne i8 %tmp2324, 0 ; <i1> [#uses=1] @@ -70,7 +70,7 @@ cond_true26: ; preds = %bb17 unreachable cond_next27: ; preds = %bb17 - %tmp28 = load i32* %z16 ; <i32> [#uses=1] + %tmp28 = load i32, i32* %z16 ; <i32> [#uses=1] %tmp29 = icmp ne i32 %tmp28, 0 ; <i1> [#uses=1] %tmp2930 = zext i1 %tmp29 to i8 ; <i8> [#uses=1] %toBool31 = icmp ne i8 %tmp2930, 0 ; <i1> [#uses=1] @@ -91,7 +91,7 @@ cond_next35: ; preds = %cond_next34 br label %return return: ; preds = %cond_next35 - %retval36 = load i32* %retval ; <i32> [#uses=1] + %retval36 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval36 } diff --git a/test/Transforms/SimplifyCFG/multiple-phis.ll b/test/Transforms/SimplifyCFG/multiple-phis.ll index 7845423..a6eef09 100644 --- a/test/Transforms/SimplifyCFG/multiple-phis.ll +++ b/test/Transforms/SimplifyCFG/multiple-phis.ll @@ -22,8 +22,8 @@ while.body: ; preds = %while.cond %add = add i32 %low.0, %high.addr.0 %div = udiv i32 %add, 2 %idxprom = zext i32 %div to i64 - %arrayidx = getelementptr inbounds i32* %r, i64 %idxprom - %0 = load i32* %arrayidx + %arrayidx = getelementptr inbounds i32, i32* %r, i64 %idxprom + %0 = load i32, i32* %arrayidx %cmp1 = icmp ult i32 %k, %0 br i1 %cmp1, label %if.then, label %if.else diff --git a/test/Transforms/SimplifyCFG/no_speculative_loads_with_tsan.ll b/test/Transforms/SimplifyCFG/no_speculative_loads_with_tsan.ll index b388cc5..4792e95 100644 --- a/test/Transforms/SimplifyCFG/no_speculative_loads_with_tsan.ll +++ b/test/Transforms/SimplifyCFG/no_speculative_loads_with_tsan.ll @@ -8,7 +8,7 @@ entry: br i1 %tobool, label %return, label %if.then if.then: ; preds = %entry - %0 = load i32* @g, align 4 + %0 = load i32, i32* @g, align 4 br label %return return: ; preds = %entry, %if.then @@ -26,7 +26,7 @@ entry: br i1 %tobool, label %return, label %if.then if.then: ; preds = %entry - %0 = load i32* @g, align 4 + %0 = load i32, i32* @g, align 4 br label %return return: ; preds = %entry, %if.then @@ -34,7 +34,7 @@ return: ; preds = %entry, %if.then ret i32 %retval ; CHECK-LABEL: @TestTsan ; CHECK: br i1 -; CHECK: load i32* @g +; CHECK: load i32, i32* @g ; CHECK: br label ; CHECK: ret i32 } diff --git a/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll b/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll index f34aec5..c0f0046 100644 --- a/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll +++ b/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll @@ -21,7 +21,7 @@ if.then4: ; preds = %if.else if.end7: ; preds = %if.else, %if.then4, %if.then %x.0 = phi i32* [ %a, %if.then ], [ %c, %if.then4 ], [ null, %if.else ] - %tmp9 = load i32* %x.0 + %tmp9 = load i32, i32* %x.0 ret i32 %tmp9 ; CHECK-LABEL: @test1( @@ -50,7 +50,7 @@ if.then4: ; preds = %if.else if.end7: ; preds = %if.else, %if.then4, %if.then %x.0 = phi i32* [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ] - %tmp9 = load i32* %x.0 + %tmp9 = load i32, i32* %x.0 ret i32 %tmp9 ; CHECK-LABEL: @test2( ; CHECK: if.else: @@ -79,7 +79,7 @@ if.then4: ; preds = %if.else if.end7: ; preds = %if.else, %if.then4, %if.then %x.0 = phi i32* [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ] tail call void @bar() nounwind - %tmp9 = load i32* %x.0 + %tmp9 = load i32, i32* %x.0 ret i32 %tmp9 ; CHECK-LABEL: @test3( ; CHECK: if.end7: @@ -105,8 +105,8 @@ if.then4: ; preds = %if.else if.end7: ; preds = %if.else, %if.then4, %if.then %x.0 = phi i32* [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ] - %gep = getelementptr i32* %x.0, i32 10 - %tmp9 = load i32* %gep + %gep = getelementptr i32, i32* %x.0, i32 10 + %tmp9 = load i32, i32* %gep %tmp10 = or i32 %tmp9, 1 store i32 %tmp10, i32* %gep ret i32 %tmp9 diff --git a/test/Transforms/SimplifyCFG/preserve-branchweights.ll b/test/Transforms/SimplifyCFG/preserve-branchweights.ll index 7802a05..ae1794b 100644 --- a/test/Transforms/SimplifyCFG/preserve-branchweights.ll +++ b/test/Transforms/SimplifyCFG/preserve-branchweights.ll @@ -353,7 +353,7 @@ for.cond2: %tobool = icmp eq i32 %bit.0, 0 br i1 %tobool, label %for.exit, label %for.body3, !prof !10 for.body3: - %v3 = load i32* @max_regno, align 4 + %v3 = load i32, i32* @max_regno, align 4 %cmp4 = icmp eq i32 %i.1, %v3 br i1 %cmp4, label %for.exit, label %for.inc, !prof !11 for.inc: diff --git a/test/Transforms/SimplifyCFG/select-gep.ll b/test/Transforms/SimplifyCFG/select-gep.ll index 43e46ca..f2bc5ab 100644 --- a/test/Transforms/SimplifyCFG/select-gep.ll +++ b/test/Transforms/SimplifyCFG/select-gep.ll @@ -8,7 +8,7 @@ entry: br i1 %cmp, label %if.then, label %if.end if.then: - %incdec.ptr = getelementptr %ST* %x, i32 0, i32 1 + %incdec.ptr = getelementptr %ST, %ST* %x, i32 0, i32 1 br label %if.end if.end: diff --git a/test/Transforms/SimplifyCFG/speculate-store.ll b/test/Transforms/SimplifyCFG/speculate-store.ll index e241901..c1ac7bc 100644 --- a/test/Transforms/SimplifyCFG/speculate-store.ll +++ b/test/Transforms/SimplifyCFG/speculate-store.ll @@ -2,15 +2,15 @@ define void @ifconvertstore(i32 %m, i32* %A, i32* %B, i32 %C, i32 %D) { entry: - %arrayidx = getelementptr inbounds i32* %B, i64 0 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 0 + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %C - %arrayidx2 = getelementptr inbounds i32* %A, i64 0 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 0 ; First store to the location. store i32 %add, i32* %arrayidx2, align 4 - %arrayidx4 = getelementptr inbounds i32* %B, i64 1 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %B, i64 1 + %1 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %1, %D %cmp6 = icmp sgt i32 %add5, %C br i1 %cmp6, label %if.then, label %ret.end @@ -30,15 +30,15 @@ ret.end: define void @noifconvertstore1(i32 %m, i32* %A, i32* %B, i32 %C, i32 %D) { entry: - %arrayidx = getelementptr inbounds i32* %B, i64 0 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 0 + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %C - %arrayidx2 = getelementptr inbounds i32* %A, i64 0 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 0 ; Store to a different location. store i32 %add, i32* %arrayidx, align 4 - %arrayidx4 = getelementptr inbounds i32* %B, i64 1 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %B, i64 1 + %1 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %1, %D %cmp6 = icmp sgt i32 %add5, %C br i1 %cmp6, label %if.then, label %ret.end @@ -57,16 +57,16 @@ declare void @unknown_fun() define void @noifconvertstore2(i32 %m, i32* %A, i32* %B, i32 %C, i32 %D) { entry: - %arrayidx = getelementptr inbounds i32* %B, i64 0 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 0 + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %C - %arrayidx2 = getelementptr inbounds i32* %A, i64 0 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 0 ; First store to the location. store i32 %add, i32* %arrayidx2, align 4 call void @unknown_fun() - %arrayidx4 = getelementptr inbounds i32* %B, i64 1 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %B, i64 1 + %1 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %1, %D %cmp6 = icmp sgt i32 %add5, %C br i1 %cmp6, label %if.then, label %ret.end @@ -83,15 +83,15 @@ ret.end: define void @noifconvertstore_volatile(i32 %m, i32* %A, i32* %B, i32 %C, i32 %D) { entry: - %arrayidx = getelementptr inbounds i32* %B, i64 0 - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %B, i64 0 + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %C - %arrayidx2 = getelementptr inbounds i32* %A, i64 0 + %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 0 ; First store to the location. store i32 %add, i32* %arrayidx2, align 4 - %arrayidx4 = getelementptr inbounds i32* %B, i64 1 - %1 = load i32* %arrayidx4, align 4 + %arrayidx4 = getelementptr inbounds i32, i32* %B, i64 1 + %1 = load i32, i32* %arrayidx4, align 4 %add5 = add nsw i32 %1, %D %cmp6 = icmp sgt i32 %add5, %C br i1 %cmp6, label %if.then, label %ret.end diff --git a/test/Transforms/SimplifyCFG/speculate-with-offset.ll b/test/Transforms/SimplifyCFG/speculate-with-offset.ll index 64fed85..65ebb5c 100644 --- a/test/Transforms/SimplifyCFG/speculate-with-offset.ll +++ b/test/Transforms/SimplifyCFG/speculate-with-offset.ll @@ -9,7 +9,7 @@ define void @yes(i1 %c) nounwind { entry: %a = alloca [4 x i64*], align 8 - %__a.addr = getelementptr [4 x i64*]* %a, i64 0, i64 3 + %__a.addr = getelementptr [4 x i64*], [4 x i64*]* %a, i64 0, i64 3 call void @frob(i64** %__a.addr) br i1 %c, label %if.then, label %if.end @@ -17,7 +17,7 @@ if.then: ; preds = %entry br label %return if.end: ; preds = %entry - %tmp5 = load i64** %__a.addr, align 8 + %tmp5 = load i64*, i64** %__a.addr, align 8 br label %return return: ; preds = %if.end, %if.then @@ -31,7 +31,7 @@ return: ; preds = %if.end, %if.then define void @no0(i1 %c) nounwind { entry: %a = alloca [4 x i64*], align 8 - %__a.addr = getelementptr [4 x i64*]* %a, i64 0, i64 4 + %__a.addr = getelementptr [4 x i64*], [4 x i64*]* %a, i64 0, i64 4 call void @frob(i64** %__a.addr) br i1 %c, label %if.then, label %if.end @@ -39,7 +39,7 @@ if.then: ; preds = %entry br label %return if.end: ; preds = %entry - %tmp5 = load i64** %__a.addr, align 8 + %tmp5 = load i64*, i64** %__a.addr, align 8 br label %return return: ; preds = %if.end, %if.then @@ -53,7 +53,7 @@ return: ; preds = %if.end, %if.then define void @no1(i1 %c, i64 %n) nounwind { entry: %a = alloca [4 x i64*], align 8 - %__a.addr = getelementptr [4 x i64*]* %a, i64 0, i64 %n + %__a.addr = getelementptr [4 x i64*], [4 x i64*]* %a, i64 0, i64 %n call void @frob(i64** %__a.addr) br i1 %c, label %if.then, label %if.end @@ -61,7 +61,7 @@ if.then: ; preds = %entry br label %return if.end: ; preds = %entry - %tmp5 = load i64** %__a.addr, align 8 + %tmp5 = load i64*, i64** %__a.addr, align 8 br label %return return: ; preds = %if.end, %if.then @@ -75,7 +75,7 @@ return: ; preds = %if.end, %if.then define void @no2(i1 %c, i64 %n) nounwind { entry: %a = alloca [4 x i64*], align 8 - %__a.addr = getelementptr [4 x i64*]* %a, i64 1, i64 0 + %__a.addr = getelementptr [4 x i64*], [4 x i64*]* %a, i64 1, i64 0 call void @frob(i64** %__a.addr) br i1 %c, label %if.then, label %if.end @@ -83,7 +83,7 @@ if.then: ; preds = %entry br label %return if.end: ; preds = %entry - %tmp5 = load i64** %__a.addr, align 8 + %tmp5 = load i64*, i64** %__a.addr, align 8 br label %return return: ; preds = %if.end, %if.then diff --git a/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll b/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll index ddf5d1f..f5359b5 100644 --- a/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll +++ b/test/Transforms/SimplifyCFG/switch-to-select-multiple-edge-per-block-phi.ll @@ -20,12 +20,12 @@ define i32 @fn1() { ; CHECK: %switch.selectcmp1 = icmp eq i32 %1, 5 ; CHECK: %switch.select2 = select i1 %switch.selectcmp1, i32 5, i32 %switch.select entry: - %0 = load i32* @b, align 4 + %0 = load i32, i32* @b, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %if.end3, label %if.then if.then: - %1 = load i32* @a, align 4 + %1 = load i32, i32* @a, align 4 switch i32 %1, label %if.end3 [ i32 5, label %return i32 0, label %return diff --git a/test/Transforms/SimplifyCFG/switch_create.ll b/test/Transforms/SimplifyCFG/switch_create.ll index e1e9157..490b751 100644 --- a/test/Transforms/SimplifyCFG/switch_create.ll +++ b/test/Transforms/SimplifyCFG/switch_create.ll @@ -154,8 +154,8 @@ lor.end: ; preds = %entry, %entry, %ent define i1 @test6({ i32, i32 }* %I) { entry: - %tmp.1.i = getelementptr { i32, i32 }* %I, i64 0, i32 1 ; <i32*> [#uses=1] - %tmp.2.i = load i32* %tmp.1.i ; <i32> [#uses=6] + %tmp.1.i = getelementptr { i32, i32 }, { i32, i32 }* %I, i64 0, i32 1 ; <i32*> [#uses=1] + %tmp.2.i = load i32, i32* %tmp.1.i ; <i32> [#uses=6] %tmp.2 = icmp eq i32 %tmp.2.i, 14 ; <i1> [#uses=1] br i1 %tmp.2, label %shortcirc_done.4, label %shortcirc_next.0 shortcirc_next.0: ; preds = %entry diff --git a/test/Transforms/SimplifyCFG/trap-debugloc.ll b/test/Transforms/SimplifyCFG/trap-debugloc.ll index 24a286f..a86649b 100644 --- a/test/Transforms/SimplifyCFG/trap-debugloc.ll +++ b/test/Transforms/SimplifyCFG/trap-debugloc.ll @@ -11,14 +11,14 @@ define void @foo() nounwind ssp { !llvm.module.flags = !{!10} !llvm.dbg.sp = !{!0} -!0 = !{!"0x2e\00foo\00foo\00\003\000\001\000\006\000\000\000", !8, !1, !3, null, void ()* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 3] [def] [scope 0] [foo] -!1 = !{!"0x29", !8} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00Apple clang version 3.0 (tags/Apple/clang-206.1) (based on LLVM 3.0svn)\001\00\000\00\000", !8, !4, !4, !9, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !8, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !1, type: !3, function: void ()* @foo) +!1 = !MDFile(filename: "foo.c", directory: "/private/tmp") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-206.1) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: 0, file: !8, enums: !4, retainedTypes: !4, subprograms: !9) +!3 = !MDSubroutineType(types: !4) !4 = !{null} !5 = !MDLocation(line: 4, column: 2, scope: !6) -!6 = !{!"0xb\003\0012\000", !8, !0} ; [ DW_TAG_lexical_block ] +!6 = distinct !MDLexicalBlock(line: 3, column: 12, file: !8, scope: !0) !7 = !MDLocation(line: 5, column: 1, scope: !6) -!8 = !{!"foo.c", !"/private/tmp"} +!8 = !MDFile(filename: "foo.c", directory: "/private/tmp") !9 = !{!0} -!10 = !{i32 1, !"Debug Info Version", i32 2} +!10 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll b/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll index 5ae62af..5881367 100644 --- a/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll +++ b/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll @@ -11,7 +11,7 @@ entry: br i1 %0, label %bb, label %return bb: ; preds = %entry - %1 = load volatile i32* null + %1 = load volatile i32, i32* null unreachable br label %return diff --git a/test/Transforms/SimplifyCFG/unreachable-blocks.ll b/test/Transforms/SimplifyCFG/unreachable-blocks.ll index 1df0eab..87a64ad 100644 --- a/test/Transforms/SimplifyCFG/unreachable-blocks.ll +++ b/test/Transforms/SimplifyCFG/unreachable-blocks.ll @@ -10,12 +10,12 @@ entry: while_block: ; preds = %and_if_cont2, %and_if_cont %newlen = sub i32 %newlen, 1 - %newptr = getelementptr i8* %newptr, i64 1 + %newptr = getelementptr i8, i8* %newptr, i64 1 %test = icmp sgt i32 %newlen, 0 br i1 %test, label %and_if1, label %and_if_cont2 and_if1: ; preds = %while_block - %char = load i8* %newptr + %char = load i8, i8* %newptr %test2 = icmp ule i8 %char, 32 br label %and_if_cont2 diff --git a/test/Transforms/SimplifyCFG/volatile-phioper.ll b/test/Transforms/SimplifyCFG/volatile-phioper.ll index 6367451..f2d4b8b 100644 --- a/test/Transforms/SimplifyCFG/volatile-phioper.ll +++ b/test/Transforms/SimplifyCFG/volatile-phioper.ll @@ -29,7 +29,7 @@ while.body: ; preds = %entry, %if.then, %w %Addr.017 = phi i8* [ %incdec.ptr, %while.body ], [ null, %if.then ], [ null, %entry ] %x.016 = phi i8 [ %inc, %while.body ], [ 0, %if.then ], [ 0, %entry ] %inc = add i8 %x.016, 1 - %incdec.ptr = getelementptr inbounds i8* %Addr.017, i64 1 + %incdec.ptr = getelementptr inbounds i8, i8* %Addr.017, i64 1 store volatile i8 %x.016, i8* %Addr.017, align 1 %0 = ptrtoint i8* %incdec.ptr to i64 %1 = trunc i64 %0 to i32 diff --git a/test/Transforms/Sink/basic.ll b/test/Transforms/Sink/basic.ll index 4aac6d6..1bbf161 100644 --- a/test/Transforms/Sink/basic.ll +++ b/test/Transforms/Sink/basic.ll @@ -8,11 +8,11 @@ ; CHECK-LABEL: @foo( ; CHECK: true: -; CHECK-NEXT: %l = load i32* @A +; CHECK-NEXT: %l = load i32, i32* @A ; CHECK-NEXT: ret i32 %l define i32 @foo(i1 %z) { - %l = load i32* @A + %l = load i32, i32* @A store i32 0, i32* @B br i1 %z, label %true, label %false true: @@ -28,7 +28,7 @@ false: ; CHECK-NEXT: store i32 define i32 @foo2(i1 %z) { - %l = load volatile i32* @A + %l = load volatile i32, i32* @A store i32 0, i32* @B br i1 %z, label %true, label %false true: @@ -75,11 +75,11 @@ entry: br i1 %1, label %if, label %endif if: - %2 = getelementptr i32* %0, i32 1 + %2 = getelementptr i32, i32* %0, i32 1 store i32 0, i32* %0 store i32 1, i32* %2 - %3 = getelementptr i32* %0, i32 %b - %4 = load i32* %3 + %3 = getelementptr i32, i32* %0, i32 %b + %4 = load i32, i32* %3 ret i32 %4 endif: @@ -100,11 +100,11 @@ entry: br i1 %1, label %if, label %endif if: - %2 = getelementptr i32* %0, i32 1 + %2 = getelementptr i32, i32* %0, i32 1 store i32 0, i32* %0 store i32 1, i32* %2 - %3 = getelementptr i32* %0, i32 %b - %4 = load i32* %3 + %3 = getelementptr i32, i32* %0, i32 %b + %4 = load i32, i32* %3 ret i32 %4 endif: @@ -131,11 +131,11 @@ if0: br i1 %1, label %if, label %endif if: - %2 = getelementptr i32* %0, i32 1 + %2 = getelementptr i32, i32* %0, i32 1 store i32 0, i32* %0 store i32 1, i32* %2 - %3 = getelementptr i32* %0, i32 %b - %4 = load i32* %3 + %3 = getelementptr i32, i32* %0, i32 %b + %4 = load i32, i32* %3 ret i32 %4 endif: diff --git a/test/Transforms/StraightLineStrengthReduce/X86/lit.local.cfg b/test/Transforms/StraightLineStrengthReduce/X86/lit.local.cfg new file mode 100644 index 0000000..c8625f4 --- /dev/null +++ b/test/Transforms/StraightLineStrengthReduce/X86/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'X86' in config.root.targets: + config.unsupported = True diff --git a/test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll b/test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll new file mode 100644 index 0000000..94c47c7 --- /dev/null +++ b/test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll @@ -0,0 +1,30 @@ +; RUN: opt < %s -slsr -gvn -dce -S | FileCheck %s + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Do not perform SLSR on &input[s] and &input[s * 2] which fit into addressing +; modes of X86. +define i32 @slsr_gep(i32* %input, i64 %s) { +; CHECK-LABEL: @slsr_gep( + ; v0 = input[0]; + %p0 = getelementptr inbounds i32, i32* %input, i64 0 + %v0 = load i32, i32* %p0 + + ; v1 = input[s]; + %p1 = getelementptr inbounds i32, i32* %input, i64 %s +; CHECK: %p1 = getelementptr inbounds i32, i32* %input, i64 %s + %v1 = load i32, i32* %p1 + + ; v2 = input[s * 2]; + %s2 = mul nsw i64 %s, 2 + %p2 = getelementptr inbounds i32, i32* %input, i64 %s2 +; CHECK: %p2 = getelementptr inbounds i32, i32* %input, i64 %s2 + %v2 = load i32, i32* %p2 + + ; return v0 + v1 + v2; + %1 = add i32 %v0, %v1 + %2 = add i32 %1, %v2 + ret i32 %2 +} + diff --git a/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll b/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll new file mode 100644 index 0000000..47e6637 --- /dev/null +++ b/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll @@ -0,0 +1,109 @@ +; RUN: opt < %s -slsr -gvn -dce -S | FileCheck %s + +target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64" + +define i32 @slsr_gep(i32* %input, i64 %s) { +; CHECK-LABEL: @slsr_gep( + ; v0 = input[0]; + %p0 = getelementptr inbounds i32, i32* %input, i64 0 + %v0 = load i32, i32* %p0 + + ; v1 = input[s]; + %p1 = getelementptr inbounds i32, i32* %input, i64 %s +; CHECK: %p1 = getelementptr inbounds i32, i32* %input, i64 %s + %v1 = load i32, i32* %p1 + + ; v2 = input[s * 2]; + %s2 = mul nsw i64 %s, 2 + %p2 = getelementptr inbounds i32, i32* %input, i64 %s2 +; CHECK: %p2 = getelementptr inbounds i32, i32* %p1, i64 %s + %v2 = load i32, i32* %p2 + + ; return v0 + v1 + v2; + %1 = add i32 %v0, %v1 + %2 = add i32 %1, %v2 + ret i32 %2 +} + +define i32 @slsr_gep_sext(i32* %input, i32 %s) { +; CHECK-LABEL: @slsr_gep_sext( + ; v0 = input[0]; + %p0 = getelementptr inbounds i32, i32* %input, i64 0 + %v0 = load i32, i32* %p0 + + ; v1 = input[(long)s]; + %t = sext i32 %s to i64 + %p1 = getelementptr inbounds i32, i32* %input, i64 %t +; CHECK: %p1 = getelementptr inbounds i32, i32* %input, i64 %t + %v1 = load i32, i32* %p1 + + ; v2 = input[(long)(s * 2)]; + %s2 = mul nsw i32 %s, 2 + %t2 = sext i32 %s2 to i64 + %p2 = getelementptr inbounds i32, i32* %input, i64 %t2 +; CHECK: %p2 = getelementptr inbounds i32, i32* %p1, i64 %t + %v2 = load i32, i32* %p2 + + ; return v0 + v1 + v2; + %1 = add i32 %v0, %v1 + %2 = add i32 %1, %v2 + ret i32 %2 +} + +define i32 @slsr_gep_2d([10 x [5 x i32]]* %input, i64 %s, i64 %t) { +; CHECK-LABEL: @slsr_gep_2d( + ; v0 = input[s][t]; + %p0 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* %input, i64 0, i64 %s, i64 %t + %v0 = load i32, i32* %p0 + + ; v1 = input[s * 2][t]; + %s2 = mul nsw i64 %s, 2 +; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = mul i64 %s, 5 + %p1 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* %input, i64 0, i64 %s2, i64 %t +; CHECK: %p1 = getelementptr inbounds i32, i32* %p0, i64 [[BUMP]] + %v1 = load i32, i32* %p1 + + ; v2 = input[s * 3][t]; + %s3 = mul nsw i64 %s, 3 + %p2 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* %input, i64 0, i64 %s3, i64 %t +; CHECK: %p2 = getelementptr inbounds i32, i32* %p1, i64 [[BUMP]] + %v2 = load i32, i32* %p2 + + ; return v0 + v1 + v2; + %1 = add i32 %v0, %v1 + %2 = add i32 %1, %v2 + ret i32 %2 +} + +%struct.S = type <{ i64, i32 }> + +; In this case, the bump +; = (char *)&input[s * 2][t].f1 - (char *)&input[s][t].f1 +; = 60 * s +; which may not be divisible by typeof(input[s][t].f1) = 8. Therefore, we +; rewrite the candidates using byte offset instead of index offset as in +; @slsr_gep_2d. +define i64 @slsr_gep_uglygep([10 x [5 x %struct.S]]* %input, i64 %s, i64 %t) { +; CHECK-LABEL: @slsr_gep_uglygep( + ; v0 = input[s][t].f1; + %p0 = getelementptr inbounds [10 x [5 x %struct.S]], [10 x [5 x %struct.S]]* %input, i64 0, i64 %s, i64 %t, i32 0 + %v0 = load i64, i64* %p0 + + ; v1 = input[s * 2][t].f1; + %s2 = mul nsw i64 %s, 2 +; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = mul i64 %s, 60 + %p1 = getelementptr inbounds [10 x [5 x %struct.S]], [10 x [5 x %struct.S]]* %input, i64 0, i64 %s2, i64 %t, i32 0 +; CHECK: getelementptr inbounds i8, i8* %{{[0-9]+}}, i64 [[BUMP]] + %v1 = load i64, i64* %p1 + + ; v2 = input[s * 3][t].f1; + %s3 = mul nsw i64 %s, 3 + %p2 = getelementptr inbounds [10 x [5 x %struct.S]], [10 x [5 x %struct.S]]* %input, i64 0, i64 %s3, i64 %t, i32 0 +; CHECK: getelementptr inbounds i8, i8* %{{[0-9]+}}, i64 [[BUMP]] + %v2 = load i64, i64* %p2 + + ; return v0 + v1 + v2; + %1 = add i64 %v0, %v1 + %2 = add i64 %1, %v2 + ret i64 %2 +} diff --git a/test/Transforms/StraightLineStrengthReduce/slsr.ll b/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll index 951cbb0..0a7e472 100644 --- a/test/Transforms/StraightLineStrengthReduce/slsr.ll +++ b/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll @@ -1,5 +1,7 @@ ; RUN: opt < %s -slsr -gvn -dce -S | FileCheck %s +target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64" + declare i32 @foo(i32 %a) define i32 @slsr1(i32 %b, i32 %s) { diff --git a/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll b/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll index f2c705a..23c8a58 100644 --- a/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll +++ b/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll @@ -18,17 +18,17 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.lv.foo = !{!5} !llvm.dbg.gv = !{!8} -!0 = !{!"0x2e\00foo\00foo\00foo\002\000\001\000\006\000\001\000", !12, !1, !3, null, void ()* @foo, null, null, null} ; [ DW_TAG_subprogram ] -!1 = !{!"0x29", !12} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\001\00\000\00\000", !12, !4, !4, null, null, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !12, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3, function: void ()* @foo) +!1 = !MDFile(filename: "b.c", directory: "/tmp") +!2 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !12, enums: !4, retainedTypes: !4) +!3 = !MDSubroutineType(types: !4) !4 = !{null} -!5 = !{!"0x100\00y\003\000", !6, !1, !7} ; [ DW_TAG_auto_variable ] -!6 = !{!"0xb\002\000\000", !12, !0} ; [ DW_TAG_lexical_block ] -!7 = !{!"0x24\00int\000\0032\0032\000\000\005", !12, !1} ; [ DW_TAG_base_type ] -!8 = !{!"0x34\00x\00x\00\001\000\001", !1, !1, !7, i32* @x} ; [ DW_TAG_variable ] +!5 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "y", line: 3, scope: !6, file: !1, type: !7) +!6 = distinct !MDLexicalBlock(line: 2, column: 0, file: !12, scope: !0) +!7 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = !MDGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !7, variable: i32* @x) !9 = !{i32 0} !10 = !MDLocation(line: 3, scope: !6) !11 = !MDLocation(line: 4, scope: !6) -!12 = !{!"b.c", !"/tmp"} -!13 = !{i32 1, !"Debug Info Version", i32 2} +!12 = !MDFile(filename: "b.c", directory: "/tmp") +!13 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/StripSymbols/2010-08-25-crash.ll b/test/Transforms/StripSymbols/2010-08-25-crash.ll index 1534647..457dfd1 100644 --- a/test/Transforms/StripSymbols/2010-08-25-crash.ll +++ b/test/Transforms/StripSymbols/2010-08-25-crash.ll @@ -7,18 +7,18 @@ entry: !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!14} -!0 = !{!"0x2e\00foo\00foo\00foo\003\000\001\000\006\000\000\000", !10, !1, !3, null, i32 ()* @foo, null, null, null} ; [ DW_TAG_subprogram ] -!1 = !{!"0x29", !10} ; [ DW_TAG_file_type ] -!2 = !{!"0x11\0012\00clang version 2.8 (trunk 112062)\001\00\000\00\001", !10, !11, !11, !12, !13, null} ; [ DW_TAG_compile_unit ] -!3 = !{!"0x15\00\000\000\000\000\000\000", !10, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!0 = !MDSubprogram(name: "foo", linkageName: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !10, scope: !1, type: !3, function: i32 ()* @foo) +!1 = !MDFile(filename: "/tmp/a.c", directory: "/Volumes/Lalgate/clean/D.CW") +!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 2.8 (trunk 112062)", isOptimized: true, emissionKind: 1, file: !10, enums: !11, retainedTypes: !11, subprograms: !12, globals: !13) +!3 = !MDSubroutineType(types: !4) !4 = !{!5} -!5 = !{!"0x24\00int\000\0032\0032\000\000\005", !10, !1} ; [ DW_TAG_base_type ] -!6 = !{!"0x34\00i\00i\00i\002\001\001", !1, !1, !7, i32 0, null} ; [ DW_TAG_variable ] -!7 = !{!"0x26\00\000\000\000\000\000", !10, !1, !5} ; [ DW_TAG_const_type ] +!5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !MDGlobalVariable(name: "i", linkageName: "i", line: 2, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !7) +!7 = !MDDerivedType(tag: DW_TAG_const_type, file: !10, scope: !1, baseType: !5) !8 = !MDLocation(line: 3, column: 13, scope: !9) -!9 = !{!"0xb\003\0011\000", !10, !0} ; [ DW_TAG_lexical_block ] -!10 = !{!"/tmp/a.c", !"/Volumes/Lalgate/clean/D.CW"} +!9 = distinct !MDLexicalBlock(line: 3, column: 11, file: !10, scope: !0) +!10 = !MDFile(filename: "/tmp/a.c", directory: "/Volumes/Lalgate/clean/D.CW") !11 = !{i32 0} !12 = !{!0} !13 = !{!6} -!14 = !{i32 1, !"Debug Info Version", i32 2} +!14 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/StripSymbols/strip-dead-debug-info.ll b/test/Transforms/StripSymbols/strip-dead-debug-info.ll index aca7cd6..febb944 100644 --- a/test/Transforms/StripSymbols/strip-dead-debug-info.ll +++ b/test/Transforms/StripSymbols/strip-dead-debug-info.ll @@ -18,8 +18,8 @@ entry: ; Function Attrs: nounwind readonly ssp define i32 @foo(i32 %i) #2 { entry: - tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !15, metadata !{}), !dbg !20 - %.0 = load i32* @xyz, align 4 + tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !15, metadata !MDExpression()), !dbg !20 + %.0 = load i32, i32* @xyz, align 4 ret i32 %.0, !dbg !21 } @@ -30,29 +30,29 @@ attributes #2 = { nounwind readonly ssp } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!25} -!0 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\001\00\000\00\001", !1, !2, !2, !23, !24, null} ; [ DW_TAG_compile_unit ] [/tmp//g.c] [DW_LANG_C89] -!1 = !{!"g.c", !"/tmp/"} +!0 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !23, globals: !24) +!1 = !MDFile(filename: "g.c", directory: "/tmp/") !2 = !{null} -!3 = !{!"0x2e\00bar\00bar\00\005\001\001\000\006\000\001\000", !1, null, !4, null, null, null, null, null} ; [ DW_TAG_subprogram ] [line 5] [local] [def] [scope 0] [bar] -!4 = !{!"0x15\00\000\000\000\000\000\000", !1, !5, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/tmp//g.c] -!6 = !{!"0x2e\00fn\00fn\00fn\006\000\001\000\006\000\001\000", !1, null, !7, null, i32 ()* @fn, null, null, null} ; [ DW_TAG_subprogram ] [line 6] [def] [scope 0] [fn] -!7 = !{!"0x15\00\000\000\000\000\000\000", !1, !5, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!3 = !MDSubprogram(name: "bar", line: 5, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: null, type: !4) +!4 = !MDSubroutineType(types: !2) +!5 = !MDFile(filename: "g.c", directory: "/tmp/") +!6 = !MDSubprogram(name: "fn", linkageName: "fn", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: null, type: !7, function: i32 ()* @fn) +!7 = !MDSubroutineType(types: !8) !8 = !{!9} -!9 = !{!"0x24\00int\000\0032\0032\000\000\005", !1, !5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] -!10 = !{!"0x2e\00foo\00foo\00foo\007\000\001\000\006\000\001\000", !1, null, !11, null, i32 (i32)* @foo, null, null, null} ; [ DW_TAG_subprogram ] [line 7] [def] [scope 0] [foo] -!11 = !{!"0x15\00\000\000\000\000\000\000", !1, !5, null, !12, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !MDSubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: null, type: !11, function: i32 (i32)* @foo) +!11 = !MDSubroutineType(types: !12) !12 = !{!9, !9} -!13 = !{!"0x100\00bb\005\000", !14, !5, !9} ; [ DW_TAG_auto_variable ] -!14 = !{!"0xb\005\000\000", !1, !3} ; [ DW_TAG_lexical_block ] [/tmp//g.c] -!15 = !{!"0x101\00i\007\000", !10, !5, !9} ; [ DW_TAG_arg_variable ] -!16 = !{!"0x34\00abcd\00abcd\00\002\001\001", !5, !5, !9, null, null} ; [ DW_TAG_variable ] -!17 = !{!"0x34\00xyz\00xyz\00\003\000\001", !5, !5, !9, i32* @xyz, null} ; [ DW_TAG_variable ] +!13 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "bb", line: 5, scope: !14, file: !5, type: !9) +!14 = distinct !MDLexicalBlock(line: 5, column: 0, file: !1, scope: !3) +!15 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 7, arg: 0, scope: !10, file: !5, type: !9) +!16 = !MDGlobalVariable(name: "abcd", line: 2, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !9) +!17 = !MDGlobalVariable(name: "xyz", line: 3, isLocal: false, isDefinition: true, scope: !5, file: !5, type: !9, variable: i32* @xyz) !18 = !MDLocation(line: 6, scope: !19) -!19 = !{!"0xb\006\000\000", !1, !6} ; [ DW_TAG_lexical_block ] [/tmp//g.c] +!19 = distinct !MDLexicalBlock(line: 6, column: 0, file: !1, scope: !6) !20 = !MDLocation(line: 7, scope: !10) !21 = !MDLocation(line: 10, scope: !22) -!22 = !{!"0xb\007\000\000", !1, !10} ; [ DW_TAG_lexical_block ] [/tmp//g.c] +!22 = distinct !MDLexicalBlock(line: 7, column: 0, file: !1, scope: !10) !23 = !{!3, !6, !10} !24 = !{!16, !17} -!25 = !{i32 1, !"Debug Info Version", i32 2} +!25 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/StructurizeCFG/branch-on-argument.ll b/test/Transforms/StructurizeCFG/branch-on-argument.ll index 4eba0cd..386994f 100644 --- a/test/Transforms/StructurizeCFG/branch-on-argument.ll +++ b/test/Transforms/StructurizeCFG/branch-on-argument.ll @@ -28,7 +28,7 @@ entry: for.body: %i = phi i32 [0, %entry], [%i.inc, %end.loop] - %ptr = getelementptr i32 addrspace(1)* %out, i32 %i + %ptr = getelementptr i32, i32 addrspace(1)* %out, i32 %i store i32 %i, i32 addrspace(1)* %ptr, align 4 br i1 %arg, label %mid.loop, label %end.loop diff --git a/test/Transforms/StructurizeCFG/loop-multiple-exits.ll b/test/Transforms/StructurizeCFG/loop-multiple-exits.ll index 45f3165..40f6be9 100644 --- a/test/Transforms/StructurizeCFG/loop-multiple-exits.ll +++ b/test/Transforms/StructurizeCFG/loop-multiple-exits.ll @@ -23,7 +23,7 @@ for.cond: ; preds = %for.inc, %entry ; CHECK: for.body: for.body: ; preds = %for.cond - %arrayidx = getelementptr inbounds i32 addrspace(1)* %out, i32 %i.0 + %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %out, i32 %i.0 store i32 %i.0, i32 addrspace(1)* %arrayidx, align 4 %cmp1 = icmp ugt i32 %i.0, %cond_b ; CHECK: br i1 %{{[0-9a-zA-Z_]+}}, label %for.inc, label %[[FLOW1:[0-9a-zA-Z_]+]] @@ -37,7 +37,7 @@ for.body: ; preds = %for.cond for.inc: ; preds = %for.body %0 = add i32 %cond_a, %i.0 - %arrayidx3 = getelementptr inbounds i32 addrspace(1)* %out, i32 %0 + %arrayidx3 = getelementptr inbounds i32, i32 addrspace(1)* %out, i32 %0 store i32 %i.0, i32 addrspace(1)* %arrayidx3, align 4 %inc = add i32 %i.0, 1 br label %for.cond diff --git a/test/Transforms/StructurizeCFG/post-order-traversal-bug.ll b/test/Transforms/StructurizeCFG/post-order-traversal-bug.ll index 740b3d1..ba9aa29 100644 --- a/test/Transforms/StructurizeCFG/post-order-traversal-bug.ll +++ b/test/Transforms/StructurizeCFG/post-order-traversal-bug.ll @@ -28,11 +28,11 @@ for.body: ; preds = %for.body.backedge, ; CHECK: lor.lhs.false: ; CHECK: br label %Flow lor.lhs.false: ; preds = %for.body - %arrayidx = getelementptr inbounds float* %nr, i64 %indvars.iv - %tmp1 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %nr, i64 %indvars.iv + %tmp1 = load float, float* %arrayidx, align 4 %tmp2 = add nsw i64 %indvars.iv, -1 - %arrayidx2 = getelementptr inbounds float* %nr, i64 %tmp2 - %tmp3 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %nr, i64 %tmp2 + %tmp3 = load float, float* %arrayidx2, align 4 %cmp3 = fcmp une float %tmp1, %tmp3 br i1 %cmp3, label %if.then, label %for.body.1 @@ -44,8 +44,8 @@ lor.lhs.false: ; preds = %for.body if.then: ; preds = %lor.lhs.false, %for.body %sub4 = sub nsw i32 %tmp0, %prev_start.026 %tmp4 = add nsw i64 %indvars.iv, -1 - %arrayidx8 = getelementptr inbounds float* %nr, i64 %tmp4 - %tmp5 = load float* %arrayidx8, align 4 + %arrayidx8 = getelementptr inbounds float, float* %nr, i64 %tmp4 + %tmp5 = load float, float* %arrayidx8, align 4 br i1 %cmp1, label %for.end, label %for.body.1 ; CHECK: for.end: @@ -83,8 +83,8 @@ for.body.6: ; preds = %for.body.1 ; CHECK: if.then6.6 ; CHECK: br label %for.body.backedge if.then6.6: ; preds = %for.body.6 - %arrayidx8.6 = getelementptr inbounds float* %nr, i64 %indvars.iv.next.454 - %tmp29 = load float* %arrayidx8.6, align 4 + %arrayidx8.6 = getelementptr inbounds float, float* %nr, i64 %indvars.iv.next.454 + %tmp29 = load float, float* %arrayidx8.6, align 4 br label %for.body.backedge ; CHECK: Flow3: diff --git a/test/Transforms/TailCallElim/basic.ll b/test/Transforms/TailCallElim/basic.ll index 8e9814b..2488b55 100644 --- a/test/Transforms/TailCallElim/basic.ll +++ b/test/Transforms/TailCallElim/basic.ll @@ -183,7 +183,7 @@ define void @test11() { %a = alloca i8* %b = alloca i8 call void @test11_helper1(i8** %a, i8* %b) ; a = &b - %c = load i8** %a + %c = load i8*, i8** %a call void @test11_helper2(i8* %c) ; CHECK: call void @test11_helper2 ret void diff --git a/test/Transforms/TailCallElim/dont_reorder_load.ll b/test/Transforms/TailCallElim/dont_reorder_load.ll index a29b72e..ac399a1 100644 --- a/test/Transforms/TailCallElim/dont_reorder_load.ll +++ b/test/Transforms/TailCallElim/dont_reorder_load.ll @@ -21,7 +21,7 @@ if: ; preds = %entry else: ; preds = %entry %tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1] %tmp8 = call fastcc i32 @no_tailrecelim_1(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1] - %tmp9 = load i32* @extern_weak_global ; <i32> [#uses=1] + %tmp9 = load i32, i32* @extern_weak_global ; <i32> [#uses=1] %tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1] ret i32 %tmp10 } @@ -40,7 +40,7 @@ if: ; preds = %entry else: ; preds = %entry %tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1] %tmp8 = call fastcc i32 @no_tailrecelim_2(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1] - %tmp9 = load i32* %a_arg ; <i32> [#uses=1] + %tmp9 = load i32, i32* %a_arg ; <i32> [#uses=1] %tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1] ret i32 %tmp10 } @@ -58,7 +58,7 @@ if: ; preds = %entry else: ; preds = %entry %tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1] %tmp8 = call fastcc i32 @no_tailrecelim_3(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1] - %tmp9 = load volatile i32* %a_arg ; <i32> [#uses=1] + %tmp9 = load volatile i32, i32* %a_arg ; <i32> [#uses=1] %tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1] ret i32 %tmp10 } diff --git a/test/Transforms/TailCallElim/inf-recursion.ll b/test/Transforms/TailCallElim/inf-recursion.ll index 157226f..c121c25 100644 --- a/test/Transforms/TailCallElim/inf-recursion.ll +++ b/test/Transforms/TailCallElim/inf-recursion.ll @@ -31,3 +31,24 @@ define float @fabsf(float %f) { } declare x86_fp80 @fabsl(x86_fp80 %f) + +; Don't crash while transforming a function with infinite recursion. +define i32 @PR22704(i1 %bool) { +entry: + br i1 %bool, label %t, label %f + +t: + %call1 = call i32 @PR22704(i1 1) + br label %return + +f: + %call = call i32 @PR22704(i1 1) + br label %return + +return: + ret i32 0 + +; CHECK-LABEL: @PR22704( +; CHECK: %bool.tr = phi i1 [ %bool, %entry ], [ true, %t ], [ true, %f ] +; CHECK: br i1 %bool.tr, label %t, label %f +} diff --git a/test/Transforms/TailCallElim/reorder_load.ll b/test/Transforms/TailCallElim/reorder_load.ll index 2e350d6..b989bbf 100644 --- a/test/Transforms/TailCallElim/reorder_load.ll +++ b/test/Transforms/TailCallElim/reorder_load.ll @@ -16,7 +16,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly { ; CHECK-LABEL: @raise_load_1( ; CHECK-NOT: call -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK-NOT: call ; CHECK: } entry: @@ -29,7 +29,7 @@ if: ; preds = %entry else: ; preds = %entry %tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1] %tmp8 = call fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1] - %tmp9 = load i32* %a_arg ; <i32> [#uses=1] + %tmp9 = load i32, i32* %a_arg ; <i32> [#uses=1] %tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1] ret i32 %tmp10 } @@ -40,7 +40,7 @@ else: ; preds = %entry define fastcc i32 @raise_load_2(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) readonly { ; CHECK-LABEL: @raise_load_2( ; CHECK-NOT: call -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK-NOT: call ; CHECK: } entry: @@ -60,7 +60,7 @@ unwind: ; preds = %else recurse: ; preds = %else %tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1] %tmp8 = call fastcc i32 @raise_load_2(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1] - %tmp9 = load i32* @global ; <i32> [#uses=1] + %tmp9 = load i32, i32* @global ; <i32> [#uses=1] %tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1] ret i32 %tmp10 } @@ -71,7 +71,7 @@ recurse: ; preds = %else define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly { ; CHECK-LABEL: @raise_load_3( ; CHECK-NOT: call -; CHECK: load i32* +; CHECK: load i32, i32* ; CHECK-NOT: call ; CHECK: } entry: @@ -84,7 +84,7 @@ if: ; preds = %entry else: ; preds = %entry %tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1] %tmp8 = call fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %tmp7) ; <i32> [#uses=1] - %tmp9 = load i32* @extern_weak_global ; <i32> [#uses=1] + %tmp9 = load i32, i32* @extern_weak_global ; <i32> [#uses=1] %tmp10 = add i32 %tmp9, %tmp8 ; <i32> [#uses=1] ret i32 %tmp10 } @@ -96,8 +96,8 @@ else: ; preds = %entry define fastcc i32 @raise_load_4(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) readonly { ; CHECK-LABEL: @raise_load_4( ; CHECK-NOT: call -; CHECK: load i32* -; CHECK-NEXT: load i32* +; CHECK: load i32, i32* +; CHECK-NEXT: load i32, i32* ; CHECK-NOT: call ; CHECK: } entry: @@ -116,9 +116,9 @@ unwind: ; preds = %else recurse: ; preds = %else %tmp7 = add i32 %start_arg, 1 ; <i32> [#uses=1] - %first = load i32* %a_arg ; <i32> [#uses=1] + %first = load i32, i32* %a_arg ; <i32> [#uses=1] %tmp8 = call fastcc i32 @raise_load_4(i32* %a_arg, i32 %first, i32 %tmp7) ; <i32> [#uses=1] - %second = load i32* %a_arg ; <i32> [#uses=1] + %second = load i32, i32* %a_arg ; <i32> [#uses=1] %tmp10 = add i32 %second, %tmp8 ; <i32> [#uses=1] ret i32 %tmp10 } diff --git a/test/Transforms/Util/lowerswitch.ll b/test/Transforms/Util/lowerswitch.ll index 17c1202..1eddb43 100644 --- a/test/Transforms/Util/lowerswitch.ll +++ b/test/Transforms/Util/lowerswitch.ll @@ -52,3 +52,137 @@ bb3: exit: ret void } + +; Test that we don't crash. +define void @test2(i32 %mode) { +; CHECK-LABEL: @test2 + br i1 undef, label %1, label %._crit_edge + +; <label>:1 ; preds = %0 + switch i32 %mode, label %33 [ + i32 2, label %2 + i32 3, label %3 + i32 4, label %4 + i32 5, label %5 + i32 6, label %6 + i32 7, label %7 + i32 8, label %8 + i32 9, label %9 + i32 10, label %10 + i32 11, label %14 + i32 12, label %18 + i32 13, label %22 + i32 14, label %26 + i32 15, label %27 + i32 16, label %34 + i32 17, label %34 + i32 18, label %34 + i32 19, label %34 + i32 22, label %34 + i32 20, label %31 + i32 21, label %32 + ] + +; <label>:2 ; preds = %1 + br label %34 + +; <label>:3 ; preds = %1 + br label %34 + +; <label>:4 ; preds = %1 + br label %34 + +; <label>:5 ; preds = %1 + br label %34 + +; <label>:6 ; preds = %1 + br label %34 + +; <label>:7 ; preds = %1 + br label %34 + +; <label>:8 ; preds = %1 + br label %34 + +; <label>:9 ; preds = %1 + br label %34 + +; <label>:10 ; preds = %1 + br i1 undef, label %11, label %12 + +; <label>:11 ; preds = %10 + br label %13 + +; <label>:12 ; preds = %10 + br label %13 + +; <label>:13 ; preds = %12, %11 + br label %34 + +; <label>:14 ; preds = %1 + br i1 undef, label %15, label %16 + +; <label>:15 ; preds = %14 + br label %17 + +; <label>:16 ; preds = %14 + br label %17 + +; <label>:17 ; preds = %16, %15 + br label %34 + +; <label>:18 ; preds = %1 + br i1 undef, label %19, label %20 + +; <label>:19 ; preds = %18 + br label %21 + +; <label>:20 ; preds = %18 + br label %21 + +; <label>:21 ; preds = %20, %19 + br label %34 + +; <label>:22 ; preds = %1 + br i1 undef, label %23, label %24 + +; <label>:23 ; preds = %22 + br label %25 + +; <label>:24 ; preds = %22 + br label %25 + +; <label>:25 ; preds = %24, %23 + br label %34 + +; <label>:26 ; preds = %1 + br label %34 + +; <label>:27 ; preds = %1 + br i1 undef, label %28, label %29 + +; <label>:28 ; preds = %27 + br label %30 + +; <label>:29 ; preds = %27 + br label %30 + +; <label>:30 ; preds = %29, %28 + br label %34 + +; <label>:31 ; preds = %1 + br label %34 + +; <label>:32 ; preds = %1 + br label %34 + +; <label>:33 ; preds = %1 + br label %34 + +; <label>:34 ; preds = %33, %32, %31, %30, %26, %25, %21, %17, %13, %9, %8, %7, %6, %5, %4, %3, %2, %1, %1, %1, %1, %1 + %o.0 = phi float [ undef, %33 ], [ undef, %32 ], [ undef, %31 ], [ undef, %30 ], [ undef, %26 ], [ undef, %25 ], [ undef, %21 ], [ undef, %17 ], [ undef, %13 ], [ undef, %9 ], [ undef, %8 ], [ undef, %7 ], [ undef, %6 ], [ undef, %5 ], [ undef, %4 ], [ undef, %3 ], [ undef, %2 ], [ undef, %1 ], [ undef, %1 ], [ undef, %1 ], [ undef, %1 ], [ undef, %1 ] + br label %._crit_edge + +._crit_edge: ; preds = %34, %0 + ret void +} |