Commit 3ef9ed6e authored by Michael Schwarz's avatar Michael Schwarz
Browse files

Improve readme

parent 975116bb
# Examples for the Program Optimization Practical Course SS20
This is organized by analysis. For each analysis, there is at least one example consisting of
- the input C program (*.c)
- the resulting ll-file (*.ll)
- the input C program (`*.c`)
- the resulting ll-file (`*.ll`)
```
clang -emit-llvm -Xclang -disable-O0-optnone -c 1.c
llvm-dis 1.bc
```
Here, all local variables are turned into calls to `alloca` (i.e. they are accessed using pointers)
- the resulting ll-file after the mem2reg pass (*-opt.ll)
Here, all local variables are represented by calling `alloca` and then accessing them using pointers.
- the resulting ll-file after the mem2reg pass (`*-opt.ll`)
```
opt -mem2reg 1.bc -o 1-opt.bc
llvm-dis 1-opt.bc
```
This transforms the program so registers are used for local variables instead of memory accesses.
- the ll-file after mem2reg annotated with possible analysis results (*-opt-annotated.ll)
- a possible ll-file after applying the transformation based on the analysis result from the step before (*-opt-optimized.ll)
- the ll-file after mem2reg annotated with possible analysis results (`*-opt-annotated.ll`)
- a possible ll-file after applying the transformation based on the analysis result from the step before (`*-opt-optimized.ll`)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment