[llvm-dev] Endianness for multi-word types

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 1 14:00:15 PST 2015


On 1 December 2015 at 13:41, Tim Shen via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> As a simple solution, when see a LLVM IR bitcast, instead of generating
> (ISD::BITCAST x), can we generate (exchange_hi_lo (ISD::BITCAST x)) instead?

An LLVM bitcast is defined to be equivalent to a store/load pair.
Changing that for ISD::BITCAST would be very surprising, and  I
wouldn't recommend it. It's a very useful invariant for reasoning
about what should happen.

When we had to work around similar endian nightmares in ARM I think we
ended up creating AArch64ISD::NVCAST to represent a true nop cast.

Cheers.

Tim.


More information about the llvm-dev mailing list