similar to: [LLVMdev] How to .. jump from inline asm to a BasicBlock?

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] How to .. jump from inline asm to a BasicBlock?"

2011 Jan 21
1
[LLVMdev] goto in inline asm
Is goto from inline asm supported in LLVM 2.8 ? I am searching for something similar to what gcc 4.5 does: http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Extended%20asm%20with%20goto http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Extended%20asm%20with%20goto which allows jumping from inline assembly to a label defined in C. I want to jump from inline asm to a basic block in LLVM.
2010 Oct 12
1
[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"
Hi, I tried adding the PHI nodes in BB_unique, and it works for the simple case described here, but in case the nodes were declared in some predecessors of ExitBB1 and used in ExitBB1_redirect and its successors, it won't work, unless I create entries for all of them in BB_unique. B1 (declares PHI_1) B3 | | B2
2010 Oct 13
4
[LLVMdev] Values have no names when generating *.ll files in clang and llvm 2.8 ?
Hello, I upgraded to llvm 2.8 and when I generate *.ll files from C/C++ with clang -S -emit-llvm I obtain a *.ll file in which instructions and basicblocks have no names. I tried as well compiling with the -g option, but no names were given. In the release notes it is indicated to use "--show-annotations" to print the number of uses. Is there something similar for assigning names to
2012 May 06
2
[LLVMdev] Metadata for Argument, BasicBlock
Hi everybody, Is there a clean way to attach metadata nodes to Arguments and/or BasicBlocks? It looks to me like one can directly attach metadata only to instructions. My current workaround is to insert a call to a dummy function that holds metadata for its parent block - pretty ugly, but manageable. The same problem arises when I want to store specific information about the arguments of a
2010 May 10
2
[LLVMdev] Separate loop condition and loop body
Hi, Is it possible to get the list of BasicBlocks building the condition of a loop and the list of BasicBlocks that form the body? My first approach was to iterate over the list of all Basicblocks of a loop and separate the header as the condition and the remaining as the body of the loop. However, this is not correct for instance in the case of a while loop in the form: while( A & B) do {
2010 Oct 11
3
[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"
Hi, I am working on a pass aimed to unify multiple exits of a loop into a unique basic block. The approach is straight forward: I create a unique BasicBlock BB_unique that has as predecessors all the exit blocks of the loop, it contains a phi instruction and a switch to redirect the flow correctly. Additionally, for each initial exit block I create an associated block that will jump to the
2011 Mar 01
3
[LLVMdev] metadata to inform the optimizers that some code should stay unchanged
Hello LLVM, I am working on some passes that perform code transformations. Since I am interested in performance, I apply the O3 passes, right after my pass. However, the optimization passes modify the code inserted by my pass in an undesirable way. As far I know, there is no way to prevent the optimizers from optimizing some regions of code. So what I intend to do is to attach metadata to the
2020 Mar 25
4
Multi-Threading Compilers
On Wed, Mar 25, 2020 at 8:52 AM Doerfert, Johannes <jdoerfert at anl.gov> wrote: > I think the solution space for the value/use-list issue might be larger > than what was mentioned so far. > > > Some random thoughts: > > If no pass ever walks the use list of a constant, except globals which > we could handle differently, we could get rid of their use-list or >
2013 Nov 02
2
[LLVMdev] Indirect branching to BasicBlock
Hello, I'm currently writing a function pass for LLVM and face the following problem. I want to store the address of a BasicBlock (or the label, as LLVM refers to it) in a local variable (AllocaInst). Later on I intend to indirectly branch to this address by "dereferencing" the variable. Is this possible? I tried creating an instance of AllocaInst but I'm not quite sure which
2018 Dec 05
3
Getting a BasicBlock address
Is there a defined way to get the address of a BasicBlock as a value? According to the language reference, any use outside of indirectbr and comparison against null is undefined. There is some wording about targets possibly allowing use in inline assembly. Is that really the only option? Is there anything a pass can query to see if it is allowed for a target? I don't see anything like that
2012 May 06
0
[LLVMdev] Metadata for Argument, BasicBlock
Hi Ralf, > Is there a clean way to attach metadata nodes to Arguments and/or > BasicBlocks? not at the moment. Feel free to work on adding this functionality! > It looks to me like one can directly attach metadata only to instructions. > My current workaround is to insert a call to a dummy function that holds > metadata for its parent block - pretty ugly, but manageable. The
2019 Jan 29
2
[cfe-dev] Create a BlockAddress array from LLVM Pass
Sorry for emailing both group. As I will have a constant array of BlockAddress, what type I should use in Constant Array for its ArrayType declaration? I am creating the list in following way: unsigned int nBr = fit->second.size(); llvm::Constant *listBA[nBr]; unsigned int Idx = 0; for (std::set<llvm::BasicBlock *>::iterator it = fit->second.begin(); it != fit->second.end(); ++it)
2011 Mar 04
0
[LLVMdev] metadata to inform the optimizers that some code should stay unchanged
Xinfinity wrote: > > > Hello LLVM, > > I am working on some passes that perform code transformations. Since I am > interested in performance, I apply the O3 passes, right after my pass. > However, the optimization passes modify the code inserted by my pass in an > undesirable way. As far I know, there is no way to prevent the optimizers > from optimizing some regions of
2010 Oct 11
0
[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"
On Oct 11, 2010, at 9:05 AM, Xinfinity wrote: > > Hi, > > I am working on a pass aimed to unify multiple exits of a loop into a unique > basic block. The approach is straight forward: > I create a unique BasicBlock BB_unique that has as predecessors all the exit > blocks of the loop, it contains a phi instruction and a switch to redirect > the flow correctly.
2019 Jan 28
2
Create a BlockAddress array from LLVM Pass
Hi Good day. For the following function local static constant array: static const __attribute__((used)) __attribute__((section("data"))) void *codetable[] = { &&RETURN, &&INCREMENT, &&DECREMENT, &&DOUBLE, &&SWAPWORD}; I have the following in the LLVM IR. @sampleCode.codetable = internal global [5 x i8*] [i8* blockaddress(@sampleCode, %19), i8*
2010 Jun 24
2
[LLVMdev] How to prevent an instruction to be executed more than once?
I need to mark the beginning of some regions of code, that I want to patch at runtime. In this case, I want to mark the beginning of BB4 and then to patch the jumps, because I want to temporarily change the flow at runtime and then to restore the previous version. In order to patch, I need to know the exact structure of the generated code. So, I might have a BasicBlock like: BB4: call void asm
2010 Jun 24
2
[LLVMdev] How to prevent an instruction to be executed more than once?
Hi LLVM-devs, I am looking for a way to prevent an instruction to be executed more than once, or duplicated .. I know that by default everything can be duplicated, but is there a work-around? The structure of the code is BB1 BB2 | | | | | | |----------| | v BB3 where the first instruction in BB3 is inserting an inline assembly
2020 Feb 28
2
Is BlockAddress always correct ?
Hi I use BlockAddress to get the address of BasicBlock , and I use GlobalVariable 's getInitializer() to pass the address of BasicBlock to the global variable of my own program and then I print it out. But , I found that BlockAddress is not always correct. For example, some function's rsp (stack pointer) or other register is maintained by caller, so it would be like:
2020 Mar 21
3
Multi-Threading Compilers
> On Mar 20, 2020, at 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
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);