similar to: [LLVMdev] Steps to addDestination

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Steps to addDestination"

2013 Jul 23
0
[LLVMdev] Steps to addDestination
Hi Rasha, > I need to addDestination to some basic blocks Just to make sure there's no confusion here: you really are trying to create code like: define i32 @foo(i1 %tst) { %Address = select i1 %tst, i8* blockaddress(@foo, %true), i8* blockaddress(@foo, %false) indirectbr i8* %Address, [label %true, label %false] ; This is what you're creating true: ret i32 42 false: ret i32
2013 Jul 24
2
[LLVMdev] Steps to addDestination
Hi 1- for(rit=Result.begin();rit!=Result.end();++rit) { Value* Address= BlockAddress::get (*rit); IndirectBrInst *IBI = IndirectBrInst::Create(Address, Result.size(),i->getTerminator() ); IBI->addDestination((*rit)); } I tried this code , but the needed destination wasn't added. 2- About LLVM backend $ llc -march=cpp example_file.ll -o I think it
2013 Jul 23
2
[LLVMdev] Steps to addDestination
1- I need the first example. 2- I set the Address uninitialized according to the documentation " Setting the name on the Value automatically updates the module's symbol table" from Value.h source code 3- I'm not sure about "select" instruction, you mean that the address is the new destination (basic block)that will be added Thanks On 23 July 2013 16:38, Tim Northover
2013 Jul 25
0
[LLVMdev] Steps to addDestination
Hi Rasha, > for(rit=Result.begin();rit!=Result.end();++rit) > { > Value* Address= BlockAddress::get (*rit); > > IndirectBrInst *IBI = IndirectBrInst::Create(Address, Result.size(),i->getTerminator() ); > IBI->addDestination((*rit)); > } This would be creating a block looking something like: [ Do stuff ] indirectbr i8*
2013 Jul 24
0
[LLVMdev] Steps to addDestination
Hi Rasha, On Wed, Jul 24, 2013 at 12:28 AM, Rasha Omar <rasha.sala7 at gmail.com> wrote: > 1- I need the first example. Oh good. > 2- I set the Address uninitialized according to the documentation > " Setting the name on the Value automatically updates the module's symbol > table" from Value.h source code That's referring to a string name, and is only really
2018 Aug 30
4
crash problem when using IndirectBrInst to replace BranchInst
Hello all, I have written a pass, which replaces condition branchinst using indirectBr to obfuscate program. The origin IR is as the following: br i1 %1, label %2, label %3 And the transformed IR is as the follwoing: %4 = select i1 %1, i8* blockaddress(@func, %2), i8* blockaddress(@func, %3) indirectbr i8* %4, [label %2, label %3] The pass's core function is as the
2018 Aug 31
2
crash problem when using IndirectBrInst to replace BranchInst
With Debug mode, it shows the assert error: Assertion failed: (I != BlockLiveness.end() && "Predecessor not found"), function calculateLocalLiveness, file lib/CodeGen/StackColoring.cpp, line 782. 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'busybox/archival/libarchive/decompress_bunzip2.c'. 4. Running
2010 May 04
2
[LLVMdev] Question about GVN
Hello, I was investigating GVN.cpp file and I found suspicious part: 1587 bool NeedToSplitEdges = false; 1588 for (pred_iterator PI = pred_begin(LoadBB), E = pred_end(LoadBB); 1589 PI != E; ++PI) { 1590 BasicBlock *Pred = *PI; 1591 if (IsValueFullyAvailableInBlock(Pred, FullyAvailableBlocks)) { 1592 continue; 1593 } 1594 PredLoads[Pred] = 0; 1595 1596 if
2012 Dec 01
0
[LLVMdev] [RFC] "noclone" function attribute
On 12/1/2012 10:02 AM, James Molloy wrote: > > I'm proposing a new function attribute, "noclone", with the semantics that "calls to functions marked "noclone" cannot be cloned or duplicated into the same function.". That is, it is illegal to call J = I->clone() then attach J to the same basic block as I if I is marked "noclone". The class Loop
2009 Feb 11
2
problem with 'which' and strings
I have written a function that goes through a database and calculates various metric scores and allocates them to a data set. For 400 of the 500 sites that I calculate these metrics for works fine and allocates the scores into the appropriate column. For some reason, some sites I run into the below problem: Here is what I am doing: > names(orig.metric) [1] "BenInsect"
2010 Mar 15
3
[LLVMdev] LLVM tries to remove labels used in blockaddress()
Hi, i ran into a problem when using blockaddress() with a label in another function. It seems to me that LLVM tries to remove the label used in blockaddress because it seems like it is not used, but in fact it may be used somewhere with a indirectbr. I attached a small test-case that produces this error. (The original problem is much more complicated, so i hope the reduced example, which has no
2010 Mar 15
0
[LLVMdev] LLVM tries to remove labels used in blockaddress()
On Mar 15, 2010, at 7:11 AM, Sebastian Schlunke wrote: > Hi, > > i ran into a problem when using blockaddress() with a label in another function. It seems to me that LLVM tries to remove the label used in blockaddress because it seems like it is not used, but in fact it may be used somewhere with a indirectbr. > > I attached a small test-case that produces this error. (The
2010 Dec 11
3
[LLVMdev] indirectbr/blockaddress question
In my llvm jit project I needed to lookup BB addresses at execution time and then jump to the corresponding BB. A C++ routine called at runtime from IR finds the right BB, gets its BlockAddress and returns it as an i8*. The IR does an indirectbr on this value... Well, not really. The routine returns the address of a BlockAddress node. Is there any way to get the real runtime code address for the
2010 Mar 15
3
[LLVMdev] LLVM tries to remove labels used in blockaddress()
I see. But the block does not necessarily contain dead code. My original problem is more like this: define i32 @main() { entry: %target = bitcast i8* blockaddress(@test_fun, %test_label) to i8* call i32 @test_fun(i8* %target) ret i32 0 } define i32 @test_fun(i8* %target) { entry: indirectbr i8* %target, [label %test_label] test_label: ; assume some code here... br label %ret ret: ret
2010 Mar 15
2
[LLVMdev] LLVM tries to remove labels used in blockaddress()
On Mar 15, 2010, at 9:41 AM, Chris Lattner wrote: > > On Mar 15, 2010, at 7:11 AM, Sebastian Schlunke wrote: > >> Hi, >> >> i ran into a problem when using blockaddress() with a label in another function. It seems to me that LLVM tries to remove the label used in blockaddress because it seems like it is not used, but in fact it may be used somewhere with a
2011 Jul 31
3
[LLVMdev] SwitchInst::addCase with BlockAddress
I'm trying to figure out how to feed a blockaddress to a switch condition AND destination (basically emulating an indirectbr via a switch; I know it's not a good approach, I'm just experimenting). Suppose I have the following: SwitchInst *s = SwitchInst::Create(...); BasicBlock *bb = ...; PtrToIntInst k = new PtrToIntInst(BlockAddress::get(bb), <TYPE>, "", s);
2010 Aug 02
2
[LLVMdev] indirectbr and phi instructions
Hi, How does the requirement that phi instructions have one value per predecessor basic block interact with indirectbr instructions? For instance, take the following code: L1: br i1 %somevalue, label %L2, label %L3 L2: %ret1 = i8* blockaddress(@myfunction, %L5) br label %L4 L3: %ret2 = i8* blockaddress(@myfunction, %L6) br label %L4 L4: %ret = phi i8* [%ret1, L2], [%ret2, L3]
2010 Mar 15
0
[LLVMdev] LLVM tries to remove labels used in blockaddress()
On Mar 15, 2010, at 10:01 AM, Sebastian Schlunke wrote: > I see. But the block does not necessarily contain dead code. This case is now fixed in r98566, I will fix the 'dead block' case in a bit. -Chris > > My original problem is more like this: > > define i32 @main() { > entry: > %target = bitcast i8* blockaddress(@test_fun, %test_label) to i8* > > call
2010 Mar 15
1
[LLVMdev] LLVM tries to remove labels used in blockaddress()
Works like a charm! Thanks for the fast help. :) - Sebastian On Monday 15 March 2010 20:10:54 you wrote: > > On Mar 15, 2010, at 10:01 AM, Sebastian Schlunke wrote: > > > I see. But the block does not necessarily contain dead code. > > This case is now fixed in r98566, I will fix the 'dead block' case in a bit. > > -Chris > > > > > My
2010 Dec 12
0
[LLVMdev] indirectbr/blockaddress question
On Sat, Dec 11, 2010 at 4:19 PM, Maurice Marks <maurice.marks at gmail.com> wrote: > In my llvm jit project I needed to lookup BB addresses at execution time and > then jump to the corresponding BB. A C++ routine called at runtime from IR > finds the right BB, gets its BlockAddress and returns it as an i8*. The IR > does an indirectbr on this value... > Well, not really. The