mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-19 02:08:06 +00:00
[DAG] Add canMergeStoresTo predicate checks. NFCI.
Propagate canMergeStoresTo checks to missing cases in StoreMerge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303668 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2d1ebed099
commit
91b8ce247b
@ -12616,7 +12616,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
||||
unsigned SizeInBits = (i + 1) * ElementSizeBytes * 8;
|
||||
EVT StoreTy = EVT::getIntegerVT(Context, SizeInBits);
|
||||
bool IsFast = false;
|
||||
if (TLI.isTypeLegal(StoreTy) &&
|
||||
if (TLI.isTypeLegal(StoreTy) && TLI.canMergeStoresTo(StoreTy) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFast) &&
|
||||
IsFast) {
|
||||
@ -12627,6 +12627,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
||||
EVT LegalizedStoredValueTy =
|
||||
TLI.getTypeToTransformTo(Context, StoredVal.getValueType());
|
||||
if (TLI.isTruncStoreLegal(LegalizedStoredValueTy, StoreTy) &&
|
||||
TLI.canMergeStoresTo(LegalizedStoredValueTy) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, LegalizedStoredValueTy,
|
||||
FirstStoreAS, FirstStoreAlign, &IsFast) &&
|
||||
IsFast) {
|
||||
@ -12700,7 +12701,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
||||
EVT Ty =
|
||||
EVT::getVectorVT(*DAG.getContext(), MemVT.getScalarType(), Elts);
|
||||
bool IsFast;
|
||||
if (TLI.isTypeLegal(Ty) &&
|
||||
if (TLI.isTypeLegal(Ty) && TLI.canMergeStoresTo(Ty) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, Ty, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFast) &&
|
||||
IsFast)
|
||||
@ -12809,7 +12810,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
||||
// Find a legal type for the vector store.
|
||||
EVT StoreTy = EVT::getVectorVT(Context, MemVT, i + 1);
|
||||
bool IsFastSt, IsFastLd;
|
||||
if (TLI.isTypeLegal(StoreTy) &&
|
||||
if (TLI.isTypeLegal(StoreTy) && TLI.canMergeStoresTo(StoreTy) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFastSt) &&
|
||||
IsFastSt &&
|
||||
@ -12822,7 +12823,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
||||
// Find a legal type for the integer store.
|
||||
unsigned SizeInBits = (i + 1) * ElementSizeBytes * 8;
|
||||
StoreTy = EVT::getIntegerVT(Context, SizeInBits);
|
||||
if (TLI.isTypeLegal(StoreTy) &&
|
||||
if (TLI.isTypeLegal(StoreTy) && TLI.canMergeStoresTo(StoreTy) &&
|
||||
TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
|
||||
FirstStoreAlign, &IsFastSt) &&
|
||||
IsFastSt &&
|
||||
@ -12835,6 +12836,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
|
||||
TargetLowering::TypePromoteInteger) {
|
||||
EVT LegalizedStoredValueTy = TLI.getTypeToTransformTo(Context, StoreTy);
|
||||
if (TLI.isTruncStoreLegal(LegalizedStoredValueTy, StoreTy) &&
|
||||
TLI.canMergeStoresTo(LegalizedStoredValueTy) &&
|
||||
TLI.isLoadExtLegal(ISD::ZEXTLOAD, LegalizedStoredValueTy,
|
||||
StoreTy) &&
|
||||
TLI.isLoadExtLegal(ISD::SEXTLOAD, LegalizedStoredValueTy,
|
||||
|
Loading…
x
Reference in New Issue
Block a user