Displaying 20 results from an estimated 58 matches for "globalvar".
2014 Sep 02
3
[LLVMdev] LICM promoting memory to scalar
...cking this in test/Transforms/LICM/scalar-promote-memmodel.ll
However, I have a sample code where GCC is able to promote the memory to scalar and hoist/sink load/store out of loop but LLVM cannot.
Is GCC being aggressive here or LLVM missing out an opportunity?
Here is my sample code:
extern int globalvar;
void foo(int n , int incr) {
unsigned int i;
for (i = 0 ; i < n; i += incr ) {
if (i < n/2)
globalvar += incr;
}
return;
}
GCC output:
$ aarch64-linux-gnu-g++ -S -o - -O3 -ffast-math -march=armv8-a+simd test.cpp
.arch armv8-a+fp+simd
.file "test.cpp...
2014 Sep 02
2
[LLVMdev] LICM promoting memory to scalar
...<morisset at google.com> wrote:
>
> The problem here is that doing this can introduce a race which is undefined at the IR level.
> In the example you gave above I suspect that this is a bug in GCC. I may have missed something in the assembly, but it appears that gcc loads a copy of globalvar in w3, does stuff with w3 and then stores w3 in globalvar. This is unsound in the case where the loop is run with n = 0.
> For an example, if you have a thread run foo(0,0) in a loop (so not doing anything) and another thread doing:
> for (int i = 0 ; i <1000000 ; ++i) {
> globalvar...
2014 Sep 03
3
[LLVMdev] LICM promoting memory to scalar
..., Robin Morisset <morisset at google.com> wrote:
The problem here is that doing this can introduce a race which is undefined
at the IR level.
In the example you gave above I suspect that this is a bug in GCC. I may
have missed something in the assembly, but it appears that gcc loads a copy
of globalvar in w3, does stuff with w3 and then stores w3 in globalvar. This
is unsound in the case where the loop is run with n = 0.
For an example, if you have a thread run foo(0,0) in a loop (so not doing
anything) and another thread doing:
for (int i = 0 ; i <1000000 ; ++i) {
globalvar = i;
asser...
2011 Nov 21
2
[LLVMdev] A way to pass const char* arg without creating a GlobalVariable
Hi,
Is it possible to make up a ConstantArray containing a "const char*"
string and pass it directly to the function "char*" argument *without*
creating a GlobalVaribable?
I looked around and found the usual implementation is
array->globalVar->gep. If we omit globalVar & gep, then the argument
type would be [ i8 x N ], where N is set to the exact string length,
and the expected type is i8* => assertion.
In other words, in C we can submit constant...
2017 Apr 04
4
RFC: Adding a string table to the bitcode format
...f this, but note that currently string can be encoded with
> less than 8 bits / char in some cases (there might some size increase
> because of this).
> That said we already paid this with the metadata table in the recent past
> for example.
>
> The format of MODULE_CODE_{FUNCTION,GLOBALVAR,ALIAS,IFUNC,COMDAT}
> records would change so that their first operand would specify their names
> with a byte offset into the string table. (To allow for backwards
> compatibility, I would increment the bitcode version.)
>
>
> I assume you mean the EPOCH?
>
> Here is what i...
2017 Apr 04
5
RFC: Adding a string table to the bitcode format
...value
names, make bitcode files more compressible and make bitcode easier to
parse). The format of the string table would be a top-level block
containing a blob containing null-terminated strings [0] similar to the
string table format used in most object files.
The format of MODULE_CODE_{FUNCTION,GLOBALVAR,ALIAS,IFUNC,COMDAT}
records would change so that their first operand would specify their names
with a byte offset into the string table. (To allow for backwards
compatibility, I would increment the bitcode version.) Here is what it
would look like as bcanalyzer output:
<MODULE_BLOCK>
<V...
2011 Nov 21
0
[LLVMdev] A way to pass const char* arg without creating a GlobalVariable
...On Nov 20, 2011, at 16:58, "Dmitry N. Mikushin" <maemarcus at gmail.com> wrote:
> Hi,
>
> Is it possible to make up a ConstantArray containing a "const char*"
> string and pass it directly to the function "char*" argument *without*
> creating a GlobalVaribable?
> I looked around and found the usual implementation is
> array->globalVar->gep. If we omit globalVar & gep, then the argument
> type would be [ i8 x N ], where N is set to the exact string length,
> and the expected type is i8* => assertion.
> In other words, in...
2004 Jul 26
1
Global Variables Scope
All,
Can you use the global variables set in the [globals] section of the
extension.conf file in other configuration files?
Here is an example:
I have a file called globalvars.conf that I include in the [globals]
section in extension.conf. I would like either (a) that the global
variables being defined in this section can be used from voicemail.conf
or (b) that I can include the globalvars.conf in voicemail.conf and use
the variables there also.
So: (Bad example bu...
2009 Oct 11
3
[LLVMdev] Some additions to the C bindings
...lass. */
+typedef struct LLVMOpaqueUse *LLVMUseRef;
My understanding is that this actually conceptually corresponds to
use_iterator, not Use. Please name this something like
LLVMUseIterator. Also, please document this, not just referring to
llvm::Use.
+int LLVMHasInitializer(LLVMValueRef GlobalVar);
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
Isn't LLVMHasInitializer just LLVMGetInitializer(x) != 0?
Otherwise, looks ok to me,
-Chris
2017 Apr 04
4
RFC: Adding a string table to the bitcode format
...ively small part of the data in the
bitcode file. The same logic applies to the symbol table (note that we use
support::ulittle32_t instead of a bit encoding).
That said we already paid this with the metadata table in the recent past
> for example.
>
> The format of MODULE_CODE_{FUNCTION,GLOBALVAR,ALIAS,IFUNC,COMDAT}
> records would change so that their first operand would specify their names
> with a byte offset into the string table. (To allow for backwards
> compatibility, I would increment the bitcode version.)
>
>
> I assume you mean the EPOCH?
>
No, the MODULE_COD...
2017 Apr 04
2
RFC: Adding a string table to the bitcode format
...> bitcode file. The same logic applies to the symbol table (note that we use
> support::ulittle32_t instead of a bit encoding).
>
> That said we already paid this with the metadata table in the recent past
>> for example.
>>
>
>> The format of MODULE_CODE_{FUNCTION,GLOBALVAR,ALIAS,IFUNC,COMDAT}
>> records would change so that their first operand would specify their names
>> with a byte offset into the string table. (To allow for backwards
>> compatibility, I would increment the bitcode version.)
>>
>>
>> I assume you mean the EPOCH?...
2009 Oct 07
0
[LLVMdev] Some additions to the C bindings
On Tue, Oct 6, 2009 at 2:13 PM, Kenneth Uildriks <kennethuil at gmail.com> wrote:
> My front-end is sync'd with the trunk now, and working well, but it
> required some additional functions exposed in the C bindings. I
> hereby submit them for review and approval for inclusion in the trunk.
>
LLVMGetAttribute had a bug in it. Here's the revised version of the patch
2009 Oct 06
3
[LLVMdev] Some additions to the C bindings
My front-end is sync'd with the trunk now, and working well, but it
required some additional functions exposed in the C bindings. I
hereby submit them for review and approval for inclusion in the trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbindings.patch
Type: application/octet-stream
Size: 7269 bytes
Desc: not available
URL:
2011 Oct 26
0
[LLVMdev] Use still stuck around after Def is destroyed:
On Oct 26, 2011, at 12:18 PM, ret val wrote:
> I made a GlobalVariable that is of type ConstantArray. For one of it's
> elements I assigned it the ConstantExpr::getBitCast of another
> GlobalVariable(the "shadow pointer" mentioned). This gives me:
>
> While deleting: i32 (i32)** %Shadow Variable for ptr1
> Use still stu...
2007 Jan 11
3
[LLVMdev] Request documentation for global var syntax
file://docs/LangRef.html#globalvars
The section describing the definition of global vars discusses that you
can specify an alignment and can also specify a section. Could someone
provide an example that works in gccas in release 1.9 for both defining
which section the var is assigned to and defining the variables
alignment?
Also,...
2014 Jul 29
2
[LLVMdev] Reminder: Please switch to MCJIT, as the old JIT will be removed soon.
Hi Keno,
Could you give a short high-level overview of the way Julia works now with
MCJIT instead the JIT:
What I gather so far...
* Compiled IR functions are emitted to a shadow module.
* Any used function is cloned into its own new module and the module is
added to MCJIT.
* Called functions or globalvars are only declared in that module.
* Modules are never removed meaning "old" functions are abandoned rather
then replaced.
* All function calls go through a trampoline function doing the multiple
dispatch, also enabling old function replacement to new version.
Thanks,
Yaron
2014-07-...
2011 Oct 26
3
[LLVMdev] Use still stuck around after Def is destroyed:
I made a GlobalVariable that is of type ConstantArray. For one of it's
elements I assigned it the ConstantExpr::getBitCast of another
GlobalVariable(the "shadow pointer" mentioned). This gives me:
While deleting: i32 (i32)** %Shadow Variable for ptr1
Use still stuck around after Def is...
2017 Jun 08
2
[RFC][ThinLTO] llvm-dis ThinLTO summary dump format
...DO gave
> anything besides Unknown. I'll be looking more into this tomorrow.
>
> Here's the current format:
>
> > ../build/bin/llvm-lto2 dump-summary b.o
> ---
> NamedGlobalValueMap:
> :
> - GUID: 3762489268811518743
> Kind: GlobalVar
> Linkage: PrivateLinkage
> NotEligibleToImport: true
> Live: false
> cold:
> - GUID: 11668175513417606517
> Kind: Function
> Linkage: ExternalLinkage
> NotEligibleToImport: true
>...
2018 May 07
1
Global Variable Initialization via Internal Function
...global
variables if initialization values are not constants.
*Do we really need to create an internal function for complex global
variable initializations during variable declaration? Can't we create
instructions in global scope?*
Example Simple C++ code:
int func()
{
return 5*2;
}
init globalVar = func();
int main(...)
...
Thanks for helping!
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180506/731b5be2/attachment.html>
2017 Jun 07
2
[RFC][ThinLTO] llvm-dis ThinLTO summary dump format
On Wed, Jun 7, 2017 at 8:58 AM, Charles Saternos <charles.saternos at gmail.com
> wrote:
> Alright, now it outputs YAML in the following format:
>
> ---
> NamedGlobalValueMap:
> X:
> - Kind: GlobalVar
> Linkage: ExternalLinkage
> NotEligibleToImport: false
> Live: false
> a:
> - Kind: Alias
> Linkage: WeakAnyLinkage
> NotEligibleToImport: false
> Live: false
> AliaseeGUID:...