mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
2a2896669d
Being lazy with printing the banner seems hard to reason with, we should print it unconditionally first (it could also lead to duplicate banners if we have multiple functions in -filter-print-funcs). The printIR() functions were doing too many things. I separated out the call from PrintPassInstrumentation since we were essentially doing two completely separate things in printIR() from different callers. There were multiple ways to generate the name of some IR. That's all been moved to getIRName(). The printing of the IR name was also inconsistent, now it's always "IR Dump on $foo" where "$foo" is the name. For a function, it's the function name. For a loop, it's what's printed by Loop::print(), which is more detailed. For an SCC, it's the list of functions in parentheses. For a module it's "[module]", to differentiate between a possible SCC with a function called "module". To preserve D74814, we have to check if we're going to print anything at all first. This is unfortunate, but I would consider this a special case that shouldn't be handled in the core logic. Reviewed By: jamieschmeiser Differential Revision: https://reviews.llvm.org/D100231
29 lines
1.1 KiB
LLVM
29 lines
1.1 KiB
LLVM
; Make sure that Loop which was invalidated by loop-deletion
|
|
; does not lead to problems for -print-after-all and is just skipped.
|
|
;
|
|
; RUN: opt < %s -disable-output \
|
|
; RUN: -passes=loop-instsimplify -print-after-all 2>&1 | FileCheck %s -check-prefix=SIMPLIFY
|
|
; RUN: opt < %s -disable-output \
|
|
; RUN: -passes=loop-deletion,loop-instsimplify -print-after-all 2>&1 | FileCheck %s -check-prefix=DELETED
|
|
; RUN: opt < %s -disable-output \
|
|
; RUN: -passes=loop-deletion,loop-instsimplify -print-after-all -print-module-scope 2>&1 | FileCheck %s -check-prefix=DELETED-BUT-PRINTED
|
|
;
|
|
; SIMPLIFY: IR Dump {{.*}} LoopInstSimplifyPass
|
|
; DELETED-NOT: IR Dump {{.*}}LoopInstSimplifyPass
|
|
; DELETED-NOT: IR Dump {{.*}}LoopDeletionPass
|
|
; DELETED-BUT-PRINTED: IR Dump {{.*}}LoopDeletionPass {{.*}}(invalidated)
|
|
; DELETED-BUT-PRINTED-NOT: IR Dump {{.*}}LoopInstSimplifyPass
|
|
|
|
define void @deleteme() {
|
|
entry:
|
|
br label %loop
|
|
loop:
|
|
%iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
|
|
%iv.next = add i32 %iv, 1
|
|
%check = icmp ult i32 %iv.next, 3
|
|
br i1 %check, label %loop, label %exit
|
|
exit:
|
|
ret void
|
|
}
|
|
|