1 ; Test memprof internal compiler flags:
2 ; -memprof-use-callbacks
3 ; -memprof-memory-access-callback-prefix
5 ; RUN: opt < %s -passes='function(memprof),memprof-module' -memprof-use-callbacks -S | FileCheck %s --check-prefix=CHECK-CALL --check-prefix=CHECK-CALL-DEFAULT
6 ; RUN: opt < %s -passes='function(memprof),memprof-module' -memprof-use-callbacks -memprof-memory-access-callback-prefix=__foo_ -S | FileCheck %s --check-prefix=CHECK-CALL --check-prefix=CHECK-CALL-CUSTOM
7 ; RUN: opt < %s -passes='function(memprof),memprof-module' -memprof-use-callbacks=false -S | FileCheck %s --check-prefix=CHECK-INLINE
8 ; RUN: opt < %s -passes='function(memprof),memprof-module' -S | FileCheck %s --check-prefix=CHECK-INLINE
9 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"
10 target triple = "x86_64-unknown-linux-gnu"
12 define void @test_load(ptr %a, ptr %b, ptr %c, ptr %d) {
14 ; CHECK-CALL: %[[LOAD_ADDR1:[^ ]*]] = ptrtoint ptr %a to i64
15 ; CHECK-CALL-DEFAULT: call void @__memprof_load(i64 %[[LOAD_ADDR1]])
16 ; CHECK-CALL-CUSTOM: call void @__foo_load(i64 %[[LOAD_ADDR1]])
17 ; CHECK-CALL: %[[LOAD_ADDR2:[^ ]*]] = ptrtoint ptr %b to i64
18 ; CHECK-CALL-DEFAULT: call void @__memprof_load(i64 %[[LOAD_ADDR2]])
19 ; CHECK-CALL-CUSTOM: call void @__foo_load(i64 %[[LOAD_ADDR2]])
20 ; CHECK-CALL: %[[LOAD_ADDR3:[^ ]*]] = ptrtoint ptr %c to i64
21 ; CHECK-CALL-DEFAULT: call void @__memprof_load(i64 %[[LOAD_ADDR3]])
22 ; CHECK-CALL-CUSTOM: call void @__foo_load(i64 %[[LOAD_ADDR3]])
23 ; CHECK-CALL: %[[LOAD_ADDR4:[^ ]*]] = ptrtoint ptr %d to i64
24 ; CHECK-CALL-DEFAULT: call void @__memprof_load(i64 %[[LOAD_ADDR4]])
25 ; CHECK-CALL-CUSTOM: call void @__foo_load(i64 %[[LOAD_ADDR4]])
26 ; CHECK-CALL-DEFAULT-NOT: call void @__memprof_load
27 ; CHECK-CALL-CUSTOM-NOT: call void @__foo_load
28 ; CHECK-INLINE-NOT: call void @__memprof_load
29 %tmp1 = load i32, ptr %a, align 4
30 %tmp2 = load i64, ptr %b, align 8
31 %tmp3 = load i512, ptr %c, align 32
32 %tmp4 = load i80, ptr %d, align 8