search for: _foo

Displaying 20 results from an estimated 118 matches for "_foo".

2015 Mar 03
2
[LLVMdev] Need a clue to improve the optimization of some C code
...%rdx andq %r15, %rdx cmpq %r15, (%rax,%rdx) jne LBB0_4 leaq 0(%rdx,%rax), %rcx LBB0_4: movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx callq *8(%rcx) movq %rax, %rbx LBB0_5: ~~~ This is the IR code, which produces above: ~~~ ; Function Attrs: inlinehint nounwind define internal %struct._foo* @call(%struct._foo* %foo, i8* %key, i8* %value) #2 { %1 = alloca %struct._foo*, align 8 %2 = alloca %struct._foo*, align 8 %3 = alloca i8*, align 8 %4 = alloca i8*, align 8 %dispatch = alloca %struct._dispatch*, align 8 %table = alloca %struct._table*, align 8 %entrys = alloca %struc...
2015 Mar 03
2
[LLVMdev] Need a clue to improve the optimization of some C code
...i >> movq %r15, %rsi >> movq %r14, %rdx >> callq *8(%rcx) >> movq %rax, %rbx >> LBB0_5: >> ~~~ >> >> >> This is the IR code, which produces above: >> ~~~ >> ; Function Attrs: inlinehint nounwind >> define internal %struct._foo* @call(%struct._foo* %foo, i8* %key, i8* %value) #2 { >> %1 = alloca %struct._foo*, align 8 >> %2 = alloca %struct._foo*, align 8 >> %3 = alloca i8*, align 8 >> %4 = alloca i8*, align 8 >> %dispatch = alloca %struct._dispatch*, align 8 >> %table = all...
2006 Jun 05
2
Functions starting with underscores
I'm having problems with functions starting with underscores '_foo' <- function(x) {1} seems to work but I can't assign an attribute to this function attr('_foo', 'bar') <- 'pow' Any way of doing this? This is for a C++ -> R wrapping system so I'd like to keep the C++ names which start with underscores. (please c...
2016 Feb 11
3
Expected constant simplification not happening
...ssume at least the same speed or better. This is with llvm 3.7.0. And yes this pains me at the moment :) Ciao Nat! ---- ; ModuleID = 'optimize-fail.c' target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" %struct._foo = type {} %struct._entry = type { i32, i32, i8* (%struct._foo*, i32, i8*)* } %struct._table = type { i64, i32, i32, [1 x %struct._entry] } %struct.test = type { %struct.__foo, i32 } %struct.__foo = type { %struct._dispatch } %struct._dispatch = type { %struct._entry*, i8* (%struct._foo*, i32, i8*)*...
2016 Dec 07
1
Expected constant simplification not happening
...this pains me at the moment :) > > Ciao > Nat! > ---- > ; ModuleID = 'optimize-fail.c' > target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" > target triple = "x86_64-apple-macosx10.10.0" > > %struct._foo = type {} > %struct._entry = type { i32, i32, i8* (%struct._foo*, i32, i8*)* } > %struct._table = type { i64, i32, i32, [1 x %struct._entry] } > %struct.test = type { %struct.__foo, i32 } > %struct.__foo = type { %struct._dispatch } > %struct._dispatch = type { %s...
2016 Apr 19
3
Backward references in assembly absolute expressions
While trying to compile an existing codebase which uses handwritten assembly with LLVM, I ran into an issue around using backward references in assembly absolute expressions. A simple example can be the following snippet: _foo: .fill 0x100 _bar: .fill _bar - _foo _baz: .fill 0x100 While gas compiles this snippet without any errors, the integrated assembler throws an error: expected absolute expression for _bar - _foo. I haven't found any definition of absolute expression in gas manual, and it's arguable w...
2010 Feb 12
2
[LLVMdev] [PATCH] Fix off-by-one errors in the doxygen documentation
...ives.h +++ b/include/llvm/MC/MCDirectives.h @@ -17,32 +17,32 @@ namespace llvm { enum MCSymbolAttr { - MCSA_Invalid = 0, /// Not a valid directive. + MCSA_Invalid = 0, ///< Not a valid directive. // Various directives in alphabetical order. - MCSA_ELF_TypeFunction, /// .type _foo, STT_FUNC # aka @function - MCSA_ELF_TypeIndFunction, /// .type _foo, STT_GNU_IFUNC - MCSA_ELF_TypeObject, /// .type _foo, STT_OBJECT # aka @object - MCSA_ELF_TypeTLS, /// .type _foo, STT_TLS # aka @tls_object - MCSA_ELF_TypeCommon, /// .type _foo, STT_COMMON # aka @com...
2011 Dec 06
0
[LLVMdev] Implement implicit TLS on Windows - need advice
...d to add tests. As for the second patch, that's not how MSVC 2010 emits code (and it needs tests). thread_local.c: #ifdef _MSC_VER #define __thread __declspec(thread) #endif __thread int i = 0; int foo() { return i++; } thread_local.asm: PUBLIC _i _TLS SEGMENT _i DD 00H _TLS ENDS PUBLIC _foo EXTRN __tls_array:DWORD EXTRN __tls_index:DWORD ; Function compile flags: /Ogtpy _TEXT SEGMENT _foo PROC ; File c:\users\mspencer\projects\llvm-project\test\thread_local.c ; Line 7 mov eax, DWORD PTR __tls_index mov ecx, DWORD PTR fs:__tls_array mov ecx, DWORD PTR [ecx+eax*4] mov eax, DWORD PTR...
2016 Jun 30
4
Help required regarding IPRA and Local Function optimization
..."() #0 ret void } define internal void @foo() #0 { call void asm sideeffect "movl %r14d, %r15d", "~{r15}"() #0 ret void } and its generated assembly code when IPRA enabled: .section __TEXT,__text,regular,pure_instructions .macosx_version_min 10, 12 .p2align 4, 0x90 _foo: ## @foo .cfi_startproc ## BB#0: ## InlineAsm Start movl %r14d, %r15d ## InlineAsm End retq .cfi_endproc .globl _bar .p2align 4, 0x90 _bar: ## @bar .cfi_startproc ## BB#0: pushq %r15 Ltmp0: .cfi_def_cfa_offset 16 pushq %rbx Ltmp1:...
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
That's useful to know that the static compilation code path works. Furthermore, as expected from that: 52: c7 05 04 00 00 00 d5 00 00 00 movl $213, 4 00000054: IMAGE_REL_I386_DIR32 _foo It looks like the offset `4` of the second field of your struct is correct in the object file, so this does seem to be a problem in the JIT-specific linking/loading. Can you try debugging into lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h to see if the relocation is getting applie...
2011 Dec 04
3
[LLVMdev] Implement implicit TLS on Windows - need advice
Hi! LLVM currently does not implement the implicit TLS model on Windows. This model is easy: - a thread local variable ends up in the .tls section - to access a thread local variable, you have to do (1) load pointer to thread local storage from TEB On x86_64, this is gs:0x58, on x86 it is fs:0x2C. (2) load pointer to thread local state. In general, the index is stored in variable
2018 Jul 03
2
Why Clang is yielding different LLVM IR return type for the same function
Hi: So I have a library function called fooo() in a source file B.c and an external A.c file that is referencing a function fooo() in it. foo is returning a pointer to a structure A.ll: %struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* } declare i8* @fooo() #2 B.ll: %struct._bar= type { %struct._foo, i32, i32 (%struct.doo*, %struct.doo*, %struct.doo*)* } define noalias %struct._bar* @fooo() #2{ .......... } I am implementing a transform pass that operates on the merg...
2011 Sep 06
4
[LLVMdev] Unexpected behavior reading/writing <8 x i1> vector to memory
...false, i1 false, i1 false, i1 false, i1 false, i1 false>, <8 x i1>* %c %val = load <8 x i1>* %c %vali8 = bitcast <8 x i1> %val to i8 %vali32 = zext i8 %vali8 to i32 ret i32 %vali32 } If I run this through opt -mem2reg before compiling with llc, then I basically get: _foo: movl $1, %eax ret which looks good to me (and is the result I expect). If I just run it through llc without mem2reg,I get this suspicious output, which returns zero. _foo: movb $1, -8(%rsp) movb $0, -8(%rsp) movzbl -8(%rsp), %eax ret Is this a bug? I double checked the LLVM assembly ref...
2011 Mar 16
0
[LLVMdev] linkage type
There is a description of all the possible linkage types at http://llvm.org/docs/LangRef.html#linkage – does this answer your question? (Basically, an extern_weak resp. ExternalWeakLinkage symbol becomes null instead of being an undefined reference) David On 3/16/11 7:06 PM, Junjie Gu wrote: > What is the difference between WeakAnyLinkage and ExternalWeakLinkage > ? They are defined
2017 Jun 07
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...t gmail.com> wrote: > >> That's useful to know that the static compilation code path works. >> Furthermore, as expected from that: >> >> 52: c7 05 04 00 00 00 d5 00 00 00 movl $213, 4 >> 00000054: IMAGE_REL_I386_DIR32 _foo >> >> It looks like the offset `4` of the second field of your struct is >> correct in the object file, so this does seem to be a problem in the >> JIT-specific linking/loading. >> >> Can you try debugging into lib/ExecutionEngine/Runti >> meDyld/Targets/Ru...
2011 Mar 16
2
[LLVMdev] linkage type
What is the difference between WeakAnyLinkage and ExternalWeakLinkage ? They are defined in GlobalValue.h. Thanks Junjie
2018 Sep 14
6
Function calls keep increasing the stack usage
...ions disabled. Consider the following C code snippet: int foo(int x, int y); void bar() { foo(1, 2); foo(3, 4); } Clang/LLVM 6.0 generates the following assembly code: _bar: subl $32, %esp movl $1, %eax movl $2, %ecx movl $1, (%esp) movl $2, 4(%esp) movl %eax, 28(%esp) movl %ecx, 24(%esp) calll _foo movl $3, %ecx movl $4, %edx movl $3, (%esp) movl $4, 4(%esp) movl %eax, 20(%esp) movl %ecx, 16(%esp) movl %edx, 12(%esp) calll _foo movl %eax, 8(%esp) addl $32, %esp retl Note how the constants are stored in registers but when saving the parameters on the stack for the call the immediate values ar...
2018 Sep 14
2
Function calls keep increasing the stack usage
...(3, 4); >> } >> >> Clang/LLVM 6.0 generates the following assembly code: >> _bar: >> subl $32, %esp >> movl $1, %eax >> movl $2, %ecx >> movl $1, (%esp) >> movl $2, 4(%esp) >> movl %eax, 28(%esp) >> movl %ecx, 24(%esp) >> calll _foo >> movl $3, %ecx >> movl $4, %edx >> movl $3, (%esp) >> movl $4, 4(%esp) >> movl %eax, 20(%esp) >> movl %ecx, 16(%esp) >> movl %edx, 12(%esp) >> calll _foo >> movl %eax, 8(%esp) >> addl $32, %esp >> retl >> >> Note how th...
2015 Jan 16
2
[LLVMdev] Function calls only being JIT'd once by Kaleidoscope with MCJIT?
Oh - I know what this is. You were running this on Linux, right? On MacOS I think the symbol is getting double mangled while going through MCJIT::getSymbolAddress, hence the failure: The IR level foo function gets compiled to "_foo" in the object file, and then "_foo" gets mangled to "__foo" when we look it up. Linux doesn't do assembly level name-mangling, so this bug doesn't show up there. Since applying this fixes Linux, and leaves MacOS no more broken than before, I'll put it in. Hope...
2006 Sep 05
1
rsync, mac OSX tiger, and UFS
...o using rsync to copy *to* an Apple UFS volume (either from another Apple UFS volume, or a remote volume on a Unix file server). The problem is the "special treatment" that some low-level system calls give to "apple double" files. For example, if rsync first copies a file ._foo, and then file foo, the action of copying foo *erases* the copy of ._foo on the destination volume. Unfortunately, this happens at a very low level: if you make a system call to "open" to create a file "foo", and if "._foo" exists, then "._foo" will be...