This is an archive of the discontinued LLVM Phabricator instance.

[mips] Expand on r206218 to put the prologue_end marker in the correct place.
AbandonedPublic

Authored by dsanders on Apr 25 2014, 7:18 AM.

Details

Reviewers
None
Summary

The difficulty with moving the prologue_end marker turned out to be that the
stack decrement instruction and all the instructions leading up to it
(including CFI_INSTRUCTIONs) needed to be marked with the FrameSetup flag as
well.

I'll fix MIPS16 in a follow-up.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 8847.Apr 25 2014, 7:18 AM
dsanders retitled this revision from to [mips] Expand on r206218 to put the prologue_end marker in the correct place..
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: echristo.
dsanders added a subscriber: Unknown Object (MLST).

Adding a comment so that phabricator posts this patch to the list.

echristo edited edge metadata.Apr 28 2014, 4:41 PM

Hrm. Looks like most targets are going to end up needing this, but there are a few complications. I'd almost rather just add it during the instruction build rather than iterating through all of the instructions as post-processing.

Thoughts?

I started off adding it to the construction of each instruction but I switched to the post-processing method after noticing the loadImmediate() call in adjustStackPtr(). I was a bit reluctant to add an argument to a general function to deal with a special case needed by one caller. The same applies to storeRegToStackSlot().

It's also slightly more convenient to implement as a post-process step but that's not a very good reason to do it that way since emitPrologue() is rarely changed once it's implemented.

lib/Target/Mips/MipsSEFrameLowering.cpp
360–361

The storeRegToStackSlot() call

lib/Target/Mips/MipsSEInstrInfo.cpp
372

This is the loadImmediate() call

376–382

I just noticed that the loop in emitPrologue() should cover a superset of the instructions that this loop covers. I'll have to try removing this loop to see if it makes a difference. Also, I've left some debugging output here which I'll remove.

How about we move this to PEI::insertPrologEpilogCode instead and make it work for all targets and then we won't have to worry about annotating instructions?

-eric

That sounds good to me. I'll try to fit in updating my patch next week

BTW I looked at this a while ago and it's a bit more complicated than
just moving it up so adding this patch in to the mips port (and, if
you don't mind a couple other ports) is probably the right way to go
for now.

-eric

echristo resigned from this revision.May 26 2016, 12:42 PM
echristo removed a reviewer: echristo.
dsanders abandoned this revision.Aug 5 2016, 1:52 AM

Abandoning a very old patch.