<div dir="ltr">Thanks! That is exactly what I was looking for. I was basing most of my stuff on NVPTX and apparently they don't bother implementing the reverseBranchCondition.<div><br></div><div>Also, thanks for print-after-all flag. Should be useful for me.</div><div><br></div><div>Thanks again for all the help.</div><div>-Dilan</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 10, 2017 at 1:01 PM Friedman, Eli <<a href="mailto:efriedma@codeaurora.org">efriedma@codeaurora.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7/9/2017 4:36 PM, Dilan Manatunga via llvm-dev wrote:<br>
> When I looked at the debug output for the x86 backend though, I can't<br>
> figure out how they realize to get rid of that branch. Up to the last<br>
> point that MachineInstrs are printed (the rewrite virtual registers<br>
> pass), the MachineInstrs still show the two jump paradigm. But in the<br>
> final output, it somehow becomes one branch case.<br>
<br>
The "-print-after-all" flag is often useful to figure out what various<br>
passes do.<br>
<br>
><br>
> I know one solution is for me to add a pass after basic block<br>
> placement to change these instructions, but I am wondering if there is<br>
> a recommended way to do this. Especially as this seems like a common<br>
> problem, where an existing generic pass would have some interface a<br>
> backend should support to allow branch re-writes to create the single<br>
> branch case.<br>
<br>
This transform already exists as target-independent code in<br>
BranchFolding.cpp. Is TargetInstrInfo::reverseBranchCondition<br>
implemented for your target?<br>
<br>
-Eli<br>
<br>
--<br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
</blockquote></div>