[cfe-dev] How to disable alias analysis in clang?

John McCall rjmccall at apple.com
Wed Jul 10 02:11:02 PDT 2013


On Jul 5, 2013, at 11:34 AM, Konstantin Tokarev <annulen at yandex.ru> wrote:
> I've tried to use -fno-strict-aliasing flag, however, when I add -mllvm -debug-pass=Arguments to clang arguments, I still see -tbaa and -basicaa in pass list. -mllvm -enable-tbaa=0 does not help too.

-fno-strict-aliasing should be sufficient to disable type-based alias analysis; even if the pass is in the list, the frontend won't emit any of the type annotations that it uses.

Basic alias analysis just tells us things like "two independent variables don't alias".  I don't know why you'd want to turn that off, but if you really want that level of control, you should disable the builtin passes, output IR, and build your own pass list with opt.

John.



More information about the cfe-dev mailing list