Displaying 5 results from an estimated 5 matches for "tobool1".
Did you mean:
tobool
2013 Sep 11
0
[LLVMdev] removing unnecessary ZEXT
...%entry ], [ %1, %if.end ]
%c.addr.0 = phi i8* [ %c, %entry ], [ %incdec.ptr, %if.end ]
%tobool = icmp eq i8 %0, 0
br i1 %tobool, label %do.end, label %if.end
if.end:
%incdec.ptr = getelementptr inbounds i8* %c.addr.0, i64 1
%1 = load i8* %incdec.ptr, align 1
%tobool1 = icmp eq i8 %1, 0
br i1 %tobool1, label %do.end, label %do.body
do.end:
ret void
}
The problem seems to be that an icmp becomes isolated in a different basic block to the originators of the vreg it uses viz:
entry:
%.pre = load i8* %c, align 1
do.body:
%0...
2013 Sep 11
2
[LLVMdev] removing unnecessary ZEXT
On Sep 10, 2013, at 8:59 AM, Robert Lytton <robert at xmos.com> wrote:
> Hi,
>
> A bit more information.
> I believe my problem lies with the fact that the load is left as 'anyext from i8'.
> On the XCore target we know this will become an 8bit zext load - as there is no 8bit sign extended load!
> If BB#1 were to force the load to a "zext from i8" would
2016 Jul 27
2
Remove zext-unfolding from InstCombine
...e of the `icmp` instructions left. However, that means that `foo` will not be lowered to the IR that we have in zext-or-icmp.ll, where the `zext` is placed after the `or` instruction as opposed to `@foo_before_InstCombine`:
```
define i8 @zext_or_icmp_icmp(i8 %a, i8 %b) {
%mask = and i8 %a, 1
%toBool1 = icmp eq i8 %mask, 0
%toBool2 = icmp eq i8 %b, 0
%bothCond = or i1 %toBool1, %toBool2
%zext = zext i1 %bothCond to i8
ret i8 %zext
}
```
That means as long as the `zext` in zext-or-icmp.ll isn't pushed in front of the `icmp` operations it will not be possible to remove one of them via...
2016 Aug 04
2
Remove zext-unfolding from InstCombine
...below).
When testing this on ...
define i8 @foo(i8 %a, i8 %b) {
%and = and i8 %a, 1
%xor = xor i8 %and, 1
%cmp = icmp eq i8 %b, 0
%zext = zext i1 %cmp to i8
%or = or i8 %xor, %zext
ret i8 %or
}
… and also on ...
define i8 @zext_or_icmp_icmp(i8 %a, i8 %b) {
%mask = and i8 %a, 1
%toBool1 = icmp eq i8 %mask, 0
%toBool2 = icmp eq i8 %b, 0
%bothCond = or i1 %toBool1, %toBool2
%zext = zext i1 %bothCond to i8
ret i8 %zext
}
… InstCombine will now eventually get to:
define i8 @zext_or_icmp_icmp(i8 %a, i8 %b) {
%1 = icmp ne i8 %b, 0
%2 = zext i1 %1 to i8
%zext.demorgan = a...
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