Remove unnecessary caching of the subtarget for HexagonFrameLowering and remove the unused constructor argument.

llvm-svn: 211819
This commit is contained in:
Eric Christopher 2014-06-27 00:13:47 +00:00
parent 0d0b3600d8
commit a68f376333
3 changed files with 4 additions and 8 deletions

View File

@ -165,8 +165,8 @@ void HexagonFrameLowering::emitEpilogue(MachineFunction &MF,
} }
// Replace 'jumpr r31' instruction with dealloc_return for V4 and higher // Replace 'jumpr r31' instruction with dealloc_return for V4 and higher
// versions. // versions.
if (STI.hasV4TOps() && MBBI->getOpcode() == Hexagon::JMPret if (MF.getTarget().getSubtarget<HexagonSubtarget>().hasV4TOps() &&
&& !DisableDeallocRet) { MBBI->getOpcode() == Hexagon::JMPret && !DisableDeallocRet) {
// Check for RESTORE_DEALLOC_RET_JMP_V4 call. Don't emit an extra DEALLOC // Check for RESTORE_DEALLOC_RET_JMP_V4 call. Don't emit an extra DEALLOC
// instruction if we encounter it. // instruction if we encounter it.
MachineBasicBlock::iterator BeforeJMPR = MachineBasicBlock::iterator BeforeJMPR =

View File

@ -11,20 +11,16 @@
#define HEXAGON_FRAMEINFO_H #define HEXAGON_FRAMEINFO_H
#include "Hexagon.h" #include "Hexagon.h"
#include "HexagonSubtarget.h"
#include "llvm/Target/TargetFrameLowering.h" #include "llvm/Target/TargetFrameLowering.h"
namespace llvm { namespace llvm {
class HexagonFrameLowering : public TargetFrameLowering { class HexagonFrameLowering : public TargetFrameLowering {
private: private:
const HexagonSubtarget &STI;
void determineFrameLayout(MachineFunction &MF) const; void determineFrameLayout(MachineFunction &MF) const;
public: public:
explicit HexagonFrameLowering(const HexagonSubtarget &sti) explicit HexagonFrameLowering() : TargetFrameLowering(StackGrowsDown, 8, 0) {}
: TargetFrameLowering(StackGrowsDown, 8, 0), STI(sti) {
}
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
/// the function. /// the function.

View File

@ -72,7 +72,7 @@ HexagonTargetMachine::HexagonTargetMachine(const Target &T, StringRef TT,
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
DL("e-m:e-p:32:32-i1:32-i64:64-a:0-n32"), Subtarget(TT, CPU, FS), DL("e-m:e-p:32:32-i1:32-i64:64-a:0-n32"), Subtarget(TT, CPU, FS),
InstrInfo(Subtarget), TLInfo(*this), TSInfo(*this), InstrInfo(Subtarget), TLInfo(*this), TSInfo(*this),
FrameLowering(Subtarget) { FrameLowering() {
initAsmInfo(); initAsmInfo();
} }