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

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 01:22:26 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())) &&
----------------
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.


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

https://reviews.llvm.org/D142100



More information about the llvm-commits mailing list