News for hackers. Stuff that matters.
Re:Reducing code size with LLVM Machine Outliner on 32-bit A... by Someone on Wednesday April 14, 2021 @01:47PM (#26810520)
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?
Re:Reducing code size with LLVM Machine Outliner on 32-bit A... by yroux on Thursday April 15, 2021 @03:50AM (#26817370)
Well, 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.

Re:Reducing code size with LLVM Machine Outliner on 32-bit A... by throwaway222145 on Wednesday April 14, 2021 @03:25PM (#26811851)
The Jump Threading pass likely removes that unnecessary branch instruction.