LLVM  14.0.0git
Macros | Functions
AMDGPUEmitPrintf.cpp File Reference
#include "llvm/Transforms/Utils/AMDGPUEmitPrintf.h"
#include "llvm/ADT/SparseBitVector.h"
#include "llvm/Analysis/ValueTracking.h"
Include dependency graph for AMDGPUEmitPrintf.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-emit-printf"
 

Functions

static bool isCString (const Value *Arg)
 
static ValuefitArgInto64Bits (IRBuilder<> &Builder, Value *Arg)
 
static ValuecallPrintfBegin (IRBuilder<> &Builder, Value *Version)
 
static ValuecallAppendArgs (IRBuilder<> &Builder, Value *Desc, int NumArgs, Value *Arg0, Value *Arg1, Value *Arg2, Value *Arg3, Value *Arg4, Value *Arg5, Value *Arg6, bool IsLast)
 
static ValueappendArg (IRBuilder<> &Builder, Value *Desc, Value *Arg, bool IsLast)
 
static ValuegetStrlenWithNull (IRBuilder<> &Builder, Value *Str)
 
static ValuecallAppendStringN (IRBuilder<> &Builder, Value *Desc, Value *Str, Value *Length, bool isLast)
 
static ValueappendString (IRBuilder<> &Builder, Value *Desc, Value *Arg, bool IsLast)
 
static ValueprocessArg (IRBuilder<> &Builder, Value *Desc, Value *Arg, bool SpecIsCString, bool IsLast)
 
static void locateCStrings (SparseBitVector< 8 > &BV, Value *Fmt)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-emit-printf"

Definition at line 23 of file AMDGPUEmitPrintf.cpp.

Function Documentation

◆ appendArg()

static Value* appendArg ( IRBuilder<> &  Builder,
Value Desc,
Value Arg,
bool  IsLast 
)
static

Definition at line 88 of file AMDGPUEmitPrintf.cpp.

References Arg, Builder, callAppendArgs(), and fitArgInto64Bits().

Referenced by processArg().

◆ appendString()

static Value* appendString ( IRBuilder<> &  Builder,
Value Desc,
Value Arg,
bool  IsLast 
)
static

Definition at line 177 of file AMDGPUEmitPrintf.cpp.

References Arg, Builder, callAppendStringN(), and getStrlenWithNull().

Referenced by llvm::emitAMDGPUPrintfCall(), and processArg().

◆ callAppendArgs()

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

Definition at line 72 of file AMDGPUEmitPrintf.cpp.

References Builder, Int32Ty, and M.

Referenced by appendArg().

◆ callAppendStringN()

static Value* callAppendStringN ( IRBuilder<> &  Builder,
Value Desc,
Value Str,
Value Length,
bool  isLast 
)
static

Definition at line 165 of file AMDGPUEmitPrintf.cpp.

References Builder, Int32Ty, and M.

Referenced by appendString().

◆ callPrintfBegin()

static Value* callPrintfBegin ( IRBuilder<> &  Builder,
Value Version 
)
static

Definition at line 62 of file AMDGPUEmitPrintf.cpp.

References Builder, M, llvm::Module::Override, and Version.

Referenced by llvm::emitAMDGPUPrintfCall().

◆ fitArgInto64Bits()

static Value* fitArgInto64Bits ( IRBuilder<> &  Builder,
Value Arg 
)
static

Definition at line 38 of file AMDGPUEmitPrintf.cpp.

References Arg, Builder, llvm::Type::DoubleTyID, and llvm_unreachable.

Referenced by appendArg().

◆ getStrlenWithNull()

static Value* getStrlenWithNull ( IRBuilder<> &  Builder,
Value Str 
)
static

◆ isCString()

static bool isCString ( const Value Arg)
static

Definition at line 25 of file AMDGPUEmitPrintf.cpp.

References Arg.

Referenced by for(), and processArg().

◆ locateCStrings()

static void locateCStrings ( SparseBitVector< 8 > &  BV,
Value Fmt 
)
static

◆ processArg()

static Value* processArg ( IRBuilder<> &  Builder,
Value Desc,
Value Arg,
bool  SpecIsCString,
bool  IsLast 
)
static

Definition at line 183 of file AMDGPUEmitPrintf.cpp.

References appendArg(), appendString(), Arg, Builder, and isCString().

Referenced by llvm::emitAMDGPUPrintfCall().