Home | History | Annotate | Download | only in Sink
      1 ; RUN: opt -sink -S < %s | FileCheck %s
      2 
      3 ; Verify that IR sinking does not move convergent operations to
      4 ; blocks that are not control equivalent.
      5 
      6 ; CHECK: define i32 @foo
      7 ; CHECK: entry
      8 ; CHECK-NEXT: call i32 @bar
      9 ; CHECK-NEXT: br i1 %arg
     10 
     11 define i32 @foo(i1 %arg) {
     12 entry:
     13   %c = call i32 @bar() readonly convergent
     14   br i1 %arg, label %then, label %end
     15 
     16 then:
     17   ret i32 %c
     18 
     19 end:
     20   ret i32 0
     21 }
     22 
     23 declare i32 @bar() readonly convergent
     24 
     25