Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] sign extensions, SCEVs, and wrap flags"
2012 Sep 19
0
[LLVMdev] sign extensions, SCEVs, and wrap flags
On Sep 18, 2012, at 8:21 PM, Preston Briggs <preston.briggs at gmail.com> wrote:
> Given the following SCEV,
>
> (sext i32 {2,+,1}<nw><%for.body> to i64)
>
> from the following C source,
>
> void strong3(int *A, int *B, int n) {
> for (int i = 0; i < n; i++) {
> A[i + 2] = i;
> ...
> }
> }
>
> Since the No-Wrap flag is
2012 Sep 19
2
[LLVMdev] sign extensions, SCEVs, and wrap flags
On Tue, Sep 18, 2012 at 10:59 PM, Andrew Trick <atrick at apple.com> wrote:
>
> On Sep 18, 2012, at 8:21 PM, Preston Briggs <preston.briggs at gmail.com>
> wrote:
>
> Given the following SCEV,
>
> *(sext i32 {2,+,1}<nw><%for.body> to i64)*
>
>
> from the following C source,
>
> *void strong3(int *A, int *B, int n) {*
> * for (int i =
2012 Sep 20
0
[LLVMdev] sign extensions, SCEVs, and wrap flags
On Sep 19, 2012, at 2:18 PM, Preston Briggs <preston.briggs at gmail.com> wrote:
> On Tue, Sep 18, 2012 at 10:59 PM, Andrew Trick <atrick at apple.com> wrote:
>
> On Sep 18, 2012, at 8:21 PM, Preston Briggs <preston.briggs at gmail.com> wrote:
>
>> Given the following SCEV,
>>
>> (sext i32 {2,+,1}<nw><%for.body> to i64)
>>
2012 Sep 20
3
[LLVMdev] sign extensions, SCEVs, and wrap flags
On Wed, Sep 19, 2012 at 6:30 PM, Andrew Trick <atrick at apple.com> wrote:
>
> On Sep 19, 2012, at 2:18 PM, Preston Briggs <preston.briggs at gmail.com>
> wrote:
>
> On Tue, Sep 18, 2012 at 10:59 PM, Andrew Trick <atrick at apple.com> wrote:
>
>>
>> On Sep 18, 2012, at 8:21 PM, Preston Briggs <preston.briggs at gmail.com>
>> wrote:
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] =
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 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
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
2012 Sep 22
0
[LLVMdev] sign extensions, SCEVs, and wrap flags
>> Are all your array indices uniformly sign-extended?
>> I don't know if this is a good idea, but why can't you consider the
sext
>> operand the array index rather than the gep operand? If you prove
that the
>> narrow indices are disjoint, then the extended indices must be
disjoint.
>> SCEV operations should work fine on the narrow indices
2013 Nov 13
2
[LLVMdev] SCEV getMulExpr() not propagating Wrap flags
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 i32* %b, i64 %0
%1 = load i32* %arrayidx, align 4, !tbaa !1
%add = add nsw i32 %1, %I
%arrayidx3 = getelementptr
2012 Dec 18
0
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
On Tue, Dec 18, 2012 at 9:56 AM, Matthew Curtis <mcurtis at codeaurora.org> wrote:
>
> Here's how I'm evaluating the expression (in my head):
>
> 00: Add(ZeroExtend(Truncate(Minus(AddRec(Start=0,Step=3)[n],3), i8), i32),3)
> |
> 01: Add(ZeroExtend(Truncate(Minus(AddRec(Start=0,Step=3)[0],3), i8), i32),3)
>
2012 Sep 20
0
[LLVMdev] sign extensions, SCEVs, and wrap flags
Hi,
> Sorry, I probably led you astray. No-self-wrap is useful for determining
> trip count, but does not mean that sign/zero extension can be hoisted.
>
> But if you run your analysis after -indvars, the sign-extension should be
> removed if possible. The algorithm walks the derived induction variables
> specifically looking for add nsw/nuw and replacing
2012 Jun 16
2
[LLVMdev] SCEV not simplifying
I have a pair of SCEVs that appear different to me.
However, when I compute the difference, it's not known to be non-zero.
src = (sext i32 %n to i64)
dst = (sext i32 (1 + %n) to i64)
delta = ((sext i32 %n to i64) + (-1 * (sext i32 (1 + %n) to i64)))
Is this behavior expected?
If I repeat the experiment with 64-bit ints (or unsigned),
things work out like I expect. 32-bit
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 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
2012 Dec 18
2
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
Dan,
Thanks for the response ...
On 12/17/2012 1:53 PM, Dan Gohman wrote:
> On Mon, Dec 10, 2012 at 2:13 PM, Matthew Curtis <mcurtis at codeaurora.org> wrote:
>> 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
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
2012 Oct 08
3
[LLVMdev] SCEV bottom value
I'd like a value, call it Bottom, such that
SE->getAddExpr(Bottom, X) => Bottom
SE->getMulExpr(Bottom, X,) => Bottom
isKnownPredicate(any, Bottom, X) => false
etc.
I can write code to make NULL work like I want, but it would be simpler if
something was already defined. I'm wondering about SCEV::Unknown. The
documentation suggests I could perhaps use it for a
2012 Nov 02
2
[LLVMdev] DependenceAnalysis and PR14241
On 11/02/2012 10:21 AM, Preston Briggs wrote:
>
> My initial guess is that a conservative fix is quick and small (make
> sure the underlying pointers are loop invariant, otherwise give up). A
> better approach would be to somehow turn code like the example into
> array references that can be analyzed. I'll need to think about this and
> do some reading.
Hi Preston,
I looked