[PATCH] D68408: [InstCombine] Negator - sink sinkable negations

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 00:36:27 PDT 2019


lebedev.ri added a comment.

In D68408#1708655 <https://reviews.llvm.org/D68408#1708655>, @efriedma wrote:

> Hmm, that's a bit more complicated than I hoped it would be... but I don't see any obvious way to simplify it.


The one big missing thing is to use an actual worklist instead of recursion, but i'm not sure how to do that yet.

> It looks like this speculatively creates new instructions, then erases them on failure?

Yes. More specifically, while speculatively creating them, it inserts them internal worklist
and in their proper places in basic blocks. If we succeed to negate the entire tree,
that worklist is then propagated to instcombine itself.
If that doesn't happen, then they are 'trivially' dead and deleted.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68408





More information about the llvm-commits mailing list