<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
{margin-top:0;
margin-bottom:0}
p
{margin-top:0;
margin-bottom:0}
p
{margin-top:0;
margin-bottom:0}
p
{margin-top:0;
margin-bottom:0}
p
{margin-top:0;
margin-bottom:0}
p
{margin-top:0;
margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,<br>
<br>
I would like to commit this patch.<br>
Could someone give insight into the possible compilation-speed-optimization of only searching chains when traversing the DAG?<br>
Thank you<br>
<br>
Robert<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF929660"><font color="#000000" face="Tahoma" size="2"><b>From:</b> llvm-commits-bounces@cs.uiuc.edu [llvm-commits-bounces@cs.uiuc.edu] on behalf of Robert Lytton [robert@xmos.com]<br>
<b>Sent:</b> 23 August 2013 11:11<br>
<b>To:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> bug in PrescheduleNodesWithMultipleUses()<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"><br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi<br>
<br>
(this picks up from the thread in llvmdev: "PrescheduleNodesWithMultipleUses() causing failure in PickNodeToScheduleBottomUp() ???")<br>
<br>
PrescheduleNodesWithMultipleUses() is a function that tries to transform a DAG where nodes have multiple uses, with the aim of reducing the live range.<br>
(see comment in lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp)<br>
<br>
However, it does not check to see if callResources will be affected by the transformation.<br>
<br>
<br>
The problem<br>
========<br>
Take the following correctly scheduled DAG (arrow to predecessor):<br>
<font face="Courier New"><br>
SetUp2 SetUp1<br>
^ ^<br>
| |<br>
| |<br>
Destroy2---->PredSU <----SU<br>
^ ^ ^<br>
| | |<br>
| | |<br>
----------- | ---------<br>
| | |<br>
Destroy1<br>
^<br>
|<br>
</font><br>
In this example there are two successors of 'PredSU' with type<br>
getCallFrameDestroyOpcode (Destroy) and one is a successor of the other.<br>
Taking the successor of the two Destroys (Destroy1), note that it's<br>
matching getCallFrameSetupOpcode (Setup1) is a predecessor of 'SU'.<br>
In this situation, re-routing the dependency on 'PredSU' through 'SU' will<br>
cause a dead lock Viz:<br>
<br>
<font face="Courier New"> SetUp2 PredSU SetUp1<br>
^ ^ ^<br>
| | |<br>
| | |<br>
Destroy2-----> SU -------<br>
^ ^ ^<br>
| | |<br>
| | |<br>
----------- | |<br>
| | |<br>
Destroy1<br>
^<br>
|<br>
</font><br>
<font color="black" face="Tahoma" size="2"><span dir="ltr" style="font-size:10pt"><font size="2">The new function callResourceDeadLockDanger()</font></span></font> will check for this situation<br>
and prevent PrescheduleNodesWithMultipleUses() from making the transformation<br>
if it will cause a callResource dead lock.<br>
<br>
<br>
Outstanding issues<br>
============<br>
<br>
1. Is it too aggressive in searching predecessors and successors?<br>
Should the algorithm give up and assume the worst if the depth of search reaches a predefined limit?<br>
Can someone confirm that the extra processing time is not onerous.<br>
<br>
2. Should the initial search for 'SetUp1' and 'Destroy1' only search along chains? viz conditional upon II->isCtrl()<br>
This will reduce the search space, but are getCallFrameSetupOpcode & getCallFrameDestroyOpcode always 'chained'?<br>
(Later searches for Destroy2 need to check all predecessors)<br>
<br>
3. What is the best way to construct the test case?<br>
Using an IR as input does not guarantee the required DAG will be output for testing.<br>
The test IR only produces the correct DAG when built for the XCore target.<br>
(see attached test case)<br>
<br>
4. Where should the test be placed?<br>
Currently I have placed it under test/CodeGen/XCore but it relates to lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp<br>
<br>
Thank you<br>
<br>
Robert<br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>