summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-06 16:49:30 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-06 16:49:30 +0000
commit10fd03857fe80159c9a82802b17df693b2ea7fe0 (patch)
treeb179731404d87d1661a413551e76e54e7c4b14fb
parent6872455c6d9199e9be9bc7f931f82145045e7b2c (diff)
downloadbcm5719-llvm-10fd03857fe80159c9a82802b17df693b2ea7fe0.tar.gz
bcm5719-llvm-10fd03857fe80159c9a82802b17df693b2ea7fe0.zip
MIR Serialization: Serialize the 'non-temporal' machine memory operand flag.
llvm-svn: 244228
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.cpp1
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.h5
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp3
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp2
-rw-r--r--llvm/test/CodeGen/MIR/X86/memory-operands.mir24
5 files changed, 34 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
index 892a15f9273..47e55017f1e 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
@@ -175,6 +175,7 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) {
.Case("ppc_fp128", MIToken::kw_ppc_fp128)
.Case("target-flags", MIToken::kw_target_flags)
.Case("volatile", MIToken::kw_volatile)
+ .Case("non-temporal", MIToken::kw_non_temporal)
.Default(MIToken::Identifier);
}
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h
index 407a85a32a1..1ff7dda1151 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.h
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.h
@@ -67,6 +67,7 @@ struct MIToken {
kw_ppc_fp128,
kw_target_flags,
kw_volatile,
+ kw_non_temporal,
// Identifier tokens
Identifier,
@@ -128,7 +129,9 @@ public:
Kind == kw_early_clobber || Kind == kw_debug_use;
}
- bool isMemoryOperandFlag() const { return Kind == kw_volatile; }
+ bool isMemoryOperandFlag() const {
+ return Kind == kw_volatile || Kind == kw_non_temporal;
+ }
bool is(TokenKind K) const { return Kind == K; }
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 1596889b065..0c3f5ecce86 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -1063,6 +1063,9 @@ bool MIParser::parseMemoryOperandFlag(unsigned &Flags) {
case MIToken::kw_volatile:
Flags |= MachineMemOperand::MOVolatile;
break;
+ case MIToken::kw_non_temporal:
+ Flags |= MachineMemOperand::MONonTemporal;
+ break;
// TODO: report an error when we specify the same flag more than once.
// TODO: parse the other memory operand flags.
default:
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index a166dd58fe4..c84cec9ed2e 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -655,6 +655,8 @@ void MIPrinter::print(const MachineMemOperand &Op) {
// TODO: Print operand's other flags.
if (Op.isVolatile())
OS << "volatile ";
+ if (Op.isNonTemporal())
+ OS << "non-temporal ";
if (Op.isLoad())
OS << "load ";
else {
diff --git a/llvm/test/CodeGen/MIR/X86/memory-operands.mir b/llvm/test/CodeGen/MIR/X86/memory-operands.mir
index cc73263728e..314cc1d2871 100644
--- a/llvm/test/CodeGen/MIR/X86/memory-operands.mir
+++ b/llvm/test/CodeGen/MIR/X86/memory-operands.mir
@@ -27,6 +27,14 @@
ret i32 %1
}
+ define void @non_temporal_store(i32* %a, i32 %b) {
+ entry:
+ store i32 %b, i32* %a, align 16, !nontemporal !0
+ ret void
+ }
+
+ !0 = !{i32 1}
+
...
---
name: test
@@ -76,3 +84,19 @@ body:
- 'MOV32mr killed %rdi, 1, _, 0, _, %eax :: (volatile store 4 into %ir.x)'
- 'RETQ %eax'
...
+---
+name: non_temporal_store
+tracksRegLiveness: true
+liveins:
+ - { reg: '%rdi' }
+ - { reg: '%esi' }
+body:
+ - id: 0
+ name: entry
+ liveins: [ '%esi', '%rdi' ]
+ instructions:
+# CHECK: name: non_temporal_store
+# CHECK: MOVNTImr killed %rdi, 1, _, 0, _, killed %esi :: (non-temporal store 4 into %ir.a)
+ - 'MOVNTImr killed %rdi, 1, _, 0, _, killed %esi :: (non-temporal store 4 into %ir.a)'
+ - RETQ
+...
OpenPOWER on IntegriCloud