[LLVMdev] Predication bug in AggressiveAntiDepBreaker?

Verena Beckham verena at codeplay.com
Mon Jul 22 09:18:53 PDT 2013


Hi,

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.

The attached patch fixes this test case.

Or am I missing something target dependent here?

-- 
Verena Beckham

Vice President Engineering

Codeplay Software Ltd
45 York Place, Edinburgh, EH1 3HP
Tel: 0131 466 0503
Fax: 0131 557 6600
Website: http://www.codeplay.com

This email and any attachments may contain confidential and /or 
privileged information and  is for use  by the addressee only. If you 
are not the intended recipient, please notify Codeplay Software Ltd 
immediately and delete the message from your computer. You may not copy 
or forward it,or use or disclose its contents to any other person. Any 
views or other information in this message which do not relate to our 
business are not authorized by Codeplay software Ltd, nor does this 
message form part of any contract unless so stated.
As internet communications are capable of data corruption Codeplay 
Software Ltd does not accept any responsibility for any changes made to 
this message after it was sent. Please note that Codeplay Software Ltd 
does not accept any liability or responsibility for viruses and it is 
your responsibility to scan any attachments.
Company registered in England and Wales, number: 04567874
Registered office: 81 Linkfield Street, Redhill RH1 6BY
-------------- next part --------------
Index: AggressiveAntiDepBreaker.cpp
===================================================================
--- AggressiveAntiDepBreaker.cpp	(revision 186828)
+++ AggressiveAntiDepBreaker.cpp	(working copy)
@@ -399,7 +399,7 @@
     unsigned Reg = MO.getReg();
     if (Reg == 0) continue;
     // Ignore KILLs and passthru registers for liveness...
-    if (MI->isKill() || (PassthruRegs.count(Reg) != 0))
+    if (MI->isKill() || (PassthruRegs.count(Reg) != 0) || TII->isPredicated(MI))
       continue;
 
     // Update def for Reg and aliases.


More information about the llvm-dev mailing list