[DAG] Use correct size for truncated store merge of load. NFCI.

Avoid non-legal memory ops by checking correct size when merging
stores of loads into a extload-truncstore pair.

llvm-svn: 305466
This commit is contained in:
Nirav Dave 2017-06-15 13:28:06 +00:00
parent 56912cda71
commit 9a4998980d
1 changed files with 2 additions and 2 deletions

View File

@ -12959,8 +12959,8 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
TLI.allowsMemoryAccess(Context, DL, LegalizedStoredValueTy,
FirstStoreAS, FirstStoreAlign, &IsFastSt) &&
IsFastSt &&
TLI.allowsMemoryAccess(Context, DL, LegalizedStoredValueTy,
FirstLoadAS, FirstLoadAlign, &IsFastLd) &&
TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstLoadAS,
FirstLoadAlign, &IsFastLd) &&
IsFastLd)
LastLegalIntegerType = i + 1;
}