The patch adds SPIR-V specific intrinsics required to keep information critical to SPIR-V consistency (types, constants, etc.) during translation from IR to MIR. Two related passes (SPIRVEmitIntrinsics and SPIRVPreLegalizer) and several LIT tests (passed with this change) have also been added. It also fixes the issue with opaque pointers in SPIRVGlobalRegistry.cpp and the mismatch of the data layout between the SPIR-V backend and clang (Issue #55122). Differential Revision: https://reviews.llvm.org/D124416 Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com> Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com> Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com> Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
35 lines
1.2 KiB
C++
35 lines
1.2 KiB
C++
//===-- SPIRV.h - Top-level interface for SPIR-V representation -*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_SPIRV_SPIRV_H
|
|
#define LLVM_LIB_TARGET_SPIRV_SPIRV_H
|
|
|
|
#include "MCTargetDesc/SPIRVMCTargetDesc.h"
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
namespace llvm {
|
|
class SPIRVTargetMachine;
|
|
class SPIRVSubtarget;
|
|
class InstructionSelector;
|
|
class RegisterBankInfo;
|
|
|
|
FunctionPass *createSPIRVPreLegalizerPass();
|
|
FunctionPass *createSPIRVEmitIntrinsicsPass(SPIRVTargetMachine *TM);
|
|
InstructionSelector *
|
|
createSPIRVInstructionSelector(const SPIRVTargetMachine &TM,
|
|
const SPIRVSubtarget &Subtarget,
|
|
const RegisterBankInfo &RBI);
|
|
|
|
void initializeSPIRVModuleAnalysisPass(PassRegistry &);
|
|
void initializeSPIRVPreLegalizerPass(PassRegistry &);
|
|
void initializeSPIRVEmitIntrinsicsPass(PassRegistry &);
|
|
} // namespace llvm
|
|
|
|
#endif // LLVM_LIB_TARGET_SPIRV_SPIRV_H
|