May 2015
Intermediate to advanced
296 pages
5h 10m
English
In this recipe, we will see how we can transform the IR from one form to another using the opt tool. We will see different optimizations being applied to IR code.
You need to have the opt tool installed.
The opt tool runs the transformation pass as in the following command:
$opt –passname input.ll –o output.ll
$ cat multiply.c int mult() { int a =5; int b = 3; int c = a * b; return c; }
$ clang -emit-llvm -S multiply.c -o multiply.ll $ cat multiply.ll ; ModuleID = 'multiply.c' target datalayout ...
Read now
Unlock full access