This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Generate formatted DAGISelEmitter without relying on formatted_raw_ostream.
ClosedPublic

Authored by craig.topper on Sep 17 2017, 11:47 PM.

Details

Summary

The generated DAG isel file currently makes use of formatted_raw_ostream primarily for generating a hierarchical representation while also skipping over the initial comment that contains the current index.

It was reported in D37957 that this formatting might be slow due to the need to keep track of column numbers by monitoring all the written data for new lines.

This patch attempts to rewrite the emitter to make use of simpler formatting mechanisms to generate a fairly similar output. The main difference is that the number in the index comment is now right justified and padded with spaces inside the comment. Previously we appended the spaces after the comment.

I haven't done any build time measurements with this myself.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 17 2017, 11:47 PM
RKSimon edited edge metadata.Sep 19 2017, 8:07 AM

As noted by @zturner on PR28222:

Here's some numbers from my work machine:

Before r313271: 11.46s
After r313271: 38.32s
After r313271 + D37957: 20.62s
After r313271 + D37966: 33.61s

kparzysz accepted this revision.Sep 19 2017, 12:29 PM

On my machine, in the debug build of TableGen, the time for X86 -gen-dag-isel went down from 61s to 52s.

This revision is now accepted and ready to land.Sep 19 2017, 12:29 PM
This revision was automatically updated to reflect the committed changes.