1 ; RUN: opt -S -loop-rotate < %s | FileCheck %s
2 ; RUN: opt -S -loop-rotate -enable-mssa-loop-dependency=true -verify-memoryssa < %s | FileCheck %s
6 declare void @f1(i32) convergent
9 ; The call to f1 in the loop header shouldn't be duplicated (meaning, loop
10 ; rotation shouldn't occur), because f1 is convergent.
12 ; CHECK: call void @f1
13 ; CHECK-NOT: call void @f1
15 define void @test(i32 %x) {
20 %n.phi = phi i32 [ %n, %loop.fin ], [ 0, %entry ]
21 call void @f1(i32 %n.phi)
22 %cond = icmp eq i32 %n.phi, %x
23 br i1 %cond, label %exit, label %loop.fin
26 %n = add i32 %n.phi, 1