Inliner, as an SCC pass, does not run on functions that are not reachable from the callgraph entry node.
Because of this, it may fail to inline an alwaysinline function.
The change runs GlobalDCE before inlining to make sure that this does not happen.
See the testcase for a sample input triggering this issue (the interesting case here is -O1, reproducing with both opt -O1 and clang -O1).