LLVM  4.0.0
ARMLegalizerInfo.cpp
Go to the documentation of this file.
1 //===- ARMLegalizerInfo.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 ARM.
11 /// \todo This should be generated by TableGen.
12 //===----------------------------------------------------------------------===//
13 
14 #include "ARMLegalizerInfo.h"
16 #include "llvm/IR/DerivedTypes.h"
17 #include "llvm/IR/Type.h"
19 
20 using namespace llvm;
21 
22 #ifndef LLVM_BUILD_GLOBAL_ISEL
23 #error "You shouldn't build this"
24 #endif
25 
27  using namespace TargetOpcode;
28 
29  const LLT p0 = LLT::pointer(0, 32);
30 
31  const LLT s8 = LLT::scalar(8);
32  const LLT s16 = LLT::scalar(16);
33  const LLT s32 = LLT::scalar(32);
34 
35  setAction({G_FRAME_INDEX, p0}, Legal);
36 
37  setAction({G_LOAD, s32}, Legal);
38  setAction({G_LOAD, 1, p0}, Legal);
39 
40  for (auto Ty : {s8, s16, s32})
41  setAction({G_ADD, Ty}, Legal);
42 
43  computeTables();
44 }
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".
Definition: LowLevelType.h:51
This file declares the targeting of the Machinelegalizer class for ARM.
The operation is expected to be selectable directly by the target, and no transformation is necessary...
Definition: LegalizerInfo.h:54
static LLT pointer(uint16_t AddressSpace, unsigned SizeInBits)
Get a low-level pointer in the given address space (defaulting to 0).
Definition: LowLevelType.h:57
void setAction(const InstrAspect &Aspect, LegalizeAction Action)
More friendly way to set an action for common types that have an LLT representation.