LLVM 23.0.0git
InlineAsmPrepare.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "inline-asm-prepare"

Functions

 INITIALIZE_PASS_BEGIN (InlineAsmPrepare, "inline-asm-prepare", "Prepare inline asm insts", false, false) INITIALIZE_PASS_END(InlineAsmPrepare
static void printDebugDomInfo (const DominatorTree &DT, const Use &U, const BasicBlock *BB, bool IsDefaultDest)
static bool isInSameBasicBlock (const Use &U, const BasicBlock *BB)
 The Use is in the same BasicBlock as the intrinsic call.
static void updateSSA (DominatorTree &DT, CallBrInst *CBR, CallInst *Intrinsic, SSAUpdater &SSAUpdate)
static bool splitCriticalEdges (CallBrInst *CBR, DominatorTree *DT)
static bool insertIntrinsicCalls (CallBrInst *CBR, DominatorTree &DT)
 Create a separate SSA definition in each indirect target (via llvm.callbr.landingpad).
static bool processCallBrInst (Function &F, CallBrInst *CBR, DominatorTree *DT)
static SmallVector< CallBrInst *, 2 > findCallBrs (Function &F)
static bool runImpl (Function &F, ArrayRef< CallBrInst * > CBRs, DominatorTree *DT)

Variables

inline asm prepare
inline asm Prepare asm insts
inline asm Prepare asm false

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "inline-asm-prepare"

Definition at line 57 of file InlineAsmPrepare.cpp.

Function Documentation

◆ findCallBrs()

SmallVector< CallBrInst *, 2 > findCallBrs ( Function & F)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( InlineAsmPrepare ,
"inline-asm-prepare" ,
"Prepare inline asm insts" ,
false ,
false  )

◆ insertIntrinsicCalls()

bool insertIntrinsicCalls ( CallBrInst * CBR,
DominatorTree & DT )
static

Create a separate SSA definition in each indirect target (via llvm.callbr.landingpad).

This may require splitting critical edges so we have a location to place the intrinsic. Then remap users of the original callbr output SSA value to instead point to the appropriate llvm.callbr.landingpad value.

Definition at line 173 of file InlineAsmPrepare.cpp.

References llvm::SSAUpdater::AddAvailableValue(), Changed, llvm::Value::getContext(), llvm::CallBrInst::getDefaultDest(), llvm::CallBrInst::getIndirectDests(), llvm::Value::getName(), llvm::CallBrInst::getNumIndirectDests(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::Value::getType(), llvm::SSAUpdater::Initialize(), llvm::SmallPtrSetImpl< PtrType >::insert(), and updateSSA().

Referenced by processCallBrInst().

◆ isInSameBasicBlock()

bool isInSameBasicBlock ( const Use & U,
const BasicBlock * BB )
static

The Use is in the same BasicBlock as the intrinsic call.

Definition at line 100 of file InlineAsmPrepare.cpp.

References llvm::dyn_cast(), and I.

Referenced by updateSSA().

◆ printDebugDomInfo()

void printDebugDomInfo ( const DominatorTree & DT,
const Use & U,
const BasicBlock * BB,
bool IsDefaultDest )
static

◆ processCallBrInst()

bool processCallBrInst ( Function & F,
CallBrInst * CBR,
DominatorTree * DT )
static

Definition at line 201 of file InlineAsmPrepare.cpp.

References Changed, F, insertIntrinsicCalls(), and splitCriticalEdges().

Referenced by runImpl().

◆ runImpl()

bool runImpl ( Function & F,
ArrayRef< CallBrInst * > CBRs,
DominatorTree * DT )
static

Definition at line 219 of file InlineAsmPrepare.cpp.

References Changed, F, and processCallBrInst().

◆ splitCriticalEdges()

◆ updateSSA()

Variable Documentation

◆ false

inline asm Prepare asm false

Definition at line 81 of file InlineAsmPrepare.cpp.

◆ insts

inline asm Prepare asm insts
inline

Definition at line 81 of file InlineAsmPrepare.cpp.

◆ prepare

inline asm prepare

Definition at line 80 of file InlineAsmPrepare.cpp.