[llvm-dev] Global or Local variable different builder behavior

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 30 09:45:39 PDT 2019


With 'A' being a global variable, the GEP becomes a ConstantExpr
(GetElementPtrConstantExpr instead of GetElementPtrInst) since all of
its arguments are constant. ConstantExpr are "free-floating", i.e. not
int a BasicBlock's instruction list and therefore only appear in the
printout when used.

Michael

Am Mo., 30. Sept. 2019 um 11:23 Uhr schrieb Duat via llvm-dev
<llvm-dev at lists.llvm.org>:
>
> Hello,
> I posted this question on stackoverflow : https://stackoverflow.com/questions/58147549/global-or-local-variable-different-builder-behavior
>
> with no response, but I can't understand the different behavior based on whether the variable is global or local.
> Can you help me to understand?
>
> thanks
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list