Displaying 5 results from an estimated 5 matches for "m_binop".
Did you mean:
binop
2018 Sep 25
2
[FPEnv] FNEG instruction
...PM Sanjay Patel <spatel at rotateright.com> wrote:
> I have 1 concern about adding an explicit fneg op to IR:
>
> Currently, fneg qualifies as a binop in IR (since there's no other way to
> represent it), and we have IR transforms that are based on matching that
> pattern (m_BinOp). With a proper unary fneg instruction, those transforms
> are not going to fire anymore. So I think we'll need to duplicate code to
> account for that difference (or hack the matcher to include fneg?).
>
>
The existing regression tests probably aren't going to show optimizatio...
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
...med/allowed.
This should match that *specific* pattern (other than verifying the
correct equal binop types), although i have not tested it:
ICmpInst::Predicate Pred;
Value *A, *B, *Mul, *Sub, *Mul2;
if (match(&SI,
m_Select(m_ICmp(Pred,
m_CombineAnd(m_BinOp(m_Value(A), m_Value(B)),
m_Value(Mul)),
m_AllOnes()),
m_Deferred(Mul),
m_CombineAnd(
m_c_BinOp(m_CombineAnd(m_Sub(m_Zero(), m_Deferred
(A)),...
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
Hi,
There is an opportunity in instCombine for following instruction pattern:
%mul = mul nsw i32 %b, %a
%cmp = icmp sgt i32 %mul, -1
%sub = sub i32 0, %a
%mul2 = mul nsw i32 %sub, %b
%cond = select i1 %cmp, i32 %mul, i32 %mul2
Source code for above pattern:
return (a*b) >=0 ? (a*b) : -a*b;
Currently, llvm(-O3) can not recognize this as abs(a*b).
I initially think we could do this in
2018 Sep 11
2
[FPEnv] FNEG instruction
+1 for an explicit FNEG instruction, since as previously discussed, it has
stricter requirements for what value may be returned by the operation. And
strengthening the requirement on FSUB is not feasible when the values are
variables rather than literals.
That is:
FSUB(-0.0, NaN) = either NaN *or* -NaN
FSUB(-0.0, -NaN) = either NaN *or* -NaN
FNEG(NaN) = -NaN
FNEG(-NaN) = NaN
On Tue, Sep 11,
2018 Sep 26
2
[FPEnv] FNEG instruction
...; wrote:
>>
>>> I have 1 concern about adding an explicit fneg op to IR:
>>>
>>> Currently, fneg qualifies as a binop in IR (since there's no other way
>>> to represent it), and we have IR transforms that are based on matching that
>>> pattern (m_BinOp). With a proper unary fneg instruction, those transforms
>>> are not going to fire anymore. So I think we'll need to duplicate code to
>>> account for that difference (or hack the matcher to include fneg?).
>>>
>>
>>>
>> The existing regression te...