Cazalet-Hyams, Orlando via llvm-dev
2020-Oct-21 15:03 UTC
[llvm-dev] How to determine the most-immediate dominator from a set?
Hi llvm-dev, Given an instruction, is there a standard way in llvm, such as a function or methodology, to determine its most-immediate dominator from a set? Many thanks, Orlando -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201021/0ee04250/attachment.html>
Jakub (Kuba) Kuderski via llvm-dev
2020-Oct-21 19:08 UTC
[llvm-dev] How to determine the most-immediate dominator from a set?
Hi Orlando, If I understand correctly, you should be able to use `DT::findNearestCommonDominator` [1]. Because this function takes 2 blocks at a time, you'd need to call it in a loop. Basically NCD(B1, B2, B3, ...) = NCD(NCD(B1, B2), B3, ...). Sincerely, Jakub [1] https://llvm.org/doxygen/classllvm_1_1DominatorTreeBase.html#af555c3593d46d5f057fbebc8d292eac8 On Wed, Oct 21, 2020 at 11:03 AM Cazalet-Hyams, Orlando via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi llvm-dev, > > > > Given an instruction, is there a standard way in llvm, such as a function > or > > methodology, to determine its most-immediate dominator from a set? > > Many thanks, > > Orlando > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Jakub Kuderski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201021/a39c3f72/attachment.html>
Cazalet-Hyams, Orlando via llvm-dev
2020-Oct-22 08:31 UTC
[llvm-dev] How to determine the most-immediate dominator from a set?
That looks useful, thanks for the help. Orlando From: Jakub (Kuba) Kuderski <kubakuderski at gmail.com> Sent: 21 October 2020 20:09 To: Cazalet-Hyams, Orlando <orlando.hyams at sony.com> Cc: llvm-dev at lists.llvm.org Subject: Re: [llvm-dev] How to determine the most-immediate dominator from a set? Hi Orlando, If I understand correctly, you should be able to use `DT::findNearestCommonDominator` [1]. Because this function takes 2 blocks at a time, you'd need to call it in a loop. Basically NCD(B1, B2, B3, ...) = NCD(NCD(B1, B2), B3, ...). Sincerely, Jakub [1] https://llvm.org/doxygen/classllvm_1_1DominatorTreeBase.html#af555c3593d46d5f057fbebc8d292eac8 On Wed, Oct 21, 2020 at 11:03 AM Cazalet-Hyams, Orlando via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Hi llvm-dev, Given an instruction, is there a standard way in llvm, such as a function or methodology, to determine its most-immediate dominator from a set? Many thanks, Orlando _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -- Jakub Kuderski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201022/8ab290f3/attachment.html>