<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 15, 2017 at 1:43 PM, Matt Arsenault <span dir="ltr"><<a href="mailto:arsenm2@gmail.com" target="_blank">arsenm2@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div><div class="h5"><div>On May 15, 2017, at 07:54, vivek pandya via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-6433517918335851374Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr">Hello LLVM Developers,<div><br></div><div>I am working on an architecture which have one bit shift operation if barrel shiftier hardware is not present in such cases some DAGCombine optimizations reduces performance of certain benchmarks upto 5% for example consider follwing optimization:</div><div><div style="font-family:consolas,'courier new',monospace;font-size:14px;line-height:19px;white-space:pre-wrap"><span style="color:rgb(0,142,0)">fold (select_cc seteq (and x, y), 0, 0, A) -> (and (shr (shl x)) A)</span></div></div><div>Here it introduce 2 shift operations and when barrel shiftier is not present these shifts will be converted to loops thus making it worst. I am sure there few architectures which have similar features. So how to disable these kind of optimizations in DAGCombine particularly when I want build and use LLVM for more than one target ?</div><div><br></div><div>Sincerely,</div><div>Vivek</div></div></div></div>
______________________________<wbr>_________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br><div>Sounds to me like this combine is missing a TLI.isOperationLegal(ISD::<wbr>LSHR) or similar check</div></div></blockquote><div>I think for me, problem will still be there because shift operation is legal on my target but it is able to shift only 1 bit at a time and that's why I need to convert to loop. </div><div>-Vivek</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Matt</div></font></span></div></blockquote></div><br></div></div>