similar to: [LLVMdev] <badref> showed up when duplicating a list of dependent instructions

Displaying 20 results from an estimated 500 matches similar to: "[LLVMdev] <badref> showed up when duplicating a list of dependent instructions"

2011 May 09
0
[LLVMdev] <badref> showed up when duplicating a list of dependent instructions
Hi Chuck, > std::vector<Instruction *>::iterator p; > Instruction * pi = PREVIOUS_POSITION; > BasicBlock * pb = PREVIOUS_POSITION->getParent(); > > for(p = coll.begin(); p != coll.end(); ++p){ > Instruction * CurI = * p; > Instruction * CloneI = CurI->clone(); clone doesn't know have any magical way of knowing that it should update the instruction's
2011 May 05
0
[LLVMdev] identifying all dependent instructions through multi-levels of def-use relationship
Dear Chuck, I haven't read all of the details, but it seems that what you need to do is to clone defs before you clone any uses of the def. To do that, you want to iterate over the instructions in dominator-tree order. To do that, you first construct the dominator tree (there is an LLVM analysis pass that does that). Then, you iterate over the basic blocks in the dominator tree from
2011 May 04
2
[LLVMdev] identifying all dependent instructions through multi-levels of def-use relationship
While working on my optimization pass (a Function Pass), I try to replicate a call instruction and insert it at some earlier location (similar to LICM). However, the instruction I am trying to replicate has dependencies on an uncertain number of instructions that are used to generate an address. A simple example (IR segment): define void @foo() nounwind { entry: %a = alloca i32, align 4;
2012 Nov 02
0
[LLVMdev] Instruction does not dominate all uses! <badref> ??
edA-qa mort-ora-y wrote: > I'm having trouble figuring out what the error "Instruction does not > dominate all uses!" means. I'm trying to construct a call to a function > with two parameters. The printed IR, with error, looks like this: > > define i32 @add(i32, i32) { > EntryBlock: > %2 = add i32 %0, %1 > ret i32 %2 > } > > define i32
2012 Nov 02
4
[LLVMdev] Instruction does not dominate all uses! <badref> ??
I'm having trouble figuring out what the error "Instruction does not dominate all uses!" means. I'm trying to construct a call to a function with two parameters. The printed IR, with error, looks like this: define i32 @add(i32, i32) { EntryBlock: %2 = add i32 %0, %1 ret i32 %2 } define i32 @eval_expr() { EntryBlock: ret i32 <badref> } Instruction does not dominate
2009 Aug 11
1
[LLVMdev] globals, modules and badref.
While adapting my JIT compiler to ToT coming from 2.5, I found this: Referencing global in another module! %3 = bitcast [8 x i8]** <badref> to i8* ; <i8*> [#uses=1]Instruction <badref> is a naked (void*) pointer. This worked on 2.5 without problem. I tried creating a GlobalVariable: external constant [8 x i8]* ; <[8 x i8]**>:<badref>
2012 Nov 02
2
[LLVMdev] Instruction does not dominate all uses! <badref> ??
Okay, I've think I understand now. By using a "Value" object (like a function call) in another instruction does nothing more than use a reference to that value. It is still my responsibility to ensure that value/reference is actually created prior to its use in the block. On 02/11/12 12:16, Nick Lewycky wrote: > edA-qa mort-ora-y wrote: >> I'm having trouble figuring
2012 Nov 02
0
[LLVMdev] Instruction does not dominate all uses! <badref> ??
Hi edA-qa mort-ora-y, On 02/11/12 10:20, edA-qa mort-ora-y wrote: > I'm having trouble figuring out what the error "Instruction does not > dominate all uses!" means. I'm trying to construct a call to a function > with two parameters. The printed IR, with error, looks like this: > > define i32 @add(i32, i32) { > EntryBlock: > %2 = add i32 %0, %1 >
2013 Dec 04
2
[LLVMdev] DwarfDebug problems
Thanks for the quick response. I wrote some code to search “llvm.dbg.cu” for the function (right before the failed assertion): if (TheCU == nullptr) { errs() << "compile unit: " << TheCU << "\n scopeNode(" << FnScope->getScopeNode() << ") => " << *FnScope->getScopeNode() << "\n"; auto fn =
2013 Dec 04
0
[LLVMdev] DwarfDebug problems
On Tue, Dec 3, 2013 at 10:07 PM, Brandon Holt <bholt at cs.washington.edu> wrote: > Thanks for the quick response. > > I wrote some code to search “llvm.dbg.cu” for the function (right before the > failed assertion): > > if (TheCU == nullptr) { > errs() << "compile unit: " << TheCU << "\n scopeNode(" << >
2013 Dec 04
2
[LLVMdev] DwarfDebug problems
In your transform I'd take a look at things like the individual basic blocks you're replacing and the functions you're replacing and making sure that the various lexical blocks are being changed at the same time... -eric On Tue, Dec 3, 2013 at 11:12 PM, David Blaikie <dblaikie at gmail.com> wrote: > On Tue, Dec 3, 2013 at 10:07 PM, Brandon Holt <bholt at
2013 Dec 04
0
[LLVMdev] DwarfDebug problems
How do I find and update the lexical blocks? Is, for example, “CloneFunction” doing this in a way I can copy? I tried finding the subprogram node in “llvm.dbg.cu” and updating the function: DISubprogram s(*subprog_iter); if (s.getFunction() == F) { s.replaceFunction(NF); } But this didn’t seem to have any effect. Do I need to do something similar with every basic block or something? On Dec
2013 Dec 04
0
[LLVMdev] DwarfDebug problems
On Tue, Dec 3, 2013 at 9:04 PM, Brandon Holt <bholt at cs.washington.edu> wrote: > In a pass I’m working on, I’ve done some manipulation of several functions, replacing them with new copies with different types, etc. > > The LLVM IR passes the verifier, but when I have debug symbols enabled (“-g”), I get the following error when Clang generates the Dwarf info (using a very recent
2013 Dec 04
2
[LLVMdev] DwarfDebug problems
In a pass I’m working on, I’ve done some manipulation of several functions, replacing them with new copies with different types, etc. The LLVM IR passes the verifier, but when I have debug symbols enabled (“-g”), I get the following error when Clang generates the Dwarf info (using a very recent build of LLVM/Clang from Git mirror): > Assertion failed: (TheCU && "Unable to find
2013 Apr 09
3
[LLVMdev] Passing DW_TAG_typedef as the type to DIBuilder's createFunction
Hi David, I'm seeing an assertion failure when passing this node !{i32 786454, metadata <badref>, metadata <badref>, metadata !"fn_t", i32 5, i64 0, i64 0, i64 0, i32 0, metadata <badref>} ; [ DW_TAG_typedef ] [fn_t] [line 5, size 0, align 0, offset 0] [from ] as the function type parameter to DIBuilder::createFunction, due to this check in DebugInfo.cpp:
2013 Apr 09
0
[LLVMdev] Passing DW_TAG_typedef as the type to DIBuilder's createFunction
On Tue, Apr 9, 2013 at 1:53 AM, Duncan Sands <baldrick at free.fr> wrote: > Hi David, I'm seeing an assertion failure when passing this node > > !{i32 786454, metadata <badref>, metadata <badref>, metadata !"fn_t", i32 > 5, i64 0, i64 0, i64 0, i32 0, metadata <badref>} ; [ DW_TAG_typedef ] > [fn_t] [line 5, size 0, align 0, offset 0] [from ]
2013 Jan 22
1
[LLVMdev] Confusion about Alias Analysis Results -print-no-aliases&&-print-alias-sets
<div>Need help about Alias Analysis.</div><div>I try to detect use-after-free debug in source code. And my analysis is based on LLVM IR.</div><div>I use the following code as a small example. I want to get the result p&&q are alias.</div><div>//uaf.cpp</div><div><div>#include<iostream></div><div>using namespace
2013 Apr 10
2
[LLVMdev] Passing DW_TAG_typedef as the type to DIBuilder's createFunction
Hi Eric, On 10/04/13 00:20, Eric Christopher wrote: > On Tue, Apr 9, 2013 at 1:53 AM, Duncan Sands <baldrick at free.fr> wrote: >> Hi David, I'm seeing an assertion failure when passing this node >> >> !{i32 786454, metadata <badref>, metadata <badref>, metadata !"fn_t", i32 >> 5, i64 0, i64 0, i64 0, i32 0, metadata <badref>} ;
2002 Nov 27
1
[LLVMdev] Instruciton replacement
llvm is giving me some assertion errors when trying to replace an instruction, and I'm not quite sure of what to do. I have the following snippet of code: switch((*I)->getOpcode()) { case Instruction::Malloc: { AllocaInst *AI; AI = new AllocaInst(cast<AllocationInst>(*I)->getAllocatedType(), cast<AllocationInst>(*I)->getArraySize());
2013 Aug 02
1
[LLVMdev] replacing GetElementPtrConstantExpr with GetElementPtrInst ... sometimes
Hi During a pass, the XCore target lowers thread local global variables by turning them into global variable arrays indexed by the (max 8) thread ID. (see XCoreLowerThreadLocal.cpp) This works fine for instructions e.g. GetElementPtrInst But can't be done for constants e.g. GetElementPtrConstantExpr Thus I would like to replace GetElementPtrConstantExpr with GetElementPtrInst when it is