<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Currently, two patches undergoing review wish to add a new operator for LLVM's DIExpression: D70642[0], and D82363[1]. Though both of these cases use the same name, the operators have different meanings: in the former, it has the form `DW_OP_LLVM_argN`
 where N is in [0-7], and represents the Nth argument of the containing intrinsic; its purpose is to enable the intrinsic @llvm.dbg.derefval, which represents implicit pointers. In the latter, it has the form `DW_OP_LLVM_arg, N`, where N >= 0, and represents
 the Nth value in a variadic debug value, which is being added in the same patch. Functionally these are quite similar; the main difference is that the latter picks the Nth value from a subset of the intrinsic's operands, while the former picks the Nth value
 from the entire containing intrinsic.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My personal opinion (possibly biased as the author of D82363) is that the best solution is to remove DW_OP_LLVM_argN from the implicit pointer work altogether. The operator introduced in that patch is more general-purpose than necessary;
 it is only used as DW_OP_LLVM_arg0 and in conjunction with @llvm.dbg.derefval, an intrinsic added in that patch. It seems at a glance that the functionality could be folded into the new intrinsic and operator pair by having them automatically refer to arg0.
 While it's possible that this general-purpose operator could have value in the future, I think that it is better to have specific operators for each use case, rather than an operator that could refer to a machine value, a local variable, or even the DIExpression
 that contains it. Also of note, the main feature that this operator would be useful for implementing is the feature that D82363 is adding: referencing multiple machine values in a debug value. The difference is that the version of the operator in the more
 recent patch is explicitly used to represent machine values; it cannot refer to anything else.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Finally, the implicit pointer patches haven't received an update in a while: the last comment or update was on January 10th. It is possible at this point that the work will not make it in for a very long time, and may be substantially changed
 when it does - I imagine there will be very little cost associated with using a different operator in that case.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m mainly looking to confirm that there are no objections to this, and also ensure that this change doesn’t sneak past anyone if it is accepted.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[0] <a href="https://reviews.llvm.org/D70642">https://reviews.llvm.org/D70642</a><o:p></o:p></p>
<p class="MsoNormal">[1] <a href="https://reviews.llvm.org/D82363">https://reviews.llvm.org/D82363</a><o:p></o:p></p>
</div>
</body>
</html>