[PATCH] D65141: [DivergenceAnalysis] Add methods for querying divergence at use

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 05:41:18 PDT 2019


nhaehnle accepted this revision.
nhaehnle added a comment.
This revision is now accepted and ready to land.

I do prefer the explicit `isDivergentUse`!

To @arsenm 's question: at least for the SelectionDAG, the key is in `SITargetLowering::isSDNodeSourceOfDivergence`, which calls `isDivergent` on a value.

The way the SelectionDAG works, we have in our hands at this point a live value that comes into a basic block via a register. This suggests an `isDivergentInBB`. Would it be possible to do that instead / on top? For the new DA this seems very natural, and for the old DA this seems at least possible by storing a set of divergent (Value, BasicBlock) pairs instead of divergent uses. Alternatively, we'd have to scan the uses for one that lives in the appropriate basic block, which is slow since it means traversing a linked list... or perhaps there are other thoughts on this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65141





More information about the llvm-commits mailing list