<div dir="ltr">Thanks.<div><br></div><div>Jordy</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 20, 2016 at 4:25 PM, Krzysztof Parzyszek <span dir="ltr"><<a href="mailto:kparzysz@codeaurora.org" target="_blank">kparzysz@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Committed in r270219.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Krzysztof</font></span><span class=""><br>
<br>
On 5/20/2016 9:05 AM, Jordy Potman wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Yes, this fix works for me.<br>
<br>
Jordy<br>
<br>
On Fri, May 20, 2016 at 3:12 PM, Krzysztof Parzyszek<br></span><div><div class="h5">
<<a href="mailto:kparzysz@codeaurora.org" target="_blank">kparzysz@codeaurora.org</a> <mailto:<a href="mailto:kparzysz@codeaurora.org" target="_blank">kparzysz@codeaurora.org</a>>> wrote:<br>
<br>
Hi Jordy,<br>
<br>
Does this fix work for you?<br>
<br>
unsigned SI = Scavenged.size(), Diff = UINT_MAX;<br>
+ int FIB = MFI.getObjectIndexBegin(), FIE = MFI.getObjectIndexEnd();<br>
for (unsigned I = 0; I < Scavenged.size(); ++I) {<br>
if (Scavenged[I].Reg != 0)<br>
continue;<br>
// Verify that this slot is valid for this register.<br>
int FI = Scavenged[I].FrameIndex;<br>
+ if (FI < FIB || FI >= FIE)<br>
+ continue;<br>
unsigned S = MFI.getObjectSize(FI);<br>
unsigned A = MFI.getObjectAlignment(FI);<br>
<br>
-Krzysztof<br>
<br>
<br>
<br>
On 5/20/2016 7:04 AM, Jordy Potman wrote:<br>
<br>
Hi Krzysztof,<br>
<br>
I'm seeing an "Invalid Object Idx" assert in the call to<br>
MFI.getObjectSize(FI) in the code below on my out of tree target<br>
after<br>
this commit.<br>
<br>
+ // Verify that this slot is valid for this register.<br>
+ int FI = Scavenged[I].FrameIndex;<br>
+ unsigned S = MFI.getObjectSize(FI);<br>
+ unsigned A = MFI.getObjectAlignment(FI);<br>
+ if (NeedSize > S || NeedAlign > A)<br>
+ continue;<br>
<br>
<br>
The reason for this is that the Scavenged vector may contain a<br>
ScavengedInfo structure with a FrameIndex of -1 after the first<br>
call of<br>
scavengeRegister on targets where there is no spill slot but the<br>
target<br>
knows how to save/restore the register (using<br>
TRI->saveScavengerRegister). This ScavengedInfo structure with a<br>
FrameIndex of -1 is added to the Scavenged vector by the code on<br>
lines<br>
425-429 in the first call of scavengeRegister.<br>
<br>
I have fixed this in my tree by adding<br>
<br>
if (FI < 0)<br>
continue;<br>
<br>
before the the call to MFI.getObjectSize(FI) in the code above,<br>
see the<br>
attached patch, but there may be a cleaner/better solution.<br>
<br>
Jordy<br>
<br>
<br>
<br>
--<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,<br>
hosted by The Linux Foundation<br>
<br>
<br>
</div></div></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
</div></div></blockquote></div><br></div>