Displaying 20 results from an estimated 10000 matches similar to: "Inlining + CSE + restrict pointers == funtimes"
2020 Jan 22
2
Inlining + CSE + restrict pointers == funtimes
At a high level, EarlyCSE should be intersecting the metadata of instructions that it combines. If it doesn't, and also doesn't drop the metadata, that seems like a bug, regardless of anything else.
On 1/22/20 9:30 AM, Jeroen Dobbelaere wrote:
Hi Neil, Hall,
- as far as 'C' is concerned, this is input code is valid, as the pointers are not used to modify objects.
- as far as
2019 Jun 30
2
Information Loss of Array Type in Function Interface in IR Generated by Clang
Dear all,
Hi! Recently, I notice a situation where I cannot infer the size of the outermost dimension of array in the function interface.
To concretely depict the problem, I show the C source code and the generated IR code at the end. The array size of A[] is 51 but this information is lost in the generated IR.
How can I maintain such information in IR? Should I set some argument for
2019 Jun 30
2
Information Loss of Array Type in Function Interface in IR Generated by Clang
Dear David,
Thanks for your prompt reply!
Sure, I can implement a AST visitor to go through the AST to get the information but I just wonder whether there is any other way to let Clang do so.
What I am considering is how to let the generated IR looks like below, which some tools realize:
define dso_local i32 @_Z1fPii([51 x i32]* %A, i32 %x) local_unnamed_addr #0 !dbg !7 {
entry:
...
2020 Jun 28
2
__restirct ignored when including headers like <cmath>
Hi,
I am observing a strange behaviour in which Clang ignores __restirct when I
include some standard headers.
For example, this code:
void vec_add(int* __restrict a,
int* __restrict b,
int n) {
#pragma unroll 4
for(int i=0; i<n; ++i) {
a[i] += b[i];
}
}
results in:
; Function Attrs: nofree norecurse nounwind
define dso_local void @_Z7vec_addPiS_i(i32*
2020 Sep 29
5
restrict func param losing noalias when inlined
Johannes,
Thanks, I have been following along some of the thread(s) and the phab
reviews. The scope of this work is more encompassing than our current needs
and I've looked at trying to carve a piece out.
It's not clear to me what purpose the llvm.noalias intrinsic serves right
now. Also, if a mem instruction has !noalias metadata, then it should not
be aliased, but I must be missing
2018 Apr 25
2
Help on understanding assume shape array processing and array descriptors in LLVM IR
Hi,
I am trying to understand how assume shaped arrays are received and
processed in LLVM IR. I am using "flang" for my front end.
There seems to be an array descriptor received as implicit argument
for every assume shaped array.
For my test routine:
---snip--
SUBROUTINE test(a,b,Li,Lj,Istr,Iend,Jstr,Jend)
INTEGER, INTENT(IN) :: Li,Lj
INTEGER, INTENT(IN) :: Istr, Iend,
2020 Jan 22
2
Inlining + CSE + restrict pointers == funtimes
Ok I think we have some common ground - CSE should choose the aliased
pointer over the non-aliased one because we don't want the no-aliasing
information to creep outwards from the inlined callsite.
I'll put together a patch in the coming days and add y'all as reviewers so
you get visibility.
Cheers,
-Neil.
On Wed, Jan 22, 2020 at 4:47 PM Jeroen Dobbelaere <
Jeroen.Dobbelaere at
2019 Dec 10
2
TypePromoteFloat loses intermediate rounding operations
For the following C code
__fp16 x, y, z, w;
void foo() {
x = y + z;
x = x + w;
}
clang produces IR that extends each operand to float and then truncates to
half before assigning to x. Like this
define dso_local void @foo() #0 !dbg !18 {
%1 = load half, half* @y, align 2, !dbg !21
%2 = fpext half %1 to float, !dbg !21
%3 = load half, half* @z, align 2, !dbg !22
%4 = fpext half %3 to float, !dbg
2015 Jul 16
4
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
----- Original Message -----
> From: "Hal Finkel" <hfinkel at anl.gov>
> To: "Chandler Carruth" <chandlerc at google.com>
> Cc: llvmdev at cs.uiuc.edu
> Sent: Thursday, July 16, 2015 1:58:02 AM
> Subject: Re: [LLVMdev] Improving loop vectorizer support for loops
> with a volatile iteration variable
> ----- Original Message -----
> >
2020 Feb 27
2
TBAA for struct fields
[AMD Official Use Only - Internal Distribution Only]
Hi,
Following issue is observed with Type Based Alias Analysis(TBAA).
#######################################################
struct P {
float f1;
float f2;
float f3[3];
float f4;
};
void foo(struct P* p1, struct P* p2) {
p1->f2 = 1.2;
p2->f1 = 3.7;
}
int callFoo() {
struct P p;
foo(&p, &(p.f2));
}
2011 Dec 09
0
[LLVMdev] Implementing devirtualization
On Thu, Dec 8, 2011 at 2:11 PM, Vitor Luis Menezes <vitor at utexas.edu> wrote:
> We've got the following test case:
>
>
> class A {
> public:
> int x;
> A(int x) : x(x) {}
> int hoo() {return 4;}
> virtual int foo() {return x;}
> virtual int goo() {return foo()+10;}
> virtual int operator+(A &a) {
> return x + a.x;
> }
> };
2019 Dec 10
2
TypePromoteFloat loses intermediate rounding operations
Thanks Eli.
I forgot to bring up the strict FP questions which I was working on when I
found this. If we're in a strict FP function, do the fp_to_f16/f16_to_fp
emitted by promoting load/store/bitcast need to be strict versions of
fp_to_f16/f16_to_fp. And if so where do we get the chain, especially for
the bitcast case which isn't a chained node.
~Craig
On Tue, Dec 10, 2019 at 3:18 PM
2018 Apr 25
0
Help on understanding assume shape array processing and array descriptors in LLVM IR
Hello,
I believe these descriptors are specific to flang, not to LLVM. You should probably ask your question on flang-dev list.
Thank you,
--Eugene
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Venkataramanan Kumar via llvm-dev
Sent: Wednesday, April 25, 2018 8:44 AM
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] Help on understanding assume shape array
2011 Dec 08
2
[LLVMdev] Implementing devirtualization
We've got the following test case:
class A {
public:
int x;
A(int x) : x(x) {}
int hoo() {return 4;}
virtual int foo() {return x;}
virtual int goo() {return foo()+10;}
virtual int operator+(A &a) {
return x + a.x;
}
};
class B : public A {
public:
B(int x) : A(x) {}
int hoo() {return 2;}
virtual int foo() {return A::foo()*2;}
};
int main() {
A* a = new A(1);
2015 Aug 13
2
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
Hi Gerolf,
I think we have several (perhaps separable) issues here:
1. Do we have a canonical form for loops, preserved through the optimizer, that allows naturally-constructed loop nests to remain separable?
2. Do we forbid non-lowering transformations that turn vectorizable loops into non-vectorizable loops?
3. How do we detect cases where transformations cause a negative answer to either
2019 Nov 06
2
Alias analysis only throwing mayAlias for something that seems should be identifiable as mustAlias
I have a global 2-D array ARRAY[N][M] and I am accessing it inside the for
loop like this:
for (i...)
for (j ...)
ARRAY[i][j] ...
So nothing really weird is happening. If I look at the generated IR, it is
also fairly straight forward.
@ARRAY0 = dso_local global [32 x [32 x i32]] zeroinitializer, section
".slow_mem", align 32, !dbg !84
...
%45 = getelementptr inbounds [32 x [32 x
2016 Jul 26
2
Alias Analysis with inbound GEPs
----- Original Message -----
> From: "Elena Demikhovsky" <elena.demikhovsky at intel.com>
> To: "Hal J. Finkel" <hfinkel at anl.gov>, "Eli Friedman"
> <eli.friedman at gmail.com>
> Cc: "llvm-dev" <llvm-dev at lists.llvm.org>, "Richard Smith"
> <richard-llvm at metafoo.co.uk>
> Sent: Tuesday, July 26,
2011 Dec 08
4
[LLVMdev] Implementing devirtualization
Hello all,
Our compilers class has been using LLVM, and a partner and I decided to
implement devirtualization of virtual C++ calls in LLVM as a class project.
We quickly realized that existing debug metadata generated by Clang didn't
give us enough info to (precisely) implement this, and as such have already
begun modifying Clang to insert such metadata. However, for
devirtualization we also
2019 Nov 28
2
Question on TBAA and optimization
TBAA Question.
Please consider the following test case.
---Snip--
struct B {
int b1;
int b2;
};
struct C {
int b1;
};
struct A {
int a1;
struct C SC;
int a2;
};
int foo1(struct A * Aptr, struct B* Bptr)
{
int *a = &Aptr->SC.b1;
*a=10;
Bptr->b1 = 11;
return *a;
}
int foo2(struct A * Aptr, struct B* Bptr)
{
Aptr->SC.b1=10;
Bptr->b1 = 11;
return
2020 Jun 21
3
Restrict qualifier on class members
Hi,
I'm trying to abstract some special pointers with a class, like in the
example program below:
1 #define __remote __attribute__((address_space(1)))
2 #include <stdint.h>
3
4 __remote int* A;
5 __remote int* B;
6
7 class RemotePtr {
8 private:
9 __remote int* __restrict a;
10
11 public:
12 RemotePtr(__remote int* a) : a(a) {}
13
14 __remote