[llvm-dev] get Optimization Level options

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 20 06:21:53 PDT 2019


Hi Ramakota,

On Wed, 20 Mar 2019 at 10:59, Ramakota Reddy via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> With -Oz option this splice() API is duplicating the RET instruction in predecessor blocks.

-Oz is handled slightly differently from the numeric options. It gets
attached to the function as an attribute that you can check for with
Function::optForMinSize.

> Could anyone please give your suggestions to get OPTLevel Options(which object will carry OptLevel Options in this stage?) in this level.

This looks like it's known by the PassManagerBuilder and given to the
constructor of any pass that needs it. Mostly it just configures what
passes are run at all though.

Cheers.


Tim.


More information about the llvm-dev mailing list