[LLVMdev] Questions on non-byte-aligned fields

Rodney M. Bates rodney_bates at lcwb.coop
Sun Apr 13 08:58:07 PDT 2014


It looks like, for a non-packed struct, that every member starts on a
byte boundary, even if its size is not a byte multiple, e.g,, i1 or i20.
And since getelementptr starts with and computes a pointer, it, combined
with load/store could only be used with this limitation.

So, in the case of a packed struct, can I get fields to start and end
at non-byte boundaries?  I would still not be able to use getelementptr/
load/store to access them, but presumably I could use extractvalue and insertvalue?
Can I do this on either memory values or register values?

Even with a field that is a multiple of full bytes, if I were to fetch a word from
memory to a register variable, use extractvalue on that, or use insertvalue and then
store the word, would I lose optimization possibilities that I would have if I used
load or store?

-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the llvm-dev mailing list