<div dir="ltr">I would probably not do that. It creates a reverse relationship that can create unexpected surprises, for example passing "-mattr=-reserved-x31" would clear the RV32E feature.<div><br></div><div>I would handle it in RISCVRegisterInfo::getReservedRegs or maybe RISCVSubtarget::isRegisterReservedByUser. I would use the latter if it is important that the other callers of isRegisterReservedByUser care about this. Though I think most of those generate an error which might not be what you want.<br><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 9, 2021 at 5:43 AM Ben Shi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div style="margin:0px">Hello,</div><div style="margin:0px"><br></div><div style="margin:0px">Though the ABI / call-convention for rv32e has not be defined clear by the riscv organization. </div><div style="margin:0px"><br></div><div style="margin:0px">But besides that, is it possible to partial support it by adding target feature FeatureReserveX16---FeatureReserveX31 to the FeatureRV32E ?</div><div style="margin:0px">Just like </div><div style="margin:0px"><div style="margin:0px">def FeatureStdExtD</div><div style="margin:0px">    : SubtargetFeature<"d", "HasStdExtD", "true",</div><div style="margin:0px">                       "'D' (Double-Precision Floating-Point)",</div><div style="margin:0px">                       [FeatureStdExtF]>;</div><div style="margin:0px"><br></div><div style="margin:0px">FeatureStdExtD implies FeatureStdExtF, we can make FeatureRV32E implies FeatureReserveX16---FeatureReserveX31 ? </div><div style="margin:0px"><br></div><div style="margin:0px">Is this a proper way to tell the register allocator do not use X16-X31 ?</div><div style="margin:0px"><br></div><div style="margin:0px">Ben</div><div style="margin:0px"><br></div></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>