本文整理汇总了C++中LoadInst::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ LoadInst::getName方法的具体用法?C++ LoadInst::getName怎么用?C++ LoadInst::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoadInst
的用法示例。
在下文中一共展示了LoadInst::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DEBUG
void smtit::performTest1() {
for (Module::iterator FI = Mod->begin(), FE = Mod->end(); FI != FE; ++FI) {
Function *Func = &*FI;
// DEBUG(errs() << *Func << "\n");
for (Function::iterator BI = Func->begin(), BE = Func->end(); BI != BE;
++BI) {
BasicBlock *BB = &*BI;
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
Instruction *BBI = &*I;
//if (true == isa<StoreInst>(BBI)) {
if (true == isa<LoadInst>(BBI)) {
LoadInst *li = dyn_cast<LoadInst>(BBI);
Value *ptrOp = li->getPointerOperand();
DEBUG(errs() << *li << "\t Result Name: " << li->getName() << "\t Pointer Name: " << ptrOp->getName() << "\n");
// DEBUG(errs() << "\tStore Instruction: " << *BBI << " \n");
// DEBUG(errs() << "\t\tPointerType: " << isLLVMPAPtrTy(SI->getType())
// << " \n");
// Instruction* V = cast<Instruction>(SI->getOperand(1));
// DEBUG(errs() << "\tOperand : " << *V << " \n");
// DEBUG(errs() << "\t\tPointerType: " << isLLVMPAPtrTy(V->getType())
// << " \n");
} else if(true == isa<GetElementPtrInst>(BBI)) {
GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(BBI);
DEBUG(errs() << *gep << "\t Result Name: " << gep->getName() << "\n");
// DEBUG(errs() << "\tInstruction: " << *BBI << " \n");
// DEBUG(errs() << "\t\tPointerType: " <<
// isLLVMPAPtrTy(BBI->getType()) << " \n");
}
// For def-use chains: All the uses of the definition
//DEBUG(errs() << *BBI << "\n");
/*
for (User *U : BBI->users()) {
if (Instruction *Inst = dyn_cast<Instruction>(U)) {
DEBUG(errs()<< " " << *Inst << "\n");
}
}
for (Value::user_iterator i = BBI->user_begin(), e = BBI->user_end();
i != e; ++i) {
if (Instruction *user_inst = dyn_cast<Instruction>(*i)) {
DEBUG(errs()<< " " << *user_inst << "\n");
}
}
*/
}
}
}
}
示例2: visitLoadInst
bool Scalarizer::visitLoadInst(LoadInst &LI) {
if (!ScalarizeLoadStore)
return false;
if (!LI.isSimple())
return false;
VectorLayout Layout;
if (!getVectorLayout(LI.getType(), LI.getAlignment(), Layout))
return false;
unsigned NumElems = Layout.VecTy->getNumElements();
IRBuilder<> Builder(LI.getParent(), &LI);
Scatterer Ptr = scatter(&LI, LI.getPointerOperand());
ValueVector Res;
Res.resize(NumElems);
for (unsigned I = 0; I < NumElems; ++I)
Res[I] = Builder.CreateAlignedLoad(Ptr[I], Layout.getElemAlign(I),
LI.getName() + ".i" + Twine(I));
gather(&LI, Res);
return true;
}