[PATCH] D21789: [LLVM][INTRINSICS] adding intrinsics of CLFLUSHOPT

michael zuckerman via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 3 07:00:15 PDT 2016


m_zuckerman updated this revision to Diff 62629.

http://reviews.llvm.org/D21789

Files:
  include/llvm/IR/IntrinsicsX86.td
  lib/Target/X86/X86InstrInfo.td
  test/CodeGen/X86/clflushopt.ll

Index: test/CodeGen/X86/clflushopt.ll
===================================================================
--- test/CodeGen/X86/clflushopt.ll
+++ test/CodeGen/X86/clflushopt.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -mtriple=i686-unknown-unknown -show-mc-encoding   | FileCheck %s
+
+define void @test_clflushopt(i8* %ptr) {
+; CHECK-LABEL: test_clflushopt
+; CHECK: clflushopt      (%eax)          # encoding: [0x66,0x0f,0xae,0x38]
+  call void @llvm.x86.clflushopt(i8* %ptr)
+  ret void;
+}
+declare void @llvm.x86.clflushopt(i8*)
Index: lib/Target/X86/X86InstrInfo.td
===================================================================
--- lib/Target/X86/X86InstrInfo.td
+++ lib/Target/X86/X86InstrInfo.td
@@ -2514,7 +2514,7 @@
 //
 
 def CLFLUSHOPT : I<0xAE, MRM7m, (outs), (ins i8mem:$src),
-                   "clflushopt\t$src", []>, PD;
+                   "clflushopt\t$src", [(int_x86_clflushopt addr:$src)]>, PD;
 def CLWB       : I<0xAE, MRM6m, (outs), (ins i8mem:$src), "clwb\t$src", []>, PD;
 def PCOMMIT    : I<0xAE, MRM_F8, (outs), (ins), "pcommit", []>, PD;
 
Index: include/llvm/IR/IntrinsicsX86.td
===================================================================
--- include/llvm/IR/IntrinsicsX86.td
+++ include/llvm/IR/IntrinsicsX86.td
@@ -4292,6 +4292,13 @@
 }
 
 //===----------------------------------------------------------------------===//
+// CLFLUSHOPT
+let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
+  def int_x86_clflushopt : GCCBuiltin<"__builtin_ia32_clflushopt">,
+              Intrinsic<[], [llvm_ptr_ty], []>;
+}
+
+//===----------------------------------------------------------------------===//
 // Support protection key
 let TargetPrefix = "x86" in {  // All intrinsics start with "llvm.x86.".
   def int_x86_rdpkru : GCCBuiltin <"__builtin_ia32_rdpkru">,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21789.62629.patch
Type: text/x-patch
Size: 1819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160703/1e3f4655/attachment.bin>


More information about the llvm-commits mailing list