]> granicus.if.org Git - llvm/commitdiff
[DAG] Use correct size for truncated store merge of load. NFCI.
authorNirav Dave <niravd@google.com>
Thu, 15 Jun 2017 13:28:06 +0000 (13:28 +0000)
committerNirav Dave <niravd@google.com>
Thu, 15 Jun 2017 13:28:06 +0000 (13:28 +0000)
Avoid non-legal memory ops by checking correct size when merging
stores of loads into a extload-truncstore pair.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305466 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 41cb89240524f68633a658ee0a94477871b649ca..bcec40e4f299bcc40bbac26687442f5a09714dc6 100644 (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;
       }