Repost on commits list: Predication bug in AggressiveAntiDepBreaker?

Verena Beckham verena at codeplay.com
Fri Aug 2 06:53:08 PDT 2013


I see, we have not been setting implicit use operands for predicated 
instructions. This fixes the issue I was seeing.
Thanks very much for your pointer!

  Verena


On 31/07/2013 17:14, Jakob Stoklund Olesen wrote:
>
> On Jul 31, 2013, at 2:35 AM, Verena Beckham <verena at codeplay.com> wrote:
>
>> I wondered whether the AggressiveAntiDepBreaker can properly handle
>> predicated instructions.
>>
>> At the end of PrescanInstruction the "DefIndices" array is updated with
>> the destination register without checking whether the instruction is
>> predicated. That shortens the live range: Later on, in HandleLastUse we
>> check whether the register IsLive, which considers only "KillIndices"
>> and "DefIndices", and therefore returns False for the interval between
>> the predicated instruction and any non-predicated read before it. So
>> that read is considered the last use.
>> In my example this leads to a register not being fully renamed everywhere.
>>
>> I don't think a predicated write should count as a define.
>
> You’re right that predicated defines depend on the previous value in their register. We prefer to represent that dependency explicitly with <imp-use> operands:
>
>    %r0 = moveq 12
>    %r0 = movne 123, %r0<imp-use>
>
> As a group, the above two instructions don’t depend on the previous value in %r0. If all predicated instructions were treated as uses, we wouldn’t be able to model that.
>
> If you look in IfConverter.cpp, it is adding implicit use operands to all the predicated instructions.
>
> Thanks,
> /jakob
>



More information about the llvm-commits mailing list