Stream: t-compiler

Topic: requesting non-alignment


pnkfelix (Oct 18 2018 at 17:05, on Zulip):

@nagisa this might be a super -silly question: Is there a way to ask LLVM to always keep a value at some offset from a given alignment? (Apart workarounds like putting the value as the second field in a packed struct, which would be the most immediate way I would try to encode such a thing)

nagisa (Oct 18 2018 at 17:10, on Zulip):

uhh, not sure about "some offset"

nagisa (Oct 18 2018 at 17:10, on Zulip):

if it is 0, then doing so is pretty easy

rkruppe (Oct 18 2018 at 17:13, on Zulip):

LLVM barely even deals with alignments of fields, so I'm rather sure that isn't a thing

nagisa (Oct 18 2018 at 17:13, on Zulip):

if it is not 0 then what you might end up having to do is something along the lines of

%X = type <{ [offset x i8], %Y, [0 x i8] }>
nagisa (Oct 18 2018 at 17:14, on Zulip):

(then given %X is aligned to your "given alignment", then %Y will be offset from that by offset)

Last update: Nov 22 2019 at 05:15UTC