search for: hasname

Displaying 20 results from an estimated 44 matches for "hasname".

2008 Apr 16
2
[LLVMdev] Problems in removing a cloned instruction.
...are replaced by ret void. BasicBlock *ProgSlicer::CloneBasicBlock(const BasicBlock *BB, DenseMap<const Value*, Value*> &ValueMap, const char *NameSuffix, Function *F) { BasicBlock *NewBB = new BasicBlock("", F); if (BB->hasName()) NewBB->setName(BB->getName()+NameSuffix); bool hasCalls = false, hasDynamicAllocas = false, hasStaticAllocas = false, isTerminal =false; // Loop over all instructions, and copy them over. for (BasicBlock::const_iterator II = BB->begin(), IE = BB->end();...
2008 Apr 16
0
[LLVMdev] Problems in removing a cloned instruction.
...t; BasicBlock *ProgSlicer::CloneBasicBlock(const BasicBlock *BB, > DenseMap<const Value*, Value*> &ValueMap, > const char *NameSuffix, Function *F) { > > BasicBlock *NewBB = new BasicBlock("", F); > if (BB->hasName()) NewBB->setName(BB->getName()+NameSuffix); > > bool hasCalls = false, hasDynamicAllocas = false, > hasStaticAllocas = false, isTerminal =false; > > // Loop over all instructions, and copy them over. > for (BasicBlock::const_iterator II = BB->begi...
2016 Jul 26
2
[PATCH] Add support for the 'unless' matcher in the dynamic layer.
...till did add overhead, it seems perfectly reasonable, from a user's perspective (namely mine), that if I introduce unnecessary narrowing matchers to my chain that there may be a performance penalty. The ability to do the following easily outweighs any performance issues for me: anyOf ( /* hasName("..."), */ hasName("...") ) though C++ not allowing trailing commas makes this not quite as great. *However, without help, I would not be able to put forward a patch with anything more than simply removing the minimums.* Would this be acceptable or would someone be able...
2017 Apr 19
3
API to Differentiate between SSA and non SSA form
...her a particular variable is an SSA temporary like, if(TREE_CODE(t) == SSA_NAME) return true; Basically, I want to skip all those %0, %1 temporaries. But keep all those which refer to C variables. One way to do this would be to check whether a Value has been given a name by using hasName function. But it does not work every time. For e.g. in case of getelementptr instruction, this name refers to a member name of a structure (which is in SSA form). E.g., define void @f() { entry: %s = alloca %struct.A, align 8 %a = alloca i32, align 4 ; I can know that th...
2014 Aug 28
4
[LLVMdev] How to tell whether a GlobalValue is user-defined
...eConstantSection; > if (Kind.isMergeableConst8()) > return EightByteConstantSection; > if (Kind.isMergeableConst16()) > return SixteenByteConstantSection; > } > > Can’t we just change the first ‘if’ to: > > if (Kind.isMergeableConst() && !GV.hasName()) { > > That should leave any “named” constants in the __const section instead of moving them to the __literal section. (Though I don’t actually know if anonymous constants were given some name earlier so hasName() is useless at this point). That seems too strict. A private GV can have a na...
2011 Jul 01
2
[LLVMdev] Operand name missing
Hi, I was trying to use the following code in a if condition I->getOperand(0)->hasName() where I is an instruction with following condition already true - I->getOpcode() == Instruction::Call When I compiled a C code with llvm-2.9, I see a function call with no operand name (for operand 0) . This happens for a function with varArgs. The interesting part is that the same C code wh...
2019 Aug 23
2
LLVM-8.0 | Requesting Help : Function->getName() returns empty string
...Function *fn = (Function *) funcHandle; printf("func Name: %s\n",fn->getName().str().c_str()); gv = executionEngine->runFunction(fn, *args); . } Here it prints an empty string and also the executionEngine->runFunction() gives error : Assertion failed! Expression: GV->hasName() && "Global must have name." I am using LLVM-8.0. Please let me know if I am missing out something OR if the procedure is wrong Best regards, Manoj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/atta...
2014 Aug 27
2
[LLVMdev] How to tell whether a GlobalValue is user-defined
>> The literalN sections were developed long ago to support coalescing of >> unnamed constants like 9.897 in source code for architectures that could not >> embed large constants in instructions. The linker could knew how to break >> up the section (e.g. __literal8 is always 8 byte chunks) and coalesce copies >> by content. >> >> ~6 years ago we
2005 Nov 22
3
[LLVMdev] Cloning BasicBlock
Hi , I am trying to clone a BasicBlock. I want both to co-exist and I have introduced a conditional branch to the original or the cloned BB. I tried mapping the original instruction and the clone as below : Instruction *NewInst = II->clone(); if (II->hasName()) NewInst->setName(II->getName()); NewBB->getInstList().push_back(NewInst); ValueMap[II] = NewInst; what I got from this is , --> eventhough I have set the same name , a new name is set for the clone. original : %...
2016 Nov 28
2
Looking for help with an ast matcher
...tr Padlewski <piotr.padlewski at gmail.com> wrote: > Hi Mads, > I formatted your matcher a little bit just to understand it: > > ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType( > isInteger()), > has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName(" > compare"))), > hasArgument(0, > declRefExpr().bind("str2")), > callee(memberExpr(has( > declRefExpr().bind("str1"))))))))).bind("case1") > > And this...
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr, I think I found a working matcher: match ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType(isInteger()), has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName("compare"))), hasArgument(0, declRefExpr().bind("str2")), callee(memberExpr(has(declRefExpr().bind("str1"))))))))).bind("case1") This one bind to both str1 and str2 in str1.compare(str2). I have included a code segment below. I have attached a screenshot of...
2006 Mar 19
1
[LLVMdev] Idioms for retrieving global symbols and inheritance
...I am getting unexpected results. For each type obtained from type_iterator->second, value_iterator->first produces the same list as what type_iterator->first would produce. Also, an attempt to access value_iterator->second->getName() produces junk names. value_iterator->second->hasName() causes segfaults. All this is compiled fine. Following is sample code and output. Code: ------------- for ( SymbolTable::type_iterator itr1 = symbTab.type_begin(), itrend1 = symbTab.type_end(); itr1 != itrend1; itr1++ ) { string typeName = itr1->first; if ( lldbprfx.compare( typeName.subs...
2011 Jul 01
0
[LLVMdev] Operand name missing
On Fri, Jul 1, 2011 at 12:35 AM, ankur deshwal <a.s.deshwal at gmail.com> wrote: > Hi, > > I was trying to use the following code in a if condition > I->getOperand(0)->hasName() > > where I is an instruction with following condition already true - > I->getOpcode() == Instruction::Call > > When I compiled a C code with llvm-2.9, I see a function call with no > operand name (for operand 0) . This happens for a function with > varArgs. The interestin...
2008 Jan 14
0
[LLVMdev] Extraction of constant operands from the instruction
...d list as defined by the user class. for (User::op_iterator O = i->op_begin() ;O != i->op_end(); ++O) { Value *v = *O; llvm::cout << v->getNameStr() ; } However, whenever there is a constant operand like a numerical value, it does not displays any value at all, i checked using the hasName() method, for the constant operands the hasName() returns 0. Is there anyway I can display/extract these constant values from the instruction ? Another question: For and example IR like below, %tmp6 = load i32* @glob_var, align 4 ; <i32> [#uses=1] How can i extract the name of t...
2008 Jan 14
0
[LLVMdev] Extraction of constant operands from the instruction
Hello, > However, whenever there is a constant operand like a numerical value, it > does not displays any value at all, i checked using the hasName() method, > for the constant operands the hasName() returns 0. Correct. Constant doesn't have name at all. You should check, whether operand is a constant, cast the Value to Constant (for example, via dyn_cast facility) and then use the Constant' methods to obtain the exact value. >...
2019 Apr 23
5
StringRef Iterator Variable Display
Hello, I want to display the variable names in stringref iterator. But it is not displayed using following code. for (set<StringRef>::iterator sit = L.begin(); sit != L.end(); sit++) { errs() << *sit << " "; } How to do this? Please help.. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2016 Jul 26
2
[PATCH] Add support for the 'unless' matcher in the dynamic layer.
I was wondering if there is any objection to removing the 2-element minimum on the eachOf, anyOf and allOf matchers. It is frustrating when playing with matchers to have to edit significant amounts of code to be able to temporarily go from 2 to 1 matcher inside an any- or allOf matcher. And overall it feels very "un-set-theory"-like. The change was made here:
2012 Jun 18
0
[LLVMdev] Which pass converts call printf to puts?
...t; *Result << "\n"); // Something changed! Changed = true; ++NumSimplified; // Inspect the instruction after the call (which was potentially just // added) next. I = CI; ++I; if (CI != Result && !CI->use_empty()) { CI->replaceAllUsesWith(Result); if (!Result->hasName()) Result->takeName(CI); } CI->eraseFromParent(); Best regards, Christoph P.S. When answering, don't forget to CC the mailing list. On 18/06/2012 09:22, Thomson wrote: > Thanks for all your information. I got the pass in SimplifyLibCalls.cpp. > > I looked at the code, but...
2018 Dec 09
2
Parse LLVM IR
...t; << inst.getOpcodeName(); unsigned int i = 0; unsigned int opnt_cnt = inst.getNumOperands(); for(; i < opnt_cnt; ++i) { Value *opnd = inst.getOperand(i); std::string o; if (opnd->hasName()) { o = opnd->getName(); std::cout << " " << o << "," ; } else { std::cout << " ptr" << opnd << ","; } }...
2011 Dec 02
5
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
...e())->getElementType(); > + Type *VArgType = getVecType(ArgType); > + Type *VArgPtrType = PointerType::get(VArgType, > + cast<PointerType>(IPtr->getType())->getAddressSpace()); > + return new BitCastInst(VPtr, VArgPtrType, > + I->hasName() ? > + I->getName() + ".v.i" + utostr(o) : "", > + /* insert before */ FlipMemInputs ? J : I); > + } > + > + // Returns the value that is to be used as the vector-shuffle mask to the > + // vector instructi...