Home | History | Annotate | Download | only in SCCP
      1 ; RUN: opt < %s -ipsccp -S | FileCheck %s
      2 
      3 ; This transformation is safe for atomic loads and stores; check that it works.
      4 
      5 @G = internal global i32 17
      6 @C = internal constant i32 222
      7 
      8 define i32 @test1() {
      9 	%V = load atomic i32* @G seq_cst, align 4
     10 	%C = icmp eq i32 %V, 17
     11 	br i1 %C, label %T, label %F
     12 T:
     13 	store atomic i32 17, i32* @G seq_cst, align 4
     14 	ret i32 %V
     15 F:	
     16 	store atomic i32 123, i32* @G seq_cst, align 4
     17 	ret i32 0
     18 }
     19 ; CHECK: define i32 @test1
     20 ; CHECK-NOT: store
     21 ; CHECK: ret i32 17
     22 
     23 define i32 @test2() {
     24 	%V = load atomic i32* @C seq_cst, align 4
     25 	ret i32 %V
     26 }
     27 
     28 ; CHECK: define i32 @test2
     29 ; CHECK-NOT: load
     30 ; CHECK: ret i32 222
     31