Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIR] Add support for printing and parsing target MMO flags
Summary: Add target hooks for printing and parsing target MMO flags. Targets may override getSerializableMachineMemOperandTargetFlags() to return a mapping from string to flag value for target MMO values that should be serialized/parsed in MIR output. Add implementation of this hook for AArch64 SuppressPair MMO flag. Reviewers: bogner, hfinkel, qcolombet, MatzeB Subscribers: mcrosier, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D34962 llvm-svn: 307877
- Loading branch information
1 parent
02d34ad
commit 6748abe
Showing
10 changed files
with
135 additions
and
6 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
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
19 changes: 19 additions & 0 deletions
19
llvm/test/CodeGen/MIR/AArch64/invalid-target-memoperands.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,19 @@ | ||
# RUN: not llc -mtriple=aarch64-none-linux-gnu -run-pass none -o /dev/null %s 2>&1 | FileCheck %s | ||
|
||
--- | | ||
|
||
define void @target_memoperands_error() { | ||
ret void | ||
} | ||
|
||
... | ||
--- | ||
name: target_memoperands_error | ||
body: | | ||
bb.0: | ||
%0:_(p0) = COPY %x0 | ||
; CHECK: [[@LINE+1]]:35: use of undefined target MMO flag 'aarch64-invalid' | ||
%1:_(s64) = G_LOAD %0(p0) :: ("aarch64-invalid" load 8) | ||
RET_ReallyLR | ||
... |
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,22 @@ | ||
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s | ||
|
||
--- | | ||
|
||
define void @target_memoperands() { | ||
ret void | ||
} | ||
|
||
... | ||
--- | ||
# CHECK-LABEL: name: target_memoperands | ||
# CHECK: %1(s64) = G_LOAD %0(p0) :: ("aarch64-suppress-pair" load 8) | ||
# CHECK: G_STORE %1(s64), %0(p0) :: ("aarch64-suppress-pair" store 8) | ||
name: target_memoperands | ||
body: | | ||
bb.0: | ||
%0:_(p0) = COPY %x0 | ||
%1:_(s64) = G_LOAD %0(p0) :: ("aarch64-suppress-pair" load 8) | ||
G_STORE %1(s64), %0(p0) :: ("aarch64-suppress-pair" store 8) | ||
RET_ReallyLR | ||
... |