<div dir="ltr">Hi David,<div><br></div><div>> <span style="line-height:1.5">Out of curiosity, is there a major benefit to canonicalizing this in the middle-end vs doing this transform in code-gen prepare?</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Major? no. My initial implementation was to do this in ISelLowering, but it was remarked that matching bitreversals is a fairly generic concept that other backends could benefit from.</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">The code already in instcombine (since at least 2010) to match bswaps performs almost exactly the same steps as matching bitreversals (apart from it looks at bytes rather than bits). I therefore thought the most obvious thing to do would be to tweak the existing algorithm and improve it.</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Do you think it's too heavyweight for instcombine?</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">James</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 4 Jan 2016 at 23:13 David Majnemer via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">majnemer added a comment.<br>
<br>
Out of curiosity, is there a major benefit to canonicalizing this in the middle-end vs doing this transform in code-gen prepare?<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D15857" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15857</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>