[PATCH] D18069: Throttling LICM to reduce compile time of Value Propagation and Reg Splitting

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 15:24:00 PST 2016


wmi created this revision.
wmi added reviewers: atrick, reames, hfinkel.
wmi added subscribers: llvm-commits, davidxl.
wmi set the repository for this revision to rL LLVM.

The is the part2 to solve https://llvm.org/bugs/show_bug.cgi?id=10584

For the testcases in the bug, LICM creates many long stretched vars living across many BBs. When CVP queries Lazy Value Information (LVI) for such vars, for each var, LVI would go through all the BBs it lives across. If there are many such long stretched vars,  CVP will become very slow. Reg splitting has similar problem. For a vreg with very long live range, computing spill placement when splitting the vreg will take high cost.

The patch tries to throttle LICM to reduce the number of non-expensive instructions being hoisted outside of very large loop. For small loop, hoisting vars outside of such loop will not increase the cost much so we keep the current logic to hoist as many as possible. For large loop, expensive instructions like mul/div/rem/... will still be hoisted anyway.  For non-expensive instructions in large loop, we use reg number to throttle how many instructions should be hoisted. 

No unittest is added because I cannot find a small testcase for it.

Tested llvm testsuite and google internal benchmark on x86_64-linux-gnu and didn't find perf regression. 

Repository:
  rL LLVM

http://reviews.llvm.org/D18069

Files:
  include/llvm/Transforms/Utils/LoopUtils.h
  lib/Transforms/Scalar/LICM.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18069.50363.patch
Type: text/x-patch
Size: 13363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160310/eb368902/attachment.bin>


More information about the llvm-commits mailing list