Skip to content

Instantly share code, notes, and snippets.

@brunsgaard
Created September 21, 2013 09:02
Show Gist options
  • Save brunsgaard/6648769 to your computer and use it in GitHub Desktop.
Save brunsgaard/6648769 to your computer and use it in GitHub Desktop.
Static analysis is the process of automatically analysing the behavior of a
computer program based on the source code of the program. The main goals of
static analysis is to improve correctness and efficiency of the program. Static
analysis is part of every modern compiler today and the techniques in static
analysis continues to expand and improve.
In this project we aim to improve the static analysis performed by the L0
compiler and thereby improving correctness and efficiency of programs written
in L0.
We will use the ability to compare expressions where one or more variable
contains ranges.
As an example consider the expression a > b for the range a = [0:10] and b =
[30:100]. In this case, even though a and b are represented by ranges, we will
always be able to determine that the expression a < b is true, and thereby we
can be evaluate the expression to true at the time of compiling.
Often the range of a variable in a program is influenced by other variables,
and thus we also need to explore how ranges are propagated throughout the
program to be able to fully take advanguous of the ability to compare ranges
Symbolic range propagation allows for many kinds of beneficial transformations
in the static analysis, including detection of zero-trip loops, dead-code
elimination, determination of array sections referenced by an array access, and
loop trip-count estimation.[ref from article.]
We will explore how we can use the technique to compare relative comparison
(=,<,>), which then might be evaluated at compile time. And to check if array
access stays within it's bound, allowing the compiler to remove guards in the
resulting machine code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment