[PATCH] D50798: [LoopVectorizer] Take into account call register pressure when selecting interleave count

Robert Lougher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 15 12:41:59 PDT 2018


rob.lougher created this revision.
rob.lougher added reviewers: mkuper, hfinkel, dcaballe, hsaito, RKSimon.
Herald added a subscriber: fedor.sergeev.

This is a follow up patch to https://reviews.llvm.org/D48193. In the previous review an example of poor code generation was given, where the interleave count caused a loop containing a veclib call to generate excessive spills/reloads. The suggested fix was to simply use an IC of 1 when a veclib call is present.

Rather than use an IC of 1 for all platforms, this patch:

1. Adds a call register pressure calculation.
2. Adds calls to TargetTransformInfo to obtain information about the number of preserved registers.

At present only a basic implementation of the TTI calls is provided for x86. However, the default implementation means that this change will have no affect on other platforms.


Repository:
  rL LLVM

https://reviews.llvm.org/D50798

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/CodeGen/BasicTTIImpl.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.h
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/X86/interleaving-veclib-call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50798.160872.patch
Type: text/x-patch
Size: 19369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180815/2cdf592b/attachment.bin>


More information about the llvm-commits mailing list