brintos

brintos / llvm-project-archived public Read only

0
0
Text · 679 B · 2ef24de Raw
34 lines · plain
1; RUN: opt < %s -passes=loop-rotate -verify-memoryssa -S | FileCheck %s2 3; Test alloca in -loop-rotate.4 5; We expect a different value for %ptr each iteration (according to the6; definition of alloca). I.e. each @use must be paired with an alloca.7 8; CHECK: call void @use(ptr %9; CHECK: %ptr = alloca i810 11@e = global i16 1012 13declare void @use(ptr)14 15define void @test() {16entry:17  %end = load i16, ptr @e18  br label %loop19 20loop:21  %n.phi = phi i16 [ %n, %loop.fin ], [ 0, %entry ]22  %ptr = alloca i823  %cond = icmp eq i16 %n.phi, %end24  br i1 %cond, label %exit, label %loop.fin25 26loop.fin:27  %n = add i16 %n.phi, 128  call void @use(ptr %ptr)29  br label %loop30 31exit:32  ret void33}34