similar to: [LLVMdev] Target backend not converting char* to struct properly.

Displaying 20 results from an estimated 600 matches similar to: "[LLVMdev] Target backend not converting char* to struct properly."

2012 Oct 12
0
[LLVMdev] Target backend not converting char* to struct properly.
On Fri, Oct 12, 2012 at 10:43 AM, Stephen McGruer <stephen.mcgruer at gmail.com> wrote: > I'm having trouble getting my backend to properly treat the situation where > a char* is converted into a struct, i.e. something like: > > char* pointer_representation = ...; > MyStruct* my_struct = (MyStruct*) pointer_representation; > my_struct->an_int_field = 5; > >
2012 Oct 12
1
[LLVMdev] Target backend not converting char* to struct properly.
If you could point me towards the correct location in the standard I would appreciate that - I didn't realize it wasn't acceptable to turn pointer-data to structs. My example is reduced from the EEMBC benchmarks where I ran into the problem, so I may have reduced it too far by accident (but I'm fairly sure they do not use __attribute__ or similar). Adding a
2015 Mar 17
2
[LLVMdev] Alias analysis issue with structs on PPC
Hal Finkel <hfinkel at anl.gov> wrote on 16.03.2015 17:56:20: > If you want to do it at a clang level, the right thing to do is to > fixup the ABI lowerings for pointers to keep them pointers in this case. > So this is an artifact of the way that we pass structures, and > constructing a general solution at the ABI level might be tricky. > I've cc'd Uli, who did most
2015 Mar 13
2
[LLVMdev] Alias analysis issue with structs on PPC
Hi, I have the following C loop to vectorize: struct box { double* source; }; void test(double* restrict result, struct box my_struct, int len) { for (int i=0 ; i<len; i++) { result[i] = my_struct.source[i] * my_struct.source[i]; } } There are two references in the loop, result[i] (restrict) and my_struct.source[i] (readonly). The compiler should easily figure out that
2005 Apr 22
1
Beginner in R
hello ( and sorry for my poor english ... ) I'm a newbie on R software and I need to obtain this kind of system : a structure, like a liste : my_struct <- list() my_struct$a <- a_value my_struct$b <- another_value my_struct$c <- one_more_value and a function with two args : the first is a instance of the structure, and the second is any component of the structure (here $a, $b
2015 Mar 13
2
[LLVMdev] Alias analysis issue with structs on PPC
On Fri, Mar 13, 2015 at 2:54 PM Daniel Berlin <dberlin at dberlin.org> wrote: > On Fri, Mar 13, 2015 at 2:39 PM Olivier H Sallenave <ohsallen at us.ibm.com> > wrote: > >> Hi, >> >> I have the following C loop to vectorize: >> >> struct box { >> double* source; >> }; >> >> void test(double* restrict result, struct box
2010 Jul 14
2
[LLVMdev] Figuring out the parameters of the Call Instruction
Hi, I am trying to figure out how to read arguments of a call instruction. I had few questions based on that I have the following C Code 1 #include <stdio.h> 2 3 struct my_struct 4 { 5 int a; 6 int b; 7 }; 8 9 struct my_struct abc; 10 void p_ptr ( unsigned long j) 11 { 12 printf ( "%lx \n", j ); 13 } 14 15 void struct_ptr ( struct my_struct *
2015 Mar 15
5
[LLVMdev] Alias analysis issue with structs on PPC
On Sun, Mar 15, 2015 at 4:34 PM Olivier Sallenave <ol.sall at gmail.com> wrote: > Hi Daniel, > > Thanks for your feedback. I would prefer not to write a new AA. Can't we > directly implement that traversal in BasicAA? > Can I ask why? Outside of the "well, it's another pass", i mean? BasicAA is stateless, so you can't cache, and you really don't
2010 Jul 15
0
[LLVMdev] Figuring out the parameters of the Call Instruction
Hi Shankha, > 24 p_ptr ((unsigned long)&abc); > call void @p_ptr(i64 ptrtoint (%struct.my_struct* @abc to i64)) > nounwind, !dbg !31 > > Q.1 At line no 24 I try to read the address of global variable abc. > The address is type casted > from struct * to int * for which ptrtoint. I guess you mean "is type casted from struct * to unsigned
2010 Jul 15
1
[LLVMdev] Figuring out the parameters of the Call Instruction
Hi Duncan, Thanks for pointing out my mistake. I will reword my questions. //C code int var1; //global int a, b; foo(a, b); bar(c); generates following //LLVM IR %1 = load a; %2 = load b; call foo(%1, %2) call bar(@var1) CallInst.getOperand(1).getNameStr() on foo, returns null, but on bar returns var1. Similarly, for call void @p_ptr(i64 ptrtoint (%struct.my_struct* @abc to i64)) nounwind,
2012 Nov 23
2
[LLVMdev] clang code-completion question
Dear developers, First of all, thank you for your job on clang, now I use clang as autocompletion tool with my Vim, and it seems to work awesome. But I have some questions: 1) Is it possible to make clang to complete pointers to functions as a functions? I mean, I want to get function prototype, with returning value type and all the parameters. 2) Is it possible to make completion work inside
2008 Jun 06
1
calling a C function with a struct
I am trying to call a precompiled C function that uses a struct as one of it's arguments. I could write a wrapper function in C, but I was hoping there is some way to pack fields into an array of type raw that could be passed directly to the function. Here is some more detail. The C struct is simple, but has mixed types: struct STRUCT1 { long type; long nx; double
2004 Aug 06
1
minor suggestions
> How did you do it without the pragma? I understood that the problem was a mismatch between the the declaration and definition in for some codebooks (exc_*_tables.c). > I saw you added the pragmas to disable the float/double warnings to misc.h > though that header isn't included by the files that generate the warnings. What are the offending files then? BTW, aside from the
2012 Nov 01
2
[LLVMdev] llvm linking issue
I have three modules: ----------------------------------------------------------------- s1.ll: %0 = type <{ i32, i32 }> define void @s1(%0* byval %myStruct) nounwind { return: ret void } ----------------------------------------------------------------- s2.ll: %0 = type <{ i32, i32 }> define void @s2(%0* byval %myStruct) nounwind { return: ret void }
2012 Nov 01
0
[LLVMdev] llvm linking issue
Hi Xiaoyi, this looks like a bug to me - please file a bug report. Ciao, Duncan. On 01/11/12 04:35, Guo, Xiaoyi wrote: > I have three modules: > ----------------------------------------------------------------- > s1.ll: > > %0 = type <{ i32, i32 }> > > define void @s1(%0* byval %myStruct) nounwind { > return: > ret void > } >
2012 Oct 25
2
[LLVMdev] A question about pointer aliasing rules in LLVM
Hi, I have the following IR code </snippet> %prev = getelementptr inbounds %struct.myStruct* %node, i32 0, i32 1 %1 = load %struct.myStruct** %prev, align 4, !tbaa !0 %next1 = getelementptr inbounds %struct.myStruct* %1, i32 0, i32 0 store %struct.myStruct* %0, %struct.myStruct** %next1, align 4, !tbaa !0 %2 = load %struct.myStruct** %prev, align 4, !tbaa ! </snippet> myStruct is
2020 Jan 21
4
aarch64 does not emit DW_AT_Location
Hi Devs, debug info emitted by llvm does not contain DW_AT_Location for Formal parameter if it is an aggregate like below case 1) aggregate contain more than 4 homogeneous and size more than 128 bits i.e. typedef struct{ int a,b,c,d,e; }mystruct; void foo(mystruct ms){ } 2) aggregate contain hetrogeneous type and size more than 128 bits. i.e. typedef struct{ int a,b; float c,d,e; }mystruct; void
2002 Sep 28
2
[LLVMdev] Directory and library rename:
By request, I've renamed lib/CodeGen/PreSelection to lib/CodeGen/PreOpts (admittedly this was my choice :-), and the corresponding archive from preselect to preopt. If you see linker errors saying preselect.o is not found, this is the reason. This shouldn't happen if you update your entire tree at once. --Vikram
2012 Dec 20
2
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
Hello, Thank you for your answer. If I want to use then I have error: ‘NodeTy* llvm::ilist_half_node<NodeTy>::getPrev() [with NodeTy = llvm::Instruction]’ is protected error: ‘llvm::ilist_half_node<llvm::Instruction>’ is not an accessible base of ‘llvm::Instruction’ Do you know any other method to access the previous instruction of a terminator instruction? PS: back() is not an
2012 Dec 30
0
[LLVMdev] Cannot interchange "literal" and "identified" structs
Justin, http://llvm.org/docs/LangRef.html#structure-type "Identified types can be recursive, can be opaqued, and are never uniqued." Do you think it would be less descriptive? "Identified type, aka named llvm::StructType, is never uniqued against other identified types nor literal types, aka unnamed StructType(s)." ? See also;