diff options
Diffstat (limited to 'llvm/unittests/Transforms/Utils')
9 files changed, 147 insertions, 147 deletions
diff --git a/llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp b/llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp index 4235c93..00d9e9f 100644 --- a/llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp +++ b/llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp @@ -484,9 +484,9 @@ exit: TEST(BasicBlockUtils, SplitIndirectBrCriticalEdgesIgnorePHIs) { LLVMContext C; std::unique_ptr<Module> M = parseIR(C, R"IR( -define void @crit_edge(i8* %tgt, i1 %cond0, i1 %cond1) { +define void @crit_edge(ptr %tgt, i1 %cond0, i1 %cond1) { entry: - indirectbr i8* %tgt, [label %bb0, label %bb1, label %bb2] + indirectbr ptr %tgt, [label %bb0, label %bb1, label %bb2] bb0: br i1 %cond0, label %bb1, label %bb2 bb1: @@ -526,9 +526,9 @@ bb4: TEST(BasicBlockUtils, SplitIndirectBrCriticalEdges) { LLVMContext C; std::unique_ptr<Module> M = parseIR(C, R"IR( -define void @crit_edge(i8* %tgt, i1 %cond0, i1 %cond1) { +define void @crit_edge(ptr %tgt, i1 %cond0, i1 %cond1) { entry: - indirectbr i8* %tgt, [label %bb0, label %bb1, label %bb2] + indirectbr ptr %tgt, [label %bb0, label %bb1, label %bb2] bb0: br i1 %cond0, label %bb1, label %bb2 bb1: diff --git a/llvm/unittests/Transforms/Utils/CloningTest.cpp b/llvm/unittests/Transforms/Utils/CloningTest.cpp index d990808..237bc6e 100644 --- a/llvm/unittests/Transforms/Utils/CloningTest.cpp +++ b/llvm/unittests/Transforms/Utils/CloningTest.cpp @@ -394,7 +394,7 @@ TEST(CloneLoop, CloneLoopNest) { std::unique_ptr<Module> M = parseIR( Context, - R"(define void @foo(i32* %A, i32 %ub) { + R"(define void @foo(ptr %A, i32 %ub) { entry: %guardcmp = icmp slt i32 0, %ub br i1 %guardcmp, label %for.outer.preheader, label %for.end @@ -408,8 +408,8 @@ for.inner.preheader: for.inner: %i = phi i32 [ 0, %for.inner.preheader ], [ %inc, %for.inner ] %idxprom = sext i32 %i to i64 - %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom - store i32 %i, i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom + store i32 %i, ptr %arrayidx, align 4 %inc = add nsw i32 %i, 1 %cmp = icmp slt i32 %inc, %ub br i1 %cmp, label %for.inner, label %for.inner.exit @@ -728,10 +728,10 @@ TEST(CloneFunction, CloneEmptyFunction) { TEST(CloneFunction, CloneFunctionWithInalloca) { StringRef ImplAssembly = R"( - declare void @a(i32* inalloca(i32)) + declare void @a(ptr inalloca(i32)) define void @foo() { %a = alloca inalloca i32 - call void @a(i32* inalloca(i32) %a) + call void @a(ptr inalloca(i32) %a) ret void } declare void @bar() diff --git a/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp b/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp index 9ea8de3..90f0620 100644 --- a/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp +++ b/llvm/unittests/Transforms/Utils/CodeExtractorTest.cpp @@ -154,13 +154,13 @@ TEST(CodeExtractor, ExitBlockOrderingPhis) { %0 = alloca i32, align 4 br label %test0 test0: - %c = load i32, i32* %0, align 4 + %c = load i32, ptr %0, align 4 br label %test1 test1: - %e = load i32, i32* %0, align 4 + %e = load i32, ptr %0, align 4 br i1 true, label %first, label %test test: - %d = load i32, i32* %0, align 4 + %d = load i32, ptr %0, align 4 br i1 true, label %first, label %next first: %1 = phi i32 [ %c, %test ], [ %e, %test1 ] @@ -212,13 +212,13 @@ TEST(CodeExtractor, ExitBlockOrdering) { %0 = alloca i32, align 4 br label %test0 test0: - %c = load i32, i32* %0, align 4 + %c = load i32, ptr %0, align 4 br label %test1 test1: - %e = load i32, i32* %0, align 4 + %e = load i32, ptr %0, align 4 br i1 true, label %first, label %test test: - %d = load i32, i32* %0, align 4 + %d = load i32, ptr %0, align 4 br i1 true, label %first, label %next first: ret void @@ -317,7 +317,7 @@ TEST(CodeExtractor, StoreOutputInvokeResultAfterEHPad) { std::unique_ptr<Module> M(parseAssemblyString(R"invalid( declare i8 @hoge() - define i32 @foo() personality i8* null { + define i32 @foo() personality ptr null { entry: %call = invoke i8 @hoge() to label %invoke.cont unwind label %lpad @@ -326,8 +326,8 @@ TEST(CodeExtractor, StoreOutputInvokeResultAfterEHPad) { unreachable lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } - catch i8* null + %0 = landingpad { ptr, i32 } + catch ptr null br i1 undef, label %catch, label %finally.catchall catch: ; preds = %lpad @@ -342,13 +342,13 @@ TEST(CodeExtractor, StoreOutputInvokeResultAfterEHPad) { unreachable lpad2: ; preds = %invoke.cont2, %catch - %ex.1 = phi i8* [ undef, %invoke.cont2 ], [ null, %catch ] - %1 = landingpad { i8*, i32 } - catch i8* null + %ex.1 = phi ptr [ undef, %invoke.cont2 ], [ null, %catch ] + %1 = landingpad { ptr, i32 } + catch ptr null br label %finally.catchall finally.catchall: ; preds = %lpad33, %lpad - %ex.2 = phi i8* [ %ex.1, %lpad2 ], [ null, %lpad ] + %ex.2 = phi ptr [ %ex.1, %lpad2 ], [ null, %lpad ] unreachable } )invalid", Err, Ctx)); @@ -384,7 +384,7 @@ TEST(CodeExtractor, StoreOutputInvokeResultInExitStub) { std::unique_ptr<Module> M(parseAssemblyString(R"invalid( declare i32 @bar() - define i32 @foo() personality i8* null { + define i32 @foo() personality ptr null { entry: %0 = invoke i32 @bar() to label %exit unwind label %lpad @@ -392,9 +392,9 @@ TEST(CodeExtractor, StoreOutputInvokeResultInExitStub) { ret i32 %0 lpad: - %1 = landingpad { i8*, i32 } + %1 = landingpad { ptr, i32 } cleanup - resume { i8*, i32 } %1 + resume { ptr, i32 } %1 } )invalid", Err, Ctx)); @@ -421,7 +421,7 @@ TEST(CodeExtractor, ExtractAndInvalidateAssumptionCache) { target triple = "aarch64" %b = type { i64 } - declare void @g(i8*) + declare void @g(ptr) declare void @llvm.assume(i1) #0 @@ -430,9 +430,9 @@ TEST(CodeExtractor, ExtractAndInvalidateAssumptionCache) { br label %label label: - %0 = load %b*, %b** inttoptr (i64 8 to %b**), align 8 - %1 = getelementptr inbounds %b, %b* %0, i64 undef, i32 0 - %2 = load i64, i64* %1, align 8 + %0 = load ptr, ptr inttoptr (i64 8 to ptr), align 8 + %1 = getelementptr inbounds %b, ptr %0, i64 undef, i32 0 + %2 = load i64, ptr %1, align 8 %3 = icmp ugt i64 %2, 1 br i1 %3, label %if.then, label %if.else @@ -440,8 +440,8 @@ TEST(CodeExtractor, ExtractAndInvalidateAssumptionCache) { unreachable if.else: - call void @g(i8* undef) - store i64 undef, i64* null, align 536870912 + call void @g(ptr undef) + store i64 undef, ptr null, align 536870912 %4 = icmp eq i64 %2, 0 call void @llvm.assume(i1 %4) unreachable @@ -473,9 +473,9 @@ TEST(CodeExtractor, RemoveBitcastUsesFromOuterLifetimeMarkers) { target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" - declare void @use(i32*) - declare void @llvm.lifetime.start.p0i8(i64, i8*) - declare void @llvm.lifetime.end.p0i8(i64, i8*) + declare void @use(ptr) + declare void @llvm.lifetime.start.p0i8(i64, ptr) + declare void @llvm.lifetime.end.p0i8(i64, ptr) define void @foo() { entry: @@ -483,14 +483,14 @@ TEST(CodeExtractor, RemoveBitcastUsesFromOuterLifetimeMarkers) { br label %extract extract: - %1 = bitcast i32* %0 to i8* - call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) - call void @use(i32* %0) + %1 = bitcast ptr %0 to ptr + call void @llvm.lifetime.start.p0i8(i64 4, ptr %1) + call void @use(ptr %0) br label %exit exit: - call void @use(i32* %0) - call void @llvm.lifetime.end.p0i8(i64 4, i8* %1) + call void @use(ptr %0) + call void @llvm.lifetime.end.p0i8(i64 4, ptr %1) ret void } )ir", diff --git a/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp b/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp index 9466977..191ccc3 100644 --- a/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp +++ b/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp @@ -75,21 +75,21 @@ TEST(CodeMoverUtils, IsControlFlowEquivalentSimpleTest) { // i = 3; // } std::unique_ptr<Module> M = - parseIR(C, R"(define void @foo(i32* %i, i1 %cond1, i1 %cond2) { + parseIR(C, R"(define void @foo(ptr %i, i1 %cond1, i1 %cond2) { entry: br i1 %cond1, label %if.first, label %if.first.end if.first: - store i32 1, i32* %i, align 4 + store i32 1, ptr %i, align 4 br label %if.first.end if.first.end: br i1 %cond1, label %if.second, label %if.second.end if.second: - store i32 2, i32* %i, align 4 + store i32 2, ptr %i, align 4 br label %if.second.end if.second.end: br i1 %cond2, label %if.third, label %if.third.end if.third: - store i32 3, i32* %i, align 4 + store i32 3, ptr %i, align 4 br label %if.third.end if.third.end: ret void @@ -136,51 +136,51 @@ TEST(CodeMoverUtils, IsControlFlowEquivalentOppositeCondTest) { // i = 9; // } std::unique_ptr<Module> M = - parseIR(C, R"(define void @foo(i32* %i, i32 %X, i32 %Y) { + parseIR(C, R"(define void @foo(ptr %i, i32 %X, i32 %Y) { entry: %cmp1 = icmp ult i32 %X, %Y br i1 %cmp1, label %if.first, label %if.first.end if.first: - store i32 1, i32* %i, align 4 + store i32 1, ptr %i, align 4 br label %if.first.end if.first.end: %cmp2 = icmp ugt i32 %Y, %X br i1 %cmp2, label %if.second, label %if.second.end if.second: - store i32 2, i32* %i, align 4 + store i32 2, ptr %i, align 4 br label %if.second.end if.second.end: %cmp3 = icmp uge i32 %X, %Y br i1 %cmp3, label %if.third, label %if.third.else if.third: - store i32 3, i32* %i, align 4 + store i32 3, ptr %i, align 4 br label %if.third.end if.third.else: - store i32 4, i32* %i, align 4 + store i32 4, ptr %i, align 4 br label %if.third.end if.third.end: %cmp4 = icmp eq i32 %X, %Y br i1 %cmp4, label %if.fourth, label %if.fourth.end if.fourth: - store i32 5, i32* %i, align 4 + store i32 5, ptr %i, align 4 br label %if.fourth.end if.fourth.end: %cmp5 = icmp eq i32 %Y, %X br i1 %cmp5, label %if.fifth, label %if.fifth.else if.fifth: - store i32 6, i32* %i, align 4 + store i32 6, ptr %i, align 4 br label %if.fifth.end if.fifth.else: - store i32 7, i32* %i, align 4 + store i32 7, ptr %i, align 4 br label %if.fifth.end if.fifth.end: %cmp6 = icmp ne i32 %X, %Y br i1 %cmp6, label %if.sixth, label %if.sixth.else if.sixth: - store i32 8, i32* %i, align 4 + store i32 8, ptr %i, align 4 br label %if.sixth.end if.sixth.else: - store i32 9, i32* %i, align 4 + store i32 9, ptr %i, align 4 br label %if.sixth.end if.sixth.end: ret void @@ -227,20 +227,20 @@ TEST(CodeMoverUtils, IsControlFlowEquivalentCondNestTest) { // i = 2; // } std::unique_ptr<Module> M = - parseIR(C, R"(define void @foo(i32* %i, i1 %cond1, i1 %cond2) { + parseIR(C, R"(define void @foo(ptr %i, i1 %cond1, i1 %cond2) { entry: br i1 %cond1, label %if.outer.first, label %if.first.end if.outer.first: br i1 %cond2, label %if.inner.first, label %if.first.end if.inner.first: - store i32 1, i32* %i, align 4 + store i32 1, ptr %i, align 4 br label %if.first.end if.first.end: br i1 %cond2, label %if.outer.second, label %if.second.end if.outer.second: br i1 %cond1, label %if.inner.second, label %if.second.end if.inner.second: - store i32 2, i32* %i, align 4 + store i32 2, ptr %i, align 4 br label %if.second.end if.second.end: ret void @@ -283,7 +283,7 @@ TEST(CodeMoverUtils, IsControlFlowEquivalentImbalanceTest) { // i = 4; // } std::unique_ptr<Module> M = - parseIR(C, R"(define void @foo(i32* %i, i1 %cond1, i1 %cond2, i1 %cond3) { + parseIR(C, R"(define void @foo(ptr %i, i1 %cond1, i1 %cond2, i1 %cond3) { entry: br i1 %cond1, label %if.outer.first, label %if.first.end if.outer.first: @@ -291,26 +291,26 @@ TEST(CodeMoverUtils, IsControlFlowEquivalentImbalanceTest) { if.middle.first: br i1 %cond3, label %if.inner.first, label %if.first.end if.inner.first: - store i32 1, i32* %i, align 4 + store i32 1, ptr %i, align 4 br label %if.first.end if.first.end: br i1 %cond2, label %if.outer.second, label %if.second.end if.outer.second: br i1 %cond3, label %if.inner.second, label %if.second.end if.inner.second: - store i32 2, i32* %i, align 4 + store i32 2, ptr %i, align 4 br label %if.second.end if.second.end: br i1 %cond1, label %if.outer.third, label %if.third.end if.outer.third: br i1 %cond1, label %if.inner.third, label %if.third.end if.inner.third: - store i32 3, i32* %i, align 4 + store i32 3, ptr %i, align 4 br label %if.third.end if.third.end: br i1 %cond1, label %if.fourth, label %if.fourth.end if.fourth: - store i32 4, i32* %i, align 4 + store i32 4, ptr %i, align 4 br label %if.fourth.end if.fourth.end: ret void @@ -343,28 +343,28 @@ TEST(CodeMoverUtils, IsControlFlowEquivalentPointerTest) { // i = 3; // } std::unique_ptr<Module> M = - parseIR(C, R"(define void @foo(i32* %i, i32* %cond) { + parseIR(C, R"(define void @foo(ptr %i, ptr %cond) { entry: - %0 = load i32, i32* %cond, align 4 + %0 = load i32, ptr %cond, align 4 %tobool1 = icmp ne i32 %0, 0 br i1 %tobool1, label %if.first, label %if.first.end if.first: - store i32 1, i32* %i, align 4 + store i32 1, ptr %i, align 4 br label %if.first.end if.first.end: - %1 = load i32, i32* %cond, align 4 + %1 = load i32, ptr %cond, align 4 %tobool2 = icmp ne i32 %1, 0 br i1 %tobool2, label %if.second, label %if.second.end if.second: - store i32 2, i32* %i, align 4 + store i32 2, ptr %i, align 4 br label %if.second.end if.second.end: - store i32 1, i32* %cond, align 4 - %2 = load i32, i32* %cond, align 4 + store i32 1, ptr %cond, align 4 + %2 = load i32, ptr %cond, align 4 %tobool3 = icmp ne i32 %2, 0 br i1 %tobool3, label %if.third, label %if.third.end if.third: - store i32 3, i32* %i, align 4 + store i32 3, ptr %i, align 4 br label %if.third.end if.third.end: ret void @@ -450,7 +450,7 @@ TEST(CodeMoverUtils, IsSafeToMoveTest1) { // } // } std::unique_ptr<Module> M = parseIR( - C, R"(define void @foo(i32* noalias %A, i32* noalias %B, i32* noalias %C + C, R"(define void @foo(ptr noalias %A, ptr noalias %B, ptr noalias %C , i64 %N) { entry: %X = sdiv i64 1, %N @@ -461,18 +461,18 @@ TEST(CodeMoverUtils, IsSafeToMoveTest1) { br i1 %cmp1, label %for.body, label %for.end for.body: %i = phi i64 [ 0, %entry ], [ %inc, %for.body ] - %arrayidx_A5 = getelementptr inbounds i32, i32* %A, i64 5 - store i32 5, i32* %arrayidx_A5, align 4 - %arrayidx_A = getelementptr inbounds i32, i32* %A, i64 %i - store i32 0, i32* %arrayidx_A, align 4 - %load1 = load i32, i32* %arrayidx_A, align 4 - %arrayidx_B = getelementptr inbounds i32, i32* %B, i64 %i - store i32 %load1, i32* %arrayidx_B, align 4 - %load2 = load i32, i32* %arrayidx_A, align 4 - %arrayidx_C = getelementptr inbounds i32, i32* %C, i64 %i - store i32 %load2, i32* %arrayidx_C, align 4 - %arrayidx_A6 = getelementptr inbounds i32, i32* %A, i64 6 - store i32 6, i32* %arrayidx_A6, align 4 + %arrayidx_A5 = getelementptr inbounds i32, ptr %A, i64 5 + store i32 5, ptr %arrayidx_A5, align 4 + %arrayidx_A = getelementptr inbounds i32, ptr %A, i64 %i + store i32 0, ptr %arrayidx_A, align 4 + %load1 = load i32, ptr %arrayidx_A, align 4 + %arrayidx_B = getelementptr inbounds i32, ptr %B, i64 %i + store i32 %load1, ptr %arrayidx_B, align 4 + %load2 = load i32, ptr %arrayidx_A, align 4 + %arrayidx_C = getelementptr inbounds i32, ptr %C, i64 %i + store i32 %load2, ptr %arrayidx_C, align 4 + %arrayidx_A6 = getelementptr inbounds i32, ptr %A, i64 6 + store i32 6, ptr %arrayidx_A6, align 4 %inc = add nsw i64 %i, 1 %cmp = icmp slt i64 %inc, %N br i1 %cmp, label %for.body, label %for.end @@ -686,19 +686,19 @@ TEST(CodeMoverUtils, IsSafeToMoveTest5) { LLVMContext C; std::unique_ptr<Module> M = - parseIR(C, R"(define void @dependence(i32* noalias %A, i32* noalias %B){ + parseIR(C, R"(define void @dependence(ptr noalias %A, ptr noalias %B){ entry: - store i32 0, i32* %A, align 4 ; storeA0 - store i32 2, i32* %A, align 4 ; storeA1 - %tmp0 = load i32, i32* %A, align 4 ; loadA0 - store i32 1, i32* %B, align 4 ; storeB0 - %tmp1 = load i32, i32* %A, align 4 ; loadA1 - store i32 2, i32* %A, align 4 ; storeA2 - store i32 4, i32* %B, align 4 ; StoreB1 - %tmp2 = load i32, i32* %A, align 4 ; loadA2 - %tmp3 = load i32, i32* %A, align 4 ; loadA3 - %tmp4 = load i32, i32* %B, align 4 ; loadB2 - %tmp5 = load i32, i32* %B, align 4 ; loadB3 + store i32 0, ptr %A, align 4 ; storeA0 + store i32 2, ptr %A, align 4 ; storeA1 + %tmp0 = load i32, ptr %A, align 4 ; loadA0 + store i32 1, ptr %B, align 4 ; storeB0 + %tmp1 = load i32, ptr %A, align 4 ; loadA1 + store i32 2, ptr %A, align 4 ; storeA2 + store i32 4, ptr %B, align 4 ; StoreB1 + %tmp2 = load i32, ptr %A, align 4 ; loadA2 + %tmp3 = load i32, ptr %A, align 4 ; loadA3 + %tmp4 = load i32, ptr %B, align 4 ; loadB2 + %tmp5 = load i32, ptr %B, align 4 ; loadB3 ret void })"); @@ -763,63 +763,63 @@ TEST(CodeMoverUtils, IsSafeToMoveTest6) { LLVMContext C; std::unique_ptr<Module> M = parseIR( - C, R"(define void @dependence(i1 %cond, i32* noalias %A, i32* noalias %B){ + C, R"(define void @dependence(i1 %cond, ptr noalias %A, ptr noalias %B){ entry: br i1 %cond, label %bb0, label %bb1 bb0: br label %bb1 bb1: - store i32 0, i32* %A, align 4 ; storeA0 + store i32 0, ptr %A, align 4 ; storeA0 br i1 %cond, label %bb2, label %bb3 bb2: br label %bb3 bb3: - store i32 2, i32* %A, align 4 ; storeA1 + store i32 2, ptr %A, align 4 ; storeA1 br i1 %cond, label %bb4, label %bb5 bb4: br label %bb5 bb5: - %tmp0 = load i32, i32* %A, align 4 ; loadA0 + %tmp0 = load i32, ptr %A, align 4 ; loadA0 br i1 %cond, label %bb6, label %bb7 bb6: br label %bb7 bb7: - store i32 1, i32* %B, align 4 ; storeB0 + store i32 1, ptr %B, align 4 ; storeB0 br i1 %cond, label %bb8, label %bb9 bb8: br label %bb9 bb9: - %tmp1 = load i32, i32* %A, align 4 ; loadA1 + %tmp1 = load i32, ptr %A, align 4 ; loadA1 br i1 %cond, label %bb10, label %bb11 bb10: br label %bb11 bb11: - store i32 2, i32* %A, align 4 ; storeA2 + store i32 2, ptr %A, align 4 ; storeA2 br i1 %cond, label %bb12, label %bb13 bb12: br label %bb13 bb13: - store i32 4, i32* %B, align 4 ; StoreB1 + store i32 4, ptr %B, align 4 ; StoreB1 br i1 %cond, label %bb14, label %bb15 bb14: br label %bb15 bb15: - %tmp2 = load i32, i32* %A, align 4 ; loadA2 + %tmp2 = load i32, ptr %A, align 4 ; loadA2 br i1 %cond, label %bb16, label %bb17 bb16: br label %bb17 bb17: - %tmp3 = load i32, i32* %A, align 4 ; loadA3 + %tmp3 = load i32, ptr %A, align 4 ; loadA3 br i1 %cond, label %bb18, label %bb19 bb18: br label %bb19 bb19: - %tmp4 = load i32, i32* %B, align 4 ; loadB2 + %tmp4 = load i32, ptr %B, align 4 ; loadB2 br i1 %cond, label %bb20, label %bb21 bb20: br label %bb21 bb21: - %tmp5 = load i32, i32* %B, align 4 ; loadB3 + %tmp5 = load i32, ptr %B, align 4 ; loadB3 ret void })"); run(*M, "dependence", diff --git a/llvm/unittests/Transforms/Utils/LocalTest.cpp b/llvm/unittests/Transforms/Utils/LocalTest.cpp index 4908eda..c37ed5d 100644 --- a/llvm/unittests/Transforms/Utils/LocalTest.cpp +++ b/llvm/unittests/Transforms/Utils/LocalTest.cpp @@ -183,7 +183,7 @@ TEST(Local, MergeBasicBlockIntoOnlyPred) { auto resetIR = [&]() { M = parseIR(C, R"( - define i32 @f(i8* %str) { + define i32 @f(ptr %str) { entry: br label %bb2.i bb2.i: ; preds = %bb4.i, %entry @@ -411,7 +411,7 @@ TEST(Local, ConstantFoldTerminator) { define void @indirectbr() { entry: - indirectbr i8* blockaddress(@indirectbr, %bb0), [label %bb0, label %bb1] + indirectbr ptr blockaddress(@indirectbr, %bb0), [label %bb0, label %bb1] bb0: ret void bb1: @@ -420,14 +420,14 @@ TEST(Local, ConstantFoldTerminator) { define void @indirectbr_repeated() { entry: - indirectbr i8* blockaddress(@indirectbr_repeated, %bb0), [label %bb0, label %bb0] + indirectbr ptr blockaddress(@indirectbr_repeated, %bb0), [label %bb0, label %bb0] bb0: ret void } define void @indirectbr_unreachable() { entry: - indirectbr i8* blockaddress(@indirectbr_unreachable, %bb0), [label %bb1] + indirectbr ptr blockaddress(@indirectbr_unreachable, %bb0), [label %bb1] bb0: ret void bb1: @@ -925,7 +925,7 @@ TEST(Local, RemoveUnreachableBlocks) { declare i32 @__gxx_personality_v0(...) - define void @invoke_terminator() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { + define void @invoke_terminator() personality ptr @__gxx_personality_v0 { entry: br i1 undef, label %invoke.block, label %exit @@ -943,8 +943,8 @@ TEST(Local, RemoveUnreachableBlocks) { unreachable lpad.block: - %lp = landingpad { i8*, i32 } - catch i8* null + %lp = landingpad { ptr, i32 } + catch ptr null br label %exit exit: diff --git a/llvm/unittests/Transforms/Utils/MemTransferLowering.cpp b/llvm/unittests/Transforms/Utils/MemTransferLowering.cpp index b97bc31..dd03b4f 100644 --- a/llvm/unittests/Transforms/Utils/MemTransferLowering.cpp +++ b/llvm/unittests/Transforms/Utils/MemTransferLowering.cpp @@ -98,13 +98,13 @@ struct MemTransferLowerTest : public testing::Test { // For that reason expandMemCpyAsLoop is expected to explicitly mark // loads from source and stores to destination as not aliasing. TEST_F(MemTransferLowerTest, MemCpyKnownLength) { - ParseAssembly("declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8 *, i64, i1)\n" - "define void @foo(i8* %dst, i8* %src, i64 %n) optsize {\n" + ParseAssembly("declare void @llvm.memcpy.p0i8.p0i8.i64(ptr, ptr, i64, i1)\n" + "define void @foo(ptr %dst, ptr %src, i64 %n) optsize {\n" "entry:\n" - " %is_not_equal = icmp ne i8* %dst, %src\n" + " %is_not_equal = icmp ne ptr %dst, %src\n" " br i1 %is_not_equal, label %memcpy, label %exit\n" "memcpy:\n" - " call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, " + " call void @llvm.memcpy.p0i8.p0i8.i64(ptr %dst, ptr %src, " "i64 1024, i1 false)\n" " br label %exit\n" "exit:\n" @@ -138,13 +138,13 @@ TEST_F(MemTransferLowerTest, MemCpyKnownLength) { // llvm.memcpy lowering) doesn't alias by making sure the loop can be // successfully vectorized without additional runtime checks. TEST_F(MemTransferLowerTest, VecMemCpyKnownLength) { - ParseAssembly("declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8 *, i64, i1)\n" - "define void @foo(i8* %dst, i8* %src, i64 %n) optsize {\n" + ParseAssembly("declare void @llvm.memcpy.p0i8.p0i8.i64(ptr, ptr, i64, i1)\n" + "define void @foo(ptr %dst, ptr %src, i64 %n) optsize {\n" "entry:\n" - " %is_not_equal = icmp ne i8* %dst, %src\n" + " %is_not_equal = icmp ne ptr %dst, %src\n" " br i1 %is_not_equal, label %memcpy, label %exit\n" "memcpy:\n" - " call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, " + " call void @llvm.memcpy.p0i8.p0i8.i64(ptr %dst, ptr %src, " "i64 1024, i1 false)\n" " br label %exit\n" "exit:\n" @@ -176,16 +176,16 @@ TEST_F(MemTransferLowerTest, VecMemCpyKnownLength) { TEST_F(MemTransferLowerTest, AtomicMemCpyKnownLength) { ParseAssembly("declare void " - "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(i32*, " + "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(ptr, " "i32 *, i64, i32)\n" - "define void @foo(i32* %dst, i32* %src, i64 %n) optsize {\n" + "define void @foo(ptr %dst, ptr %src, i64 %n) optsize {\n" "entry:\n" - " %is_not_equal = icmp ne i32* %dst, %src\n" + " %is_not_equal = icmp ne ptr %dst, %src\n" " br i1 %is_not_equal, label %memcpy, label %exit\n" "memcpy:\n" " call void " - "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(i32* " - "%dst, i32* %src, " + "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(ptr " + "%dst, ptr %src, " "i64 1024, i32 4)\n" " br label %exit\n" "exit:\n" @@ -221,16 +221,16 @@ TEST_F(MemTransferLowerTest, AtomicMemCpyKnownLength) { TEST_F(MemTransferLowerTest, AtomicMemCpyUnKnownLength) { ParseAssembly("declare void " - "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(i32*, " + "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(ptr, " "i32 *, i64, i32)\n" - "define void @foo(i32* %dst, i32* %src, i64 %n) optsize {\n" + "define void @foo(ptr %dst, ptr %src, i64 %n) optsize {\n" "entry:\n" - " %is_not_equal = icmp ne i32* %dst, %src\n" + " %is_not_equal = icmp ne ptr %dst, %src\n" " br i1 %is_not_equal, label %memcpy, label %exit\n" "memcpy:\n" " call void " - "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(i32* " - "%dst, i32* %src, " + "@llvm.memcpy.element.unordered.atomic.p0i32.p0i32.i64(ptr " + "%dst, ptr %src, " "i64 %n, i32 4)\n" " br label %exit\n" "exit:\n" diff --git a/llvm/unittests/Transforms/Utils/ScalarEvolutionExpanderTest.cpp b/llvm/unittests/Transforms/Utils/ScalarEvolutionExpanderTest.cpp index 55eae64..4fe3080 100644 --- a/llvm/unittests/Transforms/Utils/ScalarEvolutionExpanderTest.cpp +++ b/llvm/unittests/Transforms/Utils/ScalarEvolutionExpanderTest.cpp @@ -121,18 +121,18 @@ TEST_F(ScalarEvolutionExpanderTest, ExpandPtrTypeSCEV) { TEST_F(ScalarEvolutionExpanderTest, SCEVZeroExtendExprNonIntegral) { /* * Create the following code: - * func(i64 addrspace(10)* %arg) + * func(ptr addrspace(10) %arg) * top: * br label %L.ph * L.ph: - * %gepbase = getelementptr i64 addrspace(10)* %arg, i64 1 + * %gepbase = getelementptr ptr addrspace(10) %arg, i64 1 * br label %L * L: * %phi = phi i64 [i64 0, %L.ph], [ %add, %L2 ] * %add = add i64 %phi2, 1 * br i1 undef, label %post, label %L2 * post: - * #= %gep = getelementptr i64 addrspace(10)* %gepbase, i64 %add =# + * #= %gep = getelementptr ptr addrspace(10) %gepbase, i64 %add =# * ret void * * We will create the appropriate SCEV expression for %gep and expand it, @@ -199,7 +199,7 @@ TEST_F(ScalarEvolutionExpanderTest, SCEVZeroExtendExprNonIntegral) { TEST_F(ScalarEvolutionExpanderTest, SCEVExpanderIsSafeToExpandAt) { /* * Create the following code: - * func(i64 addrspace(10)* %arg) + * func(ptr addrspace(10) %arg) * top: * br label %L.ph * L.ph: @@ -704,14 +704,14 @@ TEST_F(ScalarEvolutionExpanderTest, SCEVExpanderShlNSW) { EXPECT_FALSE(I->hasNoSignedWrap()); }; - checkOneCase("define void @f(i16* %arrayidx) { " - " %1 = load i16, i16* %arrayidx " + checkOneCase("define void @f(ptr %arrayidx) { " + " %1 = load i16, ptr %arrayidx " " %2 = and i16 %1, -32768 " " ret void " "} "); - checkOneCase("define void @f(i8* %arrayidx) { " - " %1 = load i8, i8* %arrayidx " + checkOneCase("define void @f(ptr %arrayidx) { " + " %1 = load i8, ptr %arrayidx " " %2 = and i8 %1, -128 " " ret void " "} "); diff --git a/llvm/unittests/Transforms/Utils/UnrollLoopTest.cpp b/llvm/unittests/Transforms/Utils/UnrollLoopTest.cpp index eec1011..7ba259d 100644 --- a/llvm/unittests/Transforms/Utils/UnrollLoopTest.cpp +++ b/llvm/unittests/Transforms/Utils/UnrollLoopTest.cpp @@ -34,7 +34,7 @@ TEST(LoopUnrollRuntime, Latch) { std::unique_ptr<Module> M = parseIR( C, - R"(define i32 @test(i32* %a, i32* %b, i32* %c, i64 %n) { + R"(define i32 @test(ptr %a, ptr %b, ptr %c, i64 %n) { entry: br label %while.cond @@ -44,13 +44,13 @@ while.cond: ; preds = %while.body, %entry br i1 %cmp, label %while.body, label %while.end while.body: ; preds = %while.cond - %arrayidx = getelementptr inbounds i32, i32* %b, i64 %i.0 - %0 = load i32, i32* %arrayidx - %arrayidx1 = getelementptr inbounds i32, i32* %c, i64 %i.0 - %1 = load i32, i32* %arrayidx1 + %arrayidx = getelementptr inbounds i32, ptr %b, i64 %i.0 + %0 = load i32, ptr %arrayidx + %arrayidx1 = getelementptr inbounds i32, ptr %c, i64 %i.0 + %1 = load i32, ptr %arrayidx1 %mul = mul nsw i32 %0, %1 - %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %i.0 - store i32 %mul, i32* %arrayidx2 + %arrayidx2 = getelementptr inbounds i32, ptr %a, i64 %i.0 + store i32 %mul, ptr %arrayidx2 %inc = add nsw i64 %i.0, 1 br label %while.cond diff --git a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp index e39cd70..7f12deae 100644 --- a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp +++ b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp @@ -74,7 +74,7 @@ TEST(ValueMapperTest, mapMDNodeDuplicatedCycle) { // Create a cycle that references G0. MDNode *N0; // !0 = !{!1} - MDNode *N1; // !1 = !{!0, i8* @G0} + MDNode *N1; // !1 = !{!0, ptr @G0} { auto T0 = MDTuple::getTemporary(Context, nullptr); Metadata *Ops1[] = {T0.get(), ConstantAsMetadata::get(G0.get())}; |
