32 lines · plain
1; RUN: opt -S -passes=loop-rotate -verify-memoryssa < %s | FileCheck %s2 3@e = global i32 104 5declare void @f1(i32) convergent6declare void @f2(i32)7 8; The call to f1 in the loop header shouldn't be duplicated (meaning, loop9; rotation shouldn't occur), because f1 is convergent.10 11; CHECK: call void @f112; CHECK-NOT: call void @f113 14define void @test(i32 %x) {15entry:16 br label %loop17 18loop:19 %n.phi = phi i32 [ %n, %loop.fin ], [ 0, %entry ]20 call void @f1(i32 %n.phi)21 %cond = icmp eq i32 %n.phi, %x22 br i1 %cond, label %exit, label %loop.fin23 24loop.fin:25 %n = add i32 %n.phi, 126 call void @f2(i32 %n)27 br label %loop28 29exit:30 ret void31}32