Repost on commits list: Predication bug in AggressiveAntiDepBreaker?

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Jul 31 09:14:28 PDT 2013


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