brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 85bcf93 Raw
41 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=argpromotion < %s | FileCheck %s3 4; Make sure volatile and atomic loads are not promoted.5 6define internal i32 @callee_volatile(ptr %p) {7; CHECK-LABEL: @callee_volatile(8; CHECK-NEXT:    [[V:%.*]] = load volatile i32, ptr [[P:%.*]], align 49; CHECK-NEXT:    ret i32 [[V]]10;11  %v = load volatile i32, ptr %p12  ret i32 %v13}14 15define void @caller_volatile(ptr %p) {16; CHECK-LABEL: @caller_volatile(17; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @callee_volatile(ptr [[P:%.*]])18; CHECK-NEXT:    ret void19;20  call i32 @callee_volatile(ptr %p)21  ret void22}23 24define internal i32 @callee_atomic(ptr %p) {25; CHECK-LABEL: @callee_atomic(26; CHECK-NEXT:    [[V:%.*]] = load atomic i32, ptr [[P:%.*]] seq_cst, align 427; CHECK-NEXT:    ret i32 [[V]]28;29  %v = load atomic i32, ptr %p seq_cst, align 430  ret i32 %v31}32 33define void @caller_atomic(ptr %p) {34; CHECK-LABEL: @caller_atomic(35; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @callee_atomic(ptr [[P:%.*]])36; CHECK-NEXT:    ret void37;38  call i32 @callee_atomic(ptr %p)39  ret void40}41