mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-22 04:05:05 +00:00
[PGO] Preserve GlobalsAA in pgo-memop-opt pass.
Preserve GlobalsAA analysis in memory intrinsic calls optimization based on profiled size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299707 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f6fa0f45a
commit
bdbfd7487e
@ -18,6 +18,7 @@
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Analysis/BlockFrequencyInfo.h"
|
||||
#include "llvm/Analysis/GlobalsModRef.h"
|
||||
#include "llvm/Analysis/IndirectCallPromotionAnalysis.h"
|
||||
#include "llvm/Analysis/IndirectCallSiteVisitor.h"
|
||||
#include "llvm/IR/BasicBlock.h"
|
||||
@ -187,6 +188,7 @@ private:
|
||||
bool runOnFunction(Function &F) override;
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const override {
|
||||
AU.addRequired<BlockFrequencyInfoWrapperPass>();
|
||||
AU.addPreserved<GlobalsAAWrapperPass>();
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
@ -1016,6 +1018,8 @@ PreservedAnalyses PGOMemOPSizeOpt::run(Function &F,
|
||||
bool Changed = PGOMemOPSizeOptImpl(F, BFI);
|
||||
if (!Changed)
|
||||
return PreservedAnalyses::all();
|
||||
return PreservedAnalyses::none();
|
||||
auto PA = PreservedAnalyses();
|
||||
PA.preserve<GlobalsAA>();
|
||||
return PA;
|
||||
}
|
||||
} // namespace llvm
|
||||
|
Loading…
x
Reference in New Issue
Block a user