[PATCH] D44564: [BasicAA] Relax restriction on PHI node handling.
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 20 04:09:52 PDT 2018
mkazantsev added inline comments.
================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:1517
bool isRecursive = false;
- for (Value *PV1 : PN->incoming_values()) {
- if (isa<PHINode>(PV1))
- // If any of the source itself is a PHI, return MayAlias conservatively
- // to avoid compile time explosion. The worst possible case is if both
- // sides are PHI nodes. In which case, this is O(m x n) time where 'm'
- // and 'n' are the number of PHI sources.
- return MayAlias;
+ unsigned phiCount = 0;
+ do {
----------------
Please follow LLVM naming convention.
================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:1553
+ // is O(m x n) time where 'm' and 'n' are the number of PHI sources.
+ if (phiCount > 0 && V1Srcs.size() > 0)
+ return MayAlias;
----------------
`V1Srcs.empty()`?
================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:1566
AliasResult Alias =
aliasCheck(V2, V2Size, V2AAInfo, V1Srcs[0],
PNSize, PNAAInfo, UnderV2);
----------------
How do we know that V1Srcs is not empty at this point?
Repository:
rL LLVM
https://reviews.llvm.org/D44564
More information about the llvm-commits
mailing list