[LLVMdev] [llvm-commits] rotate

Cameron McInally cameron.mcinally at nyu.edu
Tue Jul 31 10:01:07 PDT 2012


Well, we like the operator because it maps cleanly to Fortran's ISHFTC
intrinsic. There must also be other compilers out there, maybe catering to
cryptos, that have their own intrinsic for circular shift in other
languages. It seems wasteful for an optimizer to break apart an intrinsic
into its elemental pieces in order for LLVM to put them back together. This
was done in our compiler for some time and it cluttered up the interface
code.

Just curious... what kind of optimizations are done on ISD::ROTL/ROTR?
We're able to preform certain InstCombines and other peeps when we see a
binary operator. I do not have any experience trying to optimize ISD::ROTL.

On Tue, Jul 31, 2012 at 12:17 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Tue, Jul 31, 2012 at 8:42 AM, Cameron McInally
> <cameron.mcinally at nyu.edu> wrote:
> > Andy,
> >
> > Here is the left circular shift operator patch. I apologize to the
> reviewer
> > in advance. The patch has a good bit of fine detail. Any
> > comments/criticisms?
> >
> > Some caveats...
> >
> > 1) This is just the bare minimum needed to make the left circular shift
> > operator work (e.g. no instruction combining).
> >
> > 2) I tried my best to select operator names in the existing style; please
> > feel free to change them as appropriate.
>
> We intentionally haven't included a rotate instruction in LLVM in the
> past; the justification is that it's generally straightforward for the
> backend to form rotate operations, and making the optimizer
> effectively handle the new rotation instruction adds a substantial
> amount of complexity.  You're going to need to make a strong argument
> that the current approach is insufficient if you want to commit a
> patch like this.
>
> -Eli
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120731/cc0501cd/attachment.html>


More information about the llvm-dev mailing list