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.sclang -O2 foo.c -S -o foo.s -mllvm -enable-tbaa
Thanks for the -m tip to pass llvm options. Why is it not documented anywhere. See http://clang.llvm.org/docs/UsersManual.html#commandline <http://clang.llvm.org/docs/UsersManual.html#commandline>David On Fri, Oct 29, 2010 at 2:17 AM, Benjamin Kramer <benny.kra at googlemail.com>wrote:> > 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 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101029/bc440b07/attachment.html>
On Oct 29, 2010, at 11:35 AM, Xinliang David Li wrote:> Thanks for the -m tip to pass llvm options. Why is it not documented anywhere. See http://clang.llvm.org/docs/UsersManual.html#commandline-mllvm flags are somewhat equivalent to gcc -param options. -mllvm flags are for compiler hackers to play with, and are not stable or documented. Once TBAA is stable and reliable it will be controlled with -fstrict-aliasing as you'd expect. -Chris> > David > > On Fri, Oct 29, 2010 at 2:17 AM, Benjamin Kramer <benny.kra at googlemail.com> wrote: > > 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 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101029/2a8692c4/attachment.html>