<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 02/02/2018 01:34 PM, Yihan Pang via
llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CA+2_MPGDd8YfRL-M=86peafduwXC21akm9g_6Bb0hyzON6xf8w@mail.gmail.com">
<div dir="ltr">HI All,
<div><br>
</div>
<div>I am current working with SIMD instruction along with
stackmap features. </div>
<div><br>
</div>
<div>Recently I encountered a problem involving legalizing
stackmap. In my stackmap, I record all the live values
existing at the callsite. One of the operands in my stackmap
is an illegal vector type for arm64 architecture (<i>v4f64</i>)
and requires vector splitting in order to legalize the node (<i>v2f64</i>).
However, I noticed that in the <i>DAGTypeLegalizer::SplitVectorOperand</i>
function, the switch case does not handle stackmap cases. So
initially every time I run my code with </div>
<div><br>
</div>
<div> <i>-mllvm -debug-only=legalize_types</i></div>
<div><br>
</div>
<div>I will get an error " Do not know how to split this
operator's operand"</div>
</div>
</blockquote>
To start with, I don't think this is an area which has gotten lots
of thought. We're by far the largest user of the stackmap
infrastructure (via deopt operand bundles and patchpoint), and in
our environment, all of our arguments are legal for our target.
Given that, I think you're going to be stumbling into a lot of
unexplored topics. <br>
<br>
If you can, I would seriously consider whether you can avoid needing
to solve this during legalization. Can you instead split your stack
map operands into legal (or at least trivial to legalize) sizes in
your frontend?<br>
<br>
If you can't, can you clarify what your expectations are? In
general, the stackmap tries to describe the locations of elements
such that they can be easily found at runtime. What would you
expect the stackmap to contain for your illegal vector type? i.e.
what result are you looking for?<br>
<br>
Fair warning, I will likely not have bandwidth to respond to this
going forward. I strongly suggest you take the time to draft any
follow on questions carefully for minimal effort on the part of the
reader. It's not that I'll intentional ignore you, but my todo list
is always longer than my day. You really don't want to end up on
the todo list if you can at all avoid it. <br>
<blockquote type="cite"
cite="mid:CA+2_MPGDd8YfRL-M=86peafduwXC21akm9g_6Bb0hyzON6xf8w@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>My first attempt to fix this is to add an if statment
before the switch case to see if the Node is referring to a
stackmap, and if so I will get the SDNode of the particular
stackmap operand using </div>
<div><br>
</div>
<div><i>N->getOperand(OperandNumber).getNode(); </i></div>
<div><i><br>
</i></div>
<div>and use that instead of the original SDNode in the switch
case statement. <br>
</div>
<div><br>
</div>
<div>For example, if I need to split the 3rd operand of my
stackmap which is an vector operand </div>
<div>I will create a <i>SDNode</i> that equals to<i>
N->getOperand(3).getNode()</i>; </div>
<div><br>
</div>
<div>This attempt gives a failed assertion of " <b>Invalid node
ID for RAUW deletion.</b>" </div>
<div><br>
</div>
<div>My next attempt is to add additional instructions to
replace the original illegal vector operand with the new
resulting legal operand. This can be achieved using <i>ReplaceValueWidth</i>
function (if the stackmap flag is set) to replace the
original <i>SDValue</i> of the vector operand with the new
Resulting Value (in the function it is denoted as <i>Res</i>)
that resulted from <i>SplittingVecOp_</i>xxx function. </div>
<div><br>
</div>
<div>However, this way I ran into other failed assertion at
other locations. </div>
<div><br>
</div>
<div>Right now I am not sure what is an effective way of
handling stackmap vector operand in the legalizing phase and I
appreciate any suggestions from the community</div>
<div><br>
</div>
<div>Best,</div>
<div>Yihan </div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> </div>
</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>
<p><br>
</p>
</body>
</html>