LLVM  15.0.0git
SPIRVISelLowering.h
Go to the documentation of this file.
1 //===-- SPIRVISelLowering.h - SPIR-V DAG Lowering Interface -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the interfaces that SPIR-V uses to lower LLVM code into a
10 // selection DAG.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_SPIRV_SPIRVISELLOWERING_H
15 #define LLVM_LIB_TARGET_SPIRV_SPIRVISELLOWERING_H
16 
18 
19 namespace llvm {
20 class SPIRVSubtarget;
21 
23 public:
24  explicit SPIRVTargetLowering(const TargetMachine &TM,
25  const SPIRVSubtarget &STI)
26  : TargetLowering(TM) {}
27 
28  // Stop IRTranslator breaking up FMA instrs to preserve types information.
30  EVT) const override {
31  return true;
32  }
33 
34  // This is to prevent sexts of non-i64 vector indices which are generated
35  // within general IRTranslator hence type generation for it is omitted.
36  MVT getVectorIdxTy(const DataLayout &DL) const override {
37  return MVT::getIntegerVT(32);
38  }
40  CallingConv::ID CC,
41  EVT VT) const override;
43  EVT VT) const override;
44 };
45 } // namespace llvm
46 
47 #endif // LLVM_LIB_TARGET_SPIRV_SPIRVISELLOWERING_H
llvm::SPIRVTargetLowering::SPIRVTargetLowering
SPIRVTargetLowering(const TargetMachine &TM, const SPIRVSubtarget &STI)
Definition: SPIRVISelLowering.h:24
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:113
llvm::SPIRVTargetLowering::getNumRegistersForCallingConv
unsigned getNumRegistersForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override
Certain targets require unusual breakdowns of certain types.
Definition: SPIRVISelLowering.cpp:20
llvm::SPIRVTargetLowering::isFMAFasterThanFMulAndFAdd
bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF, EVT) const override
Return true if an FMA operation is faster than a pair of fmul and fadd instructions.
Definition: SPIRVISelLowering.h:29
llvm::SPIRVSubtarget
Definition: SPIRVSubtarget.h:36
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
TargetLowering.h
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:34
llvm::TargetLowering
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Definition: TargetLowering.h:3415
llvm::SPIRVTargetLowering::getVectorIdxTy
MVT getVectorIdxTy(const DataLayout &DL) const override
Returns the type to be used for the index operand of: ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT...
Definition: SPIRVISelLowering.h:36
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::SPIRVTargetLowering
Definition: SPIRVISelLowering.h:22
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:31
llvm::MachineFunction
Definition: MachineFunction.h:257
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::SPIRVTargetLowering::getRegisterTypeForCallingConv
MVT getRegisterTypeForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override
Certain combinations of ABIs, Targets and features require that types are legal for some operations a...
Definition: SPIRVISelLowering.cpp:32
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::MVT::getIntegerVT
static MVT getIntegerVT(unsigned BitWidth)
Definition: MachineValueType.h:1193