mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[Attributor] Gracefully handle interprocedural reachability queries
This does ensure `InformationCache::getPotentiallyReachable` will not crash/assert on instructions from different functions but simply return that one is reachable, which is conservatively correct.
This commit is contained in:
parent
d03bb7e9e6
commit
8c94163113
@ -996,7 +996,9 @@ struct InformationCache {
|
||||
if (Iter != PotentiallyReachableMap.end())
|
||||
return Iter->second;
|
||||
const Function &F = *From.getFunction();
|
||||
bool Result = isPotentiallyReachable(
|
||||
bool Result = true;
|
||||
if (From.getFunction() == To.getFunction())
|
||||
Result = isPotentiallyReachable(
|
||||
&From, &To, nullptr, AG.getAnalysis<DominatorTreeAnalysis>(F),
|
||||
AG.getAnalysis<LoopAnalysis>(F));
|
||||
PotentiallyReachableMap.insert(std::make_pair(KeyPair, Result));
|
||||
|
Loading…
Reference in New Issue
Block a user