[llvm] [llvm][IR] Add per-global code model attribute (PR #72077)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 09:04:23 PST 2023


aeubanks wrote:

I was just about to send out an RFC for https://github.com/llvm/llvm-project/pull/69638 :)

Can you explain (or link to docs) how the different code models for LoongArch work and a per-global code model would change that?
For example, for x86-64, data/text (`GlobalVariable`/`Function`) can either be small or large depending on the code model (small PIC data can be accessed with 32-bit PC-relative relocations, large data must be accessed with 64-bit relocations), so to override that we don't actually need an entire `code-model` attribute, we just need a `force-large` or `force-small` attribute to cover all cases.

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


More information about the llvm-commits mailing list