With the option -basic-aa-recphi we can detect recursive phis's that loop through constant geps, which allows us to detect more no-alias case for pointer IV's. If the other phi operand and the other alias operand are MustAlias though, we cannot presume that every element in the loop is also MustAlias. We need to instead be conservative and return MayAlias.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Commit message uses "NoAlias" where it means to use "MayAlias"?
llvm/test/Analysis/BasicAA/recphi.ll | ||
---|---|---|
8 | NoAlias: float* %next, float* %src2 is actually correct; not sure how hard it would be to prove, though. |
Whoops. Yeah. MayAlias was what it was meant to say.
llvm/test/Analysis/BasicAA/recphi.ll | ||
---|---|---|
8 | Yep. I left this test in because it does show it's not always better. Like you said I'm not sure how to prove that though. It might start to need something like SCEVAA. (Although in this case with the noalias - maybe it could be simpler than that). I would like to turn this option on by default and these would all be better than (or equal) to current trunk, at least. |
llvm/lib/Analysis/BasicAliasAnalysis.cpp | ||
---|---|---|
1729 | Actually, do you also need to check for PartialAlias? |
Actually, do you also need to check for PartialAlias?