mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
[MergedLoadStoreMotion] Move pass enabling option to PassManagerBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217538 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -70,6 +70,10 @@ static cl::opt<bool> UseCFLAA("use-cfl-aa",
|
|||||||
cl::init(false), cl::Hidden,
|
cl::init(false), cl::Hidden,
|
||||||
cl::desc("Enable the new, experimental CFL alias analysis"));
|
cl::desc("Enable the new, experimental CFL alias analysis"));
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
EnableMLSM("mlsm", cl::desc("Enable motion of merged load and store"),
|
||||||
|
cl::init(true));
|
||||||
|
|
||||||
PassManagerBuilder::PassManagerBuilder() {
|
PassManagerBuilder::PassManagerBuilder() {
|
||||||
OptLevel = 2;
|
OptLevel = 2;
|
||||||
SizeLevel = 0;
|
SizeLevel = 0;
|
||||||
@@ -228,7 +232,8 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
|
|||||||
addExtensionsToPM(EP_LoopOptimizerEnd, MPM);
|
addExtensionsToPM(EP_LoopOptimizerEnd, MPM);
|
||||||
|
|
||||||
if (OptLevel > 1) {
|
if (OptLevel > 1) {
|
||||||
MPM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamond
|
if (EnableMLSM)
|
||||||
|
MPM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds
|
||||||
MPM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies
|
MPM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies
|
||||||
}
|
}
|
||||||
MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
|
MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
|
||||||
@@ -388,7 +393,8 @@ void PassManagerBuilder::addLTOOptimizationPasses(PassManagerBase &PM) {
|
|||||||
PM.add(createGlobalsModRefPass()); // IP alias analysis.
|
PM.add(createGlobalsModRefPass()); // IP alias analysis.
|
||||||
|
|
||||||
PM.add(createLICMPass()); // Hoist loop invariants.
|
PM.add(createLICMPass()); // Hoist loop invariants.
|
||||||
PM.add(createMergedLoadStoreMotionPass()); // Merge load/stores in diamonds
|
if (EnableMLSM)
|
||||||
|
PM.add(createMergedLoadStoreMotionPass()); // Merge ld/st in diamonds.
|
||||||
PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
|
PM.add(createGVNPass(DisableGVNLoadPRE)); // Remove redundancies.
|
||||||
PM.add(createMemCpyOptPass()); // Remove dead memcpys.
|
PM.add(createMemCpyOptPass()); // Remove dead memcpys.
|
||||||
|
|
||||||
|
@@ -97,9 +97,6 @@ using namespace llvm;
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// MergedLoadStoreMotion Pass
|
// MergedLoadStoreMotion Pass
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
static cl::opt<bool>
|
|
||||||
EnableMLSM("mlsm", cl::desc("Enable motion of merged load and store"),
|
|
||||||
cl::init(true));
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class MergedLoadStoreMotion : public FunctionPass {
|
class MergedLoadStoreMotion : public FunctionPass {
|
||||||
@@ -611,8 +608,6 @@ bool MergedLoadStoreMotion::runOnFunction(Function &F) {
|
|||||||
AA = &getAnalysis<AliasAnalysis>();
|
AA = &getAnalysis<AliasAnalysis>();
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
if (!EnableMLSM)
|
|
||||||
return false;
|
|
||||||
DEBUG(dbgs() << "Instruction Merger\n");
|
DEBUG(dbgs() << "Instruction Merger\n");
|
||||||
|
|
||||||
// Merge unconditional branches, allowing PRE to catch more
|
// Merge unconditional branches, allowing PRE to catch more
|
||||||
|
Reference in New Issue
Block a user