This patch changes MIR stack-id from an integer to an enum, and adds printing/parsing support for this in MIR files. The default stack-id '0' is now renamed to 'default'. This should make MIR tests that have stack objects with different stack-ids more descriptive. It also clarifies code operating on StackID. Reviewers: arsenm, thegameg, qcolombet Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D60137 llvm-svn: 363533
36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
|
# RUN: llc -mtriple=x86_64-linux-gnux32 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
|
|
|
|
--- |
|
|
define i32* @allocai32() {
|
|
%ptr1 = alloca i32
|
|
ret i32* %ptr1
|
|
}
|
|
|
|
...
|
|
---
|
|
name: allocai32
|
|
legalized: true
|
|
regBankSelected: true
|
|
selected: false
|
|
registers:
|
|
- { id: 0, class: gpr, preferred-register: '' }
|
|
fixedStack:
|
|
stack:
|
|
- { id: 0, name: ptr1, type: default, offset: 0, size: 4, alignment: 4,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
|
|
body: |
|
|
bb.1 (%ir-block.0):
|
|
; CHECK-LABEL: name: allocai32
|
|
; CHECK: [[LEA64_32r:%[0-9]+]]:gr32 = LEA64_32r %stack.0.ptr1, 1, $noreg, 0, $noreg
|
|
; CHECK: $eax = COPY [[LEA64_32r]]
|
|
; CHECK: RET 0, implicit $eax
|
|
%0:gpr(p0) = G_FRAME_INDEX %stack.0.ptr1
|
|
$eax = COPY %0(p0)
|
|
RET 0, implicit $eax
|
|
|
|
...
|