[PATCH] [Statepoints] Reuse stack slots for assignment idioms

Igor Laevsky igor at azulsystems.com
Tue Jun 16 12:21:40 PDT 2015


In http://reviews.llvm.org/D10402#188451, @reames wrote:

> @Igor - Your restatement is correct.  I like your idea of renaming the method, but I hadn't really come up with a great name.  As your follow on question about PHIs points out, the current notion is actually stronger than just "preferred".  It's more like "preferred so strongly that there can't be a better slot to pick".


Maybe findBestSpillSlot? Or findOptimalSpillSlot.

> Hm, I think I just understood your question about phis after writing that.  Were you intending to say that we could special case PHIs where exactly one input had a spill slot assigned and that input's only use is the phi?  That avoids the problem of picking one spill slot when multiple are available.  Might be worth exploring in a future change.


Yes, that's correct. However we don't need to special case only two entry phi nodes. Condition could be "spill slots for all incoming values are same, but some might be unknown". (Currently it is "spill slots for all incoming values are known and same")

> w.r.t. your comments about DSE, no, I'm not really sure.  :)  I may be utterly wrong in fact.  Having said that, non of the existing test cases break with this change and I didn't see any differences in codegen for the example I happened to look at.  I'll revert this part of the patch, but I'll have to introduce another data structure to do it.  Can I ask you to submit a test which would have caught this?


I submitted test case in r239842.


http://reviews.llvm.org/D10402

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list