-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIRParser: Add %subreg.xxx syntax for subregister index operands
Differential Revision: http://reviews.llvm.org/D18279 llvm-svn: 264608
- Loading branch information
Showing
5 changed files
with
85 additions
and
1 deletion.
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,32 @@ | ||
# RUN: llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s 2>&1 | FileCheck %s | ||
# This test ensures that the MIR parser parses and prints subregisters index | ||
# operands correctly. | ||
|
||
--- | | ||
|
||
define zeroext i1 @t(i1 %c) { | ||
entry: | ||
ret i1 %c | ||
} | ||
|
||
... | ||
--- | ||
# CHECK-LABEL: name: t | ||
# CHECK: %0 = INSERT_SUBREG %edi, %al, {{[0-9]+}} | ||
# CHECK: %1 = EXTRACT_SUBREG %eax, {{[0-9]+}} | ||
# CHECK: %ax = REG_SEQUENCE %1, {{[0-9]+}}, %1, {{[0-9]+}} | ||
name: t | ||
isSSA: true | ||
tracksRegLiveness: true | ||
registers: | ||
- { id: 0, class: gr32 } | ||
- { id: 1, class: gr8 } | ||
body: | | ||
bb.0.entry: | ||
liveins: %edi, %eax | ||
%0 = INSERT_SUBREG %edi, %al, %subreg.sub_8bit | ||
%1 = EXTRACT_SUBREG %eax, %subreg.sub_8bit_hi | ||
%ax = REG_SEQUENCE %1, %subreg.sub_8bit, %1, %subreg.sub_8bit_hi | ||
RETQ %ax | ||
... | ||
|
26 changes: 26 additions & 0 deletions
26
llvm/test/CodeGen/MIR/X86/unknown-subregister-index-op.mir
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,26 @@ | ||
# RUN: not llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s 2>&1 | FileCheck %s | ||
# This test ensures that an error is reported when an unknown subregister index | ||
# is encountered. | ||
|
||
--- | | ||
|
||
define zeroext i1 @t(i1 %c) { | ||
entry: | ||
ret i1 %c | ||
} | ||
|
||
... | ||
--- | ||
name: t | ||
isSSA: true | ||
tracksRegLiveness: true | ||
registers: | ||
- { id: 0, class: gr32 } | ||
- { id: 1, class: gr8 } | ||
- { id: 2, class: gr8 } | ||
body: | | ||
bb.0.entry: | ||
; CHECK: [[@LINE+1]]:35: unknown subregister index 'bit8' | ||
%0 = INSERT_SUBREG %edi, %al, %subreg.bit8 | ||
RETQ %0 | ||
... |