1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=argpromotion < %s | FileCheck %s
4 ; Make sure volatile and atomic loads are not promoted.
6 define internal i32 @callee_volatile(ptr %p) {
7 ; CHECK-LABEL: @callee_volatile(
8 ; CHECK-NEXT: [[V:%.*]] = load volatile i32, ptr [[P:%.*]], align 4
9 ; CHECK-NEXT: ret i32 [[V]]
11 %v = load volatile i32, ptr %p
15 define void @caller_volatile(ptr %p) {
16 ; CHECK-LABEL: @caller_volatile(
17 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @callee_volatile(ptr [[P:%.*]])
18 ; CHECK-NEXT: ret void
20 call i32 @callee_volatile(ptr %p)
24 define internal i32 @callee_atomic(ptr %p) {
25 ; CHECK-LABEL: @callee_atomic(
26 ; CHECK-NEXT: [[V:%.*]] = load atomic i32, ptr [[P:%.*]] seq_cst, align 4
27 ; CHECK-NEXT: ret i32 [[V]]
29 %v = load atomic i32, ptr %p seq_cst, align 4
33 define void @caller_atomic(ptr %p) {
34 ; CHECK-LABEL: @caller_atomic(
35 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @callee_atomic(ptr [[P:%.*]])
36 ; CHECK-NEXT: ret void
38 call i32 @callee_atomic(ptr %p)