; Hand-authored equivalent. There is no dedicated LLVM IR while instruction.
define i32 @while_sum(i32 %limit) {
entry:
  br label %header
header:
  %i = phi i32 [ 0, %entry ], [ %i.next, %body ]
  %acc = phi i32 [ 0, %entry ], [ %next, %body ]
  %continue = icmp slt i32 %i, %limit
  br i1 %continue, label %body, label %exit
body:
  %next = add i32 %acc, %i
  %i.next = add i32 %i, 1
  br label %header
exit:
  ret i32 %acc
}
