[PATCH] D142100: [DAGCombine] Allow scalable type dead store elimination

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 08:09:32 PST 2023


sdesmalen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:19759-19764
+        if (((STBitSize >= ChainBitSize &&
+              !ST1->getMemoryVT().isScalableVector()) ||
+             (STBitSize <= ChainBitSize &&
+              !ST->getMemoryVT().isScalableVector()) ||
+             (ST->getMemoryVT().isScalableVector() &&
+              ST1->getMemoryVT().isScalableVector())) &&
----------------
sdesmalen wrote:
> This looks really confusing. You can use `TypeSize::isKnownLE`, which also returns `true` when comparing sizes with different scalable properties, e.g. `sizeof(v8i32) <= sizeof(nxv8i32)`.
> You'd just need to add an additional check that the base pointer is the same.
> 
> Ideally we'd extend BaseIndexOffset to handle scalable sizes as well, but that's quite a bit of work and may not be worth it.
For scalable vectors, can you avoid the call to STBase.contains() entirely and just check that the pointer is equal? Then you don't have to make the effort to compute the 'known' part of the STBitSize/ChainBitSize.


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

https://reviews.llvm.org/D142100



More information about the llvm-commits mailing list