Displaying 20 results from an estimated 673 matches for "zexts".
Did you mean:
zext
2016 Jul 27
2
Remove zext-unfolding from InstCombine
Hi Sanjay,
thank you a lot for your answer. I understand that in your examples it is desirable that `foo` and `goo` are canonicalized to the same IR, i.e., something like `@goo`. However, I still have a few open questions, but please correct me in case I'm thinking in the wrong direction.
> Am 21.07.2016 um 18:51 schrieb Sanjay Patel <spatel at rotateright.com>:
>
> I've
2016 Jul 21
2
Remove zext-unfolding from InstCombine
Hi all,
I have a question regarding a transformation that is carried out in InstCombine, which has been introduced by r48715. It unfolds expressions of the form `zext(or(icmp, (icmp)))` to `or(zext(icmp), zext(icmp)))` to expose pairs of `zext(icmp)`. In a subsequent iteration these `zext(icmp)` pairs could then (possibly) be optimized by another optimization (which has already been there before
2016 Aug 04
2
Remove zext-unfolding from InstCombine
Hi Sanjay,
> Am 02.08.2016 um 21:39 schrieb Sanjay Patel <spatel at rotateright.com>:
>
> Hi Matthias -
>
> Sorry for the delayed reply. I think you're on the right path with D22864.
No problem, thank you for your answer!
> If I'm understanding it correctly, my foo() example and zext_or_icmp_icmp() will be equivalent after your patch is added to InstCombine.
2015 Feb 01
2
[LLVMdev] RFC: Proposal for Poison Semantics
On Tue, Jan 27, 2015 at 8:58 PM, Sanjoy Das <sanjoy at playingwithpointers.com>
wrote:
> > Ah, yes. You are right, we cannot always assume that %y would be zero in
> > the second case.
> > This wouldn't be the first time we've lost information that we could use
> to
> > optimize a program by transforming it.
> >
> > Do you think this result
2016 Sep 29
2
IR canonicalization: select or bool math?
My gut tells me that Hal is right, and we should prefer zexts as long
as the select boils down to one instruction, but let me go against my
intuition and try to list two reasons why we should prefer selects:
* Folding operations into selects: it is trivial to transform
f(select X, Const0, Const1) to select X, f(Const0), f(Const1),
while doing that...
2015 Feb 01
4
[LLVMdev] RFC: Proposal for Poison Semantics
I don't know how things work at the moment, but it seems to me that you can
do lots of sensible things, and avoid lots of silly things, if you keep
track of four possible values for each bit:
- undef (the default)
- poison
- known to be 0
- known to be 1
This makes both David's and Chandler's examples work nicely if you assume:
- ZEXT makes all the new bits known 0
- SEXT makes all
2015 Aug 17
4
RFC for a design change in LoopStrengthReduce / ScalarEvolution
> I don't understand why you want to factor out the information,
> exactly. It seems like what you need is a function like:
>
> unsigned getMinLeadingZeros(const SCEV *);
>
> then, if you want to get the non-extended expression, you can just
> apply an appropriate truncation. I assume, however, that I'm missing
> something.
The problem is not about how to codegen
2016 Sep 28
4
IR canonicalization: select or bool math?
I have another round of questions about IR select canonicalizations. For
the purity of this quiz, please disregard prior knowledge of how this is
handled by instcombine or how this is lowered by your favorite target...of
course we'll fix it. :) Some answers in the links below if you do want to
know.
Which, if any, of these is canonical?
1. Is a zext simpler than a select?
a. define i32
2015 Jan 28
4
[LLVMdev] RFC: Proposal for Poison Semantics
On Tue, Jan 27, 2015 at 8:32 PM, Sanjoy Das <sanjoy at playingwithpointers.com>
wrote:
> >
> > Correct me if I am wrong but we are talking about transforming:
> > %maybe_poison = add nuw i32 %a, %b
> > %x = zext i32 %maybe_poison to i64
> > %y = lshr i64 %x 32
> >
> > To:
> > %za = zext i32 %a to i64
> > %zb = zext i32 %b
2010 Aug 18
2
[LLVMdev] global type legalization?
...Lattner wrote:
> Some things to consider: When the input to the zext is spilled, the reload can be folded into the zext on almost all targets, making the zext free. When the zext *isn't* folded into a load, what you're really looking for is a code placement pass which tries to put the zexts in non-redundant (and non-partially redundant) places.
That makes sense to me, but note that this is not currently implemented. All our RISC-like targets only support folding of COPY to load/store through the target-independent mechanisms.
It should be fairly simple to add a foldMemoryOperandImpl...
2015 Jan 28
2
[LLVMdev] RFC: Proposal for Poison Semantics
On Tue, Jan 27, 2015 at 7:23 PM, Sanjoy Das <sanjoy at playingwithpointers.com>
wrote:
> Hi David,
>
> I spent some time thinking about poison semantics this way, but here
> is where I always get stuck:
>
> Consider the IR fragment
>
> %x = zext i32 %maybe_poison to i64
> %y = lshr i64 %x 32
> %ptr = gep %global, %y
> store 42 to %ptr
>
> If
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
2015 Aug 18
2
RFC for a design change in LoopStrengthReduce / ScalarEvolution
> Of course, and the point is that, for example, on x86_64, the zext here is free. I'm still trying to understand the problem...
>
> In the example you provided in your previous e-mail, we choose the solution:
>
> `GEP @Global, zext(V)` -> `GEP (@Global + zext VStart), {i64 0,+,1}`
> `V` -> `trunc({i64 0,+,1}) + VStart`
>
> instead of the actually-better
2015 Aug 17
2
RFC for a design change in LoopStrengthReduce / ScalarEvolution
> To back up for a second, how much of this is self-inflicted damage?
> IndVarSimplify likes to preemptively widen induction variables. Is
> that why you have the extensions here in the first place?
In the specific example I was talking about the zext came from our
frontend (our FE used to insert these extensions for reasons that are
no longer relevant). But you can easily get the same
2015 Jan 28
2
[LLVMdev] RFC: Proposal for Poison Semantics
...t; > This is OK because performing a zext by that many bits cannot result in a
> > NUW violation.
>
> No, I'm talking about "zext(add nuw X Y)" ==> "add nuw (zext X) (zext
> Y)". In the example, replacing %x, a zext of an nuw add with an nuw
> add of zexts changes the behavior of a well-defined program.
>
Correct me if I am wrong but we are talking about transforming:
%maybe_poison = add nuw i32 %a, %b
%x = zext i32 %maybe_poison to i64
%y = lshr i64 %x 32
To:
%za = zext i32 %a to i64
%zb = zext i32 %b to i64
%x = add nuw i64 %...
2017 Jan 29
3
Folding zext from i1 into PHI nodes with only zwo incoming values.
Hi,
AFAICT there are two places where zext instructions may get folded into PHI
nodes. One is FoldPHIArgZextsIntoPHI and the other is the more generic
FoldPHIArgOpIntoPHI. Now, the former only handles PHIs with more than 2
incoming values, while the latter only handles casts where the source type
is legal.
This means that for an PHI node with two incoming i8 values, both resulting
from `zext i1 * to i8` i...
2016 Oct 20
2
RFC: Killing undef and spreading poison
Hi Mehdi,
On Wed, Oct 19, 2016 at 8:29 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:
>> sext(x):
>> t = zext x
>> result = 0
>> for i = 0 to bitwidth:
>> result |= t << i;
>> return result
>
> I don’t understand this definition of sext?
> Are you trying to express that we will copy the sign one bit at a time, and so every `new`
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
2015 Apr 29
2
[LLVMdev] [LoopVectorizer] Missed vectorization opportunities caused by sext/zext operations
Hi,
This is somewhat similar to the previous thread regarding missed vectorization
opportunities (http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-April/084765.html),
but maybe different enough to require a new thread.
I'm seeing some missed vectorization opportunities in the loop vectorizer because SCEV
is not able to fold sext/zext expressions into recurrence expressions (AddRecExpr).
This
2009 Nov 13
2
[LLVMdev] Proposal: intp type
On Nov 12, 2009, at 11:29 PM, John McCall wrote:
>> sext/zext/trunc are very nice for the optimizer, we should keep
>> them. It means that the optimizer doesn't have to check that the
>> input to a sext is bigger or smaller than the result, for example.
>> Code that cares (e.g. instcombine) really likes this.
>
> We could just say that code has undefined