Displaying 20 results from an estimated 69 matches for "setoperand".
Did you mean:
getoperand
2020 Feb 13
3
setOperands(int, Value*)
Hello,
I am trying to reset the operands of instructions. What I am doing is, I am
finding all Uses of a specific operand in an Instruction and resetting it
with a new value using "setOperands(int, Value*)". I am doing as:
for (auto vmitr=vm.begin(), vsitr=vs.begin(); vmitr!=vm.end() &&
vsitr!=vs.end(); vmitr++, vsitr++){
// I have two *Value ( operands)
for ( auto myitr =(*vsitr)->user_begin(); myitr!=(*vsitr)->user_end();
++myitr){
// Finding the uses of one opera...
2015 Mar 18
5
[LLVMdev] casting Constant * to value *?
John, you are right.
I 'browsed' the doxygen's inheritance diagram.
Shouldn't I then be able to cast Constant * to Value*?
Plugging the retrieved Constant* (from ConstantExpr::getGetElementPtr)
into Instruction->setOperand compiles, but gives me an assertion failure at
runtime.
I have no access to the code at the moment. I will gather more information
possibly tomorrow.
Thanks
Alex
John Criswell wrote:
> On 3/17/15 8:40 PM, Alexander Poddey wrote:
>> Hi all,
>>
>> extracting datafields...
2020 Mar 20
2
Multi-Threading Compilers
...;d
> say most passes will not create or modify functions nor add or remove
> calls.
The problem isn’t constants or functions themselves, it is that they are instances of llvm::Value. Everything that walks a use/def list would have to run code that checks for this, and every call to inst->setOperand() would have to do locking or conditional locking. This would be a significant across-the-board slowdown for the compiler even when globals and constants are not involved.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/ll...
2020 Mar 21
3
Multi-Threading Compilers
...t 12:34 PM, Nicholas Krause <xerofoify at gmail.com> wrote:
>
>>
>> The problem isn’t constants or functions themselves, it is that they are instances of llvm::Value. Everything that walks a use/def list would have to run code that checks for this, and every call to inst->setOperand() would have to do locking or conditional locking. This would be a significant across-the-board slowdown for the compiler even when globals and constants are not involved.
>>
>> -Chris
>
> Hi Chris,
>
> Thanks for the comments. Sure that may be true but I would prefer to...
2010 Feb 08
1
[LLVMdev] converting an unconditional into a conditional branch
...e llvm API, but I got a question for which I haven't
found a good answer yet:
What is the best way to turn an unconditional branch into a conditional
branch? All I want to do is add two more operands, a successor and a
condition. But no matter how I try to do this any one of
setCondition()/setOperand()/setSuccessor() causes an assertion like these:
Cannot set condition of unconditional branch!
Successor # out of range for Branch!
setOperand() out of range!
Can this only be done by completely replacing the unconditional branch
instruction with a new, conditional one or is there a method with...
2015 Mar 17
2
[LLVMdev] casting Constant * to value *?
...ruct_foo,
const_ptr_103_indices);
it can be used to initialize e.g. a new instruction like:
StoreInst* void_119 = new StoreInst(const_float_102, const_ptr_103, false,
label_entry_113);
But how about replacing the operand of an already existing instruction using
a Constant *?
Instruction->setOperand(1,__needs_a_value*_here__);
Thx
Alex
2014 Dec 11
2
[LLVMdev] Dereferencing null pointers
Sorry for the confusion, I pasted the code I fixed locally...
Here is the code at top of the trunk:
// load (select (cond, null, P)) -> load P
if (Constant *C = dyn_cast<Constant>(SI->getOperand(1)))
if (C->isNullValue()) {
LI.setOperand(0, SI->getOperand(2));
return &LI;
}
So it is a bug?
-----Original Message-----
From: Hal Finkel [mailto:hfinkel at anl.gov]
Sent: Thursday, December 11, 2014 11:13 AM
To: Raoux, Thomas F
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Dereferencing null pointers
----...
2014 Dec 11
2
[LLVMdev] Dereferencing null pointers
...hable only for address space 0. But there is also code doing the following transformation for all the address spaces:
// load (select (cond, null, P)) -> load P
if(isa<ConstantPointerNull>(SI->getOperand(1)) &&
LI.getPointerAddressSpace() == 0) {
LI.setOperand(0, SI->getOperand(2));
return &LI;
}
Is this a bug? Would the correct behavior be to check that the pointers' address space is 0?
Cheers,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/a...
2018 Aug 07
2
Error Calling eraseFromParent()
Hi.
This is part of my code:
...
if (auto* op = dyn_cast<BinaryOperator>(&I)) {
Value* lhs = op->getOperand(0);
Value* rhs = op->getOperand(1);
Value* mul = builder.CreateMul(lhs, rhs);
for (auto& U : op->uses()) {
User* user = U.getUser();
user->setOperand(U.getOperandNo(), mul);
}
I.eraseFromParent();
}
...
This leads to the following runtime error:
LLVMSymbolizer: error reading file: No such file or directory
...
Does anybody know the solution?
Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http:...
2018 Aug 08
2
Error Calling eraseFromParent()
...*I = &*(It++);
if (auto* op = dyn_cast<BinaryOperator>(I)) {
IRBuilder<NoFolder> builder(op);
Value* lhs = op->getOperand(0);
Value* rhs = op->getOperand(1);
Value* mul = builder.CreateMul(lhs, rhs);
for (auto& U : op->uses()) {
User* user = U.getUser();
user->setOperand(U.getOperandNo(), mul);
}
//I->eraseFromParent();
dels.push_back(I);
}
}
for (auto &I : dels) {
I->eraseFromParent();
}
...
On Wed, Aug 8, 2018 at 6:16 PM, mayuyu.io <admin at mayuyu.io> wrote:
> Hi:
> As stated in the documentation you shouldn’t modify it while iterating a...
2009 Mar 31
2
[LLVMdev] Mutating the elements of a ConstantArray
Hello,
I need to append something to the global "llvm.global_ctors". This
variable may or may not already be declared within the current module.
If I lookup the global variable, I see that it supports a
getOperand(i) and setOperand(i,c), but does not support any way that I
can enlarge that array to add a new record.
Any suggestions?
--
Nick Johnson
2010 Jun 07
2
[LLVMdev] Modifing an operand of MDNode
I have a MDNode, and one of its operand is an int. I'd like to
assign a new int value to that operand during the llvm optimization.
What is the right way to do this ? (There is no setOperand() with
MDNode class.)
Junjie
2012 Jan 17
1
[LLVMdev] [LLVM] Modify ConstantArray object contents
Hi all. Is it allowed to modify ConstantArray object within setOperand
method, or it is better to leave old ConstantArray object and create new
one?
Thanks!
-Stepan.
2019 Sep 19
2
Type unmatched after replacing functions
...olve the problems of arguments and return
values type unmatched. But I find the problem of unmatched type of uses
of function pointers is harder to solve.
The function pointers are often put in the initializers of global variables, and
they can not be simply replaced by a bitcast ConstantExpr since setOperand()
cannot be used for Constant.
So, is there any solution to this problem?
Thanks!
2018 Aug 07
2
Error Calling eraseFromParent()
...: instructions(F)) {
if (auto* op = dyn_cast<BinaryOperator>(&I)) {
IRBuilder<> builder(op);
Value* lhs = op->getOperand(0);
Value* rhs = op->getOperand(1);
Value* mul = builder.CreateMul(lhs, rhs);
for (auto& U : op->uses()) {
User* user = U.getUser();
user->setOperand(U.getOperandNo(), mul);
}
I.eraseFromParent();
}
}
...
And I think that the code worked well with LLVM-3.6.0 that I tested one
year ago. Now, I use LLVM-6.0.0.
Regards.
On Tue, Aug 7, 2018 at 8:11 PM, <paul.robinson at sony.com> wrote:
> LLVMSymbolizer is invoked while trying to pr...
2018 Aug 08
3
Error Calling eraseFromParent()
...<BinaryOperator>(I)) {
> IRBuilder<NoFolder> builder(op);
>
> Value* lhs = op->getOperand(0);
> Value* rhs = op->getOperand(1);
> Value* mul = builder.CreateMul(lhs, rhs);
>
> for (auto& U : op->uses()) {
> User* user = U.getUser();
> user->setOperand(U.getOperandNo(), mul);
> }
> //I->eraseFromParent();
> dels.push_back(I);
> }
> }
>
> for (auto &I : dels) {
> I->eraseFromParent();
> }
> ...
>
> On Wed, Aug 8, 2018 at 6:16 PM, mayuyu.io <admin at mayuyu.io> wrote:
>
>> Hi:
>> As...
2015 May 17
2
[LLVMdev] copy value of a global's data field to another global
...cess to the data stored in globals as follows:
GlobalVariable* pGvarAct=_set_a_valid_global_;
const_ptr_indicesVec=_the_indexes_
llvm::Constant* pConst;
pConst=ConstantExpr::getGetElementPtr(pGvarAct, const_ptr_indicesVec);
and e.g. use this to repalece an argumrnt of an instruction like:
I->setOperand(someArgumentIndex,pConst);
However, getGetElementPtr returns a pointerType, which holds the actual type
as sub_type.
This is a problem when I want to use the data from one global for the
initializer of another
pGvar->setInitializer(__NeedsAFloatTy_here__); //not pointerTy
So what I'...
2012 May 09
4
[LLVMdev] How can I get the destination operand of an instruction?
I am able to access the source operands of an instruction using either
getOperand() or op_iterator, However, I can't find any method available for
destination operand. Someone suggests that instruction itself can represent
the destination operand.
http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-January/037518.html
The getOperand() returns an unsigned value like 0x9063498, while I can't
2018 Aug 07
2
Error Calling eraseFromParent()
...ast<BinaryOperator>(&I)) {
> IRBuilder<> builder(op);
>
> Value* lhs = op->getOperand(0);
> Value* rhs = op->getOperand(1);
> Value* mul = builder.CreateMul(lhs, rhs);
>
> for (auto& U : op->uses()) {
> User* user = U.getUser();
> user->setOperand(U.getOperandNo(), mul);
> }
>
> I.eraseFromParent();
> }
>
> }
> ...
> And I think that the code worked well with LLVM-3.6.0 that I tested one
> year ago. Now, I use LLVM-6.0.0.
> Regards.
>
-------------- next part --------------
An HTML attachment was scrubbed...
2005 Jul 28
2
[LLVMdev] help with pointer-to-array conversion
...LI->getLoopFor( phi->getIncomingBlock(1) )
> ->getCanonicalInductionVariable(), "mul.",
GEPI);
> Instruction *add = BinaryOperator::createAdd(mul,
NewAdd, "add.", GEPI);
> GEPI->setOperand( 0, phi->getIncomingValue(0) );
> GEPI->setOperand( 1, add );
> std::cerr << "Block After: " << *GEPI->getParent();
> }
> }
605c621,622
< void IndVarSimplify::runOnLoop(Loop *L) {
---
> void IndVarSimplify::r...