<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br>
</p>
<div class="moz-cite-prefix">On 01/23/2017 02:41 PM, Matt Arsenault
via llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:755F29A7-F561-4FCD-A424-829A7B03141A@gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jan 23, 2017, at 12:36, Friedman, Eli via
llvm-dev <<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><span style="font-family: Helvetica; font-size:
12px; font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; float: none; display:
inline !important;" class="">On 1/23/2017 5:21 AM, Jonas
Paulsson wrote:</span><br style="font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">
<blockquote type="cite" style="font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;" class="">Hi Eli,<br
class="">
<br class="">
I would like to clarify generally what the difference is
between returning SDValue() and Op (input argument
unchanged) from LowerOperation()?<br class="">
<br class="">
My understanding is that returning SDValue() means that
Target gives up, and the common code is supposed to handle
it. Returning Op, the unchanged argument, means that the
Target is happy with the node as it is, and the common
code can move on to something else.<br class="">
</blockquote>
<br style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans:
auto; text-align: start; text-indent: 0px; text-transform:
none; white-space: normal; widows: auto; word-spacing:
0px; -webkit-text-stroke-width: 0px; float: none; display:
inline !important;" class="">This is right.</span></div>
</blockquote>
</div>
<br class="">
<div class="">This sounds backwards. Returning SDValue() means the
node should be treated as legal. Returning the original
operation should hit the expand path.</div>
</blockquote>
<br>
No, I think that was correct. The code in
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp reads:<br>
<br>
switch (Action) {<br>
case TargetLowering::Legal:<br>
return;<br>
case TargetLowering::Custom: {<br>
// FIXME: The handling for custom lowering with multiple
results is<br>
// a complete mess.<br>
if (SDValue Res = TLI.LowerOperation(SDValue(Node, 0), DAG)) {<br>
if (!(Res.getNode() != Node || Res.getResNo() != 0))<br>
return;<br>
<br>
...<br>
<br>
ReplaceNode(Node, ResultVals.data());<br>
return;<br>
}<br>
LLVM_FALLTHROUGH;<br>
}<br>
case TargetLowering::Expand:<br>
if (ExpandNode(Node))<br>
return;<br>
<br>
So, if you return an SDValue() then it will Expand. If you return
the original node, that is equivalent to Legal. Otherwise, you're
requesting a replacement. The logic for loads/stores and vectors is
handled separately (but is similar).<br>
<br>
-Hal<br>
<br>
<blockquote
cite="mid:755F29A7-F561-4FCD-A424-829A7B03141A@gmail.com"
type="cite">
<div class=""><br class="">
</div>
<div class="">-Matt</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>