llvm-block catches identical basic blocks between two modules.
Since llvm-block draws on debug info, input modules should be generated with -g option.
- cmake
- make
- LLVM 10
- LLVM Debian/Ubuntu nightly packages
- Automatic installation script
- LLVM Debian/Ubuntu nightly packages
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh <version number>
- clang 10
git clone https://github.com/kc-ml2/llvm-block.git
cd llvm-block && mkdir build && cd build
cmake .. -DLLVM_ROOT=<path to llvm source root>
make llvm-block
./llvm-block/llvm-block <before> <after>
clang -O0 -g -Xclang -disable-O0-optnone -emit-llvm -S *.c
llvm-link *.ll -S -o beforeg.ll
opt beforeg.ll -S <transform pass> -o afterg.ll
<path to llvm-block>/llvm-block beforeg.ll afterg.ll 2> output
opt —strip-debug -S beforeg.ll -o before.ll
opt —strip-debug -S afterg.ll -o after.ll
mkdir before after
opt -dot-cfg before.ll
mv .*.dot before
opt -dot-cfg after.ll
mv .*.dot after