<div dir="ltr">I am developing in C for an extremely memory constrained AARCH64 embedded environment.  Sometime between llvm 6 and 7, I'm seeing a code size regression when I make multiple accesses into a global struct.  Specifically, I have functions that perform several reads/writes into this global struct.<div><br><div>In older versions (5/6)<br><div>- a single ADRP/ADD combo is issued at the beginning of a function to get my structure address into a register</div><div>- that register is preserved throughout the function</div><div>- subsequent accesses into this structure are done as LDR/STR with offset from the preserved register</div><div><br></div><div>In later versions (7/8)</div><div>- the ADRP/ADD combo is performed every time I try to access something inside the struct.</div></div></div><div><br></div><div>The net result is slightly larger code that has the potential to cause me issues. There are plenty of unused registers that could be used for the purpose of not constantly re-loading the address of my struct.  My current suspicion is that later versions are presuming fewer registers are not being preserved by other function calls, and therefore can't be relied upon to hold the address of my struct.  Assuming this is right, is there some way to encourage the behavior of the older versions?</div><div><br></div><div>Thanks,</div><div>Robert M</div><div><br></div><div><br></div></div>