[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 07:41:37 PST 2023


nikic wrote:

> > Alternative would be to forbid GEP indexing into vectors entirely.
> 
> I agree that it would be better if there just were no vector GEPs, but that breaks importing older modules, and that cannot be easily auto-upgraded (convert to byte-GEPs?).

Yes, upgrade would be to byte-GEPs.

> Even worse, DXIL uses different vector semantics where alignment in vectors is respected, so importing DXIL already is a challenge, but if vector GEPs in DXIL were to be replaced by byte-GEPs as part of auto-upgrade, preserving DXIL semantics becomes difficult.

Would probably need a bitcode parser hook for the conversion of GEP indices to offsets. You'll have to deal with this problem at some point anyway, once we start upgrading *all* GEPs to byte-GEPs in the not-so-distant future.

https://github.com/llvm/llvm-project/pull/75448


More information about the cfe-commits mailing list