From de3869437d361f3501ed95b810ec5a7cdf0d6298 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 10 Sep 2015 00:53:15 +0000 Subject: [PATCH] [CodeGen] Make x86 nontemporal store patfrags generic. NFC. To be used by other targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247225 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetSelectionDAG.td | 18 ++++++++++++++++++ lib/Target/X86/X86InstrFragmentsSIMD.td | 19 ------------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/include/llvm/Target/TargetSelectionDAG.td b/include/llvm/Target/TargetSelectionDAG.td index db5041b19d0..7432cde7a2e 100644 --- a/include/llvm/Target/TargetSelectionDAG.td +++ b/include/llvm/Target/TargetSelectionDAG.td @@ -910,6 +910,24 @@ def post_truncstf32 : PatFrag<(ops node:$val, node:$base, node:$offset), return cast(N)->getMemoryVT() == MVT::f32; }]>; +// nontemporal store fragments. +def nontemporalstore : PatFrag<(ops node:$val, node:$ptr), + (store node:$val, node:$ptr), [{ + return cast(N)->isNonTemporal(); +}]>; + +def alignednontemporalstore : PatFrag<(ops node:$val, node:$ptr), + (nontemporalstore node:$val, node:$ptr), [{ + StoreSDNode *St = cast(N); + return St->getAlignment() >= St->getMemoryVT().getStoreSize(); +}]>; + +def unalignednontemporalstore : PatFrag<(ops node:$val, node:$ptr), + (nontemporalstore node:$val, node:$ptr), [{ + StoreSDNode *St = cast(N); + return St->getAlignment() < St->getMemoryVT().getStoreSize(); +}]>; + // setcc convenience fragments. def setoeq : PatFrag<(ops node:$lhs, node:$rhs), (setcc node:$lhs, node:$rhs, SETOEQ)>; diff --git a/lib/Target/X86/X86InstrFragmentsSIMD.td b/lib/Target/X86/X86InstrFragmentsSIMD.td index 73653202382..3abdb2ab5fa 100644 --- a/lib/Target/X86/X86InstrFragmentsSIMD.td +++ b/lib/Target/X86/X86InstrFragmentsSIMD.td @@ -619,25 +619,6 @@ def memop64 : PatFrag<(ops node:$ptr), (load node:$ptr), [{ def memopmmx : PatFrag<(ops node:$ptr), (x86mmx (memop64 node:$ptr))>; -// MOVNT Support -// Like 'store', but requires the non-temporal bit to be set -def nontemporalstore : PatFrag<(ops node:$val, node:$ptr), - (store node:$val, node:$ptr), [{ - return cast(N)->isNonTemporal(); -}]>; - -def alignednontemporalstore : PatFrag<(ops node:$val, node:$ptr), - (nontemporalstore node:$val, node:$ptr), [{ - StoreSDNode *St = cast(N); - return St->getAlignment() >= St->getMemoryVT().getStoreSize(); -}]>; - -def unalignednontemporalstore : PatFrag<(ops node:$val, node:$ptr), - (nontemporalstore node:$val, node:$ptr), [{ - StoreSDNode *St = cast(N); - return St->getAlignment() < St->getMemoryVT().getStoreSize(); -}]>; - def mgatherv4i32 : PatFrag<(ops node:$src1, node:$src2, node:$src3), (masked_gather node:$src1, node:$src2, node:$src3) , [{ if (MaskedGatherSDNode *Mgt = dyn_cast(N)) -- 2.34.1