mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Add Constant Hoisting Pass
Retry commit r200022 with a fix for the build bot errors. Constant expressions have (unlike instructions) module scope use lists and therefore may have users in different functions. The fix is to simply ignore these out-of-function uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -70,6 +70,8 @@ static cl::opt<bool> DisableMachineSink("disable-machine-sink", cl::Hidden,
|
||||
cl::desc("Disable Machine Sinking"));
|
||||
static cl::opt<bool> DisableLSR("disable-lsr", cl::Hidden,
|
||||
cl::desc("Disable Loop Strength Reduction Pass"));
|
||||
static cl::opt<bool> DisableConstantHoisting("disable-constant-hoisting",
|
||||
cl::Hidden, cl::desc("Disable ConstantHoisting"));
|
||||
static cl::opt<bool> DisableCGP("disable-cgp", cl::Hidden,
|
||||
cl::desc("Disable Codegen Prepare"));
|
||||
static cl::opt<bool> DisableCopyProp("disable-copyprop", cl::Hidden,
|
||||
@@ -396,6 +398,10 @@ void TargetPassConfig::addIRPasses() {
|
||||
|
||||
// Make sure that no unreachable blocks are instruction selected.
|
||||
addPass(createUnreachableBlockEliminationPass());
|
||||
|
||||
// Prepare expensive constants for SelectionDAG.
|
||||
if (getOptLevel() != CodeGenOpt::None && !DisableConstantHoisting)
|
||||
addPass(createConstantHoistingPass());
|
||||
}
|
||||
|
||||
/// Turn exception handling constructs into something the code generators can
|
||||
|
||||
Reference in New Issue
Block a user