Displaying 20 results from an estimated 500 matches similar to: "[LLVMdev] SCEV getMulExpr() not propagating Wrap flags"
2013 Nov 16
0
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
On Nov 13, 2013, at 3:39 AM, Renato Golin <renato.golin at linaro.org> wrote:
> Hi folks,
>
> I'm trying to analyse this piece of IR:
>
> for.body: ; preds = %for.body, %entry
> %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
> %0 = shl nsw i64 %indvars.iv, 1
> %arrayidx = getelementptr inbounds
2013 Nov 16
2
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
On 16 November 2013 06:56, Andrew Trick <atrick at apple.com> wrote:
> - getMulExpr constructs a new AddRec with NSW:
>
> Flags = AddRec->getNoWrapFlags(clearFlags(Flags, SCEV::FlagNW));
> const SCEV *NewRec = getAddRecExpr(NewOps, AddRecLoop, Flags);
>
Hi Andrew,
Thanks for looking at this.
Clearing the flags here makes sense, but it's being too
2013 Nov 16
0
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
> On Nov 16, 2013, at 4:11 AM, Renato Golin <renato.golin at linaro.org> wrote:
>
>> On 16 November 2013 06:56, Andrew Trick <atrick at apple.com> wrote:
>> - getMulExpr constructs a new AddRec with NSW:
>>
>> Flags = AddRec->getNoWrapFlags(clearFlags(Flags, SCEV::FlagNW));
>> const SCEV *NewRec = getAddRecExpr(NewOps, AddRecLoop,
2016 Apr 20
2
[IndVarSimplify] Narrow IV's are not eliminated resulting in inefficient code
Hi,
Would you be able to kindly check and assist with the IndVarSimplify / SCEV
problem I got in the latest LLVM, please?
Sometimes IndVarSimplify may not eliminate narrow IV's when there actually
exists such a possibility. This may affect other LLVM passes and result in
inefficient code. The reproducing test 'indvar_test.cpp' is attached.
The problem is with the second
2016 Apr 23
2
[IndVarSimplify] Narrow IV's are not eliminated resulting in inefficient code
Hi Sanjoy,
Thank you for looking into this!
Yes, your patch does fix my larger test case too. My algorithm gets double
performance improvement with the patch, as the loop now has a smaller
instruction set and succeeds to unroll w/o any extra #pragma's.
I also ran the LLVM tests against the patch. There are 6 new failures:
Analysis/LoopAccessAnalysis/number-of-memchecks.ll
2018 Feb 08
2
[SCEV] Inconsistent SCEV formation for zext
Hi Sanjoy,
SCEV is behaving inconsistently when forming SCEV for this zext instruction in the attached test case-
%conv5 = zext i32 %dec to i64
If we request a SCEV for the instruction, it returns-
(zext i32 {{-1,+,1}<nw><%for.body>,+,-1}<nw><%for.body7> to i64)
This can be seen by invoking-
$ opt -analyze -scalar-evolution inconsistent-scev-zext.ll
But when computing
2018 Feb 10
0
[SCEV] Inconsistent SCEV formation for zext
Hi,
+CC Max, Serguei
This looks like a textbook case of why caching is hard.
We first call getZeroExtendExpr on %dec, and this call does end up
returning an add rec. However, in the process of simplifying the
zext, it also calls into isLoopBackedgeGuardedByCond which in turn
calls getZeroExtendExpr(%dec) again. However, this second (recursive)
time, we don't simplify the zext and cache a
2016 Aug 03
6
[SCEV] getMulExpr could be extremely slow when creating SCEVs for a long chain of add/mul instructions
Hi,
I'm working on a slow-compile problem caused by SCEV (PR28830), and I need your suggestions on how to fix it. The loop below causes ScalarEvolution::getMulExpr to hang.
int get(unsigned n)
{
unsigned i, j, mult = 1;
for (i = 0; i < 1; i++) {
for (j = 0; j < 30; j++) {
mult *= n++;
}
}
return mult;
}
the inner loop is completed unrolled
2015 Jan 15
4
[LLVMdev] confusion w.r.t. scalar evolution and nuw
I've been doing some digging in this area (scev, wrapping arithmetic),
learning as much as I can, and have reached a point where I'm fairly
confused about the semantics of nuw in scalar evolution expressions.
Consider the following program:
define void @foo(i32 %begin) {
entry:
br label %loop
loop:
%idx = phi i32 [ %begin, %entry ], [ %idx.dec, %loop ]
%idx.dec = sub nuw i32
2013 Oct 31
2
[LLVMdev] SCEV and GEP NSW flag
Andy, et al.,
If I start with C code like this:
void foo(long k, int * restrict a, int * restrict b, int * restrict c) {
if (k > 0) {
for (int i = 0; i < 2047; i++) {
a[i] = a[i + k] + b[i] * c[i];
}
}
}
Clang -O3 will produce code like this:
entry:
%cmp = icmp sgt i64 %k, 0
br i1 %cmp, label %for.body.preheader, label %if.end
for.body.preheader:
br label
2013 Oct 01
3
[LLVMdev] ScalarEvolution::createNodeForPHI
Hello to everybody,
I'm working on some improvements on trip count computation with ScalarEvolution
analysis.
Considering the following test
;----------------------------------------------------------------------------;
define void @foo(i32 %a, i32 %b, i32 %s) #0 {
entry:
%cmp = icmp sgt i32 %s, 0
%cmp15 = icmp sgt i32 %a, %b
%or.cond = and i1 %cmp, %cmp15
br i1 %or.cond, label
2008 Feb 22
2
[LLVMdev] ScalarEvolution Patch
Dear All,
Is the following patch to ScalarEvolution correct? It seems that
without it, the enclosing for loop could skip over SCEVAddRecExpr's in
the Ops[] array.
-- John T.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: scpatch
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080222/3ff8edd7/attachment.ksh>
2013 Nov 02
0
[LLVMdev] SCEV and GEP NSW flag
On Oct 31, 2013, at 1:24 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> Andy, et al.,
>
> If I start with C code like this:
>
> void foo(long k, int * restrict a, int * restrict b, int * restrict c) {
> if (k > 0) {
> for (int i = 0; i < 2047; i++) {
> a[i] = a[i + k] + b[i] * c[i];
> }
> }
> }
>
> Clang -O3 will produce code like
2013 Oct 02
0
[LLVMdev] ScalarEvolution::createNodeForPHI
On Oct 1, 2013, at 6:45 AM, Michele Scandale <michele.scandale at gmail.com> wrote:
> Hello to everybody,
>
> I'm working on some improvements on trip count computation with ScalarEvolution
> analysis.
> Considering the following test
>
> ;----------------------------------------------------------------------------;
> define void @foo(i32 %a, i32 %b, i32 %s) #0
2013 Nov 02
2
[LLVMdev] SCEV and GEP NSW flag
----- Original Message -----
>
> On Oct 31, 2013, at 1:24 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>
> > Andy, et al.,
> >
> > If I start with C code like this:
> >
> > void foo(long k, int * restrict a, int * restrict b, int * restrict
> > c) {
> > if (k > 0) {
> > for (int i = 0; i < 2047; i++) {
> > a[i] =
2014 Feb 05
2
[LLVMdev] SCEV implementation and limitations, do we need "pow"?
Hi,
I was looking at some bugs to play with, and I started with
http://llvm.org/bugs/show_bug.cgi?id=18606
As I commented there, a loop is unrolled and exhibit this pattern:
%mul.1 = mul i32 %mul, %mul
%mul.2 = mul i32 %mul.1, %mul.1
....
With an unroll factor of 32, the last multiply has 2^32 terms in its
SCEV expression.
(I mean I expect it would have those terms if I was patient
2014 Feb 08
3
[LLVMdev] SCEV implementation and limitations, do we need "pow"?
On 2/7/14, 10:24 AM, Andrew Trick wrote:
>
> On Feb 5, 2014, at 12:54 AM, Mehdi Amini <mehdi.amini at silkan.com
> <mailto:mehdi.amini at silkan.com>> wrote:
>
>> Hi,
>>
>> I was looking at some bugs to play with, and I started with
>> http://llvm.org/bugs/show_bug.cgi?id=18606
>>
>> As I commented there, a loop is unrolled and exhibit
2018 Feb 11
2
[SCEV] Inconsistent SCEV formation for zext
Hi Sanjoy,
Thanks for investigating the issue!
I am more interested in getting the underlying problem fixed rather than making this particular test case work. I think I have more test cases where this problem crops up. I would any day prefer consistent results over compile time savings which can lead to inconsistencies. These inconsistencies require significant developer time to analyze and fix
2013 Oct 02
1
[LLVMdev] ScalarEvolution::createNodeForPHI
----- Original Message -----
>
> On Oct 1, 2013, at 6:45 AM, Michele Scandale
> <michele.scandale at gmail.com> wrote:
>
> > Hello to everybody,
> >
> > I'm working on some improvements on trip count computation with
> > ScalarEvolution
> > analysis.
> > Considering the following test
> >
> >
2012 Dec 10
3
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
Hello all,
I wanted to get some feedback on this patch for ScalarEvolution.
It addresses a performance problem I am seeing for simple benchmark.
Starting with this C code:
01: signed char foo(void)
02: {
03: const int count = 8000;
04: signed char result = 0;
05: int j;
06:
07: for (j = 0; j < count; ++j) {
08: result += (result_t)(3);
09: }
10:
11: return result;
12: }
I