This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
forked from luqmana/llvm
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIRParser: Allow regclass specification on operand
You can now define the register class of a virtual register on the operand itself avoiding the need to use a "registers:" block. Example: "%0:gr64 = COPY %rax" Differential Revision: https://reviews.llvm.org/D22398 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292321 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
7 changed files
with
154 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# RUN: llc -o - %s -mtriple=aarch64-- -run-pass=none | FileCheck %s | ||
# REQUIRES: global-isel | ||
# Test various aspects of register bank specification on machine operands. | ||
--- | | ||
define void @func() { ret void } | ||
... | ||
--- | ||
# CHECK-LABEL: name: func | ||
# CHECK: registers: | ||
# CHECK: - { id: 0, class: gpr } | ||
# CHECK: - { id: 1, class: fpr } | ||
name: func | ||
body: | | ||
bb.0: | ||
%0 : gpr(s64) = COPY %x9 | ||
%x9 = COPY %0 | ||
%3 : fpr(s64) = COPY %d0 | ||
%d1 = COPY %3 : fpr | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# RUN: not llc -o /dev/null %s -march=x86-64 -run-pass none 2>&1 | FileCheck %s | ||
# This test ensures that an error is reported for specifying the register class | ||
# of a physical register. | ||
--- | | ||
define void @t() { ret void } | ||
... | ||
--- | ||
name: t | ||
body: | | ||
bb.0: | ||
; CHECK: [[@LINE+1]]:10: register class specification expects a virtual register | ||
%eax : gr32 = COPY %rdx | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# RUN: not llc -o /dev/null %s -march=x86-64 -run-pass none 2>&1 | FileCheck %s | ||
# This test ensures that an error is reported for specifying the register class | ||
# of a physical register. | ||
--- | | ||
define void @t() { ret void } | ||
... | ||
--- | ||
name: t | ||
body: | | ||
bb.0: | ||
%0 : gr32 = COPY %rdx | ||
; CHECK: [[@LINE+1]]:24: conflicting register classes, previously: GR32 | ||
NOOP implicit %0 : gr32_abcd | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# RUN: llc -o - %s -march=x86-64 -run-pass none | FileCheck %s | ||
# Test various aspects of register class specification on machine operands. | ||
--- | | ||
define void @func() { ret void } | ||
... | ||
--- | ||
# CHECK-LABEL: name: func | ||
# CHECK: registers: | ||
# CHECK: - { id: 0, class: gr32 } | ||
# CHECK: - { id: 1, class: gr64 } | ||
# CHECK: - { id: 2, class: gr32 } | ||
# CHECK: - { id: 3, class: gr16 } | ||
name: func | ||
body: | | ||
bb.0: | ||
%0 : gr32 = COPY %rax | ||
%1.sub_32bit : gr64 = COPY %eax | ||
%rdx = COPY %1 | ||
%2 = COPY %ecx | ||
%ecx = COPY %2 : gr32 | ||
%3 : gr16 = COPY %bx | ||
%bx = COPY %3 : gr16 | ||
... |