Displaying 20 results from an estimated 101 matches for "use_empty".
2020 Jun 17
2
InstCombine doesn't delete instructions with token
...tructionCombining.cpp
@@ -3012,7 +3012,7 @@ static bool prepareICWorklistFromFunction(Function
&F, const DataLayout &DL,
while (EndInst != BB->begin()) {
// Delete the next to last instruction.
Instruction *Inst = &*--EndInst->getIterator();
- if (!Inst->use_empty())
+ if (!Inst->use_empty() && !Inst->getType()->isTokenTy())
Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
- if (Inst->isEHPad()) {
+ if (Inst->isEHPad() || Inst->getType()->isTokenTy()) {
EndInst = Inst;
@@ -3022,7...
2011 Sep 23
2
[LLVMdev] constantexpr problem
Hi all,
I have got a problem when I used the use_empty() member function while I
used a global variable. I erase all the instructions which will use a global
variable. Then I called the use_empty() on that global variable. I got no
empty because a constantexpr use the global variable. I wonder whether there
is any way to erase the constantexpr which is...
2020 Jun 17
2
InstCombine doesn't delete instructions with token
...-3012,7 +3012,7 @@ static bool prepareICWorklistFromFunction(Function
> &F, const DataLayout &DL,
> while (EndInst != BB->begin()) {
> // Delete the next to last instruction.
> Instruction *Inst = &*--EndInst->getIterator();
> - if (!Inst->use_empty())
> + if (!Inst->use_empty() && !Inst->getType()->isTokenTy())
> Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
> - if (Inst->isEHPad()) {
>
> + if (Inst->isEHPad() || Inst->getType()->isTokenTy()) {
>...
2011 Aug 26
2
[LLVMdev] Dead node removal in DAGCombiner
Is this piece of code in DAGCombiner::visitLOAD removing a dead node?
06155 if (N->use_empty()) {
06156 removeFromWorkList(N);
06157 DAG.DeleteNode(N);
06158 }
If it is, is there a reason it doesn't push its operands to the work
list as done in line 974-975?
00970 // If N has no uses, it is dead. Make sure to revisit all
N's operands once
00971...
2020 Jun 17
2
InstCombine doesn't delete instructions with token
...-3012,7 +3012,7 @@ static bool prepareICWorklistFromFunction(Function
> &F, const DataLayout &DL,
> while (EndInst != BB->begin()) {
> // Delete the next to last instruction.
> Instruction *Inst = &*--EndInst->getIterator();
> - if (!Inst->use_empty())
> + if (!Inst->use_empty() && !Inst->getType()->isTokenTy())
> Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
> - if (Inst->isEHPad()) {
>
> + if (Inst->isEHPad() || Inst->getType()->isTokenTy()) {
>...
2010 Jun 21
3
[LLVMdev] Problems with eraseFromParent()
...ons (the number of their
uses are changed to zero).
The point is that when I finally attempt to remove the redundant unused
instructions from the generated code, there is a seg fault error.
To remove them, I'm using this function:
void EraseInst(Instruction &I) {
assert(I.use_empty() && "Cannot erase used instructions!");
I.eraseFromParent();
}
So please, if anyone could help me on this, i would be very grateful!
PS: It's also following my pass and the bytecode used for tests.
Thanks for the attention,
Alysson
-------------- next part ----...
2009 Mar 12
0
[LLVMdev] Suggestion: include object data in assertion messages
...alue that are
still
// around when the value is destroyed. If there are, then we have
a dangling
// reference and something is wrong. This code is here to print
out what is
// still being referenced. The value in question should be printed
as
// a <badref>
//
if (!use_empty()) {
cerr << "While deleting: " << *VTy << " %" << getNameStr() << "\n";
for (use_iterator I = use_begin(), E = use_end(); I != E; ++I)
cerr << "Use still stuck around after Def is destroyed:"
&...
2010 Jun 21
0
[LLVMdev] Problems with eraseFromParent()
...e changed to zero).
> The point is that when I finally attempt to remove the redundant
> unused instructions from the generated code, there is a seg fault error.
> To remove them, I'm using this function:
>
> void EraseInst(Instruction &I) {
> assert(I.use_empty() && "Cannot erase used instructions!");
> I.eraseFromParent();
> }
The problem is in how you use it:
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E;
I++) {
if (I->use_empty() && dyn_cast<LoadInst>(I)) {...
2008 Sep 12
3
[LLVMdev] Difficulty with reusing DAG nodes.
...Op1);
AddToISelQueue(Op2);
unsigned Op;
Op = (Opcode == ISD::UMUL_LOHI ? Nios2::MULxu : Nios2::MULx);
SDNode *Hi = CurDAG->getTargetNode(Op, MVT::Flag, Op1, Op2);
SDNode *Lo = CurDAG->getTargetNode(Nios2::MUL, MVT::Flag, Op1, Op2);
if (!N.getValue(0).use_empty())
ReplaceUses(N.getValue(0), SDValue(Lo,0));
if (!N.getValue(1).use_empty())
ReplaceUses(N.getValue(1), SDValue(Hi,0));
return NULL;
}
The code generator complains:
nios2-elf-ecc:
/home/rich/llvm-trunk-new/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:141:
void l...
2009 Mar 12
2
[LLVMdev] Suggestion: include object data in assertion messages
Hi all,
There are many assertions sprinkled throughout the llvm codebase,
which is a GoodThing. Most of the assertions even have informative
messages, which is a BetterThing.
However, assertion messages are static strings, and don't include any
information about the particular object/value which caused the
assertion. In a 'data oriented' system like llvm, this makes it really
2011 Aug 26
0
[LLVMdev] Dead node removal in DAGCombiner
Hi Akira,
> Is this piece of code in DAGCombiner::visitLOAD removing a dead node?
>
> 06155 if (N->use_empty()) {
> 06156 removeFromWorkList(N);
> 06157 DAG.DeleteNode(N);
> 06158 }
yes.
> If it is, is there a reason it doesn't push its operands to the work
> list as done in line 974-975?
>
> 00970 // If N has no uses, it is dead. Make sure to re...
2010 Jun 04
4
[LLVMdev] Duplicating a Basic Block
...r moment.
I was given suggestion to use CloneBasicBlock, but when I used it I get an
error :
While deleting: i32* %a
Use still stuck around after Def is destroyed: store i32* %a, i32** %p,
align 4
opt: /home/ambika/llvm_3/llvm-2.6/lib/VMCore/Value.cpp:81: virtual
llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value
is destroyed!"' failed.
0 opt 0x08471218
Aborted
This message is printed inside destructor of class value .
Now I dont understand that after all the instructions are duplicated why
does thios kind of error come??
I will be very thankful if s...
2011 Oct 26
3
[LLVMdev] Use still stuck around after Def is destroyed:
...w pointer" mentioned). This gives me:
While deleting: i32 (i32)** %Shadow Variable for ptr1
Use still stuck around after Def is destroyed:i8* bitcast (i32
(i32)** @"Shadow Variable for ptr1" to i8*)
opt: Value.cpp:75: virtual llvm::Value::~Value(): Assertion
`use_empty() && "Uses remain when a value is destroyed!"' failed.
I only see this after my Pass' runOnModule() method is done. I'm not
sure what I'm doing wrong, this seems like a legitimate actions. I
also cant come up with another way to do this.
Any advice?
Thank you
2014 Aug 09
3
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
On Sat, Aug 9, 2014 at 6:06 AM, Tim Northover <t.p.northover at gmail.com>
wrote:
> Hi Rob,
>
> On 9 August 2014 02:03, Rob Jansen <jansen at cs.umn.edu> wrote:
> > Why is the first for loop not equivalent to the second?
>
> In the second loop, "*ui" is an llvm::Use object. It's owned by a
> User, but isn't a subclass of one. To match the
2008 Feb 15
2
[LLVMdev] Possible Bad Assertion in Value.cpp
Dear All,
I'm getting the following assertion from a program I've written:
/home/vadve/criswell/src/llvm22/lib/VMCore/Value.cpp:57: virtual
llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a
value is destroyed!"' failed.
This occurs when I free a Module (the program uses an auto_ptr() to the
Module, and the auto_ptr() moves out of scope).
It looks like the code that frees a BasicBlock frees all of its
instructions in order without reg...
2013 Mar 27
2
[LLVMdev] cyclical use between caller and callee
...%read)
F is used in instruction:
%"calling function" = call i32 @X.foo(i32 %read)
While deleting: i32 (i32)* %X.foo
Use still stuck around after Def is destroyed: %"calling function" =
call i32 @X.foo(i32 %read)
mytests: Value.cpp:75: virtual llvm::Value::~Value(): Assertion
`use_empty() && "Uses remain when a value is destroyed!"' failed.
regardless of which one i call first.
What is the appropiate way to delete a function from an existing module?
2019 Apr 01
2
Instruction Execution With Hard Limitation at Runtime
...; preds = %ifElseEnd41,
%ifThen1
...
but, when I run my program by RuntimeDyld, I got an error:
While deleting: i32 %
Use still stuck around after Def is destroyed: %380 = phi i32 [ %40,
%ifThen1 ], [ <badref>, %ifElseEnd41 ], !dbg !27
Assertion failed: (use_empty() && "Uses remain when a value is
destroyed!"), function ~Value, file
/Users/duanbing/Project/llvm/llvm/lib/IR/Value.cpp, line 90.
Can you give me some tips about what's happened or how to debug this?
Thanks!
-------------- next part --------------
An HTML attachment was scru...
2011 Oct 26
0
[LLVMdev] Use still stuck around after Def is destroyed:
...This gives me:
>
> While deleting: i32 (i32)** %Shadow Variable for ptr1
> Use still stuck around after Def is destroyed:i8* bitcast (i32
> (i32)** @"Shadow Variable for ptr1" to i8*)
> opt: Value.cpp:75: virtual llvm::Value::~Value(): Assertion
> `use_empty() && "Uses remain when a value is destroyed!"' failed.
>
> I only see this after my Pass' runOnModule() method is done. I'm not
> sure what I'm doing wrong, this seems like a legitimate actions. I
> also cant come up with another way to do this.
>...
2010 Jun 04
0
[LLVMdev] Duplicating a Basic Block
...o use CloneBasicBlock, but when I used it I get an
> error :
>
> While deleting: i32* %a
> Use still stuck around after Def is destroyed: store i32* %a, i32** %p,
> align 4
> opt: /home/ambika/llvm_3/llvm-2.6/lib/VMCore/Value.cpp:81: virtual
> llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value
> is destroyed!"' failed.
> 0 opt 0x08471218
> Aborted
>
> This message is printed inside destructor of class value .
> Now I dont understand that after all the instructions are duplicated why
> does thios kind of error co...
2013 Oct 24
2
[LLVMdev] LLVM use chains
...r::printModule(llvm::Module const*)
(gdb) p m_CurTransaction->getModule()->dump()
llvm::AssemblyWriter::printGlobal (this=0x7fff5fbfe850, GV=0x107274058)
at
/Users/vvassilev/workspace/root/interpreter/llvm/src/lib/IR/AsmWriter.cpp:1444
1444 if (GV->isMaterializable())
(gdb) p GV->use_empty()
$78 = false
(gdb) p GV->use_back()
$79 = (class llvm::User *) 0x107279b88
(gdb) p GV->use_back()->dump()
i8* getelementptr inbounds ([21 x i8]* @.str1, i32 0, i32 0)
$80 = void
(gdb) p (('llvm::Instruction'*)GV->use_back())
$81 = ('llvm::Instruction' *) 0x107279b88
(gd...