1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 13:33:37 +02:00
llvm-mirror/test/Transforms/LoopUnroll/full-unroll-heuristics-phi-prop.ll
Chandler Carruth 774ae973b9 [PM] Simplify the new PM interface to the loop unroller and expose two
factory functions for the two modes the loop unroller is actually used
in in-tree: simplified full-unrolling and the entire thing including
partial unrolling.

I've also wired these up to nice names so you can express both of these
being in a pipeline easily. This is a precursor to actually enabling
these parts of the O2 pipeline.

Differential Revision: https://reviews.llvm.org/D28897

llvm-svn: 293136
2017-01-26 02:13:50 +00:00

25 lines
858 B
LLVM

; RUN: opt < %s -S -loop-unroll -unroll-max-iteration-count-to-analyze=100 -unroll-threshold=10 -unroll-max-percent-threshold-boost=200 | FileCheck %s
; RUN: opt < %s -S -passes='require<opt-remark-emit>,loop(unroll-full)' -unroll-max-iteration-count-to-analyze=100 -unroll-threshold=10 -unroll-max-percent-threshold-boost=200 | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
define i64 @propagate_loop_phis() {
; CHECK-LABEL: @propagate_loop_phis(
; CHECK-NOT: br i1
; CHECK: ret i64 3
entry:
br label %loop
loop:
%iv = phi i64 [ 0, %entry ], [ %inc, %loop ]
%x0 = phi i64 [ 0, %entry ], [ %x2, %loop ]
%x1 = or i64 %x0, 1
%x2 = or i64 %x1, 2
%inc = add nuw nsw i64 %iv, 1
%cond = icmp sge i64 %inc, 10
br i1 %cond, label %loop.end, label %loop
loop.end:
%x.lcssa = phi i64 [ %x2, %loop ]
ret i64 %x.lcssa
}