Matt Arsenault 02769f2b3f AArch64/GlobalISel: Stop using legal s1 values
As far as I can tell treating s1 values as legal makes no sense. There
are no allocatable 1-bit registers. SelectionDAG legalizes the usual
set of boolean operations to 32-bits, and this should do the
same. This avoids some special case handling in the selector of s1
values, and some extra code to look through truncates.

This makes some code worse at -O0, since nothing cleans up the and 1
the artifact combiner inserts. We could probably add some
non-essential combines or teach the artifact combiner to elide
intermediates betweeen boolean uses and defs.
2022-07-08 11:55:08 -04:00

73 lines
1.3 KiB
YAML

# RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
--- |
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
define void @unconditional_br() { ret void }
define void @conditional_br() { ret void }
define void @indirect_br() { ret void }
...
---
# CHECK-LABEL: name: unconditional_br
name: unconditional_br
legalized: true
regBankSelected: true
# CHECK: body:
# CHECK: bb.0:
# CHECK: successors: %bb.0
# CHECK: B %bb.0
body: |
bb.0:
successors: %bb.0
G_BR %bb.0
...
---
# CHECK-LABEL: name: conditional_br
name: conditional_br
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
- { id: 1, class: gpr }
# CHECK: body:
# CHECK: bb.0:
# CHECK: TBNZW %1, 0, %bb.1
# CHECK: B %bb.0
body: |
bb.0:
successors: %bb.0, %bb.1
%1(s32) = COPY $w0
G_BRCOND %1, %bb.1
G_BR %bb.0
bb.1:
...
---
# CHECK-LABEL: name: indirect_br
name: indirect_br
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
# CHECK: body:
# CHECK: bb.0:
# CHECK: %0:gpr64 = COPY $x0
# CHECK: BR %0
body: |
bb.0:
successors: %bb.0, %bb.1
%0(p0) = COPY $x0
G_BRINDIRECT %0(p0)
bb.1:
...