[llvm] r244228 - MIR Serialization: Serialize the 'non-temporal' machine memory operand flag.

Alex Lorenz via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 09:49:31 PDT 2015


Author: arphaman
Date: Thu Aug  6 11:49:30 2015
New Revision: 244228

URL: http://llvm.org/viewvc/llvm-project?rev=244228&view=rev
Log:
MIR Serialization: Serialize the 'non-temporal' machine memory operand flag.

Modified:
    llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp
    llvm/trunk/lib/CodeGen/MIRParser/MILexer.h
    llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp
    llvm/trunk/lib/CodeGen/MIRPrinter.cpp
    llvm/trunk/test/CodeGen/MIR/X86/memory-operands.mir

Modified: llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp?rev=244228&r1=244227&r2=244228&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp Thu Aug  6 11:49:30 2015
@@ -175,6 +175,7 @@ static MIToken::TokenKind getIdentifierK
       .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);
 }
 

Modified: llvm/trunk/lib/CodeGen/MIRParser/MILexer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MILexer.h?rev=244228&r1=244227&r2=244228&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MILexer.h (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MILexer.h Thu Aug  6 11:49:30 2015
@@ -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; }
 

Modified: llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp?rev=244228&r1=244227&r2=244228&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp Thu Aug  6 11:49:30 2015
@@ -1063,6 +1063,9 @@ bool MIParser::parseMemoryOperandFlag(un
   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:

Modified: llvm/trunk/lib/CodeGen/MIRPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRPrinter.cpp?rev=244228&r1=244227&r2=244228&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRPrinter.cpp Thu Aug  6 11:49:30 2015
@@ -655,6 +655,8 @@ void MIPrinter::print(const MachineMemOp
   // TODO: Print operand's other flags.
   if (Op.isVolatile())
     OS << "volatile ";
+  if (Op.isNonTemporal())
+    OS << "non-temporal ";
   if (Op.isLoad())
     OS << "load ";
   else {

Modified: llvm/trunk/test/CodeGen/MIR/X86/memory-operands.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MIR/X86/memory-operands.mir?rev=244228&r1=244227&r2=244228&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/MIR/X86/memory-operands.mir (original)
+++ llvm/trunk/test/CodeGen/MIR/X86/memory-operands.mir Thu Aug  6 11:49:30 2015
@@ -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
+...




More information about the llvm-commits mailing list