1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt < %s -passes=infer-alignment -S | FileCheck %s
4 define void @attribute(ptr align 32 %a) {
5 ; CHECK-LABEL: define void @attribute
6 ; CHECK-SAME: (ptr align 32 [[A:%.*]]) {
7 ; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[A]], align 32
8 ; CHECK-NEXT: store i32 123, ptr [[A]], align 32
11 %load = load i32, ptr %a, align 1
12 store i32 123, ptr %a, align 1
16 define void @attribute_through_call(ptr align 32 %a) {
17 ; CHECK-LABEL: define void @attribute_through_call
18 ; CHECK-SAME: (ptr align 32 [[A:%.*]]) {
19 ; CHECK-NEXT: [[RES:%.*]] = call ptr @call(ptr [[A]])
20 ; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[RES]], align 32
21 ; CHECK-NEXT: store i32 123, ptr [[RES]], align 32
22 ; CHECK-NEXT: ret void
24 %res = call ptr @call(ptr %a)
25 %load = load i32, ptr %res, align 1
26 store i32 123, ptr %res, align 1
30 define void @attribute_return_value(ptr %a) {
31 ; CHECK-LABEL: define void @attribute_return_value
32 ; CHECK-SAME: (ptr [[A:%.*]]) {
33 ; CHECK-NEXT: [[RES:%.*]] = call align 32 ptr @call(ptr [[A]])
34 ; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[RES]], align 32
35 ; CHECK-NEXT: store i32 123, ptr [[RES]], align 32
36 ; CHECK-NEXT: ret void
38 %res = call align 32 ptr @call(ptr %a)
39 %load = load i32, ptr %res, align 1
40 store i32 123, ptr %res, align 1
44 declare ptr @call(ptr returned)