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 168 of file SPIRVPreLegalizer.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addUse(), assert(), llvm::MachineIRBuilder::buildInstr(), llvm::MachineIRBuilder::getMRI(), llvm::SPIRVGlobalRegistry::getRegClass(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), llvm::SPIRVGlobalRegistry::isBitcastCompatible(), MRI, and llvm::report_fatal_error().
Referenced by selectOpBitcasts().
|
static |
Definition at line 856 of file SPIRVPreLegalizer.cpp.
References llvm::isSpvIntrinsic(), MBB, MI, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Definition at line 678 of file SPIRVPreLegalizer.cpp.
References F, llvm::MachineOperand::getImm(), llvm::MachineOperand::getReg(), Idx, llvm::MachineOperand::isDef(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isMetadata(), llvm::MachineOperand::isReg(), MI, and llvm::InlineAsm::MIOp_FirstOperand.
Referenced by insertInlineAsmProcess().
|
static |
Definition at line 382 of file SPIRVPreLegalizer.cpp.
References llvm::SPIRVGlobalRegistry::getRegClass(), llvm::SPIRVGlobalRegistry::getRegType(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), and MRI.
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 476 of file SPIRVPreLegalizer.cpp.
References llvm::SPIRVGlobalRegistry::add(), llvm::addressSpaceToStorageClass(), llvm::SPIRVGlobalRegistry::addValueAttrs(), 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::MachineOperand::getMetadata(), llvm::MachineIRBuilder::getMF(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MDNode::getOperand(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVPointerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::Value::getType(), llvm::getVRegDef(), I, 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().
|
static |
Definition at line 222 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, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::MachineIRBuilder::setInsertPt().
|
static |
Definition at line 782 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 707 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(), collectInlineAsmInstrOperands(), llvm::InlineAsm::Extra_HasSideEffects, llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::getMDOperandAsType(), llvm::SPIRVGlobalRegistry::getOrCreateOpTypeFunctionWithArgs(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::MachineFunction::getRegInfo(), llvm::SPIRVGlobalRegistry::getSPIRVTypeID(), llvm::Type::getVoidTy(), llvm::isSpvIntrinsic(), llvm::Register::isValid(), MI, llvm::InlineAsm::MIOp_AsmString, llvm::InlineAsm::MIOp_ExtraInfo, 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 804 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 973 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 60 of file SPIRVLegalizerInfo.cpp.
Referenced by processInstrsWithTypeFolding().
|
static |
Definition at line 872 of file SPIRVPreLegalizer.cpp.
References assert(), 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::BlockAddress::getBasicBlock(), llvm::MachineOperand::getBlockAddress(), llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::Type::getInt32Ty(), llvm::ConstantExpr::getIntToPtr(), llvm::MachineInstr::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(), llvm::report_fatal_error(), and llvm::SmallVectorBase< Size_T >::size().
|
static |
Definition at line 667 of file SPIRVPreLegalizer.cpp.
References llvm::MachineFunction::getRegInfo(), isTypeFoldingSupported(), MBB, MI, MRI, and llvm::processInstr().
|
static |
Definition at line 823 of file SPIRVPreLegalizer.cpp.
References assert(), llvm::MachineOperand::CreateCImm(), llvm::MachineOperand::getCImm(), llvm::getDefInstrMaybeConstant(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), llvm::isSpvIntrinsic(), MBB, MI, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
|
static |
Definition at line 280 of file SPIRVPreLegalizer.cpp.
References llvm::addressSpaceToStorageClass(), assert(), llvm::SPIRVGlobalRegistry::assignSPIRVTypeToVReg(), llvm::TypedPointerType::get(), llvm::LLT::getAddressSpace(), llvm::SPIRVGlobalRegistry::getDeducedGlobalValueType(), llvm::MachineIRBuilder::getMF(), llvm::MachineInstr::getOpcode(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVIntegerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVPointerType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVType(), llvm::SPIRVGlobalRegistry::getOrCreateSPIRVVectorType(), llvm::SPIRVGlobalRegistry::getPointeeType(), llvm::SPIRVGlobalRegistry::getPointerStorageClass(), llvm::SPIRVGlobalRegistry::getRegClass(), llvm::SPIRVGlobalRegistry::getScalarOrVectorBitWidth(), llvm::SPIRVGlobalRegistry::getScalarOrVectorComponentCount(), llvm::SPIRVGlobalRegistry::getSPIRVTypeForVReg(), llvm::Global, llvm::LLT::isPointer(), MI, MRI, propagateSPIRVType(), llvm::MachineIRBuilder::setInsertPt(), llvm::storageClassToAddressSpace(), and llvm::toTypedPointer().
Referenced by generateAssignInstrs(), and propagateSPIRVType().
|
static |
Definition at line 992 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 205 of file SPIRVPreLegalizer.cpp.
References buildOpBitcast(), MBB, MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::MachineIRBuilder::setInsertPt().
|
static |
Definition at line 403 of file SPIRVPreLegalizer.cpp.
References llvm::MachineBasicBlock::end(), MBB, and llvm::MachineIRBuilder::setInsertPt().
Referenced by llvm::insertAssignInstr().
|
static |
Definition at line 369 of file SPIRVPreLegalizer.cpp.
References llvm::LLT::getScalarSizeInBits(), llvm::LLT::isScalar(), llvm::Log2_32_Ceil(), MRI, and llvm::LLT::scalar().
Referenced by generateAssignInstrs().