How to disable alias analysis in clang?

Hi all,

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.