mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Disable expensive two-address optimizations at -O0. rdar://10453055
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -68,6 +68,7 @@ namespace {
|
||||
MachineRegisterInfo *MRI;
|
||||
LiveVariables *LV;
|
||||
AliasAnalysis *AA;
|
||||
CodeGenOpt::Level OptLevel;
|
||||
|
||||
// DistanceMap - Keep track the distance of a MI from the start of the
|
||||
// current basic block.
|
||||
@@ -571,6 +572,9 @@ bool
|
||||
TwoAddressInstructionPass::isProfitableToCommute(unsigned regB, unsigned regC,
|
||||
MachineInstr *MI, MachineBasicBlock *MBB,
|
||||
unsigned Dist) {
|
||||
if (OptLevel == CodeGenOpt::None)
|
||||
return false;
|
||||
|
||||
// Determine if it's profitable to commute this two address instruction. In
|
||||
// general, we want no uses between this instruction and the definition of
|
||||
// the two-address register.
|
||||
@@ -1193,6 +1197,9 @@ TryInstructionTransform(MachineBasicBlock::iterator &mi,
|
||||
MachineFunction::iterator &mbbi,
|
||||
unsigned SrcIdx, unsigned DstIdx, unsigned Dist,
|
||||
SmallPtrSet<MachineInstr*, 8> &Processed) {
|
||||
if (OptLevel == CodeGenOpt::None)
|
||||
return false;
|
||||
|
||||
MachineInstr &MI = *mi;
|
||||
const MCInstrDesc &MCID = MI.getDesc();
|
||||
unsigned regA = MI.getOperand(DstIdx).getReg();
|
||||
@@ -1388,6 +1395,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
|
||||
InstrItins = TM.getInstrItineraryData();
|
||||
LV = getAnalysisIfAvailable<LiveVariables>();
|
||||
AA = &getAnalysis<AliasAnalysis>();
|
||||
OptLevel = TM.getOptLevel();
|
||||
|
||||
bool MadeChange = false;
|
||||
|
||||
|
Reference in New Issue
Block a user