diff options
author | Michael Maitland <michaeltmaitland@gmail.com> | 2023-11-07 14:38:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 14:38:46 -0500 |
commit | ac4ff6168ab803db282f56af05270faf916f22e2 (patch) | |
tree | fd8acb33a3f003a506912bb34c9d14b9f07e0f3e /llvm/test/MachineVerifier | |
parent | fb8ff4cdaecb7fe498d4e3a9cbcb33d40cccd29a (diff) | |
download | llvm-ac4ff6168ab803db282f56af05270faf916f22e2.zip llvm-ac4ff6168ab803db282f56af05270faf916f22e2.tar.gz llvm-ac4ff6168ab803db282f56af05270faf916f22e2.tar.bz2 |
[CodeGen][MachineVerifier] Use TypeSize instead of unsigned for getRe… (#70881)
…gSizeInBits
This patch changes getRegSizeInBits to return a TypeSize instead of an
unsigned in the case that a virtual register has a scalable LLT. In the
case that register is physical, a Fixed TypeSize is returned.
The MachineVerifier pass is updated to allow copies between fixed and
scalable operands as long as the Src size will fit into the Dest size.
This is a precommit which will be stacked on by a change to GISel to
generate COPYs with a scalable destination but a fixed size source.
This patch is stacked on https://github.com/llvm/llvm-project/pull/70893
for the ability to use scalable vector types in MIR tests.
Diffstat (limited to 'llvm/test/MachineVerifier')
-rw-r--r-- | llvm/test/MachineVerifier/copy-scalable.mir | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/MachineVerifier/copy-scalable.mir b/llvm/test/MachineVerifier/copy-scalable.mir new file mode 100644 index 0000000..f4088f7 --- /dev/null +++ b/llvm/test/MachineVerifier/copy-scalable.mir @@ -0,0 +1,23 @@ +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3 +# RUN: llc -mtriple=riscv64 -o - -global-isel -run-pass=none -verify-machineinstrs %s | FileCheck %s +# REQUIRES: riscv64-registered-target + +--- +name: test_copy_fixed_to_scalable +legalized: true +regBankSelected: false +selected: false +tracksRegLiveness: true +registers: + - { id: 0, class: _, preferred-register: '' } +liveins: +body: | + bb.0: + liveins: $v8 + + ; CHECK-LABEL: name: test_copy_fixed_to_scalable + ; CHECK: liveins: $v8 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<vscale x 1 x s8>) = COPY $v8 + %0:_(<vscale x 1 x s8>) = COPY $v8 +... |