24 lines · plain
1; XFAIL: *2; RUN: opt -passes=dse -S < %s | FileCheck %s3 4target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"5target triple = "x86_64-apple-macosx10.7.0"6 7; Basic correctness tests for atomic stores.8; Note that it turns out essentially every transformation DSE does is legal on9; atomic ops, just some transformations are not allowed across release-acquire pairs.10 11@x = common global i32 0, align 412@y = common global i32 0, align 413 14; DSE across monotonic load (allowed as long as the eliminated store isUnordered)15define i32 @test9() {16; CHECK-LABEL: test917; CHECK-NOT: store i32 018; CHECK: store i32 119 store i32 0, ptr @x20 %x = load atomic i32, ptr @y monotonic, align 421 store i32 1, ptr @x22 ret i32 %x23}24