Benjamin Müller
2011-Jul-05 20:46 UTC
[LLVMdev] Function Pass - Control Flow with uses-iterator
Hey there, i have a BasicBlock and in this BB i am going over it finding out the "uses" of each instruction to find out the dataflow, but how do i find out the control flow? or like how do i know that the next load function loads from a previous store function - i cant find this out with the uses iterator because of the SSA form. 1. %In2 = alloca float, align 4 (uses: instr. 12 and 13) .. .. 12. store % float %5, float* In2 (uses: nothing) 13. %6 = load float* %In2 (uses : ...) so instruction nr. 12 should tell me that its being used in 13. Is this possible? Thank you Benjamin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110705/b61654e9/attachment.html>
Eli Friedman
2011-Jul-05 21:00 UTC
[LLVMdev] Function Pass - Control Flow with uses-iterator
On Tue, Jul 5, 2011 at 1:46 PM, Benjamin Müller <mueller.benjamin1 at googlemail.com> wrote:> Hey there, > i have a BasicBlock and in this BB i am going over it finding out the "uses" > of each instruction to find out the dataflow, but how do i find out the > control flow? > or like how do i know that the next load function loads from a previous > store function - i cant find this out with the uses iterator because of the > SSA form. > > 1. %In2 = alloca float, align 4 (uses: instr. 12 and 13) > .. > .. > 12. store % float %5, float* In2 (uses: nothing) > 13. %6 = load float* %In2 (uses : ...) > > so instruction nr. 12 should tell me that its being used in 13. > Is this possible?Take a look at llvm/Analysis/MemoryDependenceAnalysis.h ; it can do computations similar to what you're looking for. -Eli
Maybe Matching Threads
- Could I do some control-flow and dataflow analysis cross files and functions via IR
- [PATCH] Optimize silk_warped_autocorrelation_FIX() for ARM NEON
- [PATCH] Optimize silk_warped_autocorrelation_FIX() for ARM NEON
- DAHDI with (CDR(userfield)
- [PATCH] Optimize silk_warped_autocorrelation_FIX() for ARM NEON