[PATCH] D29456: [CodeGenPrepare] Hoist all getSubtargetImpl calls to the beginning of the pass

Igor Laevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 07:59:49 PST 2017


igor-laevsky created this revision.

Calls to the `getSubtargetImpl` on X86 tend to have non trivial execution cost. Usually it's negligible but it becomes noticeable when we try to request subtarget from the frequently executed methods, i.e like optimizeMemoryInst. This change saves subtarget, target lowering and target register info at the beginning of the pass and reuses this values during pass execution.

On one of our internal benchmarks this change reduces time spent in the llc by ~20%.


Repository:
  rL LLVM

https://reviews.llvm.org/D29456

Files:
  lib/CodeGen/CodeGenPrepare.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29456.86817.patch
Type: text/x-patch
Size: 7588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170202/4a9c6cdb/attachment.bin>


More information about the llvm-commits mailing list