I was interested in telling the compiler not to inline a given function, and discovered that the attribute((noinline)) implements this using a global variable @llvm.noinline. It did not work for me initially. I noticed that @ llvm.noinline was being internalized by -internalize, dead-code-eliminated by -constmerge, causing this information not to reach the -inline pass.
I am not sure if this is a bug, or I am just using the passes in some wrong way. Initially I thought, maybe I was being a clown by doing “opt -internalize -constmerge -inline” in that order, but then I discovered that even llvm-ld does that, so decided to just ask on the group.