Displaying 20 results from an estimated 10000 matches similar to: "Improving SCEV's behavior around IR level no-wrap flags"
2017 Aug 08
2
Improving SCEV's behavior around IR level no-wrap
Hi Sanjoy,
Any update on this?
Are there plans to implement this proposal?
Thanks,
Pankaj
-----Original Message-----
Date: Fri, 23 Sep 2016 02:09:19 -0700
From: Sanjoy Das via llvm-dev <llvm-dev at lists.llvm.org>
To: llvm-dev <llvm-dev at lists.llvm.org>, Andrew Trick
<atrick at apple.com>, Dan Gohman <dan433584 at gmail.com>, Hal Finkel
<hfinkel at anl.gov>,
2017 Aug 09
2
Improving SCEV's behavior around IR level no-wrap
> On Aug 8, 2017, at 5:34 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
>
> Hi Pankaj,
>
> IIRC there was pushback on this proposal so I did not proceed further.
> Are you blocked on this?
>
> [+CC Andy, who I remember had some objections.]
>
> — Sanjoy
Off the top of my head, my concern is that expression comparison is no longer constant time,
2016 Sep 23
3
Improving SCEV's behavior around IR level no-wrap flags
On 23 Sep 2016, at 11:08, Andrew Trick via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>> On Sep 23, 2016, at 2:09 AM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
>>
>> Hi all,
>>
>> This is about a project I've been prototyping on-and-off for a while
>> that has finally reached a point where I can claim it to be
>>
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
2017 Aug 08
2
[ScalarEvolution][SCEV] no-wrap flags dependent on order of getSCEV() calls
Hi all,
I'm looking into resolving a FIXME in the LoopDataPrefetch (and
FalkorMarkStridedAccesses) pass by marking both of these passes as
preserving the ScalarEvolution analysis. Unfortunately, when this
change is made, LSR will generate different code. One of the root
causes seems to be that SCEV will return different nsw/nuw flags for the
same Value, depending on what order the
2017 Aug 08
2
[ScalarEvolution][SCEV] no-wrap flags dependent on order of getSCEV() calls
On 8/8/2017 1:37 PM, Friedman, Eli wrote:
> On 8/8/2017 10:22 AM, Geoff Berry via llvm-dev wrote:
>> Hi all,
>>
>> I'm looking into resolving a FIXME in the LoopDataPrefetch (and FalkorMarkStridedAccesses) pass by marking both of these passes as preserving the ScalarEvolution analysis. Unfortunately, when this change is made, LSR will generate different code. One of the
2015 Jul 01
3
[LLVMdev] Deriving undefined behavior from nsw/inbounds/poison for scalar evolution
Hi Sanjoy, thanks for your thoughts on this.
On Sat, Jun 27, 2015 at 12:16 AM, Sanjoy Das <sanjoy at playingwithpointers.com
> wrote:
>
> First of all, going by the "poison causes UB only when observed", SCEV
> does not do the right thing currently: [...]
>
> That seems like a bug? There's also bug 23527 for GEP. Sounds like there
might be more such bugs.
One
2015 Jun 26
6
[LLVMdev] Deriving undefined behavior from nsw/inbounds/poison for scalar evolution
*** Summary
I'd like to propose (and implement) functionality in LLVM to determine when
a poison value from an instruction is guaranteed to produce undefined
behavior. I want to use that to improve handling of nsw, inbounds etc.
flags in scalar evolution and LSR. I imagine that there would be other uses
for it. I'd like feedback on this idea before I proceed with it.
*** Details
Poison
2016 Oct 17
2
[SCEV] inconsistent operand ordering
Hi,
I noticed an inconsistency in how ScalarEvolution orders instruction operands. This inconsistency can result in creation of separate (%a * %b) and (%b * %a) SCEVs as demonstrated by the example IR below (attached as gep-phi.ll)-
target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
define void @foo(i8* nocapture %arr, i32 %n, i32* %A, i32* %B) local_unnamed_addr {
2018 Aug 16
3
[SCEV] Why is backedge-taken count <nsw> instead of <nuw>?
Ok.
To go back to the original issue, would it be meaningful to add a
SCEVUMax(0, BTC) on the final BTC computed by SCEV?
So that it does not use "negative values"?
On Wed, Aug 15, 2018 at 2:40 PM Friedman, Eli <efriedma at codeaurora.org>
wrote:
> On 8/15/2018 2:27 PM, Alexandre Isoard wrote:
>
> I'm not sure I understand the poison/undef/UB distinctions.
>
2018 Aug 15
2
[SCEV] Why is backedge-taken count <nsw> instead of <nuw>?
I'm not sure I understand the poison/undef/UB distinctions.
But on this example:
define i32 @func(i1 zeroext %b, i32 %x, i32 %y) {
> entry:
> %adds = add nsw i32 %x, %y
> %addu = add nuw i32 %x, %y
> %cond = select i1 %b, i32 %adds, i32 %addu
> ret i32 %cond
> }
It is important to not propagate the nsw/nuw between the two SCEV
expressions (which unification would
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
2013 Oct 03
4
[LLVMdev] ScalarEvolution::createNodeForPHI
On 10/03/2013 01:22 AM, Andrew Trick wrote:
>
> I’m not sure how to make sense of an NUW flag coming from a sub.
>
> NSW is just a misnomer for signed overflow. SCEV canonicalizes sub a,b to add a, (-b). Unfortunately, signed overflow is not the same thing for sub and add...
>
> sub nsw %a, %b != add nsw %a, (-1 * %b)
>
> sub nsw i32, -1, INT_MIN is true.
>
> add
2019 Jun 25
2
SCEVExpander bug?
Hi,
We have recently encountered incorrect code generation issues and I think it is a SCEVExpander bug exposed by a recent patch to add nuw/nsw flags when generating code for SCEVMulExpr.
The test case IR looks like this-
%1 = load i16, i16* %arrayidx
%2 = and i16 %1, -32768
The SCEV form of %2 is this-
(-32768 * (%1 /u -32768))<nuw><nsw>
It has both nsw/nuw flags. The signed
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
2015 Jun 11
4
[LLVMdev] Question about NoWrap flag for SCEVAddRecExpr
[+Arnold]
> On Jun 10, 2015, at 1:29 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
>
> [+CC Andy]
>
>> Can anyone familiar with ScalarRevolution tell me whether this is an
>> expected behavior or a bug?
>
> Assuming you're talking about 2*k, this is a bug. ScalarEvolution
> should be able to prove that {0,+,4} is <nsw> and
2018 Aug 15
2
[SCEV] Why is backedge-taken count <nsw> instead of <nuw>?
Is that why we do not deduce +<nsw> from "add nsw" either?
Is that an intrinsic limitation of creating a context-invariant expressions
from a Value* or is that a limitation of our implementation (our
unification not considering the nsw flags)?
On Wed, Aug 15, 2018 at 12:39 PM Friedman, Eli <efriedma at codeaurora.org>
wrote:
> On 8/15/2018 12:21 PM, Alexandre Isoard via
2013 Oct 03
0
[LLVMdev] ScalarEvolution::createNodeForPHI
On 10/03/2013 04:15 PM, Michele Scandale wrote:
> On 10/03/2013 01:22 AM, Andrew Trick wrote:
>>
>> I’m not sure how to make sense of an NUW flag coming from a sub.
>>
>> NSW is just a misnomer for signed overflow. SCEV canonicalizes sub a,b to add a, (-b). Unfortunately, signed overflow is not the same thing for sub and add...
>>
>> sub nsw %a, %b != add nsw
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 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