1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=syncscopes --test FileCheck --test-arg --check-prefixes=INTERESTING,CHECK --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck -check-prefixes=RESULT,CHECK %s < %t
4 ; CHECK-LABEL: @load_syncscope_keep(
5 ; INTERESTING: syncscope("agent")
6 ; RESULT: %op = load atomic i32, ptr %ptr syncscope("agent") seq_cst, align 4
7 define i32 @load_syncscope_keep(ptr %ptr) {
8 %op = load atomic i32, ptr %ptr syncscope("agent") seq_cst, align 4
12 ; CHECK-LABEL: @load_syncscope_drop(
13 ; INTERESTING: load atomic
14 ; RESULT: %op = load atomic i32, ptr %ptr seq_cst, align 4
15 define i32 @load_syncscope_drop(ptr %ptr) {
16 %op = load atomic i32, ptr %ptr syncscope("agent") seq_cst, align 4
20 ; CHECK-LABEL: @store_syncscope_keep(
21 ; INTERESTING: syncscope("agent")
22 ; RESULT: store atomic i32 0, ptr %ptr syncscope("agent") seq_cst, align 4
23 define void @store_syncscope_keep(ptr %ptr) {
24 store atomic i32 0, ptr %ptr syncscope("agent") seq_cst, align 4
28 ; CHECK-LABEL: @store_syncscope_drop(
30 ; RESULT: store atomic i32 0, ptr %ptr seq_cst, align 4
31 define void @store_syncscope_drop(ptr %ptr) {
32 store atomic i32 0, ptr %ptr syncscope("agent") seq_cst, align 4
36 ; CHECK-LABEL: @atomicrmw_syncscope_keep(
37 ; INTERESTING: syncscope("agent")
38 ; RESULT: %val = atomicrmw add ptr %ptr, i32 3 syncscope("agent") seq_cst, align 4
39 define i32 @atomicrmw_syncscope_keep(ptr %ptr) {
40 %val = atomicrmw add ptr %ptr, i32 3 syncscope("agent") seq_cst, align 4
44 ; CHECK-LABEL: @atomicrmw_syncscope_drop(
45 ; INTERESTING: atomicrmw
46 ; RESULT: %val = atomicrmw add ptr %ptr, i32 3 seq_cst, align 4
47 define i32 @atomicrmw_syncscope_drop(ptr %ptr) {
48 %val = atomicrmw add ptr %ptr, i32 3 seq_cst
52 ; CHECK-LABEL: @cmpxchg_syncscope_keep(
53 ; INTERESTING: syncscope("agent")
54 ; RESULT: %val = cmpxchg ptr %ptr, i32 %old, i32 %in syncscope("agent") seq_cst seq_cst, align 4
55 define { i32, i1 } @cmpxchg_syncscope_keep(ptr %ptr, i32 %old, i32 %in) {
56 %val = cmpxchg ptr %ptr, i32 %old, i32 %in syncscope("agent") seq_cst seq_cst
60 ; CHECK-LABEL: @cmpxchg_syncscope_drop(
61 ; INTERESTING: = cmpxchg ptr
62 ; RESULT: %val = cmpxchg ptr %ptr, i32 %old, i32 %in seq_cst seq_cst, align 4
63 define { i32, i1 } @cmpxchg_syncscope_drop(ptr %ptr, i32 %old, i32 %in) {
64 %val = cmpxchg ptr %ptr, i32 %old, i32 %in syncscope("agent") seq_cst seq_cst
68 ; CHECK-LABEL: @fence_syncscope_keep(
69 ; INTERESTING: syncscope("agent")
70 ; RESULT: fence syncscope("agent") acquire
71 define void @fence_syncscope_keep() {
72 fence syncscope("agent") acquire
76 ; CHECK-LABEL: @fence_syncscope_drop(
78 ; RESULT: fence acquire
79 define void @fence_syncscope_drop() {
80 fence syncscope("agent") acquire