summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp
blob: a6b6c5ab9f087516fb2ee98f4e2d06cb89a8cee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//===----------------------------------------------------------------------===//
// Instruction Selector Subtarget Control
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
// This file defines a pass used to change the subtarget for the
// Mips Instruction selector.
//
//===----------------------------------------------------------------------===//

#include "MipsISelDAGToDAG.h"
#include "MipsModuleISelDAGToDAG.h"
#include "MipsTargetMachine.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;

#define DEBUG_TYPE "mips-isel"

namespace {
//===----------------------------------------------------------------------===//
// MipsModuleDAGToDAGISel - MIPS specific code to select MIPS machine
// instructions for SelectionDAG operations.
//===----------------------------------------------------------------------===//
class MipsModuleDAGToDAGISel : public MachineFunctionPass {
public:

  static char ID;

  explicit MipsModuleDAGToDAGISel(MipsTargetMachine &TM_)
      : MachineFunctionPass(ID), TM(TM_) {}

  // Pass Name
  const char *getPassName() const override {
    return "MIPS DAG->DAG Pattern Instruction Selection";
  }

  bool runOnMachineFunction(MachineFunction &MF) override;

protected:
  MipsTargetMachine &TM;
};
} // namespace

bool MipsModuleDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
  DEBUG(errs() << "In MipsModuleDAGToDAGISel::runMachineFunction\n");
  TM.resetSubtarget(&MF);
  return false;
}

char MipsModuleDAGToDAGISel::ID = 0;

llvm::FunctionPass *llvm::createMipsModuleISelDag(MipsTargetMachine &TM) {
  return new MipsModuleDAGToDAGISel(TM);
}


OpenPOWER on IntegriCloud