[aarch64-port-dev ] RFR: 8131362: aarch64: C2 does not handle large stack offsets (original) (raw)

Edward Nevill edward.nevill at gmail.com
Wed Jul 22 09:50:25 UTC 2015


On Fri, 2015-07-17 at 10:43 +0100, Andrew Haley wrote:

On 17/07/15 10:29, Andrew Haley wrote: > On 17/07/15 10:12, Edward Nevill wrote: >> On Fri, 2015-07-17 at 10:01 +0100, Andrew Haley wrote: >>> On 17/07/15 09:52, Edward Nevill wrote: >>>>>> Should it be +8 instead of +4? Or these offsets are not in bytes?: >>>>>> >>>>>> + unspill(rscratch1, true, srcoffset); >>>>>> + spill(rscratch1, true, dstoffset); >>>>>> + unspill(rscratch1, true, srcoffset+4); >>>>>> + spill(rscratch1, true, dstoffset+4); >>>> Ouch! Good catch. >>>> >>>> New webrev. >>>> >>>> http://cr.openjdk.java.net/~enevill/8131362/webrev.03/ >>> >>> I'm a bit more concerned that this did not fail in testing. I guess >>> there were no tests at all for stack-stack spills. >> >> Correct. And it would have to be a 128 bit vector stack-stack spill with >> an offset >= 512. How would you even provoke such a thing. > > With a highly-vectorizable test case with a zillion temporaries, I guess.

Thinking some more: I think I'd add some special code to test it all once, then delete the special code. If that's what it takes, there isn't much choice.

So what I did was I reduced the number of vector registers from 32 to 2. Even then spill_copy128 was never called. So maybe it just never does stack-stack spills on vector registers.

However it does do stack-stack spills on general purpose registers. So I reduced the number of general purpose registers to 2 and faked the size of the general purpose registers at 128 instead of 64.

spill_copy128 was then called and I verified that the generated code was correct. I also verified that the code was actually being executed by setting a breakpoint on the spill copy code.

I have also verified that both branches of the if in spill_copy128 are tested by changing the condition to force execution of each branch.

So, although we still don't know if it will ever call spill_copy128 for a vector register at least we have confidence that the spill_copy code does the right thing if it is ever called.

OK to push? Ed.



More information about the hotspot-compiler-dev mailing list