<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jan 5, 2018 at 12:51 AM Leslie Zhai 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi LLVM developers,<br>
<br>
Does it need to implement <Target>RetpolineThunksPass,<br>
`getOpcodeForRetpoline`, `EmitLoweredRetpoline`, etc. for other Targets?<br>
Or does it also need to implement `RetpolinePic` to inherit from<br>
<Target> for LLD's Backends? Alex is my mentor, he is leading me to<br>
maintain RISCV target, so I have such question, please give me<br>
suggestions, thanks for your teaching!<br></blockquote><div><br></div><div>What you need will highly depend on the architecture. We've worked to ensure this is effective on x86, but other architectures may need different approaches or may desire different approaches for performance.</div><div><br></div><div>If you read the support article linked in the commit log that describes retpoline's strategy in much more detail, you can see the criteria that determine whether it would be effective for a particular architecture.</div><div><br></div><div>That said, about the only thing that I suspect would be usefully shared in terms of code will be the feature flags. The implementation is pretty much 100% target-specific anyways. We could factor a few minor things if it proves useful.</div><div><br></div><div>That said -- I would also only use the term `retpoline` if you in fact build a return-based trampoline as the mitigation. Other potential mitigation code sequences would (IMO) be better named something else.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--<br>
Regards,<br>
Leslie Zhai - <a href="https://reviews.llvm.org/p/xiangzhai/" rel="noreferrer" target="_blank">https://reviews.llvm.org/p/xiangzhai/</a><br>
<br>
<br>
<br>
_______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>