Displaying 20 results from an estimated 30000 matches similar to: "[LLVMdev] index of an array"
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 27
2
[LLVMdev] array index access
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 get the value (5)?
Thanks.
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
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,
> 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
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
2019 Jul 22
1
[RFC] A new multidimensional array indexing intrinsic
Intrinsics can return `llvm_any_ty` (Intrinsics.td). In that case the
return type is added as a suffix to the intrinsic's name, i.e. the
syntax in the RFC is not 100% the syntax for intrinsics. Same for the
parameters which each must have their types explicitly mentioned.
Michael
Am Mo., 22. Juli 2019 um 19:08 Uhr schrieb Kaylor, Andrew
<andrew.kaylor at intel.com>:
>
> Is it
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 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
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
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
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
2012 May 04
3
[LLVMdev] Extending GetElementPointer, or Premature Linearization Considered Harmful
Duncan Sands wrote:
>> As noted in the GEP FAQ, GEPs don't support variable-length arrays;
>
> that's not quite right. The problem is only with arrays of variable length
> arrays, and more generally with arrays where the element type has variable
> size (this occurs with Ada, which has all kinds of funky variable sized types,
> for example).
You're right, though
2011 Aug 28
0
[LLVMdev] How to break/iterate over nested instructions.
Dear Manish,
First, in answer to your original question: yes, there is a pass that
will convert constant expression GEPs used within LLVM instructions into
GEP instructions. SAFECode has a pass called BreakConstantGEPs in
safecode/trunk/lib/ArrayBoundChecks/BreakConstantGEPs.cpp
(http://llvm.org/viewvc/llvm-project/safecode/trunk/lib/ArrayBoundChecks/BreakConstantGEPs.cpp?view=log).
It
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,
2015 Jan 26
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
> Fixing that still gives a wrong result, i haven't started to track down
what *else* is going on here.
Running with the attached diff + a modified buildGraphFrom to handle the
constexpr GEPs, we seem to flag everything in test2.ll (conservatively)
correctly.
Is `store` the only place we can expect to see these constexpr analogs, or
is just about anywhere fair game?
George
On Fri, Jan
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
2019 Aug 02
2
[RFC] A new multidimensional array indexing intrinsic
On Aug 2, 2019, at 8:57 AM, Michael Kruse <llvmdev at meinersbur.de> wrote:
>> This is why I ask whether its makes sense to add this to LLVM IR: If you want HPC style loop transformations, I don’t think that LLVM IR itself will ever be great, even with this. This might make some narrow set of cases slightly better, but this is far from a solution, and isn’t contiguous with getting to