convergent.ll 438 B

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