forked from OSchip/llvm-project
Add DAG argument to canMergeStoresTo NFC.
llvm-svn: 307583
This commit is contained in:
parent
f85dd9f4e5
commit
4dcad5dc6b
|
@ -415,7 +415,8 @@ public:
|
|||
virtual bool mergeStoresAfterLegalization() const { return false; }
|
||||
|
||||
/// Returns if it's reasonable to merge stores to MemVT size.
|
||||
virtual bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT) const {
|
||||
virtual bool canMergeStoresTo(unsigned AS, EVT MemVT,
|
||||
const SelectionDAG &DAG) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -12712,7 +12712,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|||
EVT StoreTy = EVT::getIntegerVT(Context, SizeInBits);
|
||||
bool IsFast = false;
|
||||
if (TLI.isTypeLegal(StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, StoreTy, DAG) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFast) &&
|
||||
IsFast) {
|
||||
|
@ -12724,7 +12724,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|||
EVT LegalizedStoredValueTy =
|
||||
TLI.getTypeToTransformTo(Context, StoredVal.getValueType());
|
||||
if (TLI.isTruncStoreLegal(LegalizedStoredValueTy, StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, LegalizedStoredValueTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, LegalizedStoredValueTy, DAG) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, LegalizedStoredValueTy,
|
||||
FirstStoreAS, FirstStoreAlign, &IsFast) &&
|
||||
IsFast) {
|
||||
|
@ -12741,7 +12741,8 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|||
!NoVectors) {
|
||||
// Find a legal type for the vector store.
|
||||
EVT Ty = EVT::getVectorVT(Context, MemVT, i + 1);
|
||||
if (TLI.isTypeLegal(Ty) && TLI.canMergeStoresTo(FirstStoreAS, Ty) &&
|
||||
if (TLI.isTypeLegal(Ty) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, Ty, DAG) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, Ty, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFast) &&
|
||||
IsFast)
|
||||
|
@ -12799,7 +12800,8 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|||
EVT Ty =
|
||||
EVT::getVectorVT(*DAG.getContext(), MemVT.getScalarType(), Elts);
|
||||
bool IsFast;
|
||||
if (TLI.isTypeLegal(Ty) && TLI.canMergeStoresTo(FirstStoreAS, Ty) &&
|
||||
if (TLI.isTypeLegal(Ty) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, Ty, DAG) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, Ty, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFast) &&
|
||||
IsFast)
|
||||
|
@ -12916,7 +12918,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|||
EVT StoreTy = EVT::getVectorVT(Context, MemVT, i + 1);
|
||||
bool IsFastSt, IsFastLd;
|
||||
if (TLI.isTypeLegal(StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, StoreTy, DAG) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFastSt) &&
|
||||
IsFastSt &&
|
||||
|
@ -12930,7 +12932,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|||
unsigned SizeInBits = (i + 1) * ElementSizeBytes * 8;
|
||||
StoreTy = EVT::getIntegerVT(Context, SizeInBits);
|
||||
if (TLI.isTypeLegal(StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, StoreTy, DAG) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFastSt) &&
|
||||
IsFastSt &&
|
||||
|
@ -12944,7 +12946,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
|||
TargetLowering::TypePromoteInteger) {
|
||||
EVT LegalizedStoredValueTy = TLI.getTypeToTransformTo(Context, StoreTy);
|
||||
if (TLI.isTruncStoreLegal(LegalizedStoredValueTy, StoreTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, LegalizedStoredValueTy) &&
|
||||
TLI.canMergeStoresTo(FirstStoreAS, LegalizedStoredValueTy, DAG) &&
|
||||
TLI.isLoadExtLegal(ISD::ZEXTLOAD, LegalizedStoredValueTy,
|
||||
StoreTy) &&
|
||||
TLI.isLoadExtLegal(ISD::SEXTLOAD, LegalizedStoredValueTy,
|
||||
|
|
|
@ -1618,7 +1618,8 @@ EVT R600TargetLowering::getSetCCResultType(const DataLayout &DL, LLVMContext &,
|
|||
return VT.changeVectorElementTypeToInteger();
|
||||
}
|
||||
|
||||
bool R600TargetLowering::canMergeStoresTo(unsigned AS, EVT MemVT) const {
|
||||
bool R600TargetLowering::canMergeStoresTo(unsigned AS, EVT MemVT,
|
||||
const SelectionDAG &DAG) const {
|
||||
// Local and Private addresses do not handle vectors. Limit to i32
|
||||
if ((AS == AMDGPUASI.LOCAL_ADDRESS || AS == AMDGPUASI.PRIVATE_ADDRESS)) {
|
||||
return (MemVT.getSizeInBits() <= 32);
|
||||
|
|
|
@ -44,7 +44,8 @@ public:
|
|||
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &,
|
||||
EVT VT) const override;
|
||||
|
||||
bool canMergeStoresTo(unsigned AS, EVT MemVT) const override;
|
||||
bool canMergeStoresTo(unsigned AS, EVT MemVT,
|
||||
const SelectionDAG &DAG) const override;
|
||||
|
||||
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS,
|
||||
unsigned Align,
|
||||
|
|
|
@ -713,7 +713,8 @@ bool SITargetLowering::isLegalAddressingMode(const DataLayout &DL,
|
|||
}
|
||||
}
|
||||
|
||||
bool SITargetLowering::canMergeStoresTo(unsigned AS, EVT MemVT) const {
|
||||
bool SITargetLowering::canMergeStoresTo(unsigned AS, EVT MemVT,
|
||||
const SelectionDAG &DAG) const {
|
||||
if (AS == AMDGPUASI.GLOBAL_ADDRESS || AS == AMDGPUASI.FLAT_ADDRESS) {
|
||||
return (MemVT.getSizeInBits() <= 4 * 32);
|
||||
} else if (AS == AMDGPUASI.PRIVATE_ADDRESS) {
|
||||
|
|
|
@ -153,7 +153,8 @@ public:
|
|||
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty,
|
||||
unsigned AS) const override;
|
||||
|
||||
bool canMergeStoresTo(unsigned AS, EVT MemVT) const override;
|
||||
bool canMergeStoresTo(unsigned AS, EVT MemVT,
|
||||
const SelectionDAG &DAG) const override;
|
||||
|
||||
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS,
|
||||
unsigned Align,
|
||||
|
|
|
@ -510,7 +510,8 @@ class InstrItineraryData;
|
|||
bool canCombineStoreAndExtract(Type *VectorTy, Value *Idx,
|
||||
unsigned &Cost) const override;
|
||||
|
||||
bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT) const override {
|
||||
bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT,
|
||||
const SelectionDAG &DAG) const override {
|
||||
// Do not merge to larger than i32.
|
||||
return (MemVT.getSizeInBits() <= 32);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue