[llvm] r294407 - [X86] Add test for clflushopt intrinsic and only enable it to be selected if the feature flag is set.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 21:45:46 PST 2017
Author: ctopper
Date: Tue Feb 7 23:45:46 2017
New Revision: 294407
URL: http://llvm.org/viewvc/llvm-project?rev=294407&view=rev
Log:
[X86] Add test for clflushopt intrinsic and only enable it to be selected if the feature flag is set.
Added:
llvm/trunk/test/CodeGen/X86/clflushopt.ll
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.td
llvm/trunk/lib/Target/X86/X86Subtarget.h
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=294407&r1=294406&r2=294407&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Feb 7 23:45:46 2017
@@ -862,6 +862,7 @@ def HasMWAITX : Predicate<"Subtarget-
def FPStackf32 : Predicate<"!Subtarget->hasSSE1()">;
def FPStackf64 : Predicate<"!Subtarget->hasSSE2()">;
def HasMPX : Predicate<"Subtarget->hasMPX()">;
+def HasCLFLUSHOPT : Predicate<"Subtarget->hasCLFLUSHOPT()">;
def HasCmpxchg16b: Predicate<"Subtarget->hasCmpxchg16b()">;
def Not64BitMode : Predicate<"!Subtarget->is64Bit()">,
AssemblerPredicate<"!Mode64Bit", "Not 64-bit mode">;
@@ -2529,6 +2530,7 @@ let Predicates = [HasTBM] in {
// Memory Instructions
//
+let Predicates = [HasCLFLUSHOPT] in
def CLFLUSHOPT : I<0xAE, MRM7m, (outs), (ins i8mem:$src),
"clflushopt\t$src", [(int_x86_clflushopt addr:$src)]>, PD;
def CLWB : I<0xAE, MRM6m, (outs), (ins i8mem:$src), "clwb\t$src", []>, PD;
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=294407&r1=294406&r2=294407&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Tue Feb 7 23:45:46 2017
@@ -487,6 +487,7 @@ public:
bool hasVLX() const { return HasVLX; }
bool hasPKU() const { return HasPKU; }
bool hasMPX() const { return HasMPX; }
+ bool hasCLFLUSHOPT() const { return HasCLFLUSHOPT; }
bool isXRaySupported() const override { return is64Bit(); }
Added: llvm/trunk/test/CodeGen/X86/clflushopt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/clflushopt.ll?rev=294407&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/clflushopt.ll (added)
+++ llvm/trunk/test/CodeGen/X86/clflushopt.ll Tue Feb 7 23:45:46 2017
@@ -0,0 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=clflushopt | FileCheck %s
+
+define void @clflushopt(i8* %p) nounwind {
+; CHECK-LABEL: clflushopt:
+; CHECK: ## BB#0:
+; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT: clflushopt (%eax)
+; CHECK-NEXT: retl
+ tail call void @llvm.x86.clflushopt(i8* %p)
+ ret void
+}
+declare void @llvm.x86.clflushopt(i8*) nounwind
More information about the llvm-commits
mailing list