add cmd line opt to disable frame index reuse for ARM and T2. debug aid.

llvm-svn: 84664
This commit is contained in:
Jim Grosbach 2009-10-20 20:19:50 +00:00
parent ac741ffd44
commit f3a2b6499e
1 changed files with 7 additions and 0 deletions

View File

@ -36,8 +36,13 @@
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
#include "llvm/ADT/BitVector.h" #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm; using namespace llvm;
static cl::opt<bool>
ReuseFrameIndexVals("arm-reuse-frame-index-vals", cl::Hidden, cl::init(true),
cl::desc("Reuse repeated frame index values"));
unsigned ARMBaseRegisterInfo::getRegisterNumbering(unsigned RegEnum, unsigned ARMBaseRegisterInfo::getRegisterNumbering(unsigned RegEnum,
bool *isSPVFP) { bool *isSPVFP) {
if (isSPVFP) if (isSPVFP)
@ -1088,6 +1093,8 @@ ARMBaseRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
Offset, Pred, PredReg, TII); Offset, Pred, PredReg, TII);
} }
MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true); MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true);
if (!ReuseFrameIndexVals)
ScratchReg = 0;
} }
return ScratchReg; return ScratchReg;
} }