[PATCH] D138899: [DAGCombiner] handle more store value forwarding

Roland Froese via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 10:05:07 PST 2023


RolandF added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17107
+      if (!Store)
+        continue;
+      BaseIndexOffset BasePtrLD = BaseIndexOffset::match(LD, DAG);
----------------
shchenz wrote:
> RolandF wrote:
> > If we can't make the assumption that token factor operands are unaliased, I think that the non-store path needs to be checked more strongly.  There are ways to touch memory besides stores.  I would suggest to whitelist the kinds of operands we know are safe and to otherwise give up.
> In the below `GatherAllAliases()`, it will collect all nodes in the `TokenFactor`(not limited to store) that are aliased to the candidate Store. If any nodes found except the candidate store itself, we will give up. That sounds like enough, what do you think?
ok


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138899



More information about the llvm-commits mailing list