开发者

turn off clang optimization, remove phi instruction

开发者 https://www.devze.com 2023-03-13 08:44 出处:网络
1) Is it possible to turn off any optimization in clang? 2) Is there a way to remove any phi instruction from generated llvm code?

1) Is it possible to turn off any optimization in clang?

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

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

And for some source files clang emit llvm code with phi-instructions. I find any wat to get llvm-file without phi-instr开发者_Python百科uctions.


You can use LLVM's reg2mem pass to get rid of any phi's. Just feed you .bc out of clang into opt -reg2mem and you're done

0

精彩评论

暂无评论...
验证码 换一张
取 消