Skip to content

Pass to get if-else and loop forest for performing static analysis

Notifications You must be signed in to change notification settings

akothen/LLVMCondLoopInfoPass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Condition-Loop-Info-LLVM-Pass

Pass to get if-else and loop forest for use by other passes for performing static analyses. This pass provides a conveninent interface to analyze if-else blocks containing loops or vice-versa. One of the possible applications is to simply perform flow-sensitive anlyses without having to iterate over blocks in if-else program constructs over and over again.

For example, as of LLVM 10.0, for determining whether a loop executes at least once (for LICM optimization), LLVM checks whether the latches execute at least once by ensuring that they are not part of any if-else constructs, and if they are, they are deemed to potentially not execute at least once. In order to make this determination, LLVM reverse-iterates over the blocks in a loop from a given latch to the point that it knows will execute at least once and then iterate the control flow graph again to find its way to the latch without having it traverse some other path because of some conditional branch leading up to it. This analysis can easily leverage the if-else-and-loop forest information in this case instead of iterating over the blocks in the loops over and over again and potentially reduce the time to perform the LICM optimization on loops.

About

Pass to get if-else and loop forest for performing static analysis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published