LLVM 20.0.0git
|
#include "llvm/Transforms/Utils/AMDGPUEmitPrintf.h"
#include "llvm/ADT/SparseBitVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/DataExtractor.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/MathExtras.h"
Go to the source code of this file.
Classes | |
struct | StringData |
Macros | |
#define | DEBUG_TYPE "amdgpu-emit-printf" |
Functions | |
static Value * | fitArgInto64Bits (IRBuilder<> &Builder, Value *Arg) |
static Value * | callPrintfBegin (IRBuilder<> &Builder, Value *Version) |
static Value * | callAppendArgs (IRBuilder<> &Builder, Value *Desc, int NumArgs, Value *Arg0, Value *Arg1, Value *Arg2, Value *Arg3, Value *Arg4, Value *Arg5, Value *Arg6, bool IsLast) |
static Value * | appendArg (IRBuilder<> &Builder, Value *Desc, Value *Arg, bool IsLast) |
static Value * | getStrlenWithNull (IRBuilder<> &Builder, Value *Str) |
static Value * | callAppendStringN (IRBuilder<> &Builder, Value *Desc, Value *Str, Value *Length, bool isLast) |
static Value * | appendString (IRBuilder<> &Builder, Value *Desc, Value *Arg, bool IsLast) |
static Value * | processArg (IRBuilder<> &Builder, Value *Desc, Value *Arg, bool SpecIsCString, bool IsLast) |
static void | locateCStrings (SparseBitVector< 8 > &BV, StringRef Str) |
static Value * | callBufferedPrintfStart (IRBuilder<> &Builder, ArrayRef< Value * > Args, Value *Fmt, bool isConstFmtStr, SparseBitVector< 8 > &SpecIsCString, SmallVectorImpl< StringData > &StringContents, Value *&ArgSize) |
static void | processConstantStringArg (StringData *SD, IRBuilder<> &Builder, SmallVectorImpl< Value * > &WhatToStore) |
static Value * | processNonStringArg (Value *Arg, IRBuilder<> &Builder) |
static void | callBufferedPrintfArgPush (IRBuilder<> &Builder, ArrayRef< Value * > Args, Value *PtrToStore, SparseBitVector< 8 > &SpecIsCString, SmallVectorImpl< StringData > &StringContents, bool IsConstFmtStr) |
#define DEBUG_TYPE "amdgpu-emit-printf" |
Definition at line 28 of file AMDGPUEmitPrintf.cpp.
Definition at line 77 of file AMDGPUEmitPrintf.cpp.
References callAppendArgs(), fitArgInto64Bits(), and llvm::IRBuilderBase::getInt64().
Referenced by processArg().
|
static |
Definition at line 165 of file AMDGPUEmitPrintf.cpp.
References callAppendStringN(), getStrlenWithNull(), and llvm::Length.
Referenced by llvm::emitAMDGPUPrintfCall(), and processArg().
|
static |
Definition at line 61 of file AMDGPUEmitPrintf.cpp.
References llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt32(), llvm::IRBuilderBase::getInt32Ty(), llvm::IRBuilderBase::getInt64Ty(), and llvm::BasicBlock::getModule().
Referenced by appendArg().
|
static |
Definition at line 154 of file AMDGPUEmitPrintf.cpp.
References llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt32(), llvm::IRBuilderBase::getInt64Ty(), llvm::BasicBlock::getModule(), and llvm::Length.
Referenced by appendString().
|
static |
Definition at line 373 of file AMDGPUEmitPrintf.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::IRBuilderBase::CreateConstInBoundsGEP1_32(), llvm::IRBuilderBase::CreateInBoundsGEP(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateStore(), llvm::dbgs(), DL, llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt8Ty(), llvm::BasicBlock::getModule(), LLVM_DEBUG, processConstantStringArg(), processNonStringArg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SparseBitVector< ElementSize >::test().
Referenced by llvm::emitAMDGPUPrintfCall().
|
static |
Definition at line 222 of file AMDGPUEmitPrintf.cpp.
References llvm::alignTo(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateAnd(), llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::CreateTrunc(), llvm::AttributeList::FunctionIndex, llvm::AttributeList::get(), llvm::getConstantStringInfo(), llvm::IRBuilderBase::getContext(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt32Ty(), llvm::IRBuilderBase::getInt64Ty(), llvm::BasicBlock::getModule(), llvm::IRBuilderBase::getPtrTy(), getStrlenWithNull(), llvm::Value::getType(), getType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::StringRef::size(), and llvm::SparseBitVector< ElementSize >::test().
Referenced by llvm::emitAMDGPUPrintfCall().
Definition at line 54 of file AMDGPUEmitPrintf.cpp.
References llvm::IRBuilderBase::CreateCall(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt64Ty(), and llvm::BasicBlock::getModule().
Referenced by llvm::emitAMDGPUPrintfCall().
Definition at line 30 of file AMDGPUEmitPrintf.cpp.
References llvm::IRBuilderBase::CreateBitCast(), llvm::IRBuilderBase::CreatePtrToInt(), llvm::IRBuilderBase::CreateZExt(), llvm::Type::DoubleTyID, llvm::IRBuilderBase::getInt64Ty(), llvm::Value::getType(), and llvm_unreachable.
Referenced by appendArg().
Definition at line 87 of file AMDGPUEmitPrintf.cpp.
References llvm::PHINode::addIncoming(), llvm::BasicBlock::begin(), llvm::BranchInst::Create(), llvm::BasicBlock::Create(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateCondBr(), llvm::IRBuilderBase::CreateGEP(), llvm::IRBuilderBase::CreateICmpEQ(), llvm::IRBuilderBase::CreateLoad(), llvm::IRBuilderBase::CreatePHI(), llvm::IRBuilderBase::CreatePtrToInt(), llvm::IRBuilderBase::CreateSub(), End, llvm::Instruction::eraseFromParent(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::GetInsertPoint(), llvm::IRBuilderBase::getInt64(), llvm::IRBuilderBase::getInt64Ty(), llvm::IRBuilderBase::getInt8(), llvm::IRBuilderBase::getInt8Ty(), llvm::Constant::getNullValue(), llvm::BasicBlock::getTerminator(), llvm::IRBuilderBase::SetInsertPoint(), and llvm::BasicBlock::splitBasicBlock().
Referenced by appendString(), and callBufferedPrintfStart().
|
static |
Definition at line 184 of file AMDGPUEmitPrintf.cpp.
References llvm::StringRef::npos, and llvm::SparseBitVector< ElementSize >::set().
Referenced by llvm::emitAMDGPUPrintfCall().
|
static |
Definition at line 171 of file AMDGPUEmitPrintf.cpp.
References appendArg(), appendString(), and llvm::Value::getType().
Referenced by llvm::emitAMDGPUPrintfCall().
|
static |
Definition at line 310 of file AMDGPUEmitPrintf.cpp.
References llvm::cantFail(), llvm::IRBuilderBase::getContext(), llvm::IRBuilderBase::getInt32Ty(), llvm::Type::getIntNTy(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU24(), llvm::DataExtractor::getU32(), llvm::DataExtractor::getU8(), llvm_unreachable, llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::StringRef::str(), and StringData::Str.
Referenced by callBufferedPrintfArgPush().
Definition at line 353 of file AMDGPUEmitPrintf.cpp.
References llvm::IRBuilderBase::CreateFPExt(), llvm::IRBuilderBase::CreateZExt(), DL, llvm::BasicBlock::getDataLayout(), llvm::IRBuilderBase::getDoubleTy(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt64Ty(), and llvm::Value::getType().
Referenced by callBufferedPrintfArgPush().