Files
clang-p2996/llvm/test/CodeGen/ARM/GlobalISel/select-constpool.mir
Serge Pavlov 52e5683ddd [GlobalISel][ARM] Legalization of G_CONSTANT using constant pool (#98308)
ARM uses complex encoding of immediate values using small number of
bits. As a result, some values cannot be represented as immediate
operands, they need to be synthesized in a register. This change
implements legalization of such constants with loading values from
constant pool.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2024-10-14 16:40:21 +07:00

26 lines
918 B
YAML

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
# RUN: llc -mtriple arm-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
---
name: get_const
legalized: true
regBankSelected: true
selected: false
tracksRegLiveness: true
constants:
- id: 0
value: i32 287454020
alignment: 4
isTargetSpecific: false
body: |
bb.1.entry:
; CHECK-LABEL: name: get_const
; CHECK: [[LDRcp:%[0-9]+]]:gpr = LDRcp %const.0, 0, 14 /* CC::al */, $noreg :: (load (s32) from constant-pool)
; CHECK-NEXT: $r0 = COPY [[LDRcp]]
; CHECK-NEXT: MOVPCLR 14 /* CC::al */, $noreg, implicit $r0
%1:gprb(p0) = G_CONSTANT_POOL %const.0
%0:gprb(s32) = G_LOAD %1(p0) :: (load (s32) from constant-pool)
$r0 = COPY %0(s32)
MOVPCLR 14 /* CC::al */, $noreg, implicit $r0
...