<div dir="ltr">Hi all,<br><br>A few different though somewhat related questions here. I'm really grateful for your answers!<br><br>1. From a previous question I know that sizeof's are resolved into literals early in the front-end before IR is even emitted. It seems that they are resolved into whatever value is correct for the host machine. But if one wishes to then take the IR and emit assembly code for some other platform (in other words, to cross-compile), what's the correct way to go about it? How to make the front-end resolve the sizeof's according to some other target triple? For example, the sizeof of a C struct of one int and one char is resolved into 8 and not 5, but for some platforms out there 5 might be the correct answer. Will the "target datalayout" information in the IR file affect this in any way?<br>
<br>2. What is that "target triple" as appears in the IR code? Who inserts it? Who takes note of it, if at all? Can the front-end be made to use some other triple than the native one? Does it affect the backends at all?<br>
<br>3. In my code, I see an array of 8 x i8 being optimized into i64 (so that memcpy is then optimized into mov) by some optimization transformation(s). I want to prevent this from happening. What optimization does this kind of type replacement? How can one prevent it alone from running (but keeping all other optmizations, i. e. not using -O0 or something similar).<br>
<br><br>Many thanks!!<br><br><br>Harel Cain<br clear="all"><br>
</div>