[PATCH] [CaptureTracking] Avoid long compilation time on large basic blocks
Bruno Cardoso Lopes
bruno.cardoso at gmail.com
Thu Jan 15 15:06:31 PST 2015
Hi nicholas, hfinkel,
=== Problem
For large basic blocks CaptureTracking may become very expensive: for each memory related instruction considered, walks top down the BB to check ordering and dominance among two instructions. In my testcase there are 81782 instructions in a BB, which leads to compilation time of ~12min w/ 'opt -O1'. This triggers in the flow: DeadStoreElimination -> MepDepAnalysis -> CaptureTracking.
=== Solution
To fix the compile time bloat, the patch changes 'shouldExplore' to do two things:
1) Add a special case to compute the ordering between instructions when both are in the same basic block. It avoids the use of two expensive functions in this scenario: 'dominates' and 'isPotentiallyReachable'.
2) Limit the search by using a threshold=1000 on the number of instructions to search. This limit presented no measurable regressions on the test-suite.
This lead to a compile time reduction of 'opt -O1' from ~12min to 1s.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D7010
Files:
include/llvm/Analysis/CaptureTracking.h
lib/Analysis/CaptureTracking.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7010.18265.patch
Type: text/x-patch
Size: 7085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150115/6a5c6481/attachment.bin>
More information about the llvm-commits
mailing list