[PATCH] D91767: [DomTree][NFC] Introduce function that finds common dom of multiple instructions

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 08:59:30 PST 2020


kuhar added a comment.

As an alternative implementation, have you considered teaching `DomTree::findNCD` to work with multiple basic blocks first, and then using this to implement the multi-instruction `findNCD`?
The algorithm would be like this: create a vector `VBB` of BB of all instructions, find its NCD, case split on the NCD and `VBB` being the same block or not.



================
Comment at: llvm/include/llvm/IR/Dominators.h:206-207
+  ///
+  /// - If there is no dominance relation between A and B's blocks, return the
+  ///   terminator of the nearest block that dominates both of them.
+  ///
----------------
Does this work for invoke instructions? I'm thinking of a situation when two instructions are in a block whose immediate dominator ends with an invoke but the invoke result is not available for these two instructions.


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

https://reviews.llvm.org/D91767



More information about the llvm-commits mailing list