From 258320134e59c1838e1b663cde08f5f0442ab5bf Mon Sep 17 00:00:00 2001 From: Nirav Dave Date: Thu, 15 Jun 2017 13:28:06 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305466 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 41cb8924052..bcec40e4f29 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -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; } -- 2.50.1