[llvm] r294264 - [LVI] Switch from BFS to DFS exploration order

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 16:40:02 PST 2017


On Mon, Feb 6, 2017 at 4:25 PM, Philip Reames via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: reames
> Date: Mon Feb  6 18:25:24 2017
> New Revision: 294264
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294264&view=rev
> Log:
> [LVI] Switch from BFS to DFS exploration order
>
> This patch changes the order in which LVI explores previously unexplored paths.
>
> Previously, the code used an BFS strategy where each unexplored input was added to the search queue before any of them were explored. This has the effect of causing all inputs to be explored before returning to re-evaluate the merge point (non-local or phi node). This has the unfortunate property of doing redundant work if one of the inputs to the merge is found to be overdefined (i.e. unanalysable). If any input is overdefined, the result of the merge will be too; regardless of the values of other inputs.
>
> The new code uses a DFS strategy where we re-evaluate the merge after evaluating each input. If we discover an overdefined input, we immediately return without exploring other inputs.
>
> We have reports of large (4-10x) improvements of compile time with this patch and some reports of more precise analysis results as well.  See the review discussion for details.  The original motivating case was pr10584.
>
> Differential Revision: https://reviews.llvm.org/D28190
>

Thanks!

-- 
Davide


More information about the llvm-commits mailing list