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:
parent
fb52d15569
commit
1f02b1c024
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user