[llvm] 30f098e - [Instrumentation] Convert tests to opaque pointers (NFC)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 16:40:01 PST 2024


Author: Fangrui Song
Date: 2024-03-07T16:39:57-08:00
New Revision: 30f098ef9dfb121bccaef6975b13788b6f940e47

URL: https://github.com/llvm/llvm-project/commit/30f098ef9dfb121bccaef6975b13788b6f940e47
DIFF: https://github.com/llvm/llvm-project/commit/30f098ef9dfb121bccaef6975b13788b6f940e47.diff

LOG: [Instrumentation] Convert tests to opaque pointers (NFC)

Link: https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322

Added: 
    

Modified: 
    llvm/test/Instrumentation/AddressSanitizer/aarch64be.ll
    llvm/test/Instrumentation/AddressSanitizer/program-addrspace.ll
    llvm/test/Instrumentation/InstrProfiling/before-value-profile-lowering.ll
    llvm/test/Instrumentation/InstrProfiling/timestamp-coverage.ll
    llvm/test/Instrumentation/InstrProfiling/timestamp.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Instrumentation/AddressSanitizer/aarch64be.ll b/llvm/test/Instrumentation/AddressSanitizer/aarch64be.ll
index eb522a0f3f3173..aeb1b0e8ebe778 100644
--- a/llvm/test/Instrumentation/AddressSanitizer/aarch64be.ll
+++ b/llvm/test/Instrumentation/AddressSanitizer/aarch64be.ll
@@ -2,9 +2,9 @@
 ; RUN: opt < %s -passes=asan -S -mtriple=aarch64_be-linux-gnu | FileCheck --check-prefix=CHECK-AARCH64BE %s
 ; REQUIRES: aarch64-registered-target
  
-define i32 @read_4_bytes(i32* %a) sanitize_address {
+define i32 @read_4_bytes(ptr %a) sanitize_address {
 entry:
-  %tmp1 = load i32, i32* %a, align 4
+  %tmp1 = load i32, ptr %a, align 4
   ret i32 %tmp1
 }
  

diff  --git a/llvm/test/Instrumentation/AddressSanitizer/program-addrspace.ll b/llvm/test/Instrumentation/AddressSanitizer/program-addrspace.ll
index adfe21135e7ada..1d5bfb09ead97c 100644
--- a/llvm/test/Instrumentation/AddressSanitizer/program-addrspace.ll
+++ b/llvm/test/Instrumentation/AddressSanitizer/program-addrspace.ll
@@ -16,7 +16,7 @@ target datalayout = "P1"
 
 define i1 @b(i64 %c) addrspace(1) {
   %cast = inttoptr i64 %c to ptr addrspace(42)
-  %cmp = icmp ugt ptr addrspace(42) %cast, getelementptr inbounds ([1 x i32], ptr addrspace(42) @a, i64 0, i64 0)
+  %cmp = icmp ugt ptr addrspace(42) %cast, @a
   ret i1 %cmp
 }
 

diff  --git a/llvm/test/Instrumentation/InstrProfiling/before-value-profile-lowering.ll b/llvm/test/Instrumentation/InstrProfiling/before-value-profile-lowering.ll
index 5dfec433f4ecb3..870e74ccfdac46 100644
--- a/llvm/test/Instrumentation/InstrProfiling/before-value-profile-lowering.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/before-value-profile-lowering.ll
@@ -7,17 +7,17 @@
 
 target triple = "x86_64-unknown-linux-gnu"
 
-declare void @llvm.instrprof.increment.step(i8*, i64, i32, i32, i64)
+declare void @llvm.instrprof.increment.step(ptr, i64, i32, i32, i64)
 
-declare void @llvm.instrprof.value.profile(i8*, i64, i64, i32, i32)
+declare void @llvm.instrprof.value.profile(ptr, i64, i64, i32, i32)
 
 ; CHECK: @__profd_foo = private global
 @__profn_foo = private constant [3 x i8] c"foo"
 
-define i32 @foo(i32 ()* ) {
-  %2 = ptrtoint i32 ()* %0 to i64
-  call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i64 %2, i32 0, i32 0)
-  call void @llvm.instrprof.increment.step(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0, i64 0)
+define i32 @foo(ptr ) {
+  %2 = ptrtoint ptr %0 to i64
+  call void @llvm.instrprof.value.profile(ptr @__profn_foo, i64 0, i64 %2, i32 0, i32 0)
+  call void @llvm.instrprof.increment.step(ptr @__profn_foo, i64 0, i32 1, i32 0, i64 0)
   %3 = tail call i32 %0()
   ret i32 %3
 }

diff  --git a/llvm/test/Instrumentation/InstrProfiling/timestamp-coverage.ll b/llvm/test/Instrumentation/InstrProfiling/timestamp-coverage.ll
index ab9b664a2cff65..d40cc2ac02c1bc 100644
--- a/llvm/test/Instrumentation/InstrProfiling/timestamp-coverage.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/timestamp-coverage.ll
@@ -6,11 +6,11 @@ target triple = "aarch64-unknown-linux-gnu"
 ; CHECK: @__profc_foo = private global [9 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF", section "__llvm_prf_cnts", comdat, align 8
 
 define void @_Z3foov() {
-  call void @llvm.instrprof.timestamp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 9, i32 0)
+  call void @llvm.instrprof.timestamp(ptr @__profn_foo, i64 12345678, i32 9, i32 0)
   ; CHECK: call void @__llvm_profile_set_timestamp(ptr @__profc_foo)
-  call void @llvm.instrprof.cover(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 9, i32 8)
+  call void @llvm.instrprof.cover(ptr @__profn_foo, i64 12345678, i32 9, i32 8)
   ret void
 }
 
-declare void @llvm.instrprof.timestamp(i8*, i64, i32, i32)
-declare void @llvm.instrprof.cover(i8*, i64, i32, i32)
+declare void @llvm.instrprof.timestamp(ptr, i64, i32, i32)
+declare void @llvm.instrprof.cover(ptr, i64, i32, i32)

diff  --git a/llvm/test/Instrumentation/InstrProfiling/timestamp.ll b/llvm/test/Instrumentation/InstrProfiling/timestamp.ll
index aa2393695d6b85..c08ba4485fc5dd 100644
--- a/llvm/test/Instrumentation/InstrProfiling/timestamp.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/timestamp.ll
@@ -6,11 +6,11 @@ target triple = "aarch64-unknown-linux-gnu"
 ; CHECK: @__profc_foo = private global [2 x i64] zeroinitializer, section "__llvm_prf_cnts", comdat, align 8
 
 define void @_Z3foov() {
-  call void @llvm.instrprof.timestamp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 2, i32 0)
+  call void @llvm.instrprof.timestamp(ptr @__profn_foo, i64 12345678, i32 2, i32 0)
   ; CHECK: call void @__llvm_profile_set_timestamp(ptr @__profc_foo)
-  call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 2, i32 1)
+  call void @llvm.instrprof.increment(ptr @__profn_foo, i64 12345678, i32 2, i32 1)
   ret void
 }
 
-declare void @llvm.instrprof.timestamp(i8*, i64, i32, i32)
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.timestamp(ptr, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)


        


More information about the llvm-commits mailing list