2017-10-19 01:33:31 +02:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
[tablegen][globalisel] Add support for nested instruction matching.
Summary:
Lift the restrictions that prevented the tree walking introduced in the
previous change and add support for patterns like:
(G_ADD (G_MUL (G_SEXT $src1), (G_SEXT $src2)), $src3) -> SMADDWrrr $dst, $src1, $src2, $src3
Also adds support for G_SEXT and G_ZEXT to support these cases.
One particular aspect of this that I should draw attention to is that I've
tried to be overly conservative in determining the safety of matches that
involve non-adjacent instructions and multiple basic blocks. This is intended
to be used as a cheap initial check and we may add a more expensive check in
the future. The current rules are:
* Reject if any instruction may load/store (we'd need to check for intervening
memory operations.
* Reject if any instruction has implicit operands.
* Reject if any instruction has unmodelled side-effects.
See isObviouslySafeToFold().
Reviewers: t.p.northover, javed.absar, qcolombet, aditya_nandakumar, ab, rovka
Reviewed By: ab
Subscribers: igorb, dberris, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D30539
llvm-svn: 299430
2017-04-04 15:25:23 +02:00
|
|
|
# RUN: llc -O0 -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
--- |
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
|
|
|
|
|
|
|
define void @SMADDLrrr_gpr() { ret void }
|
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: SMADDLrrr_gpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
- { id: 2, class: gpr }
|
|
|
|
- { id: 3, class: gpr }
|
|
|
|
- { id: 4, class: gpr }
|
|
|
|
- { id: 5, class: gpr }
|
|
|
|
- { id: 6, class: gpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: %x0, %w1, %w2
|
|
|
|
|
2017-10-19 01:33:31 +02:00
|
|
|
; CHECK-LABEL: name: SMADDLrrr_gpr
|
2017-10-24 20:04:54 +02:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY %x0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY %w1
|
|
|
|
; CHECK: [[COPY2:%[0-9]+]]:gpr32 = COPY %w2
|
|
|
|
; CHECK: [[SMADDLrrr:%[0-9]+]]:gpr64 = SMADDLrrr [[COPY1]], [[COPY2]], [[COPY]]
|
2017-10-19 01:33:31 +02:00
|
|
|
; CHECK: %x0 = COPY [[SMADDLrrr]]
|
[tablegen][globalisel] Add support for nested instruction matching.
Summary:
Lift the restrictions that prevented the tree walking introduced in the
previous change and add support for patterns like:
(G_ADD (G_MUL (G_SEXT $src1), (G_SEXT $src2)), $src3) -> SMADDWrrr $dst, $src1, $src2, $src3
Also adds support for G_SEXT and G_ZEXT to support these cases.
One particular aspect of this that I should draw attention to is that I've
tried to be overly conservative in determining the safety of matches that
involve non-adjacent instructions and multiple basic blocks. This is intended
to be used as a cheap initial check and we may add a more expensive check in
the future. The current rules are:
* Reject if any instruction may load/store (we'd need to check for intervening
memory operations.
* Reject if any instruction has implicit operands.
* Reject if any instruction has unmodelled side-effects.
See isObviouslySafeToFold().
Reviewers: t.p.northover, javed.absar, qcolombet, aditya_nandakumar, ab, rovka
Reviewed By: ab
Subscribers: igorb, dberris, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D30539
llvm-svn: 299430
2017-04-04 15:25:23 +02:00
|
|
|
%0(s64) = COPY %x0
|
|
|
|
%1(s32) = COPY %w1
|
|
|
|
%2(s32) = COPY %w2
|
|
|
|
%3(s64) = G_SEXT %1
|
|
|
|
%4(s64) = G_SEXT %2
|
|
|
|
%5(s64) = G_MUL %3, %4
|
|
|
|
%6(s64) = G_ADD %0, %5
|
|
|
|
%x0 = COPY %6
|
|
|
|
...
|
|
|
|
|