[PATCH] D35623: [DAG] Fix typo preventing some stores merges to truncated stores.

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 22 19:09:23 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL308833: [DAG] Fix typo preventing some stores merges to truncated stores. (authored by niravd).

Repository:
  rL LLVM

https://reviews.llvm.org/D35623

Files:
  llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/trunk/test/CodeGen/AMDGPU/merge-stores.ll
  llvm/trunk/test/CodeGen/BPF/undef.ll


Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -12866,8 +12866,8 @@
               TLI.getTypeToTransformTo(Context, StoredVal.getValueType());
           if (TLI.isTruncStoreLegal(LegalizedStoredValueTy, StoreTy) &&
               TLI.canMergeStoresTo(FirstStoreAS, LegalizedStoredValueTy, DAG) &&
-              TLI.allowsMemoryAccess(Context, DL, LegalizedStoredValueTy,
-                                     FirstStoreAS, FirstStoreAlign, &IsFast) &&
+              TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
+                                     FirstStoreAlign, &IsFast) &&
               IsFast) {
             LastIntegerTrunc = true;
             LastLegalType = i + 1;
@@ -13098,8 +13098,8 @@
             TLI.isLoadExtLegal(ISD::SEXTLOAD, LegalizedStoredValueTy,
                                StoreTy) &&
             TLI.isLoadExtLegal(ISD::EXTLOAD, LegalizedStoredValueTy, StoreTy) &&
-            TLI.allowsMemoryAccess(Context, DL, LegalizedStoredValueTy,
-                                   FirstStoreAS, FirstStoreAlign, &IsFastSt) &&
+            TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstStoreAS,
+                                   FirstStoreAlign, &IsFastSt) &&
             IsFastSt &&
             TLI.allowsMemoryAccess(Context, DL, StoreTy, FirstLoadAS,
                                    FirstLoadAlign, &IsFastLd) &&
Index: llvm/trunk/test/CodeGen/AMDGPU/merge-stores.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/merge-stores.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/merge-stores.ll
@@ -10,8 +10,7 @@
 
 
 ; GCN-LABEL: {{^}}merge_global_store_2_constants_i8:
-; GCN: buffer_store_byte
-; GCN: buffer_store_byte
+; GCN: buffer_store_short
 ; GCN: s_endpgm
 define amdgpu_kernel void @merge_global_store_2_constants_i8(i8 addrspace(1)* %out) #0 {
   %out.gep.1 = getelementptr i8, i8 addrspace(1)* %out, i32 1
@@ -489,8 +488,7 @@
 }
 
 ; GCN-LABEL: {{^}}merge_local_store_2_constants_i8:
-; GCN: ds_write_b8
-; GCN: ds_write_b8
+; GCN: ds_write_b16
 ; GCN: s_endpgm
 define amdgpu_kernel void @merge_local_store_2_constants_i8(i8 addrspace(3)* %out) #0 {
   %out.gep.1 = getelementptr i8, i8 addrspace(3)* %out, i32 1
Index: llvm/trunk/test/CodeGen/BPF/undef.ll
===================================================================
--- llvm/trunk/test/CodeGen/BPF/undef.ll
+++ llvm/trunk/test/CodeGen/BPF/undef.ll
@@ -23,10 +23,9 @@
 ; EL: r1 = 134678021
 ; EB: r1 = 84281096
 ; CHECK: *(u32 *)(r10 - 8) = r1
-; CHECK: r1 = 9
-; CHECK: *(u8 *)(r10 - 4) = r1
-; CHECK: r1 = 10
-; CHECK: *(u8 *)(r10 - 3) = r1
+; EL: r1 = 2569
+; EB: r1 = 2314
+; CHECK: *(u16 *)(r10 - 4) = r1
 ; CHECK: *(u16 *)(r10 + 24) = r2
 ; CHECK: *(u16 *)(r10 + 22) = r2
 ; CHECK: *(u16 *)(r10 + 20) = r2


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35623.107807.patch
Type: text/x-patch
Size: 2980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170723/73dc7dd3/attachment.bin>


More information about the llvm-commits mailing list