<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;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="LPlnk328483">https://reviews.llvm.org/D113366</a> and <a href="https://github.com/llvm/llvm-project/commit/1376301c87274bccf5565eb892173442782b1de3" id="LPNoLPOWALinkPreview">https://github.com/llvm/llvm-project/commit/1376301c87274bccf5565eb892173442782b1de3</a> <br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></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 !important">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>
</body>
</html>