LLVM 20.0.0git
|
#include "SPIRV.h"
#include "SPIRVSubtarget.h"
#include "SPIRVUtils.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/IntrinsicsSPIRV.h"
#include "llvm/Target/TargetIntrinsicInfo.h"
Go to the source code of this file.
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "spirv-prelegalizer" |
#define DEBUG_TYPE "spirv-prelegalizer" |
Definition at line 26 of file SPIRVPreLegalizer.cpp.
|
static |
Definition at line 42 of file SPIRVPreLegalizer.cpp.
References llvm::SPIRVGlobalRegistry::add(), llvm::MachineInstr::addOperand(), assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::MachineOperand::CreateReg(), llvm::SPIRVGlobalRegistry::find(), llvm::SPIRVSubtarget::getInstrInfo(), llvm::MachineInstr::getOpcode(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::MachineFunction::getRegInfo(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), llvm::SmallSet< T, N, C >::insert(), llvm::isSpvIntrinsic(), llvm::Register::isValid(), MBB, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::MachineInstr::setDesc().
|
static |
Definition at line 344 of file SPIRVPreLegalizer.cpp.
References assert(), llvm::LLT::fixed_vector(), getIsFloat(), llvm::SPIRVGlobalRegistry::getPointerSize(), getRegClass(), llvm::SPIRVGlobalRegistry::getScalarOrVectorBitWidth(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::LLT::isPointer(), llvm::LLT::isVector(), MRI, llvm::LLT::pointer(), and llvm::LLT::scalar().
Referenced by llvm::processInstr().
|
static |
Definition at line 154 of file SPIRVPreLegalizer.cpp.
References llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), I, llvm::isSpvIntrinsic(), MRI, and UseMI.
Referenced by insertBitcasts().
|
static |
Definition at line 127 of file SPIRVPreLegalizer.cpp.
References assert(), llvm::SmallSet< T, N, C >::contains(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::getCImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::ConstantInt::getZExtValue(), llvm::isSpvIntrinsic(), MBB, MI, MRI, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Definition at line 437 of file SPIRVPreLegalizer.cpp.
References llvm::SPIRVGlobalRegistry::add(), llvm::addressSpaceToStorageClass(), assert(), llvm::MachineBasicBlock::begin(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::MachineBasicBlock::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::MachineBasicBlock::end(), llvm::SPIRVGlobalRegistry::find(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::MachineOperand::getCImm(), llvm::MachineOperand::getFPImm(), llvm::SPIRVSubtarget::getInstrInfo(), llvm::getMDOperandAsType(), llvm::MachineIRBuilder::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVPointerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::Value::getType(), llvm::insertAssignInstr(), llvm::isSpvIntrinsic(), llvm::Register::isValid(), llvm_unreachable, MBB, MI, MRI, llvm::post_order(), propagateSPIRVType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineIRBuilder::setInsertPt(), UseMI, and widenScalarLLTNextPow2().
|
inline |
Definition at line 311 of file SPIRVPreLegalizer.cpp.
References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), and true.
Referenced by createNewIdReg().
|
static |
Definition at line 319 of file SPIRVPreLegalizer.cpp.
References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::SPIRVGlobalRegistry::getPointerSize(), llvm::MachineOperand::getReg(), and llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg().
Referenced by createNewIdReg().
|
static |
Definition at line 168 of file SPIRVPreLegalizer.cpp.
References llvm::addressSpaceToStorageClass(), assert(), llvm::SPIRVGlobalRegistry::assignSPIRVTypeToVReg(), llvm::MachineIRBuilder::buildBitcast(), findAssignTypeInstr(), llvm::SPIRVSubtarget::getInstrInfo(), llvm::getMDOperandAsType(), llvm::MachineIRBuilder::getMF(), llvm::MachineIRBuilder::getMRI(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVPointerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::MachineFunction::getSubtarget(), llvm::isSpvIntrinsic(), MBB, MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineRegisterInfo::replaceRegWith(), and llvm::MachineIRBuilder::setInsertPt().
|
static |
Definition at line 728 of file SPIRVPreLegalizer.cpp.
References insertInlineAsmProcess(), llvm::isSpvIntrinsic(), MBB, MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), and llvm::SmallVectorBase< Size_T >::size().
|
static |
Definition at line 629 of file SPIRVPreLegalizer.cpp.
References llvm::SPIRVGlobalRegistry::add(), llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::addStringImm(), llvm::MachineInstrBuilder::addUse(), assert(), llvm::SPIRVGlobalRegistry::assignSPIRVTypeToVReg(), llvm::MachineIRBuilder::buildInstr(), llvm::InlineAsm::Extra_HasSideEffects, F, llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::getMDOperandAsType(), llvm::SPIRVGlobalRegistry::getOrCreateOpTypeFunctionWithArgs(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), llvm::Type::getVoidTy(), Idx, llvm::MachineOperand::isDef(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isMetadata(), llvm::MachineOperand::isReg(), llvm::isSpvIntrinsic(), llvm::Register::isValid(), MI, llvm::InlineAsm::MIOp_AsmString, llvm::InlineAsm::MIOp_ExtraInfo, llvm::InlineAsm::MIOp_FirstOperand, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::LLT::scalar(), llvm::MachineIRBuilder::setInsertPt(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by insertInlineAsm().
|
static |
Definition at line 750 of file SPIRVPreLegalizer.cpp.
References llvm::buildOpSpirvDecorations(), llvm::isSpvIntrinsic(), MBB, MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::MachineIRBuilder::setInsertPt().
|
static |
Definition at line 854 of file SPIRVPreLegalizer.cpp.
References llvm::MachineBasicBlock::canFallThrough(), llvm::MachineBasicBlock::empty(), llvm::isSpvIntrinsic(), MBB, llvm::MachineBasicBlock::rbegin(), and llvm::MachineBasicBlock::rend().
Referenced by removeImplicitFallthroughs().
Definition at line 53 of file SPIRVLegalizerInfo.cpp.
Referenced by processInstrsWithTypeFolding().
|
static |
Definition at line 592 of file SPIRVPreLegalizer.cpp.
References llvm::SPIRVGlobalRegistry::getPointerSize(), llvm::MachineFunction::getRegInfo(), isTypeFoldingSupported(), MBB, MI, MRI, llvm::LLT::pointer(), llvm::processInstr(), and UseMI.
|
static |
Definition at line 768 of file SPIRVPreLegalizer.cpp.
References assert(), llvm::MachineOperand::CreateCImm(), llvm::MachineOperand::CreateMBB(), llvm::Constant::destroyConstant(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::MachineBasicBlock::getBasicBlock(), llvm::MachineOperand::getBlockAddress(), llvm::Function::getContext(), llvm::getDefInstrMaybeConstant(), llvm::MachineFunction::getFunction(), llvm::Type::getInt32Ty(), llvm::ConstantExpr::getIntToPtr(), llvm::MachineInstr::getOpcode(), getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), llvm::Value::getType(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineOperand::isBlockAddress(), llvm::isSpvIntrinsic(), MBB, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::replaceAllUsesWith(), and llvm::report_fatal_error().
|
static |
Definition at line 225 of file SPIRVPreLegalizer.cpp.
References assert(), llvm::SPIRVGlobalRegistry::assignSPIRVTypeToVReg(), llvm::TypedPointerType::get(), llvm::SPIRVGlobalRegistry::getDeducedGlobalValueType(), llvm::MachineIRBuilder::getMF(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVIntegerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVVectorType(), llvm::SPIRVGlobalRegistry::getScalarOrVectorBitWidth(), llvm::SPIRVGlobalRegistry::getScalarOrVectorComponentCount(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::Global, MI, MRI, propagateSPIRVType(), llvm::MachineIRBuilder::setInsertPt(), and llvm::toTypedPointer().
Referenced by generateAssignInstrs(), and propagateSPIRVType().
|
static |
Definition at line 873 of file SPIRVPreLegalizer.cpp.
References assert(), llvm::MachineIRBuilder::buildBr(), llvm::MachineBasicBlock::end(), isImplicitFallthrough(), MBB, llvm::MachineIRBuilder::setInsertPt(), and llvm::MachineBasicBlock::successors().
|
static |
Definition at line 299 of file SPIRVPreLegalizer.cpp.
References llvm::LLT::getScalarSizeInBits(), llvm::LLT::isScalar(), llvm::Log2_32_Ceil(), MRI, and llvm::LLT::scalar().
Referenced by generateAssignInstrs().