<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">In my view, this falls solidly into the
category of things which should not be an error. A warning is
debatable, but an error is ridiculous. <br>
<br>
Philip<br>
<br>
On 08/23/2016 03:19 PM, Richard Smith wrote:<br>
</div>
<blockquote
cite="mid:CAOfiQqnzAD-5o9FDDAYoXd9UoH63QU1TzCrh_U4HUQxKCWikmg@mail.gmail.com"
type="cite">
<div dir="ltr">I've temporarily removed the unused data member in
r279581.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Aug 23, 2016 at 3:12 PM,
Richard Smith <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span class="">On Tue, Aug 23,
2016 at 3:06 PM, Mehdi Amini via llvm-commits <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:llvm-commits@lists.llvm.org"
target="_blank">llvm-commits@lists.llvm.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
Philip,<br>
<br>
I assume it is a work-in-progress, but just to let
you know I have a warning with this:<br>
<br>
/llvm/src/include/llvm/CodeGen<wbr>/StackMaps.h:35:23:
warning: private field 'MI' is not used
[-Wunused-private-field]<br>
const MachineInstr *MI;<br>
^<br>
</blockquote>
<div><br>
</div>
</span>
<div>We're seeing this too; please fix or revert, this
breaks -Werror builds.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
—
<div>
<div class="h5"><br>
Mehdi<br>
<div>
<div><br>
<br>
> On Aug 23, 2016, at 2:21 PM, Philip
Reames via llvm-commits <<a
moz-do-not-send="true"
href="mailto:llvm-commits@lists.llvm.org"
target="_blank">llvm-commits@lists.llvm.org</a>>
wrote:<br>
><br>
> Author: reames<br>
> Date: Tue Aug 23 16:21:43 2016<br>
> New Revision: 279574<br>
><br>
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project?rev=279574&view=rev"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=279574&view=rev</a><br>
> Log:<br>
> [stackmaps] Extract out magic constants
[NFCI]<br>
><br>
> This is a first step towards clarifying
the exact MI semantics of stackmap's "live
values".<br>
><br>
><br>
> Modified:<br>
> llvm/trunk/include/llvm/CodeGe<wbr>n/StackMaps.h<br>
> llvm/trunk/lib/CodeGen/StackMa<wbr>ps.cpp<br>
> llvm/trunk/lib/CodeGen/TargetI<wbr>nstrInfo.cpp<br>
><br>
> Modified:
llvm/trunk/include/llvm/CodeGe<wbr>n/StackMaps.h<br>
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/StackMaps.h?rev=279574&r1=279573&r2=279574&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/include/llvm/<wbr>CodeGen/StackMaps.h?rev=279574<wbr>&r1=279573&r2=279574&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- llvm/trunk/include/llvm/CodeGe<wbr>n/StackMaps.h
(original)<br>
> +++ llvm/trunk/include/llvm/CodeGe<wbr>n/StackMaps.h
Tue Aug 23 16:21:43 2016<br>
> @@ -22,6 +22,29 @@ class AsmPrinter;<br>
> class MCExpr;<br>
> class MCStreamer;<br>
><br>
> +/// \brief MI-level stackmap operands.<br>
> +///<br>
> +/// MI slackmap operations take the
form:<br>
> +/// <id>, <numBytes>, live
args...<br>
> +class StackMapOpers {<br>
> +public:<br>
> + /// Enumerate the meta operands.<br>
> + enum { IDPos, NBytesPos };<br>
> +<br>
> +private:<br>
> + const MachineInstr *MI;<br>
> +<br>
> +public:<br>
> + explicit StackMapOpers(const
MachineInstr *MI);<br>
> +<br>
> + /// Get the operand index of the
variable list of non-argument operands.<br>
> + /// These hold the "live state".<br>
> + unsigned getVarIdx() const {<br>
> + // Skip ID, nShadowBytes.<br>
> + return 2;<br>
> + }<br>
> +};<br>
> +<br>
> /// \brief MI-level patchpoint
operands.<br>
> ///<br>
> /// MI patchpoint operations take the
form:<br>
><br>
> Modified:
llvm/trunk/lib/CodeGen/StackMa<wbr>ps.cpp<br>
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackMaps.cpp?rev=279574&r1=279573&r2=279574&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/CodeGen/<wbr>StackMaps.cpp?rev=279574&r1=<wbr>279573&r2=279574&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- llvm/trunk/lib/CodeGen/StackMa<wbr>ps.cpp
(original)<br>
> +++ llvm/trunk/lib/CodeGen/StackMa<wbr>ps.cpp
Tue Aug 23 16:21:43 2016<br>
> @@ -35,6 +35,12 @@ static
cl::opt<int> StackMapVersion(<br>
><br>
> const char *StackMaps::WSMP = "Stack
Maps: ";<br>
><br>
> +StackMapOpers::StackMapOpers(<wbr>const
MachineInstr *MI)<br>
> + : MI(MI) {<br>
> + assert(getVarIdx() <=
MI->getNumOperands() &&<br>
> + "invalid stackmap
definition");<br>
> +}<br>
> +<br>
> PatchPointOpers::PatchPointOpe<wbr>rs(const
MachineInstr *MI)<br>
> : MI(MI),
HasDef(MI->getOperand(0).isReg<wbr>()
&& MI->getOperand(0).isDef()
&&<br>
>
!MI->getOperand(0).isImplicit(<wbr>)),<br>
> @@ -343,8 +349,9 @@ void
StackMaps::recordStackMapOpers<wbr>(cons<br>
> void StackMaps::recordStackMap(cons<wbr>t
MachineInstr &MI) {<br>
> assert(MI.getOpcode() ==
TargetOpcode::STACKMAP && "expected
stackmap");<br>
><br>
> - int64_t ID =
MI.getOperand(0).getImm();<br>
> - recordStackMapOpers(MI, ID,
std::next(MI.operands_begin(), 2),<br>
> + StackMapOpers opers(&MI);<br>
> + const int64_t ID =
MI.getOperand(PatchPointOpers:<wbr>:IDPos).getImm();<br>
> + recordStackMapOpers(MI, ID,
std::next(MI.operands_begin(),
opers.getVarIdx()),<br>
>
MI.operands_end());<br>
> }<br>
><br>
> @@ -352,7 +359,7 @@ void
StackMaps::recordPatchPoint(co<wbr>nst M<br>
> assert(MI.getOpcode() ==
TargetOpcode::PATCHPOINT &&
"expected patchpoint");<br>
><br>
> PatchPointOpers opers(&MI);<br>
> - int64_t ID =
opers.getMetaOper(PatchPointOp<wbr>ers::IDPos).getImm();<br>
> + const int64_t ID =
opers.getMetaOper(PatchPointOp<wbr>ers::IDPos).getImm();<br>
><br>
> auto MOI =
std::next(MI.operands_begin(),
opers.getStackMapStartIdx());<br>
> recordStackMapOpers(MI, ID, MOI,
MI.operands_end(),<br>
><br>
> Modified:
llvm/trunk/lib/CodeGen/TargetI<wbr>nstrInfo.cpp<br>
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfo.cpp?rev=279574&r1=279573&r2=279574&view=diff"
rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/CodeGen/<wbr>TargetInstrInfo.cpp?rev=<wbr>279574&r1=279573&r2=279574&<wbr>view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- llvm/trunk/lib/CodeGen/TargetI<wbr>nstrInfo.cpp
(original)<br>
> +++ llvm/trunk/lib/CodeGen/TargetI<wbr>nstrInfo.cpp
Tue Aug 23 16:21:43 2016<br>
> @@ -437,11 +437,15 @@ static
MachineInstr *foldPatchpoint(Mach<br>
>
const TargetInstrInfo &TII) {<br>
> unsigned StartIdx = 0;<br>
> switch (MI.getOpcode()) {<br>
> - case TargetOpcode::STACKMAP:<br>
> - StartIdx = 2; // Skip ID,
nShadowBytes.<br>
> + case TargetOpcode::STACKMAP: {<br>
> + // StackMapLiveValues are foldable<br>
> + StackMapOpers opers(&MI);<br>
> + StartIdx = opers.getVarIdx();<br>
> break;<br>
> + }<br>
> case TargetOpcode::PATCHPOINT: {<br>
> - // For PatchPoint, the call args
are not foldable.<br>
> + // For PatchPoint, the call args
are not foldable (even if reported in the<br>
> + // stackmap e.g. via anyregcc).<br>
> PatchPointOpers opers(&MI);<br>
> StartIdx = opers.getVarIdx();<br>
> break;<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> llvm-commits mailing list<br>
> <a moz-do-not-send="true"
href="mailto:llvm-commits@lists.llvm.org"
target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a moz-do-not-send="true"
href="mailto:llvm-commits@lists.llvm.org"
target="_blank">llvm-commits@lists.llvm.org</a><br>
<a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>