R600: Implement isTruncateFree

Truncation is just accessing a subregister for any multiple of
the register size, so it's free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201107 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault 2014-02-10 19:57:42 +00:00
parent d5a9ea8afe
commit 700bba297b
2 changed files with 6 additions and 0 deletions

View File

@ -232,6 +232,11 @@ bool AMDGPUTargetLowering::isFNegFree(EVT VT) const {
return VT == MVT::f32;
}
bool AMDGPUTargetLowering::isTruncateFree(EVT, EVT Dest) const {
// Truncate is just accessing a subregister.
return (Dest.getSizeInBits() % 32 == 0);
}
//===---------------------------------------------------------------------===//
// TargetLowering Callbacks
//===---------------------------------------------------------------------===//

View File

@ -81,6 +81,7 @@ public:
virtual bool isFAbsFree(EVT VT) const;
virtual bool isFNegFree(EVT VT) const;
virtual bool isTruncateFree(EVT Src, EVT Dest) const LLVM_OVERRIDE;
virtual MVT getVectorIdxTy() const;
virtual bool isLoadBitCastBeneficial(EVT, EVT) const LLVM_OVERRIDE;
virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv,