[PATCH] D21449: Target independent codesize heuristics for Loop Idiom Recognition

Sunita Marathe via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 14:39:45 PDT 2016


Sunita_Marathe created this revision.
Sunita_Marathe added reviewers: mcrosier, haicheng.
Sunita_Marathe added a subscriber: llvm-commits.
Sunita_Marathe set the repository for this revision to rL LLVM.
Sunita_Marathe changed the visibility of this Differential Revision from "Public (No Login Required)" to "Subscribers".
Sunita_Marathe changed the edit policy of this Differential Revision from "All Users" to "Sunita_Marathe (Sunita Marathe)".

This change set implements target independent code size heuristics to control Loop Idiom Recognition (LIR) when compiling with -Os or -Oz.

The heuristics allow LIR for the loop's stores if 
- the loop contains no non-idiom instructions which could prevent the loop's collapse after idiom recognition,
- the number of candidate idioms in the loop do not exceed a value which is a function of the number of loops stores and which takes chained loop stores into account.

The reasoning is that the code resulting from idiom recognition of loops  which satisfy the above criterion has a good chance of comparing reasonably well in terms of code size with the original loop code, i.e. doing LIR for such loops is less likely to result in unreasonable code bloat.


Repository:
  rL LLVM

http://reviews.llvm.org/D21449

Files:
  lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  test/Transforms/LoopIdiom/lir_codesize_heurs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21449.61024.patch
Type: text/x-patch
Size: 27631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160616/40f83618/attachment.bin>


More information about the llvm-commits mailing list