[Bug middle-end/51982] Shrink-wrapping opportunity
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51982 --- Comment #5 from Segher Boessenkool --- Yes, the only two calls in the resulting machine code are both to unicode_eq. Splitting the ranges (and then assigning volatile regs to the first half) hurts if it doesn't end up helping shrink-wrapping. There also is the problem that some pseudos are already coalesced earlier (at expand time even) while in fact they are independent (some will naturally end up in r3, the return register, while others need to be non-volatile).
[Bug middle-end/51982] Shrink-wrapping opportunity
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51982 --- Comment #4 from Peter Bergner --- (In reply to David Edelsohn from comment #3) > The function lookup_unicode should be shrink-wrapped to not create a stack > frame if unicode_eq is not called, which is the common case > > if (!PyUnicode_CheckExact(key)) { > return lookdict(mp, key, hash, value_addr); > } I'm guessing lookdict() above is inlined so not a call... > i = (size_t)hash & mask; > ep = &ep0[i]; > if (ep->me_key == NULL || ep->me_key == key) { > *value_addr = &ep->me_value; > return ep; > } > /* - Postpone frame creation until this point. -- */ > if (ep->me_key == dummy) > freeslot = ep; > else { > if (ep->me_hash == hash && unicode_eq(ep->me_key, key)) { > *value_addr = &ep->me_value; > return ep; > } > freeslot = NULL; > } For us to postpone frame creation to the point you specify above, we'd need to split all of the pseudos that are live at that point and who are live across a call (ie, pseudos that IRA will attempt to assign to a non-volatile/callee-saved register). That would allow IRA to use a volatile reg for the split pseudo above the frame setup point and a non-volatile reg for the split pseudo after the frame setup point. Of course we'd need to inhibit coalescing the copy away. Doesn't IRA have code that tries to do such a thing? /me goes off to have a look.
[Bug middle-end/51982] Shrink-wrapping opportunity
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51982 Bug 51982 depends on bug 10474, which changed state. Bug 10474 Summary: shrink wrapping for functions http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10474 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug middle-end/51982] Shrink-wrapping opportunity
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51982 --- Comment #3 from David Edelsohn 2013-04-21 23:26:03 UTC --- Created attachment 29912 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29912 self-contained example The function lookup_unicode should be shrink-wrapped to not create a stack frame if unicode_eq is not called, which is the common case if (!PyUnicode_CheckExact(key)) { return lookdict(mp, key, hash, value_addr); } i = (size_t)hash & mask; ep = &ep0[i]; if (ep->me_key == NULL || ep->me_key == key) { *value_addr = &ep->me_value; return ep; } /* - Postpone frame creation until this point. -- */ if (ep->me_key == dummy) freeslot = ep; else { if (ep->me_hash == hash && unicode_eq(ep->me_key, key)) { *value_addr = &ep->me_value; return ep; } freeslot = NULL; }
[Bug middle-end/51982] Shrink-wrapping opportunity
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51982 Alan Modra changed: What|Removed |Added CC|amodra at gcc dot gnu.org |amodra at gmail dot com --- Comment #2 from Alan Modra 2012-02-06 07:07:41 UTC --- I confirm comment #2. We do have incoming args being saved in callee-saved regs and those callee-saved regs then being used. However, there are additional problems to solve before this function will ever be shrink-wrapped. We have uses of callee-saved regs for more than just incoming args. For instance, "mask" gets put in r24 and "ep0" in r25 in the first bb, and a little later, "i" in r29 and others are used for other intermediate values.
[Bug middle-end/51982] Shrink-wrapping opportunity
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51982 Andrew Pinski changed: What|Removed |Added Depends on||10474 --- Comment #1 from Andrew Pinski 2012-01-24 19:02:33 UTC --- This is most likely the same reference problem as in PR 10474 comment #10.
[Bug middle-end/51982] Shrink-wrapping opportunity
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51982 David Edelsohn changed: What|Removed |Added Keywords||missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed||2012-01-24 CC||amodra at gcc dot gnu.org Ever Confirmed|0 |1