1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

[PM] ADCE: Fix caching of analyses.

When this pass was originally ported, AA wasn't available for the
new PM. Now it is, so we can cache properly.

llvm-svn: 271303
This commit is contained in:
Davide Italiano 2016-05-31 17:39:39 +00:00
parent fb52d15569
commit 1f02b1c024

View File

@ -146,9 +146,14 @@ static bool aggressiveDCE(Function& F) {
}
PreservedAnalyses ADCEPass::run(Function &F) {
if (aggressiveDCE(F))
return PreservedAnalyses::none();
return PreservedAnalyses::all();
if (!aggressiveDCE(F))
return PreservedAnalyses::all();
// FIXME: ADCE should also 'preserve the CFG'.
// The new pass manager has currently no way to do it.
auto PA = PreservedAnalyses();
PA.preserve<GlobalsAA>();
return PA;
}
namespace {