[PATCH] D67350: [IfCvt][ARM] Optimise diamond if-conversion for code size

Oliver Stannard (Linaro) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 05:46:01 PDT 2019


ostannard created this revision.
ostannard added reviewers: efriedma, kparzysz, uabelho.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: LLVM.

Currently, the heuristics the if-conversion pass uses for diamond if-conversion
are based on execution time, with no consideration for code size. This adds a
new set of heuristics to be used when optimising for code size.

This is mostly target-independent, because the if-conversion pass can
see the code size of the instructions which it is removing. For thumb,
there are a few passes (insertion of IT instructions, selection of
narrow branches, and selection of CBZ instructions) which are run after
if conversion and affect these heuristics, so I've added target hooks to
better predict the code-size effect of a proposed if-conversion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67350

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/IfConversion.cpp
  llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
  llvm/lib/Target/ARM/ARMBaseInstrInfo.h
  llvm/test/CodeGen/ARM/ifcvt-size.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67350.219327.patch
Type: text/x-patch
Size: 22332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190909/45ffd43b/attachment.bin>


More information about the llvm-commits mailing list