[llvm-commits] [llvm] r123048 - in /llvm/trunk: include/llvm/CodeGen/IntrinsicLowering.h lib/CodeGen/IntrinsicLowering.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/X86/X86ISelLowering.cpp test/CodeGen/ARM/bswap-inline-asm.ll test/CodeGen/X86/bswap-inline-asm.ll

Chris Lattner clattner at apple.com
Fri Jan 7 18:02:09 PST 2011


On Jan 7, 2011, at 5:24 PM, Evan Cheng wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=123048&view=rev
> Log:
> Recognize inline asm 'rev /bin/bash, ' as a bswap intrinsic call.

Reversing bash eh?  Nice instruction!

A comment:

> +    /// LowerToByteSwap - Replace a call instruction into a call to bswap
> +    /// intrinsic. Return false if it has determined the call is not a
> +    /// simple integer bswap.
> +    static bool LowerToByteSwap(CallInst *CI);

Instead of having it be layered like this, I'd prefer that you add an IRBuilder::CreateBSwap operation (just like CreateMemSet) and use that.  This means that you'll be creating a new call (+ RAUW) then deleting the old one, but the compile time impact doesn't matter in this case.

-Chris





More information about the llvm-commits mailing list