<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>X86 would definitely benefit from this as we often use generic
opcodes as part of more complex patterns that could then be
handled through
SimplifyDemandedBits/SimplifyDemandedVectorElts/SimplifyMultipleUse.</p>
<p>Is this likely to slow compile times down?</p>
<p>I've tried but struggled to come up with an acceptable way to
determine the accumulated demanded bits/elts across all users of a
SDValue - I was always worried that caching would miss nodes that
had recently been added/removed.</p>
<p>I've often thought it a shame that the standard combines don't
include the demandedbits/elts masks directly instead of having a
separate SimplifyDemanded* mechanism.</p>
<p>Simon.<br>
</p>
<div class="moz-cite-prefix">On 22/10/2020 15:37, Jay Foad via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANd1uZ=xBsRvvu9Z7LpnQZnpyy2L+nNNWq1taaZwfCtYTrtNHA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">All,
<div><br>
</div>
<div>The AMDGPU target has a 24-bit multiply instruction. In
SimplifyDemandedBits I'd like to be able to turn a generic i32
ISD::MUL into AMDGPUISD::MUL_I24 if only the low order 24 bits
are demanded. Currently it seems like there's no way to do
that, because the target hook
SimplifyDemandedBitsForTargetNode is only called for
target-specific nodes, not for generic nodes like MUL.</div>
<div><br>
</div>
<div>Would it be acceptable to call the target hook for generic
nodes as well? Here's a patch to show the general idea: <a
href="https://reviews.llvm.org/D89964"
moz-do-not-send="true">https://reviews.llvm.org/D89964</a></div>
<div>(It probably needs a bit of polish, e.g. the name
"SimplifyDemandedBitsForTargetNode" is misleading now.)</div>
<div><br>
</div>
<div>In the future perhaps "demanded bits" could become a cached
analysis that could be queried from anywhere. Then I could
write a target-specific DAG combine for MUL that would query
the demanded bits for the node to do this transformation.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Jay.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</body>
</html>