3 ms·
In the first example, one of the b OUTLINED_FUNCTION_0 jumps can be removed (in the code as presented, the last one. A sufficiently smart compiler would fig
by Someone 6y ago
In the first example, one of the
b OUTLINED_FUNCTION_0
jumps can be removed (in the code as presented, the last one. A sufficiently smart compiler would figure out which of the functions is called most often). If the outliner pass doesn’t do that, is there a LLVM pass that can do that kind of stuff?
- throwaway222145 6y agoThe Jump Threading pass likely removes that unnecessary branch instruction.
- yroux 6y agoWell, the examples are simplified to present the concept of outlining. In the first example calc_X and OUTLINED_FUNCTION_0 are functions and not basic blocks, thus they are not guaranteed to placed in that order, but I agree, if they were consecutives blocks the last call should have ben removed. To give more details on the LLVM optimization pipeline there are only two passes which run after the Machine Outliner for ARM before code emission (ConstantIslands and LowOverheadLoops) because they are dependent upon block layout and size.