<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 25, 2015, at 7:53 PM, Owen Anderson <<a href="mailto:resistor@mac.com" class="">resistor@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 25, 2015, at 12:31 PM, Jingyue Wu <<a href="mailto:jingyue@google.com" class="">jingyue@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; float: none; background-color: rgb(255, 255, 255); display: inline !important;" class="">Owen, could you explain more on the approach of using branch-if-none instructions in your mind? I believe you have lots of great insights, but<span class="Apple-converted-space"> </span></span><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I don't see how cbranch.ifnone instructions directly solve my issue. The issue I am trying to solve is that certain CFG optimizations transform the CFG into a "bad" structure which hurts the performance of the compiled code in the presence of divergent branches. On the other hand, I don't want to disable jump threading all together because it is still beneficial for non-divergent branches. As far as I can understand, cbranch.ifnone provides a fast path so that a warp can jump over the region that no threads in the warp ever execute. However, it doesn't help the case where the branches are indeed divergent. </span></div></blockquote></div><br class=""><div class="">I don’t have any specific advice to offer you about JumpThreading. My experience has been that it generally not worth using for GPU targets. I suspect that an enhanced model that allowed the target to assign a cost-per-duplication of instructions might make it more profitable.</div></div></div></blockquote><br class=""></div><div>Also, if you’re interested in optimizations that reduce branch divergence, you might take a look at the following papers. I have no hands-on experience with them, but they seem like they could be useful, particularly to more general compute applications:</div><div><br class=""></div><div><a href="http://www.eecg.toronto.edu/~han/papers/brdiv-gpgpu11.pdf" class="">http://www.eecg.toronto.edu/~han/papers/brdiv-gpgpu11.pdf</a></div><div><a href="http://www.eecg.toronto.edu/~han/papers/lm-gpgpu13.pdf" class="">http://www.eecg.toronto.edu/~han/papers/lm-gpgpu13.pdf</a></div><div><br class=""></div><div>—Owen</div></body></html>