similar to: [LLVMdev] Strange pointer aliasing behaviour

Displaying 20 results from an estimated 700 matches similar to: "[LLVMdev] Strange pointer aliasing behaviour"

2010 Jun 17
0
[LLVMdev] Strange pointer aliasing behaviour
On Wed, Jun 16, 2010 at 1:39 PM, Pierre C <lists at peufeu.com> wrote: > > I'm hitting a strange pointer aliasing "bug". Here is a test case : > > /* SOURCE CODE */ > > #define little_list_size 8 > > class LittleList1 { > public: >        int     _length; >        double  _data[ little_list_size ]; > >        LittleList1( int length ) >
2010 Jun 28
2
[LLVMdev] Strange pointer aliasing behaviour
On Jun 27, 2010, at 2:26 PM, Eugene Toder wrote: > Hi Dan, > > Are you referring to my reasoning for why _length and _data[i] do not > alias? No, I was referring to the discussion of C99 6.7.2.1, 6.5.6, 6.2.6, and so on. > I don't think this needs TBAA or any "strict" aliasing rules. > All that sufficient is 1) assumption about struct layout: >
2010 Jun 27
0
[LLVMdev] Strange pointer aliasing behaviour
Hi Dan, Are you referring to my reasoning for why _length and _data[i] do not alias? I don't think this needs TBAA or any "strict" aliasing rules. All that sufficient is 1) assumption about struct layout: offsetof(_length) < offsetof(_data) 2) assumption that i >= 0. My understanding is that 1) is guaranteed by llvm rules and 2) by C rules, however I'm not sure how to
2010 Jun 27
2
[LLVMdev] Strange pointer aliasing behaviour
Hello Eugene, The underlying problem here is that your reasoning below follows C rules, while BasicAA and other LLVM passes must follow LLVM IR rules, which are different in this area. In LLVM IR, memory has no types. Translating from C to LLVM IR does not preserve this information. In addition to being the reason BasicAA can't reason about array bounds and struct members as you describe,
2010 Jun 26
0
[LLVMdev] Strange pointer aliasing behaviour
John, David, That's not the whole story, though. For example, 6.7.2.1/13 of C99 allows a conversion between a pointer to struct and it's first member and also specifies that members of the struct are laid out in the order of declaration. To derive pointer to one field from another it's sufficient to 1) cast pointer to a struct to a pointer to array of chars 2) perform arithmetics as
2010 May 14
2
[LLVMdev] type of the store operand
Hiya, I want to know what's the type of the operand (value) along with the store instruction. For example, the following instruction store the content in an integer type pointer scevgep99.1 to the address another integer pointer points to. *"store i8* %scevgep99.1, i8** %scevgep92.1, align 4"* It seems there is no APIs in StoreInst can do this. Is there any way to figure the type
2013 Oct 29
1
[LLVMdev] JIT'ing 2 functions with inter-dependencies
I am having problems JIT'ing 2 functions where one of them calls the other. (I am using the old JIT interface). Here is the setup: define void @func1() { entrypoint: call void @func2(void) ret void } define void @func2(void) { entrypoint: ret void } (I omit the arguments and function bodies for simplicity.) It's 'func1' that would be called from host code,
2011 Sep 06
2
Generalizing call to function
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
2015 Apr 28
2
[LLVMdev] alias set collapse and LICM
On Mon, Apr 27, 2015 at 4:21 PM, Daniel Berlin <dberlin at dberlin.org> wrote: > You can't win here (believe me, i've tried, and better people than me have > tried, for years :P). > No matter what you do, the partitioning will never be 100% precise. The > only way to solve that in general is to pairwise query over the > partitioning. > > Your basic problem is
2010 May 14
0
[LLVMdev] type of the store operand
Zheng Wang wrote: > Hiya, > > I want to know what's the type of the operand (value) along with the > store instruction. For example, the following instruction store the > content in an integer type pointer scevgep99.1 to the address another > integer pointer points to. > > *"store i8* %scevgep99.1, i8** %scevgep92.1, align 4"* > > It seems there is no
2009 Sep 14
1
[LLVMdev] How to split module?
Hi, all. My question is about how to split one module into N modules(N >= 2)? For example, given the following code: #src.c# int main() { //......// func1(); func2(); //......// return 0; } void func1() { //......// } void func2() { //......// } func1() has no dependence with func2(), so they can perform parallel execution. And I have to split src.c into src1.c
2015 Apr 19
2
[LLVMdev] LLVM IR for inline functions
Hi, I have a naive question on how to generate LLVM IR for inline functions. I have compiled this C code: *inline void func1()* * {* * int x=3;* * }* * void func2()* * {* * func1();* * int y = 4;* * }* into LLVM IR, using clang -emit-llvm -S -c <filename> But the generated LLVM IR file does *not* have func1() expanded (see below for the relevant parts). *; Function Attrs: nounwind
2003 Jun 09
1
Questions for package ts prediction
Dear helpers, I am trying to write a function to return prediction values using package ts. I have written three different versions since I am not sure what's wrong with my func2. func and func1 return the same results.But func1 and func2 don't. In particular, the only difference between "func1" and "func2" is the function variable name being y and data, respectively.
2000 Sep 06
2
reusing external functions across libs
Hi, I am searching for a way to solve the following problem: I want to use an external function, defined in a dyn.load()ed shared object, in another dyn.load()ed shared object. Currently I have to take the sources (Fortran) from one libraries src/ directory and copy them into the src/ dir of the other library, resulting in two copies of this function. This is bad for maintanance and maybe also
2007 Nov 26
3
Communicating from one function to another
My question is a seemingly simple one. I have a bunch of user-defined functions which compute such-and-such objects. I want to be able to define a variable in a particular function, then make use of it later, perhaps in a different function, without necessarily having to move it around in argument lists. In the C community, it would be called a "global" variable. Question 1: Is this
2010 Jun 28
0
[LLVMdev] Strange pointer aliasing behaviour
I think scev-aa does not succeed on the original example, because front ends do not put "nsw" on signed addition, so according to llvm rules addition can overflow and i can be < 0. Also, if original example used unsigned type (e.g. size_t, which is very common), I don't think ir can express the fact that i is guaranted to be >= 0. Another line of reasoning is that if
2011 Feb 17
1
Integrate with an indicator function
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <-
2010 Apr 21
1
[LLVMdev] determining the number of iteration of a loop
In your example the the number of iterations is known -- it is N. It is not known at compile time, but it's known at run-time before you enter the loop. So you can do transforms like if( N < threshold ) copy of loop optimized for small iterations count; else copy of loop optimized for large iterations count; But you are right, in general, the number of iterations in unknown. I think Khaled
2010 Jun 29
0
[LLVMdev] Confuse on getSCEVAtScope
On Jun 29, 2010, at 7:08 AM, ether zhhb wrote: > > why computeSCEVAtScope not try to get the operands in the current > scope like the function do with SCEVCommutativeExpr, like: > > if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V)) { > if (!L || !AddRec->getLoop()->contains(L)) { > ... > // Then, evaluate the AddRec. >
2011 Feb 17
1
Integration with an Indicator Function in R
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <-