[LLVMbugs] [Bug 23320] New: Use power of 2 operations for bitfields

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 22 10:52:38 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23320

            Bug ID: 23320
           Summary: Use power of 2 operations for bitfields
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pete.cooper at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

r235528 changed MachineOperand::OpKind from an unsigned char to a bitfield. 
This was to optimize the accesses of the bitfields after it.

We had a struct something like 

struct MachineOperand {
  unsigned char OpKind;
  unsigned int bitfield1 : 1;
  unsigned int bitfield2 : 1;
...
}

Although the 24-bits of bitfields and the unsigned char shared 32-bits of
storage space, the actual accesses to the bitfields were generated as i24
load/store which isn't legal.  This ultimately leads to the backend having to
split the i24 in to i8 and i16 operations.

We should see if its possible for clang to emit the unsigned char and bitfields
as an i32 given that this is how they are stored.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150422/d776495a/attachment.html>


More information about the llvm-bugs mailing list