<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 6, 2015 at 3:36 PM, Ahmed Bougacha <span dir="ltr"><<a href="mailto:ahmed.bougacha@gmail.com" target="_blank">ahmed.bougacha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Feb 6, 2015 at 3:28 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, Feb 6, 2015 at 3:15 PM, Ahmed Bougacha <<a href="mailto:ahmed.bougacha@gmail.com">ahmed.bougacha@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Author: ab<br>
>> Date: Fri Feb  6 17:15:39 2015<br>
>> New Revision: 228463<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=228463&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=228463&view=rev</a><br>
>> Log:<br>
>> [AArch64] Use the source location of the IR branch when creating Bcc<br>
>> from a conditional branch fed by an add/sub/mul-with-overflow node.<br>
>><br>
>> We previously used the SDLoc of the overflow node, for no good reason.<br>
>> In some cases, this led to the Bcc and B terminators having different<br>
>> source orders, and DBG_VALUEs being inserted between them.<br>
>><br>
>> The real issue is with the code that can't handle DBG_VALUEs between<br>
>> terminators: the few places affected by this will be fixed soon.<br>
>> In the meantime, fixing the SDLoc is a positive change no matter what.<br>
>><br>
>> No tests, as I have no idea how to get .loc emitted for branches?<br>
><br>
><br>
> .loc should be emitted for any instruction with a debug location (clang does<br>
> omit debug locations on various branches from the frontend, but you can add<br>
> them in by hand or find a case where clang doesn't omit them... ).<br>
<br>
</span>I did tweak the !dbg metadata for the branch (see attached testcase),<br>
but I only get:<br>
<br>
        .loc    1 21 21 is_stmt 1       ; /path:21:21<br>
        str      ...<br>
        b.vs    ...<br>
<br>
That is, the instruction before the branch (the store) gets a .loc,<br>
but not the branch itself.<br>
Am I missing something?<br></blockquote><div><br>Possibly a bug elsewhere in debug location preservation - there are a few down tehre in the backend for example where two instructions are coalesced into one MachineInstr (thus having only one location) then split out again, (where they both get given the same location), etc.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
-Ahmed<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
>><br>
>><br>
>> rdar://19347133<br>
>><br>
>> Modified:<br>
>>     llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp<br>
>><br>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=228463&r1=228462&r2=228463&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=228463&r1=228462&r2=228463&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)<br>
>> +++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Fri Feb  6<br>
>> 17:15:39 2015<br>
>> @@ -3263,8 +3263,8 @@ SDValue AArch64TargetLowering::LowerBR_C<br>
>>        OFCC = getInvertedCondCode(OFCC);<br>
>>      SDValue CCVal = DAG.getConstant(OFCC, MVT::i32);<br>
>><br>
>> -    return DAG.getNode(AArch64ISD::BRCOND, SDLoc(LHS), MVT::Other, Chain,<br>
>> Dest,<br>
>> -                       CCVal, Overflow);<br>
>> +    return DAG.getNode(AArch64ISD::BRCOND, dl, MVT::Other, Chain, Dest,<br>
>> CCVal,<br>
>> +                       Overflow);<br>
>>    }<br>
>><br>
>>    if (LHS.getValueType().isInteger()) {<br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>