LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 21782 - [Polly] Optimize isl's arbitrary precision library usage for small numbers
Summary: [Polly] Optimize isl's arbitrary precision library usage for small numbers
Status: RESOLVED FIXED
Alias: None
Product: Polly
Classification: Unclassified
Component: Optimizer (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Pratik Bhatu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-08 14:33 PST by Tobias Grosser
Modified: 2016-01-18 17:02 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
Test case (6.21 KB, text/x-csrc)
2014-12-08 14:45 PST, Tobias Grosser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Grosser 2014-12-08 14:33:01 PST

    
Comment 1 Tobias Grosser 2014-12-08 14:43:16 PST
isl uses an arbitrary precision integer library to be able to reason about integers and constraints that exceed 64 bit.

HOWEVER, almost all computations in isl are performed on numbers that require significantly less than 32 bits to be computed. When profiling isl a significant amount of time (30-50% is spent in libgmp), with most of this time used for
basic functionality such as isl_int_init, isl_int_set, isl_int_add and isl_int_clear. Reducing the unnecessary function call and malloc traffic may significantly speed up isl.

For Polly, it would be great if a proof of concept patch for isl is written that transforms isl_int to type 'long long' and replaces isl_init_init, isl_int_set, isl_int_add with normal operations on 'long long'. All other computations can be implemented by converting the 'long long' to gmp, performing the original operation and converting back to 'long long. For this proof of concept it is OK
to not even cosider the case where a value may exceed 64 bit.

This patch should enable us to get an idea of the performance benefits that could gained by optimizing isl for small numbers.
Comment 2 Tobias Grosser 2014-12-08 14:45:40 PST
Created attachment 13440 [details]
Test case

The following is a test case on which isl spends several 100 mseconds, but which should not require integers larger than 64 bit. It might be good to evaluate a possible patch.
Comment 3 Pratik Bhatu 2014-12-16 12:16:15 PST
I would like to work on this bug.
Comment 4 Tobias Grosser 2015-06-26 03:52:12 PDT
Fixed in 240689.
Comment 5 Tanya Lattner 2016-01-18 17:02:51 PST
Move to Polly Product.