There was an alias between 'simplifycfg' and 'simplify-cfg' in the PassRegistry. That was the original reason for this patch, which effectively removes the alias. This patch also replaces all occurrances of 'simplify-cfg' by 'simplifycfg'. Reason for choosing that form for the name is that it matches the DEBUG_TYPE for the pass, and the legacy PM name and also how it is spelled out in other passes such as 'loop-simplifycfg', and in other options such as 'simplifycfg-merge-cond-stores'. I for some reason the name should be changed to 'simplify-cfg' in the future, then I think such a renaming should be more widely done and not only impacting the PassRegistry. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D105627
47 lines
1.7 KiB
LLVM
47 lines
1.7 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -S -passes='require<opt-remark-emit>,loop-unroll<peeling;no-runtime>,simplifycfg,instcombine' -unroll-force-peel-count=3 -verify-dom-info | FileCheck %s
|
|
|
|
define void @basic(i32 %K, i32 %N) {
|
|
; CHECK-LABEL: @basic(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: br label [[OUTER:%.*]]
|
|
; CHECK: outer:
|
|
; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_INC:%.*]], [[OUTER_BACKEDGE:%.*]] ]
|
|
; CHECK-NEXT: [[CMP_INNER_PEEL8:%.*]] = icmp sgt i32 [[K:%.*]], 3
|
|
; CHECK-NEXT: br i1 [[CMP_INNER_PEEL8]], label [[INNER:%.*]], label [[OUTER_BACKEDGE]]
|
|
; CHECK: inner:
|
|
; CHECK-NEXT: [[J:%.*]] = phi i32 [ [[J_INC:%.*]], [[INNER]] ], [ 3, [[OUTER]] ]
|
|
; CHECK-NEXT: [[J_INC]] = add nuw nsw i32 [[J]], 1
|
|
; CHECK-NEXT: [[CMP_INNER:%.*]] = icmp slt i32 [[J_INC]], [[K]]
|
|
; CHECK-NEXT: br i1 [[CMP_INNER]], label [[INNER]], label [[OUTER_BACKEDGE]], [[LOOP0:!llvm.loop !.*]]
|
|
; CHECK: outer.backedge:
|
|
; CHECK-NEXT: [[I_INC]] = add i32 [[I]], 1
|
|
; CHECK-NEXT: [[CMP_OUTER:%.*]] = icmp slt i32 [[I_INC]], [[N:%.*]]
|
|
; CHECK-NEXT: br i1 [[CMP_OUTER]], label [[OUTER]], label [[END:%.*]]
|
|
; CHECK: end:
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
br label %outer
|
|
|
|
outer:
|
|
%i = phi i32 [ 0, %entry ], [ %i.inc, %outer.backedge ]
|
|
br label %inner
|
|
|
|
inner:
|
|
%j = phi i32 [ 0, %outer ], [ %j.inc, %inner ]
|
|
%j.inc = add i32 %j, 1
|
|
%cmp.inner = icmp slt i32 %j.inc, %K
|
|
br i1 %cmp.inner, label %inner, label %outer.backedge, !llvm.loop !1
|
|
|
|
outer.backedge:
|
|
%i.inc = add i32 %i, 1
|
|
%cmp.outer = icmp slt i32 %i.inc, %N
|
|
br i1 %cmp.outer, label %outer, label %end
|
|
|
|
end:
|
|
ret void
|
|
}
|
|
|
|
!1 = distinct !{!1}
|