Questions tagged [ssa]

Static single assignment is a property of a compiler's intermediate representation for optimization and static analysis.

Static single assignment is an intermediate representation where each "variable" is assigned only once. When translating from a form with mutable variables, each variable is replaced with a set of variables representing each possible assignment in order to make the definition and usage of every value explicit.

63 questions
0
votes
0 answers

What is critical edge spliting used for?

In llvm IR's phi elimination, before adding move instructions to eliminate phi instructions, we need to split the cirtical edge. I don't know what the process of spliting critical edge is used for exactly. In some online or book sources, the edge…
hnyls2002
  • 103
  • 8
0
votes
1 answer

How to eliminate phi instructions in transformed SSA?

I am working on a homework compiler project and I have done the mem2reg pass and got some phi instructions in my LLVM IR. However, I am confused about how to eliminate the phi nodes (phi destruction). After searching online and reading some chapters…
0
votes
1 answer

Algorithms for repairing ssaa form after modifying the call-flow graph

I'm learning about compiler optimizations on ssa form. One difficulty I'm having is how to retain/repair/reconstruct the ssa form after modifying the structure of the call-flow graph. Suppose I have the following cfg (the a, b, c variables are…
Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
0
votes
1 answer

Do basic block parameters mean code locality?

Most modern compilers use some form of SSA for internal representation, which needs some notation for variables whose values can come from more than one source. The classic version uses phi nodes. Basic block parameters are also an option. As I…
rwallace
  • 31,405
  • 40
  • 123
  • 242
0
votes
1 answer

How to find out golang SSA function return type

hello i am new to static analysis and try to use golang's SSA package to analyze our code. For example i want to print all function infos in the package, the example code is: dir := PROJECT_PATH cfg := packages.Config{ Mode:…
sigure
  • 13
  • 1
0
votes
1 answer

LLVM pass doesn't perform single static assignment

I'm using the prebuilt LLVM 6.0, when I perform llvm pass -mem2reg to generate SSA, the IR code remains as is without being changed. But when I use the prebuilt LLVM 3.8 to do the same thing, the llvm pass works. However, I need to use LLVM 6.0…
Mohannad
  • 93
  • 12
0
votes
0 answers

Execute SSA code

I have a SSA code in text file it was generated from golang. How can I compile this SSA code and execute it? P.S I don't have an original go code.
Geha
  • 1,345
  • 2
  • 10
  • 16
0
votes
1 answer

ASM code generation look ahead and complexity

I have an AST with nodes like funcDef, funcCall, literals, and so on. I'm working on the code generator part of my compiler, generating assembly for x86_64. My question is what is the "proper" (industry standard) way of code generating down an…
0
votes
0 answers

Which nodes should be included in CFG?

I'm writing a source-code-level optimizer for a language (LSL) whose server-side compiler is non-optimizing. The optimizer is working and performing well in some fields like constant folding, but to make it stronger, I wanted to build a CFG, to…
0
votes
0 answers

How to extract the operands and operators from the instructions in SSA IR

I am trying to build a mapping between SSA IR instructions to original instructions of a JavaScript file. I already got the IR of the JavaScript files. But the IR output is quite confusing to me. I am using Watson Libraries for Analysis (WALA) for…
Rubaiyat Jahan Mumu
  • 3,887
  • 1
  • 33
  • 35
0
votes
1 answer

SSA representation of updating a variable in enclosing scope

When a compiler is using SSA form to represent code, updates to local variables become new variables. But this doesn't always work when the variable is in an enclosing scope, e.g. (using JavaScript syntax for illustration, the situation could occur…
rwallace
  • 31,405
  • 40
  • 123
  • 242
0
votes
0 answers

Automatic forecasting time series in R using SSA

I want to do an automatic forecast for a bunch of time series using Singular Spectrum analysis in R-Studio (RSSA package). The main problem is that I can't figure out which window length is better to chose for each of the time series. I tried to do…
0
votes
1 answer

Generating SSA for functions that use pointers

I am trying to convert an imperative-style programming language into Administrative Normal Form (ANF) by using the algorithm described in this paper: http://www.sciencedirect.com/science/article/pii/S1571066105825964 In the paper, Zadarnovsky et al.…
0
votes
2 answers

Fast calculation of dominators

It is said that when converting intermediate code to static single assignment form, It is necessary to calculate the dominators of basic blocks The somewhat obvious way to do this as a fixed point of equations is slow To do it fast, you need to use…
rwallace
  • 31,405
  • 40
  • 123
  • 242
0
votes
1 answer

R packages Rssa is not imported to python with rpy2 importr

When I executed in Python command rssa = importr('Rssa') I got eroor Traceback (most recent call last): File "", line 1, in rssa = importr('Rssa') File "C:\Python34\lib\site-packages\rpy2\robjects\packages.py", line…
Antonina
  • 604
  • 1
  • 5
  • 16