I am writing a pass in llvm that would identify loop invariants and hoist those instructions who are using those invariants, above the loop body. But for that i need to know whether there is any back edge from one node to another. For e.g. I want to find whether there is a back edge from node N to node H, where node H dominates node N, that would help me identify a natural loop. How can i find whether there is any edge from one node to another in the CFG ? I could not found any class called CFG in LLVM from which i could gather this information.
identifying a loop in LLVM CFG
1.9k Views Asked by Vikash Joshi At
2
There are 2 best solutions below
0
laprej
On
If you call the loop-simplify pass it will guarantee that there is only a single back edge to the loop header. This is a transformation pass so the CFG is modified but it makes additional CFG hacking far simpler.
Related Questions in LOOPS
- Java catch the ball Game
- Looping over defined array elements in Fortran
- Loop with equation for upper limit
- Extract series of observations from dataframe for complete sets of data
- Split a large query (2 days) into pieces to increase the speed in Postgres
- Java filewriter only writing last line to file?
- For loop inside if statement will not run and I'm not sure why
- How to change Boolean array to double array
- Recent development in recoding repeated variables in R?
- Service is reporting "service has reported an invalid current state 0."
- using a for loop to compare lists
- mutating method sent to immutable object' in nsmutablearray
- Efficiency penalty of initializing a struct/class within a loop
- the difference between zip and enumerat in for loop?
- How to loop each array for Counter function inside a list using Python?
Related Questions in LLVM
- llvm headers do not compile under msvc 2013
- clang -Xclang -cc1 -O3 mips.c -emit-llvm , clang error: -emit-llvm cannot be used when linking
- clang::HeaderSearch search path ignored
- Generate C++ style code using LLVM
- What does an overlong bitshift on a LLVM vector yield?
- How can I store arbitrary data in LLVM metadata?
- Error when compiling simple LLVM example with Mingw
- In LLVM IR, how can I print the name of a unnamed value which is represented as an unsigned numeric value with their prefix such as %2?
- Why static_assert calls in unused template methods in LLVM
- With Swift open sourced, what would it take to have it running on the JVM?
- How to compile LLVM .cpp file in Windows
- Xcode 7 command failed due to signal: illegal instruction 4
- c++ segfault on one platform (MacOSX) but not another (linux)
- Call to implicitly-deleted copy constructor in LLVM(Porting code from windows to mac)
- How do I compile with "ffast-math"?
Related Questions in NODES
- Issues with reversing the linkedlist
- C++ Unable to Print Pointer Data of a Linked List
- Send information to Maya node instance in cpp
- Couting nodes with onyl one child in BST
- Find the parent node of a node in binary search tree
- Tree implementation in C++: Cannot convert Node to Node*
- From 2 column csv to 2 color NetworkX graph
- SQL Tree Structure Table
- Multiple Node Styles
- Javax JCR Node getProperties and Titles
- Check if item exists in XML with AS3
- Constructor and const reference
- How to add children nodes to the last parent node
- Show nodes with more than one relationship using NEO4j
- How do I go about the traversal of Binary Search Trees?
Related Questions in EDGES
- Draw Edges in X3DOM
- From 2 column csv to 2 color NetworkX graph
- NetworkX - Create graph from node and attributes
- For finding Eulerian Circuit, storage of state of edge being visited or not
- What does boost::out_edges( v, g ) in Boost.Graph do?
- Is it possible to have several edge weight property maps for one graph?
- How can I fix this edge iterator assignment error?
- How to import a text file as a dictionary python
- Choosing vertices by edge weight
- Jung graph library: how to search vertices based on vertex property?
- How do I disable edge selection only in JGraphX?
- How do I change the edge style between an mxCell and mxPoint in mxgraph?
- Python: Edge List to an Adjacency Matrix using SciPy/Pandas shows IndexError: column index (3) out of bounds
- how to optimize layout in graphviz to remove unecessary edges intersections (crossings)?
- Graph auto-layout algorithm
Related Questions in CONTROL-FLOW-GRAPH
- Control Flow Graphs - find all linearly independent paths
- Understand control flow graph in lcov branch coverage output
- Can I translate an AST to SSA, or do I need to translate to a CFG then to SSA?
- Tool to compare control flow of disassembly and C
- control edge rendering of a network in vis.js
- Extracting Basic Blocks/CFG from LLVM/clang on the Backend
- Control flow graph dominance
- Flattening a control flow graph to structured code
- Decompilation creating basic blocks
- Decompilation independent pattern structuring of cfg
- Drawing cfg using antlr4, graphiz and python and parser is empty
- Static analysis of unused assignments
- identifying a loop in LLVM CFG
- How to determine if a BasicBlock is controled by a `if`
- Why are the variables "i" and "j" considered dead in the control flow graph?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can roll your own (by iterating over the successors of a basic block with
succ_iterator/succ_begin/succ_end) or you can useLoopInfo.