1 ; Test that the scale (-memprof-mapping-scale) and granularity (-memprof-mapping-granularity) command-line options work as expected
3 ; RUN: opt < %s -passes='function(memprof),memprof-module' -memprof-mapping-granularity 32 -S | FileCheck --check-prefix=CHECK-GRAN %s
4 ; RUN: opt < %s -passes='function(memprof),memprof-module' -memprof-mapping-scale 1 -S | FileCheck --check-prefix=CHECK-SCALE %s
5 ; RUN: opt < %s -passes='function(memprof),memprof-module' -memprof-mapping-granularity 16 -memprof-mapping-scale 0 -S | FileCheck --check-prefix=CHECK-BOTH %s
6 target triple = "x86_64-unknown-linux-gnu"
8 define i32 @read(ptr %a) {
10 %tmp1 = load i32, ptr %a, align 4
13 ; CHECK-GRAN-LABEL: @read
15 ; CHECK-GRAN: and {{.*}} -32
16 ; CHECK-GRAN-NEXT: lshr {{.*}} 3
19 ; CHECK-SCALE-LABEL: @read
20 ; CHECK-SCALE-NOT: ret
21 ; CHECK-SCALE: and {{.*}} -64
22 ; CHECK-SCALE-NEXT: lshr {{.*}} 1
25 ; CHECK-BOTH-LABEL: @read
27 ; CHECK-BOTH: and {{.*}} -16
28 ; CHECK-BOTH-NEXT: lshr {{.*}} 0