LLVM 20.0.0git
Classes | Macros | Functions
AMDGPUEmitPrintf.cpp File Reference
#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 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, StringRef Str)
 
static ValuecallBufferedPrintfStart (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 ValueprocessNonStringArg (Value *Arg, IRBuilder<> &Builder)
 
static void callBufferedPrintfArgPush (IRBuilder<> &Builder, ArrayRef< Value * > Args, Value *PtrToStore, SparseBitVector< 8 > &SpecIsCString, SmallVectorImpl< StringData > &StringContents, bool IsConstFmtStr)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-emit-printf"

Definition at line 28 of file AMDGPUEmitPrintf.cpp.

Function Documentation

◆ appendArg()

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

Definition at line 77 of file AMDGPUEmitPrintf.cpp.

References callAppendArgs(), fitArgInto64Bits(), and llvm::IRBuilderBase::getInt64().

Referenced by processArg().

◆ appendString()

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

◆ 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

◆ callAppendStringN()

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

◆ callBufferedPrintfArgPush()

static void callBufferedPrintfArgPush ( IRBuilder<> &  Builder,
ArrayRef< Value * >  Args,
Value PtrToStore,
SparseBitVector< 8 > &  SpecIsCString,
SmallVectorImpl< StringData > &  StringContents,
bool  IsConstFmtStr 
)
static

◆ callBufferedPrintfStart()

static Value * callBufferedPrintfStart ( IRBuilder<> &  Builder,
ArrayRef< Value * >  Args,
Value Fmt,
bool  isConstFmtStr,
SparseBitVector< 8 > &  SpecIsCString,
SmallVectorImpl< StringData > &  StringContents,
Value *&  ArgSize 
)
static

◆ callPrintfBegin()

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

◆ fitArgInto64Bits()

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

◆ getStrlenWithNull()

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

◆ locateCStrings()

static void locateCStrings ( SparseBitVector< 8 > &  BV,
StringRef  Str 
)
static

◆ processArg()

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

Definition at line 171 of file AMDGPUEmitPrintf.cpp.

References appendArg(), appendString(), and llvm::Value::getType().

Referenced by llvm::emitAMDGPUPrintfCall().

◆ processConstantStringArg()

static void processConstantStringArg ( StringData SD,
IRBuilder<> &  Builder,
SmallVectorImpl< Value * > &  WhatToStore 
)
static

◆ processNonStringArg()

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