LLVM  7.0.0
MipsLegalizerInfo.cpp
Go to the documentation of this file.
1 //===- MipsLegalizerInfo.cpp ------------------------------------*- 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 /// \file
10 /// This file implements the targeting of the Machinelegalizer class for Mips.
11 /// \todo This should be generated by TableGen.
12 //===----------------------------------------------------------------------===//
13 
14 #include "MipsLegalizerInfo.h"
15 #include "MipsTargetMachine.h"
16 
17 using namespace llvm;
18 
20  using namespace TargetOpcode;
21 
22  const LLT s32 = LLT::scalar(32);
23  const LLT p0 = LLT::pointer(0, 32);
24 
26 
27  getActionDefinitionsBuilder({G_LOAD, G_STORE})
28  .legalForCartesianProduct({p0, s32}, {p0});
29 
30  getActionDefinitionsBuilder(G_CONSTANT)
31  .legalFor({s32});
32 
34  .legalFor({{p0, s32}});
35 
36  getActionDefinitionsBuilder(G_FRAME_INDEX)
37  .legalFor({p0});
38 
39  getActionDefinitionsBuilder(G_GLOBAL_VALUE)
40  .legalFor({p0});
41 
42  computeTables();
43  verify(*ST.getInstrInfo());
44 }
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
MipsLegalizerInfo(const MipsSubtarget &ST)
const MipsInstrInfo * getInstrInfo() const override
This file declares the targeting of the Machinelegalizer class for Mips.
void verify(const MCInstrInfo &MII) const
Perform simple self-diagnostic and assert if there is anything obviously wrong with the actions set u...
void computeTables()
Compute any ancillary tables needed to quickly decide how an operation should be handled.
static LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
LegalizeRuleSet & getActionDefinitionsBuilder(unsigned Opcode)
Get the action definition builder for the given opcode.
LegalizeRuleSet & legalFor(std::initializer_list< LLT > Types)
The instruction is legal when type index 0 is any type in the given list.
static LLT pointer(uint16_t AddressSpace, unsigned SizeInBits)
Get a low-level pointer in the given address space (defaulting to 0).