[all-commits] [llvm/llvm-project] 83ae49: [basicaa] Recurse through a single phi input
Philip Reames via All-commits
all-commits at lists.llvm.org
Thu Mar 4 13:07:28 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 83ae49671dea76ded19e6c35eaafbe6c495d0e50
https://github.com/llvm/llvm-project/commit/83ae49671dea76ded19e6c35eaafbe6c495d0e50
Author: Philip Reames <listmail at philipreames.com>
Date: 2021-03-04 (Thu, 04 Mar 2021)
Changed paths:
M llvm/lib/Analysis/BasicAliasAnalysis.cpp
M llvm/test/Analysis/BasicAA/recphi.ll
Log Message:
-----------
[basicaa] Recurse through a single phi input
BasicAA knows how to analyze phis, but to control compile time, we're fairly limited in doing so. This patch loosens that restriction just slightly when there is exactly one phi input (after discounting induction variable increments). The result of this is that we can handle more cases around nested and sibling loops with pointer induction variables.
A few points to note.
* This is deliberately extremely restrictive about recursing through at most one input of the phi. There's a known general problem with BasicAA sometimes hitting exponential compile time already, and this patch makes every effort not to compound the problem. Once the root issue is fixed, we can probably loosen the restrictions here a bit.
* As seen in the test file, we're still missing cases which aren't *directly* based on phis (e.g. using the indvar increment). I believe this to be a separate problem and am going to explore this in another patch once this one lands.
* As seen in the test file, this results in the unfortunate fact that using phivalues sometimes results in worse quality results. I believe this comes down to an oversight in how recursive phi detection was implemented for phivalues. I'm happy to tackle this in a follow up change.
Differential Revision: https://reviews.llvm.org/D97401
More information about the All-commits
mailing list