LLVM 22.0.0git
DXILLegalizePass.cpp File Reference
#include "DXILLegalizePass.h"
#include "DirectX.h"
#include "llvm/ADT/APInt.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include <functional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "dxil-legalize"

Functions

static bool legalizeFreeze (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * >)
static bool fixI8UseChain (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &ReplacedValues)
static bool upcastI8AllocasAndUses (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &ReplacedValues)
static bool downcastI64toI32InsertExtractElements (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &)
static void emitMemcpyExpansion (IRBuilder<> &Builder, Value *Dst, Value *Src, ConstantInt *Length)
static void emitMemsetExpansion (IRBuilder<> &Builder, Value *Dst, Value *Val, ConstantInt *SizeCI, DenseMap< Value *, Value * > &ReplacedValues)
static bool legalizeMemCpy (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &ReplacedValues)
static bool legalizeMemSet (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &ReplacedValues)
static bool updateFnegToFsub (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &)
static bool legalizeGetHighLowi64Bytes (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &ReplacedValues)
static bool legalizeScalarLoadStoreOnArrays (Instruction &I, SmallVectorImpl< Instruction * > &ToRemove, DenseMap< Value *, Value * > &)
 INITIALIZE_PASS_BEGIN (DXILLegalizeLegacy, DEBUG_TYPE, "DXIL Legalizer", false, false) INITIALIZE_PASS_END(DXILLegalizeLegacy

Variables

 DEBUG_TYPE
DXIL Legalizer
DXIL false

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "dxil-legalize"

Definition at line 23 of file DXILLegalizePass.cpp.

Function Documentation

◆ downcastI64toI32InsertExtractElements()

bool downcastI64toI32InsertExtractElements ( Instruction & I,
SmallVectorImpl< Instruction * > & ToRemove,
DenseMap< Value *, Value * > &  )
static

◆ emitMemcpyExpansion()

void emitMemcpyExpansion ( IRBuilder<> & Builder,
Value * Dst,
Value * Src,
ConstantInt * Length )
static

Definition at line 349 of file DXILLegalizePass.cpp.

References assert(), DL, llvm::dyn_cast(), I, llvm::isa(), and llvm::Length.

Referenced by legalizeMemCpy().

◆ emitMemsetExpansion()

void emitMemsetExpansion ( IRBuilder<> & Builder,
Value * Dst,
Value * Val,
ConstantInt * SizeCI,
DenseMap< Value *, Value * > & ReplacedValues )
static

◆ fixI8UseChain()

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( DXILLegalizeLegacy ,
DEBUG_TYPE ,
"DXIL Legalizer" ,
false ,
false  )

References DEBUG_TYPE.

◆ legalizeFreeze()

bool legalizeFreeze ( Instruction & I,
SmallVectorImpl< Instruction * > & ToRemove,
DenseMap< Value *, Value * >  )
static

Definition at line 27 of file DXILLegalizePass.cpp.

References llvm::dyn_cast(), I, and ToRemove.

◆ legalizeGetHighLowi64Bytes()

bool legalizeGetHighLowi64Bytes ( Instruction & I,
SmallVectorImpl< Instruction * > & ToRemove,
DenseMap< Value *, Value * > & ReplacedValues )
static

◆ legalizeMemCpy()

bool legalizeMemCpy ( Instruction & I,
SmallVectorImpl< Instruction * > & ToRemove,
DenseMap< Value *, Value * > & ReplacedValues )
static

◆ legalizeMemSet()

bool legalizeMemSet ( Instruction & I,
SmallVectorImpl< Instruction * > & ToRemove,
DenseMap< Value *, Value * > & ReplacedValues )
static

◆ legalizeScalarLoadStoreOnArrays()

◆ upcastI8AllocasAndUses()

bool upcastI8AllocasAndUses ( Instruction & I,
SmallVectorImpl< Instruction * > & ToRemove,
DenseMap< Value *, Value * > & ReplacedValues )
static

◆ updateFnegToFsub()

bool updateFnegToFsub ( Instruction & I,
SmallVectorImpl< Instruction * > & ToRemove,
DenseMap< Value *, Value * > &  )
static

Definition at line 511 of file DXILLegalizePass.cpp.

References I, and ToRemove.

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 706 of file DXILLegalizePass.cpp.

◆ false

DXIL false

Definition at line 706 of file DXILLegalizePass.cpp.

◆ Legalizer