Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] array index access"
2011 Mar 28
2
[LLVMdev] array index access
Oh I see what you mean but I don't think that is the value that I want.
In the code, I know that
%N = load i32* %k, align 4
%p = getelementptr inbounds [10 x [20 x i32]]* %3, i32 0, i32 %M, i32 %N
So I analyze the GEP and know that %N is a pointer to an int32, which is the
array index.
I want to get that index so I can insert a check to see if it violates the
array bounds.
So the final code
2011 Mar 28
0
[LLVMdev] array index access
Hi George,
> I am trying to get the first index into this two-dimensional array, that is *5.*
not sure what you mean, but if you think of your array as being a 10 x 20 matrix
then to get a pointer to element M,N you would do:
getelementptr inbounds [10 x [20 x i32]]* %3, i32 0, i32 %M, i32 %N
>
> %4 = getelementptr inbounds [10 x [20 x i32]]* %3, i32 0, i32 *5*
> *
> *
>
2011 Mar 28
2
[LLVMdev] array index access
Hi Duncan,
For this example,
getelementptr inbounds [10 x [20 x i32]]* %3, i32 0, i32 %M, i32 %N
I am trying to retrieve %N and instrument the program to see if the value
pointed to by %N exceeds the array bound (10). I assume that
%N will be associated with a load instruction. I have searched through
all the tutorials etc. and still have no clue as to how to do this, that
is,
get the value
2011 Mar 28
0
[LLVMdev] array index access
On Mon, Mar 28, 2011 at 12:48 PM, George Baah <georgebaah at gmail.com> wrote:
> Oh I see what you mean but I don't think that is the value that I want.
> In the code, I know that
> %N = load i32* %k, align 4
> %p = getelementptr inbounds [10 x [20 x i32]]* %3, i32 0, i32 %M, i32 %N
> So I analyze the GEP and know that %N is a pointer to an int32, which is the
> array
2011 Mar 28
0
[LLVMdev] array index access
Hi George,
> For this example,
> getelementptr inbounds [10 x [20 x i32]]* %3, i32 0, i32 %M, i32 %N
> I am trying to retrieve %N and instrument the program to see if the value
> pointed to by %N exceeds the array bound (10). I assume that
> %N will be associated with a load instruction. I have searched through
> all the tutorials etc. and still have no clue as to how to
2019 Jul 23
2
[RFC] A new multidimensional array indexing intrinsic
After having spoken to Johannes, I think we had a classic
misunderstanding on what "extending" means.
1.
The most obvious why for me was changing GEP to allow variable-sized
multi-dimensional arrays in the first argument, such as
%1 = getelementptr double, double* %ptr, inrange i64 %i, inrange i64 %j
(normally GEP would only allow a single index argument for a
pointer-typed base
2019 Jul 22
3
[RFC] A new multidimensional array indexing intrinsic
Am Mo., 22. Juli 2019 um 10:50 Uhr schrieb Doerfert, Johannes
<jdoerfert at anl.gov>:
> Why introduce a new intrinsic (family)? It seems that would require us
> to support GEPs and GEP + "multi-dim" semantics in various places. What is
> the benefit over a GEP extension?
Adding an intrinsic is easier than adding or extending an existing
instruction, as suggested by
2019 Jul 21
6
[RFC] A new multidimensional array indexing intrinsic
Hello,
We would like to begin discussions around a new set of intrinsics, to
better express
multi-dimensional array indexing within LLVM. The motivations and a
possible design
are sketched out below.
Rendered RFC link here
<https://github.com/bollu/llvm-multidim-array-indexing-proposal/blob/master/RFC.md>
Raw markdown:
# Introducing a new multidimensional array indexing intrinsic
## The
2011 Aug 30
2
[LLVMdev] compare two GEP instructions operand by operand
Hi,
I have a question regarding the GEP instruction. Is
it correct to consider that two GEP instructions compute the same memory address if and only if all their corresponding fields are equal?
For instance, for a two-dimensional array of integers, can we have two GEP instructions that are equal?
%arrayidx = getelementptr [10 x [30 x i32]]* @main.B, i64 0, i64 0, i64 %tmp157
%tmp =
2019 Jul 22
2
[RFC] A new multidimensional array indexing intrinsic
We could also simply extend the existing inrange mechanism to
non-constantexpr GEPs. It would remove an inconsistency in the
semantics, be relatively straight forward, and solve the motivating
example.
(I didn't read the proposal in full, so there may be other examples it
doesn't solve.)
Philip
On 7/22/19 10:01 AM, Peter Collingbourne via llvm-dev wrote:
> The restrictions of
2019 Jul 22
2
[RFC] A new multidimensional array indexing intrinsic
> It seems that the main advantage of your proposal is that it would allow for non-constant strides (i.e. variable length arrays) in dimensions other than the first one. Do these appear frequently enough in the programs that you're interested in to be worth optimizing for?
Yes - at least in Chapel (which is one of the motivating languages)
these are very common.
In other words, typical
2019 Jul 25
0
[RFC] A new multidimensional array indexing intrinsic
It's also very common in Fortran.
-David
Michael Ferguson via llvm-dev <llvm-dev at lists.llvm.org> writes:
>> It seems that the main advantage of your proposal is that it would
>> allow for non-constant strides (i.e. variable length arrays) in
>> dimensions other than the first one. Do these appear frequently
>> enough in the programs
2016 Jul 19
4
RFC: inbounds on getelementptr indices for global splitting
Hi all,
I'd like to propose an IR extension that allows the inbounds keyword to be
attached to indices in a getelementptr constantexpr.
By placing the inbounds keyword on an index, any pointer derived from the
getelementptr outside of the bounds of the element referred to by that
index, other than the pointer one past the end of the element, shall be
treated as a poison value.
The main
2011 Mar 27
0
[LLVMdev] index of an array
Hi Everyone,
I am trying to get the first index into this two dimensional array,
that is 5.
%4 = getelementptr inbounds [10 x [20 x i32]]* %3, i32 0, i32 5
I can iterate over the GEP and get the types of the operands but not
the values.
How do I go about getting the value (5)?
Thanks.
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2011 Oct 18
3
[LLVMdev] GEP instructions: is it possible to reverse-engineer array accesses?
Dear All,
As of late I am having a hard time getting my head around how array accesses
are translated by Clang into LLVM IR: the often misunderstood GEP instruction.
I am trying to reverse-engineer array accesses to discover the number of dimensions
and actual indexes of the original, and I am beginning to wonder whether this is
possible at all. To illustrate (some of) my troubles, consider
2005 Feb 22
3
[LLVMdev] Area for improvement
>
> Now the problem is obvious. A two dimensional array access is being
> performed by a single instruction. The arithmetic needed to address
> the element is implicit, and therefore inaccessible to optimizations.
> The redundant calculations can not be eliminated, nor can strength
> reduction be performed. getelementptr needs to be broken down into
> its constituent
2011 Oct 18
0
[LLVMdev] GEP instructions: is it possible to reverse-engineer array accesses?
Hi Gabriel, I suggest you don't bother with testcases like this that are doing
undefined things. For example, neither i nor k are initialized, so the result
of accessing the array is undefined. Thus the frontend can (and apparently
does) produce anything strange thing it does. What is more, the result aux is
unused, so there is no obligation to compute it correctly. I think you will
get
2014 May 22
4
[LLVMdev] RFC: Indexing of structs vs arrays in getelementpointer
Recently I posted a patch to migrate certain GEPs between basic blocks in cases where doing so would improve the ability of instcombine to merge into more complicated addressing mode (r209049 and r209065). After some build to failures it was rolled back. I now have a patch that no longer causes the regressions I was seeing, but it also no longer can optimize the case I was trying to optimize. As
2014 May 22
2
[LLVMdev] RFC: Indexing of structs vs arrays in getelementpointer
On May 22, 2014, at 3:51 PM, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Thu, May 22, 2014 at 4:42 PM, Louis Gerbarg <lgg at apple.com> wrote:
> The problem that the above transform is technically illegal because “When indexing into a (optionally packed) structure, only i32 integer constants are allowed (when using a vector of indices they must all be the same
2013 Mar 07
1
[LLVMdev] array of pointers
The getInitializer() method of a GlobalVariable returns 4 pointers like below.
[4 x i32*] [i32* getelementptr inbounds ([256 x i32]* @CRC24ATable, i32 0, i32 0), i32* getelementptr inbounds ([256 x i32]* @CRC24BTable, i32 0, i32 0), i32* getelementptr inbounds ([256 x i32]* @CRC16Table, i32 0, i32 0), i32* getelementptr inbounds ([256 x
i32]* @CRC8Table, i32 0,