<div dir="ltr"><div>Hi,</div><div><br></div><div>I've been wondering why LLVMs GEP instructions are based on types, rather than encoding the raw address calculation as a base pointer plus some scaled offsets (still in the form of a GEP, to retain provenance).</div><div><br></div><div>The type information does not seem particularly useful (shouldn't be used as an optimization base, because struct layouts lie), but increases the non-canonical IR space (there are many ways to encode the same GEP) and increases compile-time (optimizations need to constantly decompose GEPs, e.g. to get constant offsets).</div><div><br></div><div>What am I missing here?<br></div><div><br></div><div>Nikita,</div><div>Regards<br></div></div>