[llvm-dev] Accessing global variables arrays result in inlined getelementptrs

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Tue Jul 23 12:38:09 PDT 2019


Am Di., 23. Juli 2019 um 15:11 Uhr schrieb Antonin Reitz via llvm-dev
<llvm-dev at lists.llvm.org>:
> Hence two questions.
> - What is the main reason behind this behavior?

The getelementptr has all constant argument, meaning it itself becomes
an GetElementPtrConstantExpr. ConstantExprs (in contrast to
instructions) are inlined by the IR emitter.


> - Is there a way to disable it (ideally while preserving optimisations
> disabled)?

Not that I know of.

Michael


More information about the llvm-dev mailing list