[PATCH] Change MachineOperand OpKind to a bitfield
mbraun at apple.com
Mon Apr 20 17:25:08 PDT 2015
> On Apr 20, 2015, at 4:10 PM, Pete Cooper <peter_cooper at apple.com> wrote:
> Hi Rafael
> MachineOperand::OpKind is an unsigned char, followed by 24-bits of bitfields. clang is able to make all of that take 32-bits of space, but it generates pretty nasty code to do so.
> OpKind itself is loaded and stored as an i8 and so gets very nice IR. However, loading an entry from one of the bitfields results in a load of an i24, then masking operations. Given that i24 isn’t legal, the legalizer goes to great lengths to make this work, typically splitting it in to i8 and i16 operations.
I don't know the actual clang code, but isn't the canonical codegen for something like the following "unsigned SubReg_TargetFlags : 12;" to load an "unsigned" value and shift/mask that? Why does it use i24?
More information about the llvm-commits