<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Alex,</div><div class=""><br class=""></div>I can't say I'm happy that this is the case* but the SelectionDAG importer does honour AddedComplexity. When it's sorting the rules, the complexity score that SelectionDAG would have used has precedence over the priority that GlobalISel uses. I ended up having to give in on my opposition to using the complexity scores after we had a very hard time resolving ordering differences on an out of tree target that was using AddedComplexity a lot (pretty much everywhere) to fix up SelectionDAG's scheme<div class=""><br class=""></div><div class="">*I dislike the way AddedComplexity tweaks an already dubious scoring system using magic numbers.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 22, 2019, at 09:21, via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 12px;" class="">Hi all,<br class=""><br class="">I have two GIComplexOperandMatchers, one that takes [base(gpr)+offset(imm)], another that takes (global address inc offset) directly. It's quite possible that I'm not doing things the right way(tm) by having these, but they seem to be making the transition easier.<br class=""><br class=""><div class="">However, because these patterns are look identical to the parser, tablegen seems to give them both equal preference - yet in all instances, the direct memory addressing variant ought be preferred over the one that requires a pointer register. I'm 99% sure that <span style="float: none; background-color: rgb(255, 255, 255); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; word-spacing: 0px;" class="">AddedComplexity is ignored by GlobalISel, and from </span>quick look through GlobalISelEmitter.cpp I cannot find any alternative. Preferably, such an alternative would be applied to Operands, at that (maybe asking a bit much).</div><div class=""><br class=""></div><div class="">Before I go about renaming things such that alphabetical ordering gives me the results I want or hacking in a similar workaround, just want to check... is there a method I've missed for preferencing one pattern over another currently?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Alex Davies</div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>