[LLVMdev] strict aliasing and LLVM

Benjamin Kramer benny.kra at googlemail.com
Fri Oct 29 02:17:28 PDT 2010


On 29.10.2010, at 09:26, Nick Lewycky wrote:

>  * If clang -O2 worked by running 'opt' and 'llc' under the hood, we 
> could tell it to pass a flag along to them, but it doesn't. As it 
> stands, you can't turn -enable-tbaa on when running clang.
> 
> So, putting that together, one way to do it is:
> 
>   clang -O2 -fstrict-aliasing foo.c -flto -c -o foo.bc
>   opt -O2 -enable-tbaa foo.bc foo2.bc
>   llc -O2 -enable-tbaa foo2.bc -o foo2.s

clang -O2 foo.c -S -o foo.s -mllvm -enable-tbaa



More information about the llvm-dev mailing list