This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Fix and reenable arm-promote-constant.
Needs ReviewPublic

Authored by dmgreen on Aug 16 2017, 3:47 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is a first attempt at fixing and re-enabling the arm-promote-constant optimisation. The original version of this patch was written by John (thanks John!) when he ran into problems with the bugs here. This fixes things in the constant island pass by not cloning constant pool entries that are pointed to by LEA's, but converting them to a LDR to the original pool entry.

Diff Detail

Event Timeline

dmgreen created this revision.Aug 16 2017, 3:47 AM

This involves adding a new ARMConstantPoolIndexAddress so as to point the newly created constant entry at the symbol name of the other. The reference counting can get a bit gnarly, and the testing here could do with being improved. It passes the various bootstraps I throw at it, but there might well be some combination of options/conditions that make things fail. Any ideas of better ways to test this?

So it seems like a workable solution, but does make constant island pass slightly more complex. What do people think?