mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
6829815d96
Now that the way that the partial unrolling threshold for small loops is used to compute the unrolling factor as been corrected, a slightly smaller threshold is preferable. This is expected; other targets may need to re-tune as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225566 91177308-0d34-0410-b5e6-96231b3b80d8
100 lines
1.8 KiB
LLVM
100 lines
1.8 KiB
LLVM
; RUN: opt < %s -S -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -loop-unroll | FileCheck %s
|
|
define void @unroll_opt_for_size() nounwind optsize {
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
%iv = phi i32 [ 0, %entry ], [ %inc, %loop ]
|
|
%inc = add i32 %iv, 1
|
|
%exitcnd = icmp uge i32 %inc, 1024
|
|
br i1 %exitcnd, label %exit, label %loop
|
|
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: @unroll_opt_for_size
|
|
; CHECK: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: icmp
|
|
|
|
define void @unroll_default() nounwind {
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
%iv = phi i32 [ 0, %entry ], [ %inc, %loop ]
|
|
%inc = add i32 %iv, 1
|
|
%exitcnd = icmp uge i32 %inc, 1024
|
|
br i1 %exitcnd, label %exit, label %loop
|
|
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: @unroll_default
|
|
; CHECK: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: icmp
|
|
|