[PATCH] Add another run of ARM Thumb2SizeReduction pass with -Oz

Renato Golin renato.golin at linaro.org
Thu Mar 12 04:07:24 PDT 2015


On 11 March 2015 at 23:00, Pete Cooper <peter_cooper at apple.com> wrote:
> This patch schedules another pass of Thumb2SizeReduction before the PostRA
> scheduler.  This pass is only for functions with minsize set on them.  It
> results in the mov being converted to Thumb2 before the PostRA scheduler and
> so the code now becomes

Hi Pete,

+  if (getOptLevel() != CodeGenOpt::None && !getARMSubtarget().isThumb1Only())

This doesn't guarantee (Oz && T2). Wouldn't you have to be specific at
least regarding CodeGenOpt?

Also, the same pass has already been added in some cases on the code
above, you don't want to add two identical passes, even if they have
different parameters. Maybe create a boolean OnlyMinSize from opt+t2
flags, and pass it to the already existing addPass()?

The tests are good and the rest looks good to me. Thanks!

cheers,
--renato



More information about the llvm-commits mailing list