<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr"><div>Hi there!</div><div><br></div><div>Recently I saw a presentation with title "<b>Hot Cold Splitting Optimization Pass In LLVM</b>" on youtube about hotcoldsplit LLVM pass .</div><div><br></div><div>I want to use this built-in pass to optimize my IR but I don't know how it can optimize my code, I didn't find any result and contacted to the developer and he advised me to use test at LLVM for testing this pass .</div><div><br></div><div>I tried <b>opt.ll</b> from llvm/test/intstrumentation/BoundsChecking and :<br></div><div>
<div><b><br></b></div><div><b>opt -S -hotcoldsplit opt.ll -o opt1.ll</b></div><div><b><br></b></div><div>The result is not what I expect because I used a diffing tool and see just some sorts of the following has been removed from the original source :</div><div><b><br></b></div><div><b>; CHECK: mul i64 {{.*}}, 4<br>; CHECK: sub i64 4000, %<br>; CHECK-NEXT: icmp ult i64 {{.*}}, 4<br>; CHECK-NEXT: or i1<br>; CHECK: trap</b></div><div><br></div><div><b>; CHECK: mul i64 {{.*}}, 8<br>; CHECK: mul i64 {{.*}}, 4<br>; CHECK: add i64<br>; CHECK: sub i64 16, %<br>; CHECK-NEXT: icmp ult i64 16, %<br>; CHECK-NEXT: icmp ult i64 {{.*}}, 4<br>; CHECK-NEXT: or i1<br>; CHECK: trap</b></div><div><br></div><div><br></div><div>Btw, I attached the source and output file as the result .</div><div><br></div><div>As in my own code, I do not use these "<b> ; CHECK : </b>" things, I see no change on my own code after using hotcoldsplit and in fact I do expect this built-in pass to have impact on the real code but I didn't find this .</div><div><br></div><div>Can someone please clarify how this hotcoldsplit pass , affect the real code and how exactly does it working and how I can use this built-in pass in the proper way to optimize my code?</div><div><br></div><div>Thanks</div><div>Azim<br></div><div><br></div><div><b><br></b></div>

</div></div>
</div></div>