You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
455 B
22 lines
455 B
; RUN: opt < %s -S -licm | FileCheck %s
|
|
|
|
; Check that we do not hoist convergent functions out of loop
|
|
; CHECK: define i32 @test
|
|
; CHECK: loop:
|
|
; CHECK: call i32 @f
|
|
|
|
define i32 @test(i32* nocapture noalias %x, i32* nocapture %y) {
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
%a = call i32 @f() nounwind readnone convergent
|
|
%exitcond = icmp ne i32 %a, 0
|
|
br i1 %exitcond, label %end, label %loop
|
|
|
|
end:
|
|
ret i32 %a
|
|
}
|
|
|
|
declare i32 @f() nounwind readnone convergent
|