Disable clan optimization, delete phi statement

1) Is it possible to disable any optimization in clang?

2) Is there a way to remove any phi command from the generated llvm code?

I use clang with options: clang test.c -Wimplicit -emit-llvm -g -O0 -c -o result.bc

And for some clang emit llvm code source files with phi instructions. I find any wat to get llvm file without phi instructions.

+3
source share
1 answer

You can use LLVM reg2mem pass to get rid of any phi. Just give you .bc from clang to opt -reg2mem and you are done

+6
source

All Articles