[PATCH] D115036: [SelectionDAG] Use UnknownSize for VP memory ops

Simon Moll via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 03:15:26 PST 2021


simoll added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7332
     // anything.
-    MemoryLocation ML;
-    if (VT.isScalableVector())
-      ML = MemoryLocation::getAfter(PtrOperand);
-    else
-      ML = MemoryLocation(
-          PtrOperand,
-          LocationSize::precise(
-              DAG.getDataLayout().getTypeStoreSize(VPIntrin.getType())),
-          AAInfo);
+    MemoryLocation ML = MemoryLocation::getAfter(PtrOperand, AAInfo);
     AddToChain = !AA || !AA->pointsToConstantMemory(ML);
----------------
Not intimately familiar with MemoryLocations, but conceptually, for fixed size, we should be able to use an imprecise MemoryLocation here, quoting from the MemLoc header:
```
// precisely N bytes. An imprecise value is formed as the union of two or more
// precise values, and can conservatively represent all of the values unioned
// into it. Importantly, imprecise values are an *upper-bound* on the size of a
// MemoryLocation.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115036



More information about the llvm-commits mailing list