It may be that clang added the `optnone` attribute to main when you built
it in (b): https://godbolt.org/g/WhM1UA . optnone, as the name implies,
requests that optimizations are skipped for a given function. If this is
the case, removing the optnone might make (b) do what you want.
For (c), I'd in
test.cpp:
int main() {
int ret = 0;
for (int i = 0; i < 100; i++) {
ret += i;
}
return ret;
}
Hi,
I’m new to clang/llvm recently and interested in doing some stuff in
optimization passes.
I tried to play above simple test with clang and see if I could get expected
llvm IR by enabling llvm l