search for: basicblockutil

Displaying 20 results from an estimated 37 matches for "basicblockutil".

Did you mean: basicblockutils
2010 Jul 18
2
[LLVMdev] How to insert a basic block in an edge
...1 has two succesor bb3 and bb4, and bb3 has two >> predecessor bb1 and bb2. Now how can I insert a basic block between >> bb1 and bb3 that at the edge bb1-->bb3 . >> >> In general how can I insert a basic block on an edge? > > Use llvm::SplitEdge in Transforms/Utils/BasicBlockUtils.h. > > The technique is to create a new bb with a single branch to bb3, then modify > bb1's use of bb3 to point to 'new bb' instead, then fix up any phi nodes in > bb3 by replacing uses of bb1 with 'new bb'. > > Nick >
2018 Jun 13
2
RFC: cleanup in Transforms/Utils
Hi, I'm looking to see what's the best way to solve the fact that these two utils mostly do the same thing: 1. lib/Transforms/Utils/Local.cpp : MergeBasicBlockIntoOnlyPred 2. lib/Transforms/Utils/BasicBlockUtils.cpp : MergeBlockIntoPredecessor (+cc some of the folks who touched at least one of these either originally or recently) Brief overview: 1. MergeBasicBlockIntoOnlyPred 2. MergeBlockIntoPredecessor Update DT Update DT Update either DT or DDT Updates LI and MemoryDependenceResults Move all instructi...
2010 Jul 20
2
[LLVMdev] How to insert a basic block in an edge
...>>>> predecessor bb1 and bb2. Now how can I insert a basic block between >>>> bb1 and bb3 that at the edge bb1-->bb3 . >>>> >>>> In general how can I insert a basic block on an edge? >>> >>> Use llvm::SplitEdge in Transforms/Utils/BasicBlockUtils.h. >>> >>> The technique is to create a new bb with a single branch to bb3, then >>> modify >>> bb1's use of bb3 to point to 'new bb' instead, then fix up any phi nodes >>> in >>> bb3 by replacing uses of bb1 with 'new bb'....
2016 Jun 21
3
function call replacement
...ed to clone the current instruction to not modify the iterator but the ReplaceInstWithInst will cause troublesplaceInstWithInst(llvm::SymbolTableList<llvm::Instruction>&, llvm::ilist_iterator<llvm::Instruction>&, llvm::Instruction*) /home/pierre/Desktop/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:198:0 #7 0x0000000002abc2a5 llvm::ReplaceInstWithInst(llvm::Instruction*, llvm::Instruction*) /home/pierre/Desktop/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:210:0 Any idea on what could be the cause of the null pointer and how to avoid it? Thanks a lot for your time! Pierre On 20 June...
2010 Jul 17
2
[LLVMdev] How to insert a basic block in an edge
Hi all, Suppose in a CFG bb1 has two succesor bb3 and bb4, and bb3 has two predecessor bb1 and bb2. Now how can I insert a basic block between bb1 and bb3 that at the edge bb1-->bb3 . In general how can I insert a basic block on an edge? Regards, Chayan
2010 Jul 17
0
[LLVMdev] How to insert a basic block in an edge
...> Suppose in a CFG bb1 has two succesor bb3 and bb4, and bb3 has two > predecessor bb1 and bb2. Now how can I insert a basic block between > bb1 and bb3 that at the edge bb1-->bb3 . > > In general how can I insert a basic block on an edge? Use llvm::SplitEdge in Transforms/Utils/BasicBlockUtils.h. The technique is to create a new bb with a single branch to bb3, then modify bb1's use of bb3 to point to 'new bb' instead, then fix up any phi nodes in bb3 by replacing uses of bb1 with 'new bb'. Nick
2012 Jul 16
1
[LLVMdev] Merge 2 BasicBlocks
Hi! I'm trying to merge 2 basicblocks. I look in BasicBlockUtils.h but the merge function does not what I want. I'm trying to merge basicblock from a switch where the 'case' have no break, from that: int a; switch(c) { case 3: a=1; case 2; b=1; case 1: c=1; } to that: int a; switch(c) { case 3: a=1...
2019 Nov 05
2
Seeking clarification about indirect critical edges
Hello all! (I apologize if I've ended up in the wrong list!) I'm trying to get a better understanding of LLVM's critical edge splitting, as documented in `Transforms/Utils/BasicBlockUtils.h`; specifically in the case of critical edges which are indirect transfer. The code comments discuss the following example: a CFG with direct edges A->D, B->D, and an indirect critical edge I->D; in this case two identical "dummy" nodes D0A and D0B would be inserted before D,...
2010 Jul 18
0
[LLVMdev] How to insert a basic block in an edge
...nd bb4, and bb3 has two >>> predecessor bb1 and bb2. Now how can I insert a basic block between >>> bb1 and bb3 that at the edge bb1-->bb3 . >>> >>> In general how can I insert a basic block on an edge? >> >> Use llvm::SplitEdge in Transforms/Utils/BasicBlockUtils.h. >> >> The technique is to create a new bb with a single branch to bb3, then modify >> bb1's use of bb3 to point to 'new bb' instead, then fix up any phi nodes in >> bb3 by replacing uses of bb1 with 'new bb'. >> >> Nick >> >
2010 Jul 21
0
[LLVMdev] How to insert a basic block in an edge
...decessor bb1 and bb2. Now how can I insert a basic block between >>>>> bb1 and bb3 that at the edge bb1-->bb3 . >>>>> >>>>> In general how can I insert a basic block on an edge? >>>> >>>> Use llvm::SplitEdge in Transforms/Utils/BasicBlockUtils.h. >>>> >>>> The technique is to create a new bb with a single branch to bb3, then >>>> modify >>>> bb1's use of bb3 to point to 'new bb' instead, then fix up any phi nodes >>>> in >>>> bb3 by replacing uses of bb1...
2015 Jul 01
4
[LLVMdev] AliasAnalysis update interface - a tale of sorrow and woe
...hitting this stems from the update API, which consists of three virtual functions: deleteValue(Value *V) copyValue(Value *From, Value *To) addEscapingUse(Use &U) These interfaces are *very* rarely called. Here are the only passes that ever bother to use these: - MemoryDependenceAnalysis.cpp - BasicBlockUtils.cpp - LoopSimplify.cpp - MergedLoadStoreMotion.cpp - GVN.cpp That's it. This is not a complete set of code that can delete a load or store, nor a complete list of things which can fold something into a Phi node or otherwise trigger an "escaping" use. Maybe these interfaces used to b...
2019 Nov 06
2
Seeking clarification about indirect critical edges
...g > *Subject:* [llvm-dev] Seeking clarification about indirect critical edges > > > > Hello all! (I apologize if I've ended up in the wrong list!) > > I'm trying to get a better understanding of LLVM's critical edge > splitting, as documented in `Transforms/Utils/BasicBlockUtils.h`; > specifically in the case of critical edges which are indirect transfer. > > The code comments discuss the following example: a CFG with direct edges > A->D, B->D, and an indirect critical edge I->D; in this case two identical > "dummy" nodes D0A and D0B woul...
2012 Apr 09
3
[LLVMdev] How to instrument a this function using insertBefore instruction???
...ic.h" #include "llvm/Analysis/LoopIterator.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpander.h" #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Type.h" #include "llvm/LLVMContext.h" #include "llvm/Support/Casting.h" #include "stdio.h" #include "llvm/Module.h" using namespace llvm; int check() { printf("...
2011 Aug 02
3
[LLVMdev] Multiple successors, single dynamic successor
Nella citazione martedì 2 agosto 2011 20:02:08, Michael Ilseman ha scritto: > I'm assuming that you're talking about a situation where this can't be > determined statically in the existing LLVM IR, but you know it's true > and want to put it in (e.g. you're the one generating LLVM IR). Correct. Or, more precisely, I'd like to investigate macro compression, i.e.
2012 Apr 09
2
[LLVMdev] How to instrument a this function using insertBefore instruction???
...;llvm/Analysis/LoopIterator.h" > #include "llvm/Analysis/LoopPass.h" > #include "llvm/Analysis/ScalarEvolution.h" > #include "llvm/Analysis/ScalarEvolutionExpander.h" > #include "llvm/Support/Debug.h" > #include "llvm/Transforms/Utils/BasicBlockUtils.h" > #include "llvm/Transforms/Utils/Cloning.h" > #include "llvm/Type.h" > #include "llvm/LLVMContext.h" > #include "llvm/Support/Casting.h" > #include "stdio.h" > > #include "llvm/Module.h" > using namespace...
2012 Apr 09
0
[LLVMdev] How to instrument a this function using insertBefore instruction???
...ic.h" #include "llvm/Analysis/LoopIterator.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpander.h" #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Type.h" #include "llvm/LLVMContext.h" #include "llvm/Support/Casting.h" #include "stdio.h" #include "llvm/Module.h" using namespace llvm; int check() { printf("...
2016 Jun 20
3
function call replacement
Hi everyone, I am trying to replace the call of a certain function with a call to another function. It would for example replace the following: %call = tail call noalias i8* @func(i64 10) by %call = tail call noalias i8* @other_func(i64 10) I managed to declare other_func correctly but I am having troubles to understand how I should proceed to do the replacement. I tried to use
2009 Aug 13
0
[LLVMdev] CallGraph - Dominators and Loop Information
...one, Can LLVM calculate DominatorTree and LoopInfo for call graphs? For example, I need to know if an edge (function1->function2) is a backedge. If there was a DominatorTree for call graphs that would be easy. Since I haven't found, I've copied the algorithm FindFunctionBackedges in BasicBlockUtils.cpp and modified it to use call graphs. Unfortunately, since the call graphs are not reducible, the algorithm does not find backedges correctly. It finds backedges where it shouldn't. Also, I need to know if a function in a call graph is a loop head. If a loop exists, which functions belong...
2011 Oct 29
2
[LLVMdev] Help regarding basic blocks in LLVM
Is there a way to combine basic blocks in LLVM? I want to form Extended Basic Blocks in LLVM.
2012 Apr 09
0
[LLVMdev] How to instrument a this function using insertBefore instruction???
...ic.h" #include "llvm/Analysis/LoopIterator.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpander.h" #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Type.h" #include "llvm/LLVMContext.h" #include "llvm/Support/Casting.h" #include "stdio.h" #include "llvm/Module.h" using namespace llvm; int check() { printf("...