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 422 - [asmwriter] Asmwriter is really slow for functions with lots of values
Summary: [asmwriter] Asmwriter is really slow for functions with lots of values
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Core LLVM classes (show other bugs)
Version: 1.3
Hardware: All All
: P normal
Assignee: Reid Spencer
URL:
Keywords: quality-of-implementation, regression
Depends on:
Blocks:
 
Reported: 2004-08-15 16:37 PDT by Chris Lattner
Modified: 2010-02-22 12:52 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
testcase that is really slow (125.22 KB, application/octet-stream)
2004-08-15 16:38 PDT, Chris Lattner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2004-08-15 16:37:36 PDT
It looks like one of the changes to the asmwriter made it recompute the
slotmachine for every value that needs a slot number.  If that is ALL values, we
spend lots of time computing SlotTable objects, only to throw them away.

The AsmWriter used to create the slot table once and use it.  The fact that it
does not anymore is a major regression from LLVM 1.2.

I'm attaching a testcase (from Marek Materzok) that takes minutes to disassemble.

-Chris
Comment 1 Chris Lattner 2004-08-15 16:38:26 PDT
Created attachment 166 [details]
testcase that is really slow
Comment 2 Reid Spencer 2004-08-16 02:26:20 PDT
Mine. Confirmed. I'll look at it this week, its kinda complicated :)
Comment 3 Reid Spencer 2004-08-16 02:50:58 PDT
Turns out it wasn't all that complicated. The patch below corrects the problem.
Not sure how this slipped through the cracks but thanks go to Marek for finding
this and providing a test case.

http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040816/017195.html

Patch passes 100% of Feature and Regression tests.

Test Results:

/usr/bin/time llvm-dis slow.bc -f
0.53user 0.01system 0:00.54elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (770major+767minor)pagefaults 0swaps

(slow.bc is the test case attached to this report)