[MachineFunctionPass] Support -filter-passes for -print-changed -filter-passes specifies a `PassID` (a lower-case dashed-separated pass name, also used by -print-after, -stop-after, etc) instead of a CamelCasePass. `-filter-passes=CamelCaseNewPMPass` seems like a workaround for new PM passes before we can use lower-case dashed-separated pass names (as used by `-passes=`). Example: ``` # getPassName() is "IRTranslator". PassID is "irtranslator" llc -mtriple=aarch64 -print-changed -filter-passes=irtranslator < print-changed-machine.ll ``` Close https://github.com/llvm/llvm-project/issues/57453 Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D133055
34 lines
1.4 KiB
LLVM
34 lines
1.4 KiB
LLVM
; REQUIRES: aarch64-registered-target
|
|
; RUN: llc -filetype=null -mtriple=aarch64 -O0 -print-changed=diff %s 2>&1 | FileCheck %s --check-prefixes=DIFF,VERBOSE
|
|
; RUN: llc -filetype=null -mtriple=aarch64 -O0 -print-changed=diff-quiet %s 2>&1 | FileCheck %s --check-prefixes=DIFF,QUIET
|
|
; RUN: llc -filetype=null -mtriple=aarch64 -O0 -print-changed=cdiff %s 2>&1 | FileCheck %s --check-prefixes=CDIFF,VERBOSE
|
|
; RUN: llc -filetype=null -mtriple=aarch64 -O0 -print-changed=cdiff-quiet %s 2>&1 | FileCheck %s --check-prefixes=CDIFF,QUIET
|
|
|
|
; VERBOSE: *** IR Dump After AArch64O0PreLegalizerCombiner (aarch64-O0-prelegalizer-combiner) on foo omitted because no change ***
|
|
; QUIET-NOT: *** {{.*}} omitted because no change ***
|
|
|
|
; DIFF: *** IR Dump After Legalizer (legalizer) on foo ***
|
|
; DIFF-NEXT: -# Machine code for function foo: IsSSA, TracksLiveness
|
|
; DIFF-NEXT: +# Machine code for function foo: IsSSA, TracksLiveness, Legalized
|
|
; DIFF-NEXT: Function Live Ins: $w0
|
|
|
|
; CDIFF: *** IR Dump After Legalizer (legalizer) on foo ***
|
|
; CDIFF-NEXT: {{.\[31m-}}# Machine code for function foo: IsSSA, TracksLiveness{{.\[0m}}
|
|
; CDIFF-NEXT: {{.\[32m\+}}# Machine code for function foo: IsSSA, TracksLiveness, Legalized{{.\[0m}}
|
|
|
|
@var = global i32 0
|
|
|
|
define void @foo(i32 %a) {
|
|
entry:
|
|
%b = add i32 %a, 1
|
|
store i32 %b, ptr @var
|
|
ret void
|
|
}
|
|
|
|
define void @bar(i32 %a) {
|
|
entry:
|
|
%b = add i32 %a, 2
|
|
store i32 %b, ptr @var
|
|
ret void
|
|
}
|