Provide an implementation of getNoopForMachoTarget for SPARC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217611 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brad Smith 2014-09-11 17:40:51 +00:00
parent 31b1bdbd95
commit da9bce2e13
3 changed files with 15 additions and 0 deletions

View File

@ -37,6 +37,11 @@ SparcInstrInfo::SparcInstrInfo(SparcSubtarget &ST)
RI(ST), Subtarget(ST) {
}
/// getNoopForMachoTarget - Return the noop instruction to use for a noop.
void SparcInstrInfo::getNoopForMachoTarget(MCInst &NopInst) const {
NopInst.setOpcode(SP::NOP);
}
/// isLoadFromStackSlot - If the specified machine instruction is a direct
/// load from a stack slot, return the virtual or physical register number of
/// the destination along with the FrameIndex of the loaded stack slot. If

View File

@ -93,6 +93,8 @@ public:
const TargetRegisterInfo *TRI) const override;
unsigned getGlobalBaseReg(MachineFunction *MF) const;
void getNoopForMachoTarget(MCInst &NopInst) const override;
};
}

View File

@ -0,0 +1,8 @@
; RUN: llc < %s -mtriple=sparc-unknown-openbsd -disable-fp-elim | FileCheck -check-prefix=CHECK-FP-LABEL %s
define void @func() {
entry:
unreachable
}
; CHECK-FP-LABEL: {{_?}}func:
; CHECK-FP-LABEL: nop {{[;!]}} avoids zero-length function