• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -S -licm | FileCheck %s
2
3; Check that we do not hoist convergent functions out of loop
4; CHECK: define i32 @test
5; CHECK: loop:
6; CHECK: call i32 @f
7
8define i32 @test(i32* nocapture noalias %x, i32* nocapture %y) {
9entry:
10  br label %loop
11
12loop:
13  %a = call i32 @f() nounwind readnone convergent
14  %exitcond = icmp ne i32 %a, 0
15  br i1 %exitcond, label %end, label %loop
16
17end:
18  ret i32 %a
19}
20
21declare i32 @f() nounwind readnone convergent
22