<div dir="ltr"><div>This problem was also reported as:</div><div><a href="https://github.com/llvm/llvm-project/issues/52684" target="_blank">https://github.com/llvm/llvm-project/issues/52684</a></div><div>...and should be fixed with:</div><div><a href="https://reviews.llvm.org/rGbb2fc19c6355" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/bb2fc19c6355d990a4cfb94be20528fbe37950a8</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 18, 2021 at 1:24 PM Sankisa, Krishna (Chaitanya) via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:rgb(0,0,255);margin:5pt" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<a href="https://reviews.llvm.org/D113366" id="gmail-m_5256569150254192232gmail-m_-9082805335362681980gmail-m_2538012633096954738LPlnk328483" target="_blank">https://reviews.llvm.org/D113366</a> and <a href="https://github.com/llvm/llvm-project/commit/1376301c87274bccf5565eb892173442782b1de3" id="gmail-m_5256569150254192232gmail-m_-9082805335362681980gmail-m_2538012633096954738LPNoLPOWALinkPreview" target="_blank">https://github.com/llvm/llvm-project/commit/1376301c87274bccf5565eb892173442782b1de3</a> <br>
</div>
<div></div>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
The above change causes a soft hang for the below IR in InstCombine Transform.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
define i32 @p0(i32 %CF_init) {
<div>  %t0 = add i32 %CF_init, -3</div>
<div>  %t1 = icmp ugt i32 %t0, 1</div>
<div>  %t2 = select i1 %t1, i32 -3, i32 1</div>
<div>  ret i32 %t2</div>
<div>}</div>
<div><br>
</div>
tryToReuseConstantFromSelectInComparison() from InstCombineSelect.cpp will replace select with inverse icmp and select. 1376301c8727 change when it sees a icmp ugt will replace with icmp ult. InstCombinerImpl::run() in InstructionCombining.cpp, will run these
 transforms in a loop and it never ends. This is causing soft hang.<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
icmp ugt is always transformed to icmp ult. Issue is with this transform. Commenting out the change fixes the soft hang issue.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Any suggestion on other ways of fixing this in <span style="background-color:rgb(255,255,255);display:inline">InstructionCombining transform pass?</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Regards,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Chaitanya</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
</div>
</div>

_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>