You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is because we try to transform the %r = add i8 %conv8, %z
before we get to the %cmp_assume = icmp eq i16 %conv16, 0.
But we end up transform %cmp_assume = icmp eq i16 %conv16, 0
-> %cmp_assume = icmp eq i1 %cmp, false which, with the assume,
we are able to use to prove %cmp is false and thus %conv8 is 0
and then on iteration two simplifying the %r = add i8 %conv8, %z.
This particular cases is pretty easy to solve by supporting (zext/sext op)
in the AssumptionCache, but you could really generate any amount of
these issues by having a fold create a pattern we recognize in computeKnownBitsFromCmp and a having a prior node that
we will only fold w/ certain known bits.
I think the fix is that when we add an assume, we need to
also add all instructions that reference it in the AssumptionCache
The text was updated successfully, but these errors were encountered:
Take the following examples:
When run with
opt -passes=instcombine
we run into:https://godbolt.org/z/6Exn4r8jc
The issue is because we try to transform the
%r = add i8 %conv8, %z
before we get to the
%cmp_assume = icmp eq i16 %conv16, 0
.But we end up transform
%cmp_assume = icmp eq i16 %conv16, 0
->
%cmp_assume = icmp eq i1 %cmp, false
which, with theassume
,we are able to use to prove
%cmp
isfalse
and thus%conv8
is0
and then on iteration two simplifying the
%r = add i8 %conv8, %z
.This particular cases is pretty easy to solve by supporting
(zext/sext op)
in the AssumptionCache, but you could really generate any amount of
these issues by having a fold create a pattern we recognize in
computeKnownBitsFromCmp
and a having a prior node thatwe will only fold w/ certain known bits.
I think the fix is that when we add an
assume
, we need toalso add all instructions that reference it in the
AssumptionCache
The text was updated successfully, but these errors were encountered: