Displaying 20 results from an estimated 30000 matches similar to: "[LLVMdev] [PATCH] Vectorizing Global Structures - Take 2"
2013 Feb 17
0
[LLVMdev] [PATCH] Vectorizing Global Structures - Take 2
On Sat, Feb 16, 2013 at 8:26 AM, Arnold Schwaighofer
<aschwaighofer at apple.com> wrote:
> Daniel,
>
> Indulge me one more mail and I will go away … (or I'll try to :)
>
> On Feb 15, 2013, at 6:38 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
>
> yes, it does, but this is somewhat irrelevant to C.
>
> The pointers will not be of type struct.a[x] *,
2015 Dec 08
2
Field sensitive alias analysis?
Jeroen, thank you for very useful link with the context. Indeed union cases
are very complicated and I see places in code when TBAA gives up.
Daniel, I completely agree that TBAA has limited power and can solve
relatively simple cases only. So anything more complicated that involves
intermediate variables that points to struct or array elements cannot be
solved by TBAA alone. Differentiating
2015 Dec 07
3
Field sensitive alias analysis?
BTW, I have found why it doesn't work for arrays. TBAA information
propagation is not implemented in CodeGenFunction::EmitArraySubscriptExpr
with "TODO: Preserve/extend path TBAA metadata?".
On Fri, Dec 4, 2015 at 1:38 PM, Dmitry Polukhin <dmitry.polukhin at gmail.com>
wrote:
> As far as I can see it is specifics of arrays inside structs. Current TBAA
> does distinguish
2015 Dec 09
2
Field sensitive alias analysis?
Hi Daniel,
I see your point about LLVM and C/C++ type agnostic. I think TBAA was
invented to partially cover this gap and give optimization opportunities
when LLVM types are not sufficient but C/C++ types have required
information.
What do you think about following example:
struct S {
int a[10];
int b;
};
int foo(struct S *ps, int i) {
ps->a[i] = 1;
ps->b = 2;
return
2016 Aug 17
2
Loop vectorization with the loop containing bitcast
Hi ,
The following loop fails to be vectorized since the load c[i] is casted as i64 and the store c[i] is double. The loop access analysis gives up since they are in different types.
Since these two memory operations are in the same size, I believe the loop access analysis should return forward dependence and thus the loop can be vectorized.
Any comments?
Thanks,
Jin
#define N 1000
double
2013 Feb 05
0
[LLVMdev] Vectorizing global struct pointers
If I understand you correctly, conceptually you want two different objects to be returned for Foo.bl and Foo.al?
Here is my take on this (take this with a grain of salt, Dan is the expert on this):
http://llvm.org/docs/GetElementPtr.html#what-happens-if-an-array-index-is-out-of-bounds
LLVM's semantic allows for arrays to be accessed out of bounds - this allows you to walk from the first
2017 Dec 19
2
MemorySSA question
On Tue, Dec 19, 2017 at 9:10 AM, Siddharth Bhat via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I could be entirely wrong, but from my understanding of memorySSA, each
> def defines an "abstract heap state" which has the coarsest possible
> definition - any write will be modelled as a "new heap state".
>
This is true for def-def relationships, but
2013 Feb 05
3
[LLVMdev] Vectorizing global struct pointers
Hi all,
One of the reasons the Livermore Loops couldn't be vectorized is that it
was using global structures to hold the arrays. Today, I'm investigating
why is that so and how to fix it.
My investigation brought me
to LoopVectorizationLegality::canVectorizeMemory():
if (WriteObjects.count(*it)) {
DEBUG(dbgs() << "LV: Found a possible read/write reorder:"
2019 Nov 10
2
Reassociation is blocking a vectorization
Hi Devs,
I am looking at the bug
https://bugs.llvm.org/show_bug.cgi?id=43953
and found that following piece of ir
%arrayidx = getelementptr inbounds float, float* %Vec0, i64 %idxprom
%0 = load float, float* %arrayidx, align 4, !tbaa !2
%arrayidx2 = getelementptr inbounds float, float* %Vec1, i64 %idxprom
%1 = load float, float* %arrayidx2, align 4, !tbaa !2
%sub = fsub fast float %0, %1
2013 Feb 07
1
[LLVMdev] alloca scalarization with dynamic indexing into vectors
Hi all,
I have a question regarding dynamic indexing into a vector with GEP. I see
that in the ScalarReplAggregates pass in the LLVM 3.2 release the call
SROA::isSafeGEP() will now allow alloca scalarization in the case where a
GEP index into a vector isn’t a constant. My question is: what is the
expected behavior when the index is out of bounds of the vector? Is it
undefined? I have an
2019 Jan 14
2
Aliasing rules difference between GCC and Clang
Hi,
It was a while now since I first asked about TBAA, and I am now getting
back to this, trying to understand TBAA as it seems that the issue I
described earlier originally in this thread is still one of many "TODO"s
in CGExpr.cpp
(http://lists.llvm.org/pipermail/llvm-dev/2018-September/126290.html).
I would like to help on this to the best of my abilities, but I'm not
quite
2013 Nov 14
0
[LLVMdev] [RFC] Scoped no-alias metadata (redux)
Hello again,
When I had originally discussed this proposal, it was thought that we would not have to worry about control dependencies on the noalias metadata because such dependencies could only present a problem when loads or stores are merged (RAUW is called), and transformations should drop metadata when that happens.
Now I'm worried that this is not true. Here's a simple example:
2016 Jul 20
2
load instruction erroneously removed by GVN v2
before inlining
all 20005
after inlining
somewhere here changed made it NoAlias
after Global Variable Optimizer
20014
20373 20255
20372 20254
before GVN
19993
20011 19991
20010 20030
It appears that TBAA metadata certainly changed after inlining and
subsequent passes. I have attached the .bc file. I think I will try to dump
out more TBAA metadata between passes. The method in
2019 Jan 18
2
Aliasing rules difference between GCC and Clang
Hi Ivan,
On 2019-01-17 18:09, Ivan Kosarev wrote:
> Hello, Jonas,
>
> > It seems that when the struct member is an array, the base type
> > becomes the element type. This is simply unhandled still in
> > CodeGenTBAA ("TODO"). My question then is if it would be
> > possible to instead create the DAG nodes !"A" and !"B" (as in
> >
2014 Sep 18
2
[LLVMdev] [Vectorization] Mis match in code generated
Hi Nadav,
Thanks for the quick reply !!
Ok, so as of now we are lacking capability to handle flat large reductions.
I did go through function vectorizeChainsInBlock() (line number 2862). In
this function,
we try to vectorize if we have phi nodes in the IR (several if's check for
phi nodes) i.e we try to
construct tree that starts at chains.
Any pointers on how to join multiple trees? I
2014 Sep 18
2
[LLVMdev] [Vectorization] Mis match in code generated
Hi,
I am trying to understand LLVM vectorization implementation and was looking
into both loop and SLP vectorization.
test case 1:
*int foo(int *a) {int sum = 0,i;for(i=0; i<16; i++) sum += a[i];return
sum;}*
This code is vectorized by loop vectorizer where we calculate scalar loop
cost as 4 and vector loop cost as 2.
Since vector loop cost is less and above reduction is legal to
2016 Jul 20
2
load instruction erroneously removed by GVN v2
Thanks for quick reply Daniel,
I tried to make a simple C testcase, but could not reproduce the same
condition with output from Clang. I suppose I could modify the C code to
make it look similar with TBAA's; I may be able to provide this by eod.
> store %ptr above the load.
My mistake; I was referring to the store $lcssa in bb2. Looking at the C
source code, it should definitely alias
2013 Nov 04
3
[LLVMdev] [RFC] Scoped no-alias metadata (redux)
Hello everyone,
In December, I had started a thread on scoped no-alias metadata in order to represent C99 'restrict' pointer information at the IR level:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056586.html
At this point, we also have another important use case: preserving the existing 'noalias' attributes on pointers after inlining. My original proposal was
2014 Sep 19
3
[LLVMdev] [Vectorization] Mis match in code generated
Hi Arnold,
Thanks for your reply.
I tried test case as suggested by you.
*void foo(int *a, int *sum) {*sum =
a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]+a[9]+a[10]+a[11]+a[12]+a[13]+a[14]+a[15];}*
so that it has a 'store' in its IR.
*IR before vectorization :*target datalayout =
"e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
target triple =
2017 Dec 19
4
MemorySSA question
Hi,
I am new to MemorySSA and wanted to understand its capabilities. Hence I
wrote the following program (test.c):
int N;
void test(int *restrict a, int *restrict b, int *restrict c, int *restrict
d, int *restrict e) {
int i;
for (i = 0; i < N; i = i + 5) {
a[i] = b[i] + c[i];
}
for (i = 0; i < N - 5; i = i + 5) {
e[i] = a[i] * d[i];
}
}
I compiled this program using