aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp
blob: b18a673912f89295f9328f18b5ae3ea130db1e92 (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
//===----------------------------------------------------------------------===//
// Instruction Selector Subtarget Control
//===----------------------------------------------------------------------===//

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

#include "Mips.h"
#include "MipsTargetMachine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"

using namespace llvm;

#define DEBUG_TYPE "mips-isel"

namespace {
  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;
  };

  char MipsModuleDAGToDAGISel::ID = 0;
}

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

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