branch-fold-test.ll 498 B

1234567891011121314151617
  1. ; This test ensures that the simplifycfg pass continues to constant fold
  2. ; terminator instructions.
  3. ; RUN: opt < %s -simplifycfg -S | not grep br
  4. define i32 @test(i32 %A, i32 %B) {
  5. J:
  6. %C = add i32 %A, 12 ; <i32> [#uses=2]
  7. br i1 true, label %L, label %K
  8. L: ; preds = %J
  9. %D = add i32 %C, %B ; <i32> [#uses=1]
  10. ret i32 %D
  11. K: ; preds = %J
  12. %E = add i32 %C, %B ; <i32> [#uses=1]
  13. ret i32 %E
  14. }