This is an archive of the discontinued LLVM Phabricator instance.

Fix/Redo computeMainRangeFromSubranges()
AbandonedPublic

Authored by MatzeB on Feb 25 2015, 1:21 PM.

Details

Reviewers
qcolombet
Summary

Fix/Redo computeMainRangeFromSubranges()

Contrary to my initial assumption there are cases where we need
additional phi-defs when constructing the main liverange from subranges.
Redo the implementation in LiveRangeCalc and utilize the SSA
construction facilities there. The downside is that this is more
expensive than before, the upside is simplified easier to undertsand
code that reuses existing infrastructure for the SSA construction.

I was not able to create a testcase for this for trunk as the cases
where this happens require somewhat "independent" subranges in different
control flow parts. With the normal instruction selection those get
lowered to different vregs in my tries. I only hit these cases for some
register coalescer changes I am prepare where
computeMainRangeFromSubranges() would be called after/during coalescing.

Diff Detail

Event Timeline

MatzeB updated this revision to Diff 20697.Feb 25 2015, 1:21 PM
MatzeB retitled this revision from to LiveRange: create copyFrom() method, remove now unused createValueCopy().
MatzeB updated this object.
MatzeB added a reviewer: qcolombet.
MatzeB added a subscriber: Unknown Object (MLST).
MatzeB retitled this revision from LiveRange: create copyFrom() method, remove now unused createValueCopy() to Fix/Redo computeMainRangeFromSubranges().Feb 25 2015, 1:26 PM
qcolombet edited edge metadata.Feb 26 2015, 9:52 AM

Hi Matthias,

What is the impact of this on the compile time? (Release without asserts).

Although I like the cleanup, I want to be sure we do not dramatically decrease the compile time.

Thanks,
-Quentin

MatzeB abandoned this revision.May 6 2015, 3:52 PM

Abandoning this revision for now:

  • In the current pipeline where live intervals are calculated immediately after PhiElimination and TwoAddress calculation the structures are so simple that the current code is good enough. So no need for this yet.
  • When doing things differently like recomputing whole live ranges in the register coalescer instead of updating them, a patch like this is necessary, but it turned out this is not enough. Without having detailed information about undef uses at the subregister level we still run into problems. So this approach can only work in combination with a scheme to mark partially undef uses.