You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.167
Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
parent
e19d552987
commit
b084638f15
@ -1,3 +0,0 @@
|
||||
if not 'ARM' in config.root.targets:
|
||||
config.unsupported = True
|
||||
|
@ -1,246 +0,0 @@
|
||||
; RUN: opt -mtriple=armv7 -mcpu=cortex-a57 -loop-unroll -S %s -o - | FileCheck %s --check-prefix=CHECK-UNROLL-A
|
||||
; RUN: opt -mtriple=thumbv7 -mcpu=cortex-a57 -loop-unroll -S %s -o - | FileCheck %s --check-prefix=CHECK-UNROLL-A
|
||||
; RUN: opt -mtriple=thumbv8m -mcpu=cortex-m23 -loop-unroll -S %s -o - | FileCheck %s --check-prefix=CHECK-UNROLL-T1
|
||||
; RUN: opt -mtriple=thumbv8m.main -mcpu=cortex-m33 -loop-unroll -S %s -o - | FileCheck %s --check-prefix=CHECK-UNROLL-T2
|
||||
; RUN: opt -mtriple=thumbv7em -mcpu=cortex-m7 -loop-unroll -S %s -o - | FileCheck %s --check-prefix=CHECK-UNROLL-T2
|
||||
|
||||
; CHECK-LABEL: partial
|
||||
define arm_aapcs_vfpcc void @partial(i32* nocapture %C, i32* nocapture readonly %A, i32* nocapture readonly %B) local_unnamed_addr #0 {
|
||||
entry:
|
||||
br label %for.body
|
||||
|
||||
; CHECK-LABEL: for.body
|
||||
for.body:
|
||||
|
||||
; CHECK-UNROLL-A: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, %entry ], [ [[IV2:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-A: [[IV1:%[a-z.0-9]+]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-A: [[IV2]] = add nuw nsw i32 [[IV1]], 1
|
||||
; CHECK-UNROLL-A: [[CMP:%[a-z.0-9]+]] = icmp eq i32 [[IV2]], 1024
|
||||
; CHECK-UNROLL-A: br i1 [[CMP]], label [[END:%[a-z.]+]], label %for.body
|
||||
|
||||
; CHECK-UNROLL-T1: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, %entry ], [ [[IV1:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-T1: [[IV1]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-T1: [[CMP:%[a-z.0-9]+]] = icmp eq i32 [[IV1]], 1024
|
||||
; CHECK-UNROLL-T1: br i1 [[CMP]], label [[END:%[a-z.]+]], label %for.body
|
||||
|
||||
; CHECK-UNROLL-T2: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, %entry ], [ [[IV16:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-T2: [[IV1:%[a-z.0-9]+]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-T2: [[IV2:%[a-z.0-9]+]] = add nuw nsw i32 [[IV1]], 1
|
||||
; CHECK-UNROLL-T2: [[IV3:%[a-z.0-9]+]] = add nuw nsw i32 [[IV2]], 1
|
||||
; CHECK-UNROLL-T2: [[IV4:%[a-z.0-9]+]] = add nuw nsw i32 [[IV3]], 1
|
||||
; CHECK-UNROLL-T2: [[IV5:%[a-z.0-9]+]] = add nuw nsw i32 [[IV4]], 1
|
||||
; CHECK-UNROLL-T2: [[IV6:%[a-z.0-9]+]] = add nuw nsw i32 [[IV5]], 1
|
||||
; CHECK-UNROLL-T2: [[IV7:%[a-z.0-9]+]] = add nuw nsw i32 [[IV6]], 1
|
||||
; CHECK-UNROLL-T2: [[IV8:%[a-z.0-9]+]] = add nuw nsw i32 [[IV7]], 1
|
||||
; CHECK-UNROLL-T2: [[IV9:%[a-z.0-9]+]] = add nuw nsw i32 [[IV8]], 1
|
||||
; CHECK-UNROLL-T2: [[IV10:%[a-z.0-9]+]] = add nuw nsw i32 [[IV9]], 1
|
||||
; CHECK-UNROLL-T2: [[IV11:%[a-z.0-9]+]] = add nuw nsw i32 [[IV10]], 1
|
||||
; CHECK-UNROLL-T2: [[IV12:%[a-z.0-9]+]] = add nuw nsw i32 [[IV11]], 1
|
||||
; CHECK-UNROLL-T2: [[IV13:%[a-z.0-9]+]] = add nuw nsw i32 [[IV12]], 1
|
||||
; CHECK-UNROLL-T2: [[IV14:%[a-z.0-9]+]] = add nuw nsw i32 [[IV13]], 1
|
||||
; CHECK-UNROLL-T2: [[IV15:%[a-z.0-9]+]] = add nuw nsw i32 [[IV14]], 1
|
||||
; CHECK-UNROLL-T2: [[IV16]] = add nuw nsw i32 [[IV15]], 1
|
||||
; CHECK-UNROLL-T2: [[CMP:%[a-z.0-9]+]] = icmp eq i32 [[IV16]], 1024
|
||||
; CHECK-UNROLL-T2: br i1 [[CMP]], label [[END:%[a-z.]+]], label %for.body
|
||||
|
||||
%i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.08
|
||||
%0 = load i32, i32* %arrayidx, align 4
|
||||
%arrayidx1 = getelementptr inbounds i32, i32* %B, i32 %i.08
|
||||
%1 = load i32, i32* %arrayidx1, align 4
|
||||
%mul = mul nsw i32 %1, %0
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %C, i32 %i.08
|
||||
store i32 %mul, i32* %arrayidx2, align 4
|
||||
%inc = add nuw nsw i32 %i.08, 1
|
||||
%exitcond = icmp eq i32 %inc, 1024
|
||||
br i1 %exitcond, label %for.cond.cleanup, label %for.body
|
||||
|
||||
for.cond.cleanup:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: runtime
|
||||
define arm_aapcs_vfpcc void @runtime(i32* nocapture %C, i32* nocapture readonly %A, i32* nocapture readonly %B, i32 %N) local_unnamed_addr #0 {
|
||||
entry:
|
||||
%cmp8 = icmp eq i32 %N, 0
|
||||
br i1 %cmp8, label %for.cond.cleanup, label %for.body
|
||||
|
||||
; CHECK-LABEL: for.body
|
||||
for.body:
|
||||
; CHECK-UNROLL-A: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, [[PRE:%[a-z.0-9]+]] ], [ [[IV2:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-A: [[IV1:%[a-z.0-9]+]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-A: [[IV2]] = add nuw i32 [[IV1]], 1
|
||||
; CHECK-UNROLL-A: br
|
||||
|
||||
; CHECK-UNROLL-T1: %i.09 = phi i32 [ %inc, %for.body ], [ 0
|
||||
; CHECK-UNROLL-T1: %inc = add nuw i32 %i.09, 1
|
||||
; CHECK-UNROLL-T1: %exitcond = icmp eq i32 %inc, %N
|
||||
; CHECK-UNROLL-T1: br
|
||||
|
||||
; CHECK-UNROLL-T2: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, [[PRE:%[a-z.0-9]+]] ], [ [[IV4:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-T2: [[IV1:%[a-z.0-9]+]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-T2: [[IV2:%[a-z.0-9]+]] = add nuw nsw i32 [[IV1]], 1
|
||||
; CHECK-UNROLL-T2: [[IV3:%[a-z.0-9]+]] = add nuw nsw i32 [[IV2]], 1
|
||||
; CHECK-UNROLL-T2: [[IV4]] = add nuw i32 [[IV3]], 1
|
||||
; CHECK-UNROLL-T2: br
|
||||
|
||||
; CHECK-UNROLL-T2: for.body.epil:
|
||||
; CHECK-UNROLL-T2: for.body.epil.1:
|
||||
; CHECK-UNROLL-T2: for.body.epil.2:
|
||||
|
||||
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.09
|
||||
%0 = load i32, i32* %arrayidx, align 4
|
||||
%arrayidx1 = getelementptr inbounds i32, i32* %B, i32 %i.09
|
||||
%1 = load i32, i32* %arrayidx1, align 4
|
||||
%mul = mul nsw i32 %1, %0
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %C, i32 %i.09
|
||||
store i32 %mul, i32* %arrayidx2, align 4
|
||||
%inc = add nuw i32 %i.09, 1
|
||||
%exitcond = icmp eq i32 %inc, %N
|
||||
br i1 %exitcond, label %for.cond.cleanup, label %for.body
|
||||
|
||||
for.cond.cleanup:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: nested_runtime
|
||||
define arm_aapcs_vfpcc void @nested_runtime(i32* nocapture %C, i16* nocapture readonly %A, i16* nocapture readonly %B, i32 %N) local_unnamed_addr #0 {
|
||||
entry:
|
||||
%cmp25 = icmp eq i32 %N, 0
|
||||
br i1 %cmp25, label %for.cond.cleanup, label %for.body4.lr.ph
|
||||
|
||||
for.body4.lr.ph:
|
||||
%h.026 = phi i32 [ %inc11, %for.cond.cleanup3 ], [ 0, %entry ]
|
||||
%mul = mul i32 %h.026, %N
|
||||
br label %for.body4
|
||||
|
||||
for.cond.cleanup:
|
||||
ret void
|
||||
|
||||
for.cond.cleanup3:
|
||||
%inc11 = add nuw i32 %h.026, 1
|
||||
%exitcond27 = icmp eq i32 %inc11, %N
|
||||
br i1 %exitcond27, label %for.cond.cleanup, label %for.body4.lr.ph
|
||||
|
||||
; CHECK-LABEL: for.body4
|
||||
for.body4:
|
||||
; CHECK-UNROLL-T1: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, [[PRE:%[a-z0-9.]+]] ], [ [[IV1:%[a-z.0-9]+]], %for.body4 ]
|
||||
; CHECK-UNROLL-T1: [[IV1]] = add nuw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-T1: br
|
||||
|
||||
; CHECK-UNROLL-T2: for.body4.epil:
|
||||
; CHECK-UNROLL-T2: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, [[PRE:%[a-z0-9.]+]] ], [ [[IV4:%[a-z.0-9]+]], %for.body4 ]
|
||||
; CHECK-UNROLL-T2: [[IV1:%[a-z.0-9]+]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-T2: [[IV2:%[a-z.0-9]+]] = add nuw nsw i32 [[IV1]], 1
|
||||
; CHECK-UNROLL-T2: [[IV3:%[a-z.0-9]+]] = add nuw nsw i32 [[IV2]], 1
|
||||
; CHECK-UNROLL-T2: [[IV4]] = add nuw i32 [[IV3]], 1
|
||||
; CHECK-UNROLL-T2: br
|
||||
; CHECK-UNROLL-T2: for.body4.epil.1:
|
||||
; CHECK-UNROLL-T2: for.body4.epil.2:
|
||||
|
||||
%w.024 = phi i32 [ 0, %for.body4.lr.ph ], [ %inc, %for.body4 ]
|
||||
%add = add i32 %w.024, %mul
|
||||
%arrayidx = getelementptr inbounds i16, i16* %A, i32 %add
|
||||
%0 = load i16, i16* %arrayidx, align 2
|
||||
%conv = sext i16 %0 to i32
|
||||
%arrayidx5 = getelementptr inbounds i16, i16* %B, i32 %w.024
|
||||
%1 = load i16, i16* %arrayidx5, align 2
|
||||
%conv6 = sext i16 %1 to i32
|
||||
%mul7 = mul nsw i32 %conv6, %conv
|
||||
%arrayidx8 = getelementptr inbounds i32, i32* %C, i32 %w.024
|
||||
%2 = load i32, i32* %arrayidx8, align 4
|
||||
%add9 = add nsw i32 %mul7, %2
|
||||
store i32 %add9, i32* %arrayidx8, align 4
|
||||
%inc = add nuw i32 %w.024, 1
|
||||
%exitcond = icmp eq i32 %inc, %N
|
||||
br i1 %exitcond, label %for.cond.cleanup3, label %for.body4
|
||||
}
|
||||
|
||||
; CHECK-LABEL: loop_call
|
||||
define arm_aapcs_vfpcc void @loop_call(i32* nocapture %C, i32* nocapture readonly %A, i32* nocapture readonly %B) local_unnamed_addr #1 {
|
||||
entry:
|
||||
br label %for.body
|
||||
|
||||
for.cond.cleanup:
|
||||
ret void
|
||||
|
||||
; CHECK-LABEL: for.body
|
||||
for.body:
|
||||
; CHECK-UNROLL-A: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, %entry ], [ [[IV1:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-A: [[IV1]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-A: icmp eq i32 [[IV1]], 1024
|
||||
; CHECK-UNROLL-A: br
|
||||
|
||||
; CHECK-UNROLL-T1: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, %entry ], [ [[IV1:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-T1: [[IV1]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-T1: icmp eq i32 [[IV1]], 1024
|
||||
; CHECK-UNROLL-T1: br
|
||||
|
||||
; CHECK-UNROLL-T2: [[IV0:%[a-z.0-9]+]] = phi i32 [ 0, %entry ], [ [[IV1:%[a-z.0-9]+]], %for.body ]
|
||||
; CHECK-UNROLL-T2: [[IV1]] = add nuw nsw i32 [[IV0]], 1
|
||||
; CHECK-UNROLL-T2: icmp eq i32 [[IV1]], 1024
|
||||
; CHECK-UNROLL-T2: br
|
||||
|
||||
%i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.08
|
||||
%0 = load i32, i32* %arrayidx, align 4
|
||||
%arrayidx1 = getelementptr inbounds i32, i32* %B, i32 %i.08
|
||||
%1 = load i32, i32* %arrayidx1, align 4
|
||||
%call = tail call arm_aapcs_vfpcc i32 @some_func(i32 %0, i32 %1) #3
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %C, i32 %i.08
|
||||
store i32 %call, i32* %arrayidx2, align 4
|
||||
%inc = add nuw nsw i32 %i.08, 1
|
||||
%exitcond = icmp eq i32 %inc, 1024
|
||||
br i1 %exitcond, label %for.cond.cleanup, label %for.body
|
||||
}
|
||||
|
||||
; CHECK-LABEL: iterate_inc
|
||||
; CHECK-UNROLL-A: %n.addr.04 = phi %struct.Node* [ %1, %while.body ], [ %n, %while.body.preheader ]
|
||||
; CHECK-UNROLL-A: %tobool = icmp eq %struct.Node* %1, null
|
||||
; CHECK-UNROLL-A: br i1 %tobool
|
||||
; CHECK-UNROLL-A-NOT: load
|
||||
|
||||
; CHECK-UNROLL-T1: %n.addr.04 = phi %struct.Node* [ %1, %while.body ], [ %n, %while.body.preheader ]
|
||||
; CHECK-UNROLL-T1: %tobool = icmp eq %struct.Node* %1, null
|
||||
; CHECK-UNROLL-T1: br i1 %tobool
|
||||
; CHECK-UNROLL-T1-NOT: load
|
||||
|
||||
; CHECK-UNROLL-T2: [[CMP0:%[a-z.0-9]+]] = icmp eq %struct.Node* [[VAR0:%[a-z.0-9]+]], null
|
||||
; CHECK-UNROLL-T2: br i1 [[CMP0]], label [[END:%[a-z.0-9]+]]
|
||||
; CHECK-UNROLL-T2: [[CMP1:%[a-z.0-9]+]] = icmp eq %struct.Node* [[VAR1:%[a-z.0-9]+]], null
|
||||
; CHECK-UNROLL-T2: br i1 [[CMP1]], label [[END]]
|
||||
; CHECK-UNROLL-T2: [[CMP2:%[a-z.0-9]+]] = icmp eq %struct.Node* [[VAR2:%[a-z.0-9]+]], null
|
||||
; CHECK-UNROLL-T2: br i1 [[CMP2]], label [[END]]
|
||||
; CHECK-UNROLL-T2: [[CMP3:%[a-z.0-9]+]] = icmp eq %struct.Node* [[VAR3:%[a-z.0-9]+]], null
|
||||
; CHECK-UNROLL-T2: br i1 [[CMP3]], label [[END]]
|
||||
; CHECK-UNROLL-T2: [[CMP4:%[a-z.0-9]+]] = icmp eq %struct.Node* [[VAR4:%[a-z.0-9]+]], null
|
||||
; CHECK-UNROLL-T2: br i1 [[CMP4]], label [[END]]
|
||||
; CHECK-UNROLL-T2-NOT: load
|
||||
|
||||
%struct.Node = type { %struct.Node*, i32 }
|
||||
|
||||
define arm_aapcscc void @iterate_inc(%struct.Node* %n) local_unnamed_addr #0 {
|
||||
entry:
|
||||
%tobool3 = icmp eq %struct.Node* %n, null
|
||||
br i1 %tobool3, label %while.end, label %while.body.preheader
|
||||
|
||||
while.body.preheader:
|
||||
br label %while.body
|
||||
|
||||
while.body:
|
||||
%n.addr.04 = phi %struct.Node* [ %1, %while.body ], [ %n, %while.body.preheader ]
|
||||
%val = getelementptr inbounds %struct.Node, %struct.Node* %n.addr.04, i32 0, i32 1
|
||||
%0 = load i32, i32* %val, align 4
|
||||
%add = add nsw i32 %0, 1
|
||||
store i32 %add, i32* %val, align 4
|
||||
%next = getelementptr inbounds %struct.Node, %struct.Node* %n.addr.04, i32 0, i32 0
|
||||
%1 = load %struct.Node*, %struct.Node** %next, align 4
|
||||
%tobool = icmp eq %struct.Node* %1, null
|
||||
br i1 %tobool, label %while.end, label %while.body
|
||||
|
||||
while.end:
|
||||
ret void
|
||||
}
|
||||
|
||||
declare arm_aapcs_vfpcc i32 @some_func(i32, i32) local_unnamed_addr #2
|
@ -1,316 +0,0 @@
|
||||
; RUN: opt -mtriple=thumbv8m.main -mcpu=cortex-m33 -loop-unroll -S < %s -o - | FileCheck %s
|
||||
; RUN: opt -mtriple=thumbv7em -mcpu=cortex-m7 -loop-unroll -S < %s -o - | FileCheck %s
|
||||
|
||||
;CHECK-LABEL: test_three_blocks
|
||||
;CHECK: for.body.epil:
|
||||
;CHECK: if.then.epil:
|
||||
;CHECK: for.inc.epil:
|
||||
;CHECK: for.body:
|
||||
;CHECK: if.then:
|
||||
;CHECK: for.inc:
|
||||
;CHECK: for.body.epil.1:
|
||||
;CHECK: if.then.epil.1:
|
||||
;CHECK: for.inc.epil.1:
|
||||
;CHECK: for.body.epil.2:
|
||||
;CHECK: if.then.epil.2:
|
||||
;CHECK: for.inc.epil.2:
|
||||
;CHECK: if.then.1:
|
||||
;CHECK: for.inc.1:
|
||||
;CHECK: if.then.2:
|
||||
;CHECK: for.inc.2:
|
||||
;CHECK: if.then.3:
|
||||
;CHECK: for.inc.3:
|
||||
define void @test_three_blocks(i32* nocapture %Output,
|
||||
i32* nocapture readonly %Condition,
|
||||
i32* nocapture readonly %Input,
|
||||
i32 %MaxJ) {
|
||||
entry:
|
||||
%cmp8 = icmp eq i32 %MaxJ, 0
|
||||
br i1 %cmp8, label %for.cond.cleanup, label %for.body.preheader
|
||||
|
||||
for.body.preheader: ; preds = %entry
|
||||
br label %for.body
|
||||
|
||||
for.cond.cleanup: ; preds = %for.inc, %entry
|
||||
%temp.0.lcssa = phi i32 [ 0, %entry ], [ %temp.1, %for.inc ]
|
||||
store i32 %temp.0.lcssa, i32* %Output, align 4
|
||||
ret void
|
||||
|
||||
for.body: ; preds = %for.body.preheader, %for.inc
|
||||
%j.010 = phi i32 [ %inc, %for.inc ], [ 0, %for.body.preheader ]
|
||||
%temp.09 = phi i32 [ %temp.1, %for.inc ], [ 0, %for.body.preheader ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %Condition, i32 %j.010
|
||||
%0 = load i32, i32* %arrayidx, align 4
|
||||
%tobool = icmp eq i32 %0, 0
|
||||
br i1 %tobool, label %for.inc, label %if.then
|
||||
|
||||
if.then: ; preds = %for.body
|
||||
%arrayidx1 = getelementptr inbounds i32, i32* %Input, i32 %j.010
|
||||
%1 = load i32, i32* %arrayidx1, align 4
|
||||
%add = add i32 %1, %temp.09
|
||||
br label %for.inc
|
||||
|
||||
for.inc: ; preds = %for.body, %if.then
|
||||
%temp.1 = phi i32 [ %add, %if.then ], [ %temp.09, %for.body ]
|
||||
%inc = add nuw i32 %j.010, 1
|
||||
%exitcond = icmp eq i32 %inc, %MaxJ
|
||||
br i1 %exitcond, label %for.cond.cleanup, label %for.body
|
||||
}
|
||||
|
||||
;CHECK-LABEL: test_two_exits
|
||||
;CHECK: for.body:
|
||||
;CHECK: if.end:
|
||||
;CHECK: cleanup.loopexit:
|
||||
;CHECK: cleanup:
|
||||
;CHECK: for.body.1:
|
||||
;CHECK: if.end.1:
|
||||
;CHECK: for.body.2:
|
||||
;CHECK: if.end.2:
|
||||
;CHECK: for.body.3:
|
||||
;CHECK: if.end.3:
|
||||
define void @test_two_exits(i32* nocapture %Output,
|
||||
i32* nocapture readonly %Condition,
|
||||
i32* nocapture readonly %Input,
|
||||
i32 %MaxJ) {
|
||||
entry:
|
||||
%cmp14 = icmp eq i32 %MaxJ, 0
|
||||
br i1 %cmp14, label %cleanup, label %for.body.preheader
|
||||
|
||||
for.body.preheader: ; preds = %entry
|
||||
br label %for.body
|
||||
|
||||
for.body: ; preds = %for.body.preheader, %if.end
|
||||
%j.016 = phi i32 [ %inc, %if.end ], [ 0, %for.body.preheader ]
|
||||
%temp.015 = phi i32 [ %temp.0.add, %if.end ], [ 0, %for.body.preheader ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %Input, i32 %j.016
|
||||
%0 = load i32, i32* %arrayidx, align 4
|
||||
%cmp1 = icmp ugt i32 %0, 65535
|
||||
br i1 %cmp1, label %cleanup, label %if.end
|
||||
|
||||
if.end: ; preds = %for.body
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %Condition, i32 %j.016
|
||||
%1 = load i32, i32* %arrayidx2, align 4
|
||||
%tobool = icmp eq i32 %1, 0
|
||||
%add = select i1 %tobool, i32 0, i32 %0
|
||||
%temp.0.add = add i32 %add, %temp.015
|
||||
%inc = add nuw i32 %j.016, 1
|
||||
%cmp = icmp ult i32 %inc, %MaxJ
|
||||
br i1 %cmp, label %for.body, label %cleanup
|
||||
|
||||
cleanup: ; preds = %if.end, %for.body, %entry
|
||||
%temp.0.lcssa = phi i32 [ 0, %entry ], [ %temp.015, %for.body ], [ %temp.0.add, %if.end ]
|
||||
store i32 %temp.0.lcssa, i32* %Output, align 4
|
||||
ret void
|
||||
}
|
||||
|
||||
;CHECK-LABEL: test_three_exits
|
||||
;CHECK-NOT: for.body.epil
|
||||
;CHECK-NOT: if.end.epil
|
||||
;CHECK-LABEL: for.body
|
||||
;CHECK-LABEL: if.end
|
||||
;CHECK-LABEL: if.end5
|
||||
define void @test_three_exits(i32* nocapture %Output,
|
||||
i32* nocapture readonly %Condition,
|
||||
i32* nocapture readonly %Input,
|
||||
i32 %MaxJ) {
|
||||
entry:
|
||||
%cmp20 = icmp eq i32 %MaxJ, 0
|
||||
br i1 %cmp20, label %cleanup, label %for.body.preheader
|
||||
|
||||
for.body.preheader: ; preds = %entry
|
||||
br label %for.body
|
||||
|
||||
for.body: ; preds = %for.body.preheader, %if.end5
|
||||
%j.022 = phi i32 [ %inc, %if.end5 ], [ 0, %for.body.preheader ]
|
||||
%temp.021 = phi i32 [ %temp.0.add, %if.end5 ], [ 0, %for.body.preheader ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %Condition, i32 %j.022
|
||||
%0 = load i32, i32* %arrayidx, align 4
|
||||
%cmp1 = icmp ugt i32 %0, 65535
|
||||
br i1 %cmp1, label %cleanup, label %if.end
|
||||
|
||||
if.end: ; preds = %for.body
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %Input, i32 %j.022
|
||||
%1 = load i32, i32* %arrayidx2, align 4
|
||||
%cmp3 = icmp ugt i32 %1, 65535
|
||||
br i1 %cmp3, label %cleanup, label %if.end5
|
||||
|
||||
if.end5: ; preds = %if.end
|
||||
%tobool = icmp eq i32 %0, 0
|
||||
%add = select i1 %tobool, i32 0, i32 %1
|
||||
%temp.0.add = add i32 %add, %temp.021
|
||||
%inc = add nuw i32 %j.022, 1
|
||||
%cmp = icmp ult i32 %inc, %MaxJ
|
||||
br i1 %cmp, label %for.body, label %cleanup
|
||||
|
||||
cleanup: ; preds = %if.end5, %for.body, %if.end, %entry
|
||||
%temp.0.lcssa = phi i32 [ 0, %entry ], [ %temp.021, %if.end ], [ %temp.021, %for.body ], [ %temp.0.add, %if.end5 ]
|
||||
store i32 %temp.0.lcssa, i32* %Output, align 4
|
||||
ret void
|
||||
}
|
||||
|
||||
;CHECK-LABEL: test_four_blocks
|
||||
;CHECK: for.body.epil:
|
||||
;CHECK: if.else.epil:
|
||||
;CHECK: if.then.epil:
|
||||
;CHECK: for.cond.cleanup:
|
||||
;CHECK: for.body:
|
||||
;CHECK: if.then:
|
||||
;CHECK: for.inc:
|
||||
;CHECK: for.body.epil.1:
|
||||
;CHECK: if.else.epil.1:
|
||||
;CHECK: if.then.epil.1:
|
||||
;CHECK: for.inc.epil.1:
|
||||
;CHECK: for.body.epil.2:
|
||||
;CHECK: if.else.epil.2:
|
||||
;CHECK: if.then.epil.2:
|
||||
;CHECK: for.inc.epil.2:
|
||||
;CHECK: if.else.1:
|
||||
;CHECK: if.then.1:
|
||||
;CHECK: for.inc.1:
|
||||
;CHECK: if.else.2:
|
||||
;CHECK: if.then.2:
|
||||
;CHECK: for.inc.2:
|
||||
;CHECK: if.else.3:
|
||||
;CHECK: if.then.3:
|
||||
;CHECK: for.inc.3:
|
||||
define void @test_four_blocks(i32* nocapture %Output,
|
||||
i32* nocapture readonly %Condition,
|
||||
i32* nocapture readonly %Input,
|
||||
i32 %MaxJ) {
|
||||
entry:
|
||||
%cmp25 = icmp ugt i32 %MaxJ, 1
|
||||
br i1 %cmp25, label %for.body.lr.ph, label %for.cond.cleanup
|
||||
|
||||
for.body.lr.ph: ; preds = %entry
|
||||
%.pre = load i32, i32* %Input, align 4
|
||||
br label %for.body
|
||||
|
||||
for.cond.cleanup: ; preds = %for.inc, %entry
|
||||
%temp.0.lcssa = phi i32 [ 0, %entry ], [ %temp.1, %for.inc ]
|
||||
store i32 %temp.0.lcssa, i32* %Output, align 4
|
||||
ret void
|
||||
|
||||
for.body: ; preds = %for.inc, %for.body.lr.ph
|
||||
%0 = phi i32 [ %.pre, %for.body.lr.ph ], [ %2, %for.inc ]
|
||||
%j.027 = phi i32 [ 1, %for.body.lr.ph ], [ %inc, %for.inc ]
|
||||
%temp.026 = phi i32 [ 0, %for.body.lr.ph ], [ %temp.1, %for.inc ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %Condition, i32 %j.027
|
||||
%1 = load i32, i32* %arrayidx, align 4
|
||||
%cmp1 = icmp ugt i32 %1, 65535
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %Input, i32 %j.027
|
||||
%2 = load i32, i32* %arrayidx2, align 4
|
||||
%cmp4 = icmp ugt i32 %2, %0
|
||||
br i1 %cmp1, label %if.then, label %if.else
|
||||
|
||||
if.then: ; preds = %for.body
|
||||
%cond = zext i1 %cmp4 to i32
|
||||
%add = add i32 %temp.026, %cond
|
||||
br label %for.inc
|
||||
|
||||
if.else: ; preds = %for.body
|
||||
%not.cmp4 = xor i1 %cmp4, true
|
||||
%sub = sext i1 %not.cmp4 to i32
|
||||
%sub10.sink = add i32 %j.027, %sub
|
||||
%arrayidx11 = getelementptr inbounds i32, i32* %Input, i32 %sub10.sink
|
||||
%3 = load i32, i32* %arrayidx11, align 4
|
||||
%sub13 = sub i32 %temp.026, %3
|
||||
br label %for.inc
|
||||
|
||||
for.inc: ; preds = %if.then, %if.else
|
||||
%temp.1 = phi i32 [ %add, %if.then ], [ %sub13, %if.else ]
|
||||
%inc = add nuw i32 %j.027, 1
|
||||
%exitcond = icmp eq i32 %inc, %MaxJ
|
||||
br i1 %exitcond, label %for.cond.cleanup, label %for.body
|
||||
}
|
||||
|
||||
;CHECK-LABEL: test_five_blocks
|
||||
;CHECK-NOT: for.body.epil:
|
||||
;CHECK: for.body:
|
||||
;CHECK: if.end:
|
||||
;CHECK: if.else:
|
||||
;CHECK: for.inc:
|
||||
;CHECK-NOT: for.inc.1:
|
||||
define void @test_five_blocks(i32* nocapture %Output,
|
||||
i32* nocapture readonly %Condition,
|
||||
i32* nocapture readonly %Input,
|
||||
i32 %MaxJ) {
|
||||
entry:
|
||||
%cmp24 = icmp ugt i32 %MaxJ, 1
|
||||
br i1 %cmp24, label %for.body.preheader, label %cleanup
|
||||
|
||||
for.body.preheader: ; preds = %entry
|
||||
br label %for.body
|
||||
|
||||
for.body: ; preds = %for.body.preheader, %for.inc
|
||||
%j.026 = phi i32 [ %inc, %for.inc ], [ 1, %for.body.preheader ]
|
||||
%temp.025 = phi i32 [ %temp.1, %for.inc ], [ 0, %for.body.preheader ]
|
||||
%arrayidx = getelementptr inbounds i32, i32* %Input, i32 %j.026
|
||||
%0 = load i32, i32* %arrayidx, align 4
|
||||
%add = add i32 %0, %temp.025
|
||||
%cmp1 = icmp ugt i32 %add, 16777215
|
||||
br i1 %cmp1, label %cleanup, label %if.end
|
||||
|
||||
if.end: ; preds = %for.body
|
||||
%arrayidx2 = getelementptr inbounds i32, i32* %Condition, i32 %j.026
|
||||
%1 = load i32, i32* %arrayidx2, align 4
|
||||
%cmp3 = icmp ugt i32 %1, 65535
|
||||
br i1 %cmp3, label %if.then4, label %if.else
|
||||
|
||||
if.then4: ; preds = %if.end
|
||||
%sub = add i32 %j.026, -1
|
||||
%arrayidx6 = getelementptr inbounds i32, i32* %Input, i32 %sub
|
||||
%2 = load i32, i32* %arrayidx6, align 4
|
||||
%cmp7 = icmp ugt i32 %0, %2
|
||||
%cond = zext i1 %cmp7 to i32
|
||||
%add8 = add i32 %add, %cond
|
||||
br label %for.inc
|
||||
|
||||
if.else: ; preds = %if.end
|
||||
%and = and i32 %add, %0
|
||||
br label %for.inc
|
||||
|
||||
for.inc: ; preds = %if.then4, %if.else
|
||||
%temp.1 = phi i32 [ %add8, %if.then4 ], [ %and, %if.else ]
|
||||
%inc = add nuw i32 %j.026, 1
|
||||
%cmp = icmp ult i32 %inc, %MaxJ
|
||||
br i1 %cmp, label %for.body, label %cleanup
|
||||
|
||||
cleanup: ; preds = %for.inc, %for.body, %entry
|
||||
%temp.2 = phi i32 [ 0, %entry ], [ %add, %for.body ], [ %temp.1, %for.inc ]
|
||||
store i32 %temp.2, i32* %Output, align 4
|
||||
ret void
|
||||
}
|
||||
|
||||
;CHECK-LABEL: iterate_inc
|
||||
;CHECK: while.body:
|
||||
;CHECK: while.end:
|
||||
;CHECK: while.body.1:
|
||||
;CHECK: while.body.2:
|
||||
;CHECK: while.body.3:
|
||||
%struct.Node = type { %struct.Node*, i32 }
|
||||
define void @iterate_inc(%struct.Node* %n, i32 %limit) {
|
||||
entry:
|
||||
%tobool5 = icmp eq %struct.Node* %n, null
|
||||
br i1 %tobool5, label %while.end, label %land.rhs.preheader
|
||||
|
||||
land.rhs.preheader: ; preds = %entry
|
||||
br label %land.rhs
|
||||
|
||||
land.rhs: ; preds = %land.rhs.preheader, %while.body
|
||||
%list.addr.06 = phi %struct.Node* [ %2, %while.body ], [ %n, %land.rhs.preheader ]
|
||||
%val = getelementptr inbounds %struct.Node, %struct.Node* %list.addr.06, i32 0, i32 1
|
||||
%0 = load i32, i32* %val, align 4
|
||||
%cmp = icmp slt i32 %0, %limit
|
||||
br i1 %cmp, label %while.body, label %while.end
|
||||
|
||||
while.body: ; preds = %land.rhs
|
||||
%inc = add nsw i32 %0, 1
|
||||
store i32 %inc, i32* %val, align 4
|
||||
%1 = bitcast %struct.Node* %list.addr.06 to %struct.Node**
|
||||
%2 = load %struct.Node*, %struct.Node** %1, align 4
|
||||
%tobool = icmp eq %struct.Node* %2, null
|
||||
br i1 %tobool, label %while.end, label %land.rhs
|
||||
|
||||
while.end: ; preds = %land.rhs, %while.body, %entry
|
||||
ret void
|
||||
}
|
Reference in New Issue
Block a user