[PATCH] D29845: [SelectionDAG] Remove redundant stores more aggressively.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 14:32:08 PST 2017


efriedma added a comment.

Ugh, studied this a bit more, this is wrong.

The problem is that TokenFactor isn't guaranteed to be the minimal set chain values.  Consider something like this:

chain1, val1 = load entrytoken...
chain2 = store chain1...
chain3 = tokenfactor chain1, chain2
chain4 = store chain3, val1, ...

The presence of chain1 in the tokenfactor is irrelevant; the only correct ordering is chain1, chain2, chain3, chain4, so chain2 might clobber the load.

I think I can come up with a more targeted fix which is correct.


Repository:
  rL LLVM

https://reviews.llvm.org/D29845





More information about the llvm-commits mailing list