<div dir="ltr"><div class="gmail_default" style="font-size:small">Yes, starting from <span style="font-size:12.8px">X86DAGtoDAGISel::selectAddr, the code calls </span><span style="font-size:12.8px">X86DAGtoDAGISel::selectAddr to resolve the address mode. </span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">But it seems there is no centralized control on the address mode. Have to patch the code in several places. </span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">Regards,</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">Hu Hong</span></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 October 2016 at 01:45, Bruce Hoult <span dir="ltr"><<a href="mailto:bruce@hoult.org" target="_blank">bruce@hoult.org</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">For some definition of "starts" :-)<div><br></div><div>Looks like X86DAGToDAGISel::<wbr>MatchAddressRecursively is the actual thing to hack up.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 17, 2016 at 6:13 PM, Craig Topper via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@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">I think the code your looking for starts at X86DAGtoDAGISel::selectAddr in X86ISelDAGtoDAG.cpp.<span><div><span></span><br>On Monday, October 17, 2016, Hong Hu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small">Hi Bruce,</div><div style="font-size:small"><br></div><div style="font-size:small">Thanks for you reply. </div><div style="font-size:small"><br></div><div style="font-size:small">I check the *.td files under the lib/Target/X86 folder, but have not got interesting findings. It requires some knowledge of LLVM backend to fully understand the *.td files. I will get some background and keep searching.</div><div style="font-size:small"><br></div><div style="font-size:small">Of course I appreciate if anyone with such experience can point the concrete locations. </div><div style="font-size:small"><br></div><div style="font-size:small">Regards,</div><div style="font-size:small">Hu Hong</div><div class="gmail_extra"><br><div class="gmail_quote">On 17 October 2016 at 22:20, Bruce Hoult <span dir="ltr"><<a>bruce@hoult.org</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">For experimental purposes, you should be able to just go into lib/Target/X86 and remove the patterns in .td files (or maybe some .cpp .. I'm not familiar with the X86 mechanisms) that map to base+index addressing modes.<div><br></div><div>Then the compiler will automatically use some extra temporary register to calculate intermediate addresses.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Oct 17, 2016 at 5:51 AM, Hong Hu via llvm-dev <span dir="ltr"><<a>llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div style="font-size:small"><div>Hi All,</div><div><br></div><div>I have a question regarding LLVM backend. I appreciate a lot if anyone can provide some hints. </div><div><br></div><div>My work here is to avoid base+index address mode for X86 target, to allow base-register only or index-register only address mode. For example, </div><div>"mov (%rsi), %rbx" is allowed, but "mov (%rsi, %rax), %rbx" is not allowed.</div><div><br></div><div>I understand LLVM backend is a complex system. Can any one help point out which subsystem I should look into to solve my question? </div><div>  </div><div style="font-size:12.8px"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Regards,<div>Hu Hong</div></div></div></div></div></div></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a>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/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>
</blockquote></div><br><br>-- <br></span>~Craig<br>
<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>