From 2e0a829da880db00e7e6b49cf50e95792dfb2be8 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 4 Jan 2023 17:02:50 +0100 Subject: [PATCH] [MetaRenamer] Convert tests to opaque pointers (NFC) --- llvm/test/Transforms/MetaRenamer/exclude-names.ll | 48 +++++++------- llvm/test/Transforms/MetaRenamer/metarenamer.ll | 76 +++++++++++------------ 2 files changed, 60 insertions(+), 64 deletions(-) diff --git a/llvm/test/Transforms/MetaRenamer/exclude-names.ll b/llvm/test/Transforms/MetaRenamer/exclude-names.ll index 2c7b819..6e088ef 100644 --- a/llvm/test/Transforms/MetaRenamer/exclude-names.ll +++ b/llvm/test/Transforms/MetaRenamer/exclude-names.ll @@ -2,15 +2,15 @@ ; Check that excluded names don't get renamed while all the other ones do -; CHECK: %my_struct1 = type { i8*, i32 } -; CHECK: %my_struct2 = type { i8*, i32 } -; CHECK-NOT: %other_struct = type { i8*, i32 } +; CHECK: %my_struct1 = type { ptr, i32 } +; CHECK: %my_struct2 = type { ptr, i32 } +; CHECK-NOT: %other_struct = type { ptr, i32 } ; CHECK: @my_global1 = global i32 42 ; CHECK: @my_global2 = global i32 24 ; CHECK-NOT: @other_global = global i32 24 -; CHECK: @my_alias1 = alias i32, i32* @my_global1 -; CHECK: @my_alias2 = alias i32, i32* @my_global2 -; CHECK-NOT: @other_alias = alias i32, i32* @other_global +; CHECK: @my_alias1 = alias i32, ptr @my_global1 +; CHECK: @my_alias2 = alias i32, ptr @my_global2 +; CHECK-NOT: @other_alias = alias i32, ptr @other_global ; CHECK: declare void @my_func1 ; CHECK: declare void @my_func2 ; CHECK-NOT: declare void @other_func @@ -18,25 +18,25 @@ ; CHECK: call void @my_func1 ; CHECK: call void @my_func2 ; CHECK-NOT: call void @other_func -; CHECK: load i32, i32* @my_global1 -; CHECK: load i32, i32* @my_global2 -; CHECK-NOT: load i32, i32* @other_global -; CHECK: load i32, i32* @my_alias1 -; CHECK: load i32, i32* @my_alias2 -; CHECK-NOT: load i32, i32* @other_alias +; CHECK: load i32, ptr @my_global1 +; CHECK: load i32, ptr @my_global2 +; CHECK-NOT: load i32, ptr @other_global +; CHECK: load i32, ptr @my_alias1 +; CHECK: load i32, ptr @my_alias2 +; CHECK-NOT: load i32, ptr @other_alias ; CHECK: alloca %my_struct1 ; CHECK: alloca %my_struct2 ; CHECK-NOT: alloca %other_struct -%my_struct1 = type { i8*, i32 } -%my_struct2 = type { i8*, i32 } -%other_struct = type { i8*, i32 } +%my_struct1 = type { ptr, i32 } +%my_struct2 = type { ptr, i32 } +%other_struct = type { ptr, i32 } @my_global1 = global i32 42 @my_global2 = global i32 24 @other_global = global i32 24 -@my_alias1 = alias i32, i32* @my_global1 -@my_alias2 = alias i32, i32* @my_global2 -@other_alias = alias i32, i32* @other_global +@my_alias1 = alias i32, ptr @my_global1 +@my_alias2 = alias i32, ptr @my_global2 +@other_alias = alias i32, ptr @other_global declare void @my_func1() declare void @my_func2() declare void @other_func() @@ -45,12 +45,12 @@ define void @some_func() { call void @my_func1() call void @my_func2() call void @other_func() - %a = load i32, i32* @my_global1 - %b = load i32, i32* @my_global2 - %c = load i32, i32* @other_global - %d = load i32, i32* @my_alias1 - %e = load i32, i32* @my_alias2 - %f = load i32, i32* @other_alias + %a = load i32, ptr @my_global1 + %b = load i32, ptr @my_global2 + %c = load i32, ptr @other_global + %d = load i32, ptr @my_alias1 + %e = load i32, ptr @my_alias2 + %f = load i32, ptr @other_alias %g = alloca %my_struct1 %h = alloca %my_struct2 %i = alloca %other_struct diff --git a/llvm/test/Transforms/MetaRenamer/metarenamer.ll b/llvm/test/Transforms/MetaRenamer/metarenamer.ll index 8dbecad..042e696 100644 --- a/llvm/test/Transforms/MetaRenamer/metarenamer.ll +++ b/llvm/test/Transforms/MetaRenamer/metarenamer.ll @@ -12,7 +12,7 @@ target triple = "x86_64-pc-linux-gnu" @func_5_xxx.static_local_3_xxx = internal global i32 3, align 4 @global_3_xxx = common global i32 0, align 4 -@func_7_xxx = weak alias i32 (...), i32 (...)* @aliased_func_7_xxx +@func_7_xxx = weak alias i32 (...), ptr @aliased_func_7_xxx define i32 @aliased_func_7_xxx(...) { ret i32 0 @@ -22,24 +22,20 @@ define i32 @func_3_xxx() nounwind uwtable ssp { ret i32 3 } -define void @func_4_xxx(%struct.foo_xxx* sret(%struct.foo_xxx) %agg.result) nounwind uwtable ssp { +define void @func_4_xxx(ptr sret(%struct.foo_xxx) %agg.result) nounwind uwtable ssp { %1 = alloca %struct.foo_xxx, align 8 - %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, %struct.foo_xxx* %1, i32 0, i32 1 - store float 2.000000e+00, float* %3, align 4 - %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, %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* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %7, i8* align 8 %8, i64 24, i1 false) + store i32 1, ptr %1, align 4 + %2 = getelementptr inbounds %struct.foo_xxx, ptr %1, i32 0, i32 1 + store float 2.000000e+00, ptr %2, align 4 + %3 = getelementptr inbounds %struct.foo_xxx, ptr %1, i32 0, i32 2 + store i32 3, ptr %3, align 4 + %4 = getelementptr inbounds %struct.bar_xxx, ptr %3, i32 0, i32 1 + store double 4.000000e+00, ptr %4, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.result, ptr align 8 %1, i64 24, i1 false) ret void } -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind +declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_4_xxx) nounwind uwtable ssp { %1 = alloca i32, align 4 @@ -49,17 +45,17 @@ define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_ %local_1_xxx = alloca i32, align 4 %local_2_xxx = alloca i32, align 4 %i = alloca i32, align 4 - store i32 %arg_1_xxx, i32* %1, align 4 - store i32 %arg_2_xxx, i32* %2, align 4 - store i32 %arg_3_xxx, i32* %3, align 4 - store i32 %arg_4_xxx, i32* %4, align 4 - store i32 1, i32* %local_1_xxx, align 4 - store i32 2, i32* %local_2_xxx, align 4 - store i32 0, i32* %i, align 4 + store i32 %arg_1_xxx, ptr %1, align 4 + store i32 %arg_2_xxx, ptr %2, align 4 + store i32 %arg_3_xxx, ptr %3, align 4 + store i32 %arg_4_xxx, ptr %4, align 4 + store i32 1, ptr %local_1_xxx, align 4 + store i32 2, ptr %local_2_xxx, align 4 + store i32 0, ptr %i, align 4 br label %5 ;