LLVM 20.0.0git
|
#include "SPIRV.h"
#include "SPIRVSubtarget.h"
#include "SPIRVTargetMachine.h"
#include "SPIRVUtils.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsSPIRV.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/LowerMemIntrinsics.h"
#include <charconv>
#include <regex>
Go to the source code of this file.
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Functions | |
void | llvm::initializeSPIRVPrepareFunctionsPass (PassRegistry &) |
INITIALIZE_PASS (SPIRVPrepareFunctions, "prepare-functions", "SPIRV prepare functions", false, false) std | |
static Function * | getOrCreateFunction (Module *M, Type *RetTy, ArrayRef< Type * > ArgTypes, StringRef Name) |
static bool | lowerIntrinsicToFunction (IntrinsicInst *Intrinsic) |
static std::string | getAnnotation (Value *AnnoVal, Value *OptAnnoVal) |
static SmallVector< Metadata * > | parseAnnotation (Value *I, const std::string &Anno, LLVMContext &Ctx, Type *Int32Ty) |
static void | lowerPtrAnnotation (IntrinsicInst *II) |
static void | lowerFunnelShifts (IntrinsicInst *FSHIntrinsic) |
static void | buildUMulWithOverflowFunc (Function *UMulFunc) |
static void | lowerExpectAssume (IntrinsicInst *II) |
static bool | toSpvOverloadedIntrinsic (IntrinsicInst *II, Intrinsic::ID NewID, ArrayRef< unsigned > OpNos) |
static void | lowerUMulWithOverflow (IntrinsicInst *UMulIntrinsic) |
|
static |
Definition at line 345 of file SPIRVPrepareFunctions.cpp.
References llvm::BasicBlock::Create(), llvm::IRBuilderBase::CreateICmpNE(), llvm::IRBuilderBase::CreateInsertValue(), llvm::IRBuilderBase::CreateNUWMul(), llvm::IRBuilderBase::CreateRet(), llvm::IRBuilderBase::CreateUDiv(), llvm::Function::empty(), llvm::PoisonValue::get(), llvm::Function::getArg(), llvm::Module::getContext(), llvm::GlobalValue::getParent(), llvm::Function::getReturnType(), and Mul.
Referenced by lowerUMulWithOverflow().
Definition at line 158 of file SPIRVPrepareFunctions.cpp.
References llvm::CallingConv::C, llvm::getConstantStringInfo(), I, llvm::Ref, and Struct.
Referenced by lowerPtrAnnotation().
|
static |
Definition at line 80 of file SPIRVPrepareFunctions.cpp.
References llvm::Function::Create(), llvm::GlobalValue::ExternalLinkage, F, Name, RetTy, llvm::Function::setCallingConv(), llvm::GlobalValue::setDSOLocal(), and llvm::CallingConv::SPIR_FUNC.
Referenced by lowerFunnelShifts(), and lowerUMulWithOverflow().
INITIALIZE_PASS | ( | SPIRVPrepareFunctions | , |
"prepare-functions" | , | ||
"SPIRV prepare functions" | , | ||
false | , | ||
false | |||
) |
Definition at line 68 of file SPIRVPrepareFunctions.cpp.
References assert(), llvm::Value::getName(), II, and llvm::StringRef::str().
|
static |
Definition at line 369 of file SPIRVPrepareFunctions.cpp.
References F, llvm::Intrinsic::getDeclaration(), II, and llvm_unreachable.
|
static |
Definition at line 284 of file SPIRVPrepareFunctions.cpp.
References llvm::BitWidth, llvm::BasicBlock::Create(), llvm::IRBuilderBase::CreateLShr(), llvm::IRBuilderBase::CreateOr(), llvm::IRBuilderBase::CreateRet(), llvm::IRBuilderBase::CreateShl(), llvm::IRBuilderBase::CreateSub(), llvm::IRBuilderBase::CreateURem(), llvm::IRBuilderBase::CreateVectorSplat(), llvm::Function::empty(), llvm::Function::getArg(), llvm::VectorType::getElementType(), llvm::CallBase::getFunctionType(), llvm::IRBuilderBase::getInt(), llvm::Type::getIntegerBitWidth(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getModule(), llvm::FixedVectorType::getNumElements(), getOrCreateFunction(), llvm::Function::getReturnType(), and llvm::CallBase::setCalledFunction().
|
static |
Definition at line 94 of file SPIRVPrepareFunctions.cpp.
References assert(), llvm::BasicBlock::Create(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateMemSet(), llvm::IRBuilderBase::CreateRet(), llvm::IRBuilderBase::CreateRetVoid(), llvm::expandMemSetAsLoop(), F, llvm::IntrinsicLowering::LowerIntrinsicCall(), and llvm::Value::setName().
|
static |
Definition at line 248 of file SPIRVPrepareFunctions.cpp.
References llvm::IRBuilderBase::CreateIntrinsic(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::MetadataAsValue::get(), llvm::MDString::get(), getAnnotation(), llvm::Type::getInt32Ty(), llvm::Value::getType(), II, parseAnnotation(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::IRBuilderBase::SetInsertPoint(), and llvm::SmallVectorBase< Size_T >::size().
|
static |
Definition at line 410 of file SPIRVPrepareFunctions.cpp.
References buildUMulWithOverflowFunc(), llvm::CallBase::getFunctionType(), llvm::Instruction::getModule(), getOrCreateFunction(), and llvm::CallBase::setCalledFunction().
|
static |
Definition at line 193 of file SPIRVPrepareFunctions.cpp.
References llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::MDString::get(), llvm::Match, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by lowerPtrAnnotation().
|
static |
Definition at line 395 of file SPIRVPrepareFunctions.cpp.
References llvm::ArrayRef< T >::empty(), F, llvm::Intrinsic::getDeclaration(), II, and llvm::SmallVectorTemplateBase< T, bool >::push_back().