R600: Always implement both versions of isTruncateFree and add a sanity check.
llvm-svn: 201222
This commit is contained in:
parent
d1afc70795
commit
53f9df4c93
|
@ -232,9 +232,15 @@ bool AMDGPUTargetLowering::isFNegFree(EVT VT) const {
|
|||
return VT == MVT::f32;
|
||||
}
|
||||
|
||||
bool AMDGPUTargetLowering::isTruncateFree(EVT, EVT Dest) const {
|
||||
bool AMDGPUTargetLowering::isTruncateFree(EVT Source, EVT Dest) const {
|
||||
// Truncate is just accessing a subregister.
|
||||
return (Dest.getSizeInBits() % 32 == 0);
|
||||
return Dest.bitsLT(Source) && (Dest.getSizeInBits() % 32 == 0);
|
||||
}
|
||||
|
||||
bool AMDGPUTargetLowering::isTruncateFree(Type *Source, Type *Dest) const {
|
||||
// Truncate is just accessing a subregister.
|
||||
return Dest->getPrimitiveSizeInBits() < Source->getPrimitiveSizeInBits() &&
|
||||
(Dest->getPrimitiveSizeInBits() % 32 == 0);
|
||||
}
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
|
|
@ -79,10 +79,11 @@ protected:
|
|||
public:
|
||||
AMDGPUTargetLowering(TargetMachine &TM);
|
||||
|
||||
virtual bool isFAbsFree(EVT VT) const;
|
||||
virtual bool isFNegFree(EVT VT) const;
|
||||
virtual bool isFAbsFree(EVT VT) const LLVM_OVERRIDE;
|
||||
virtual bool isFNegFree(EVT VT) const LLVM_OVERRIDE;
|
||||
virtual bool isTruncateFree(EVT Src, EVT Dest) const LLVM_OVERRIDE;
|
||||
virtual MVT getVectorIdxTy() const;
|
||||
virtual bool isTruncateFree(Type *Src, Type *Dest) const LLVM_OVERRIDE;
|
||||
virtual MVT getVectorIdxTy() const LLVM_OVERRIDE;
|
||||
virtual bool isLoadBitCastBeneficial(EVT, EVT) const LLVM_OVERRIDE;
|
||||
virtual SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv,
|
||||
bool isVarArg,
|
||||
|
|
Loading…
Reference in New Issue