<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’m hitting a machine verifier error in a trivial testcase which I don’t understand. There are 2 dead defs of the same register:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">---<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">name: multiple_connected_compnents_dead<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">tracksRegLiveness: true<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">body: |<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> bb.0:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> dead %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> dead %0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The live intervals look OK to me with 1 valno per instruction, for the life of the instruction like I would expect. The verifier does not like it however:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">$ llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -verify-machineinstrs -run-pass=machine-scheduler -o - -verify-misched foo.mir<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"># Before machine scheduling.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">********** INTERVALS **********<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">%0 [16r,16d:1)[32r,32d:0) 0@32r 1@16r weight:0.000000e+00<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">RegMasks:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">********** MACHINEINSTRS **********<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"># Machine code for function multiple_connected_components_dead: NoPHIs, TracksLiveness<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">0B bb.0:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">16B dead %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">32B dead %0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"># End machine code for function multiple_connected_components_dead.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">*** Bad machine code: Multiple connected components in live interval ***<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">- function: multiple_connected_components_dead<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">- interval: %0 [16r,16d:1)[32r,32d:0) 0@32r 1@16r weight:0.000000e+00<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">0: valnos 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">1: valnos 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">LLVM ERROR: Found 1 machine code errors.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">What is the problem here?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">-Matt<o:p></o:p></span></p>
</div>
</body>
</html>