[CodeGen] Pass SDAG an ORE, and replace FastISel stats with remarks.
In the long-term, we want to replace statistics with something
finer-grained that lets us gather per-function data.
Remarks are that replacement.
Create an ORE instance in SelectionDAGISel, and pass it to
SelectionDAG.
SelectionDAG was used so that we can emit remarks from all
SelectionDAG-related code, including TargetLowering and DAGCombiner.
This isn't used in the current patch but Adam tells me he's interested
for the fp-contract combines.
Use the ORE instance to emit FastISel failures as remarks (instead of
the mix of dbgs() dumps and statistics that we currently have).
Eventually, we want to have an API that tells us whether remarks are
enabled (http://llvm.org/PR32352) so that we don't emit expensive
remarks (in this case, dumping IR) when it's not needed. For now, use
'isEnabled' as a crude replacement.
This does mean that the replacement for '-fast-isel-verbose' is now
'-pass-remarks-missed=isel'. Additionally, clang users also need to
enable remark diagnostics, using '-Rpass-missed=isel'.
This also removes '-fast-isel-verbose2': there are no static statistics
that we want to only enable in asserts builds, so we can always use
the remarks regardless of the build type.
Differential Revision: https://reviews.llvm.org/D31405
llvm-svn: 299093
2017-03-31 01:49:58 +08:00
|
|
|
; RUN: llc -fast-isel -pass-remarks-missed=isel -pass-remarks-missed=isel \
|
|
|
|
; RUN: -mtriple arm64-- < %s 2> %t | FileCheck %s
|
2017-03-01 08:43:42 +08:00
|
|
|
; RUN: cat %t | FileCheck %s --check-prefix MISSED
|
|
|
|
|
|
|
|
%struct = type { [4 x i32] }
|
|
|
|
|
|
|
|
declare %struct @external()
|
|
|
|
|
|
|
|
; Check that, when fastisel falls back to SDAG, we don't emit instructions
|
|
|
|
; that follow a tail-call and would have been dropped by pure SDAGISel.
|
|
|
|
|
|
|
|
; Here, the %struct extractvalue should fail FastISel.
|
|
|
|
|
[CodeGen] Pass SDAG an ORE, and replace FastISel stats with remarks.
In the long-term, we want to replace statistics with something
finer-grained that lets us gather per-function data.
Remarks are that replacement.
Create an ORE instance in SelectionDAGISel, and pass it to
SelectionDAG.
SelectionDAG was used so that we can emit remarks from all
SelectionDAG-related code, including TargetLowering and DAGCombiner.
This isn't used in the current patch but Adam tells me he's interested
for the fp-contract combines.
Use the ORE instance to emit FastISel failures as remarks (instead of
the mix of dbgs() dumps and statistics that we currently have).
Eventually, we want to have an API that tells us whether remarks are
enabled (http://llvm.org/PR32352) so that we don't emit expensive
remarks (in this case, dumping IR) when it's not needed. For now, use
'isEnabled' as a crude replacement.
This does mean that the replacement for '-fast-isel-verbose' is now
'-pass-remarks-missed=isel'. Additionally, clang users also need to
enable remark diagnostics, using '-Rpass-missed=isel'.
This also removes '-fast-isel-verbose2': there are no static statistics
that we want to only enable in asserts builds, so we can always use
the remarks regardless of the build type.
Differential Revision: https://reviews.llvm.org/D31405
llvm-svn: 299093
2017-03-31 01:49:58 +08:00
|
|
|
; MISSED: FastISel missed: %tmp1 = extractvalue %struct %tmp0, 0
|
2017-03-01 08:43:42 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: test:
|
|
|
|
; CHECK: b external
|
|
|
|
; CHECK-NEXT: .Lfunc_end0:
|
|
|
|
define i32 @test() nounwind {
|
|
|
|
%tmp0 = tail call %struct @external()
|
|
|
|
%tmp1 = extractvalue %struct %tmp0, 0
|
|
|
|
%tmp2 = extractvalue [4 x i32] %tmp1, 0
|
|
|
|
ret i32 %tmp2
|
|
|
|
}
|