blob: e1f949f2475cb06d513c8d5bf9250f2304ed2025 [file] [log] [blame]
Akira Hatanaka5ac065a2013-03-13 00:54:29 +00001//===-- MipsSEISelLowering.h - MipsSE DAG Lowering Interface ----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Subclass of MipsTargetLowering specialized for mips32/64.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MipsSEISELLOWERING_H
15#define MipsSEISELLOWERING_H
16
17#include "MipsISelLowering.h"
Akira Hatanakacbcdcfb2013-03-30 01:12:05 +000018#include "MipsRegisterInfo.h"
Akira Hatanaka5ac065a2013-03-13 00:54:29 +000019
20namespace llvm {
21 class MipsSETargetLowering : public MipsTargetLowering {
22 public:
23 explicit MipsSETargetLowering(MipsTargetMachine &TM);
24
25 virtual bool allowsUnalignedMemoryAccesses(EVT VT, bool *Fast) const;
26
27 virtual MachineBasicBlock *
28 EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const;
29
Akira Hatanakacbcdcfb2013-03-30 01:12:05 +000030 virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
31 if (VT == MVT::Untyped)
32 return Subtarget->hasDSP() ? &Mips::ACRegsDSPRegClass :
33 &Mips::ACRegsRegClass;
34
35 return TargetLowering::getRepRegClassFor(VT);
36 }
37
Akira Hatanaka5ac065a2013-03-13 00:54:29 +000038 private:
39 virtual bool
40 isEligibleForTailCallOptimization(const MipsCC &MipsCCInfo,
41 unsigned NextStackOffset,
42 const MipsFunctionInfo& FI) const;
43
44 virtual void
45 getOpndList(SmallVectorImpl<SDValue> &Ops,
46 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
47 bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
48 CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const;
49
50 MachineBasicBlock *emitBPOSGE32(MachineInstr *MI,
51 MachineBasicBlock *BB) const;
52 };
53}
54
55#endif // MipsSEISELLOWERING_H