[PATCH] D113888: [SDAG] Use UnknownSize for masked load/store MMO size

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 07:36:19 PST 2021


dmgreen updated this revision to Diff 387257.
dmgreen added a comment.

Create an invalid LLT using LLT().


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113888/new/

https://reviews.llvm.org/D113888

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/test/CodeGen/Thumb2/mve-masked-store-mmo.ll


Index: llvm/test/CodeGen/Thumb2/mve-masked-store-mmo.ll
===================================================================
--- llvm/test/CodeGen/Thumb2/mve-masked-store-mmo.ll
+++ llvm/test/CodeGen/Thumb2/mve-masked-store-mmo.ll
@@ -11,15 +11,15 @@
 ; CHECK-NEXT:    adr r0, .LCPI0_0
 ; CHECK-NEXT:    vldrw.u32 q0, [r0]
 ; CHECK-NEXT:    add.w r0, sp, #2
-; CHECK-NEXT:    ldrb.w r1, [sp, #3]
 ; CHECK-NEXT:    vpst
 ; CHECK-NEXT:    vstrbt.8 q0, [r0]
-; CHECK-NEXT:    ldrb.w r2, [sp, #4]
 ; CHECK-NEXT:    ldrb.w r0, [sp, #2]
-; CHECK-NEXT:    ldrb.w r3, [sp, #10]
+; CHECK-NEXT:    ldrb.w r1, [sp, #3]
+; CHECK-NEXT:    ldrb.w r2, [sp, #4]
 ; CHECK-NEXT:    add r0, r1
-; CHECK-NEXT:    ldrb.w r1, [sp, #11]
+; CHECK-NEXT:    ldrb.w r3, [sp, #10]
 ; CHECK-NEXT:    add r0, r2
+; CHECK-NEXT:    ldrb.w r1, [sp, #11]
 ; CHECK-NEXT:    add r0, r3
 ; CHECK-NEXT:    add r0, r1
 ; CHECK-NEXT:    add sp, #12
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4336,9 +4336,7 @@
 
   MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand(
       MachinePointerInfo(PtrOperand), MachineMemOperand::MOStore,
-      // TODO: Make MachineMemOperands aware of scalable
-      // vectors.
-      VT.getStoreSize().getKnownMinSize(), *Alignment, I.getAAMetadata());
+      LLT() /* Unknown size */, *Alignment, I.getAAMetadata());
   SDValue StoreNode =
       DAG.getMaskedStore(getMemoryRoot(), sdl, Src0, Ptr, Offset, Mask, VT, MMO,
                          ISD::UNINDEXED, false /* Truncating */, IsCompressing);
@@ -4496,22 +4494,14 @@
   const MDNode *Ranges = I.getMetadata(LLVMContext::MD_range);
 
   // Do not serialize masked loads of constant memory with anything.
-  MemoryLocation ML;
-  if (VT.isScalableVector())
-    ML = MemoryLocation::getAfter(PtrOperand);
-  else
-    ML = MemoryLocation(PtrOperand, LocationSize::precise(
-                           DAG.getDataLayout().getTypeStoreSize(I.getType())),
-                           AAInfo);
+  MemoryLocation ML = MemoryLocation::getAfter(PtrOperand, AAInfo);
   bool AddToChain = !AA || !AA->pointsToConstantMemory(ML);
 
   SDValue InChain = AddToChain ? DAG.getRoot() : DAG.getEntryNode();
 
   MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand(
       MachinePointerInfo(PtrOperand), MachineMemOperand::MOLoad,
-      // TODO: Make MachineMemOperands aware of scalable
-      // vectors.
-      VT.getStoreSize().getKnownMinSize(), *Alignment, AAInfo, Ranges);
+      LLT() /* Unknown size */, *Alignment, AAInfo, Ranges);
 
   SDValue Load =
       DAG.getMaskedLoad(VT, sdl, InChain, Ptr, Offset, Mask, Src0, VT, MMO,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113888.387257.patch
Type: text/x-patch
Size: 2823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211115/76b318cb/attachment.bin>


More information about the llvm-commits mailing list