Interaction of --disable-llvm-passes and -O0

Pardon if this isn’t the right forum for this question, but is there a reason that when both --disable-llvm-passes and -O0 are passed to cc1 llvm optimization passes still appear to occur? For the past hour or so I was trying to figure out how to get a proper test for https://reviews.llvm.org/D41050 out - as soon as I changed -O0 to -O3 (as suggested in this post: http://lists.llvm.org/pipermail/llvm-dev/2017-April/111989.html) the optimization passes didn’t occur. Is this known/defined behavior? If so, is there documentation as to why it behaves that way?

Dan

do you have a specific (reduced, ideally) example of -O0 --disable-llvm-passes still running passes? I’d certainly expect -O0 without --disable-llvm-passes to run passes (things like the AlwaysInliner, since respecting attribute((always_inline)) is necessary for program correctness, even at -O0), but would be surprised if disabling llvm passes didn’t do what it says.