From 60cdd12d7a0eba6e1d3b8a0eaa24f21f86876fd3 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 11 Jan 2023 14:36:22 +0100 Subject: [PATCH] [CodeExtractor] Convert tests to opaque pointers (NFC) Keeping bitcasts to preserve test behavior. --- .../CodeExtractor/PartialInlineAlloca4.ll | 28 +++++++++++----------- .../CodeExtractor/PartialInlineAlloca5.ll | 26 ++++++++++---------- .../Transforms/CodeExtractor/live_shrink_gep.ll | 20 ++++++++-------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca4.ll b/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca4.ll index c0401a9..bd51910 100644 --- a/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca4.ll +++ b/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca4.ll @@ -1,49 +1,49 @@ ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s -%"class.base" = type { %"struct.base"* } +%"class.base" = type { ptr } %"struct.base" = type opaque @g = external local_unnamed_addr global i32, align 4 ; CHECK-LABEL: define{{.*}}@caller( -; CHECK: call void @llvm.lifetime.start.p0i8(i64 -1, i8* %tmp.i) -; CHECK-NEXT: call void @callee_unknown_use1.{{.*}}(i8* %tmp.i +; CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr %tmp.i) +; CHECK-NEXT: call void @callee_unknown_use1.{{.*}}(ptr %tmp.i define i32 @callee_unknown_use1(i32 %arg) local_unnamed_addr #0 { ; CHECK-LABEL:define{{.*}}@callee_unknown_use1.{{[0-9]}} ; CHECK-NOT: alloca bb: %tmp = alloca i8, align 4 - %tmp2 = load i32, i32* @g, align 4, !tbaa !2 + %tmp2 = load i32, ptr @g, align 4, !tbaa !2 %tmp3 = add nsw i32 %tmp2, 1 %tmp4 = icmp slt i32 %arg, 0 br i1 %tmp4, label %bb6, label %bb5 bb5: ; preds = %bb - call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp) #2 - store i32 %tmp3, i32* @g, align 4, !tbaa !2 - %tmp11 = bitcast i8* %tmp to i32* - call void @bar(i32* nonnull %tmp11) #2 - call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp) #2 + call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #2 + store i32 %tmp3, ptr @g, align 4, !tbaa !2 + %tmp11 = bitcast ptr %tmp to ptr + call void @bar(ptr nonnull %tmp11) #2 + call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #2 br label %bb6 bb6: ; preds = %bb5, %bb %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ] - %tmp1 = bitcast i8* %tmp to i32* + %tmp1 = bitcast ptr %tmp to ptr ret i32 %tmp7 } ; Function Attrs: argmemonly nounwind -declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 +declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1 -declare void @bar(i32*) local_unnamed_addr #2 -declare void @bar2(i32*, i32*) local_unnamed_addr #1 +declare void @bar(ptr) local_unnamed_addr #2 +declare void @bar2(ptr, ptr) local_unnamed_addr #1 ; Function Attrs: argmemonly nounwind -declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 +declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define i32 @caller(i32 %arg) local_unnamed_addr #0 { diff --git a/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca5.ll b/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca5.ll index 54fe9a5..005c021 100644 --- a/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca5.ll +++ b/llvm/test/Transforms/CodeExtractor/PartialInlineAlloca5.ll @@ -1,7 +1,7 @@ ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s -%"class.base" = type { %"struct.base"* } +%"class.base" = type { ptr } %"struct.base" = type opaque @g = external local_unnamed_addr global i32, align 4 @@ -11,35 +11,35 @@ define i32 @callee_unknown_use2(i32 %arg) local_unnamed_addr #0 { ; CHECK-NOT: alloca bb: %tmp = alloca i32, align 4 - %tmp1 = bitcast i32* %tmp to i8* - %tmp2 = load i32, i32* @g, align 4, !tbaa !2 + %tmp1 = bitcast ptr %tmp to ptr + %tmp2 = load i32, ptr @g, align 4, !tbaa !2 %tmp3 = add nsw i32 %tmp2, 1 %tmp4 = icmp slt i32 %arg, 0 br i1 %tmp4, label %bb6, label %bb5 bb5: ; preds = %bb - call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp1) #2 - store i32 %tmp3, i32* %tmp, align 4, !tbaa !2 - store i32 %tmp3, i32* @g, align 4, !tbaa !2 - call void @bar(i32* nonnull %tmp) #2 - call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp1) #2 + call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp1) #2 + store i32 %tmp3, ptr %tmp, align 4, !tbaa !2 + store i32 %tmp3, ptr @g, align 4, !tbaa !2 + call void @bar(ptr nonnull %tmp) #2 + call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp1) #2 br label %bb6 bb6: ; preds = %bb5, %bb %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ] - %tmp10 = bitcast i8* %tmp1 to i32* + %tmp10 = bitcast ptr %tmp1 to ptr ret i32 %tmp7 } ; Function Attrs: argmemonly nounwind -declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 +declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1 -declare void @bar(i32*) local_unnamed_addr #2 -declare void @bar2(i32*, i32*) local_unnamed_addr #1 +declare void @bar(ptr) local_unnamed_addr #2 +declare void @bar2(ptr, ptr) local_unnamed_addr #1 ; Function Attrs: argmemonly nounwind -declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 +declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define i32 @caller(i32 %arg) local_unnamed_addr #0 { diff --git a/llvm/test/Transforms/CodeExtractor/live_shrink_gep.ll b/llvm/test/Transforms/CodeExtractor/live_shrink_gep.ll index 4a73265..03ff31b 100644 --- a/llvm/test/Transforms/CodeExtractor/live_shrink_gep.ll +++ b/llvm/test/Transforms/CodeExtractor/live_shrink_gep.ll @@ -9,28 +9,28 @@ define void @_Z3foov() local_unnamed_addr { bb: %tmp = alloca %class.A, align 1 - %tmp1 = getelementptr inbounds %class.A, %class.A* %tmp, i64 0, i32 0 - call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %tmp1) - %tmp2 = load i32, i32* @cond, align 4, !tbaa !2 + %tmp1 = getelementptr inbounds %class.A, ptr %tmp, i64 0, i32 0 + call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %tmp1) + %tmp2 = load i32, ptr @cond, align 4, !tbaa !2 %tmp3 = icmp eq i32 %tmp2, 0 br i1 %tmp3, label %bb4, label %bb5 bb4: ; preds = %bb - call void @_ZN1A7memfuncEv(%class.A* nonnull %tmp) + call void @_ZN1A7memfuncEv(ptr nonnull %tmp) br label %bb5 bb5: ; preds = %bb4, %bb - call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %tmp1) + call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %tmp1) ret void } ; Function Attrs: argmemonly nounwind -declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) +declare void @llvm.lifetime.start.p0(i64, ptr nocapture) -declare void @_ZN1A7memfuncEv(%class.A*) local_unnamed_addr +declare void @_ZN1A7memfuncEv(ptr) local_unnamed_addr ; Function Attrs: argmemonly nounwind -declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) +declare void @llvm.lifetime.end.p0(i64, ptr nocapture) ; Function Attrs: uwtable define void @_Z3goov() local_unnamed_addr { @@ -51,8 +51,8 @@ bb: ; CHECK: newFuncRoot: ; CHECK-NEXT: %tmp = alloca %class.A ; CHECK-NEXT: %tmp1 = getelementptr -; CHECK-NEXT: call void @llvm.lifetime.start.p0i8 -; CHECK: call void @llvm.lifetime.end.p0i8 +; CHECK-NEXT: call void @llvm.lifetime.start.p0 +; CHECK: call void @llvm.lifetime.end.p0 ; CHECK-NEXT: br label %bb5.exitStub !llvm.module.flags = !{!0} -- 2.7.4