Move subtarget check upper for NEON reg-reg fixup pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85914 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2009-11-03 18:46:11 +00:00
parent ec8e1b709e
commit 747409a290
2 changed files with 4 additions and 6 deletions

View File

@ -115,7 +115,8 @@ bool ARMBaseTargetMachine::addPreEmitPass(PassManagerBase &PM,
if (OptLevel != CodeGenOpt::None) {
if (!Subtarget.isThumb1Only())
PM.add(createIfConverterPass());
PM.add(createNEONMoveFixPass());
if (Subtarget.hasNEON())
PM.add(createNEONMoveFixPass());
}
if (Subtarget.isThumb2()) {

View File

@ -35,7 +35,6 @@ namespace {
private:
const TargetRegisterInfo *TRI;
const ARMBaseInstrInfo *TII;
const ARMSubtarget *Subtarget;
typedef DenseMap<unsigned, const MachineInstr*> RegMap;
@ -71,7 +70,7 @@ bool NEONMoveFixPass::InsertMoves(MachineBasicBlock &MBB) {
Domain = ARMII::DomainNEON;
}
if ((Domain & ARMII::DomainNEON) && Subtarget->hasNEON()) {
if (Domain & ARMII::DomainNEON) {
// Convert FCPYD to VMOVD.
unsigned DestReg = MI->getOperand(0).getReg();
@ -93,8 +92,7 @@ bool NEONMoveFixPass::InsertMoves(MachineBasicBlock &MBB) {
Modified = true;
++NumVMovs;
} else {
assert((Domain & ARMII::DomainVFP ||
!Subtarget->hasNEON()) && "Invalid domain!");
assert((Domain & ARMII::DomainVFP) && "Invalid domain!");
// Do nothing.
}
}
@ -124,7 +122,6 @@ bool NEONMoveFixPass::runOnMachineFunction(MachineFunction &Fn) {
return false;
TRI = TM.getRegisterInfo();
Subtarget = &TM.getSubtarget<ARMSubtarget>();
TII = static_cast<const ARMBaseInstrInfo*>(TM.getInstrInfo());
bool Modified = false;