[PATCH] D128241: [AMDGPU] Use AddedComplexity for ret and noret atomic ops selection

Abinav Puthan Purayil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 10:24:21 PDT 2022


abinavpp added a comment.

In D128241#3632670 <https://reviews.llvm.org/D128241#3632670>, @arsenm wrote:

> In D128241#3632654 <https://reviews.llvm.org/D128241#3632654>, @abinavpp wrote:
>
>> I don't think I understood the question. I set the AddedComplexity in such a way that no-return matches are always done first since we're only adding predicates for those. By "default complexity", are we talking about getting PatternToMatch::getPatternComplexity() in CodeGenDagPatterns to give higher complexity to patterns with HasNoUse predicates?
>
> Yes. I thought predicates boosted the complexity, such that this would work out by default:
>
>   // If this node has some predicate function that must match, it adds to the
>   // complexity of this node.
>   if (!P->getPredicateCalls().empty())
>     ++Size;

Right, but I don't think we can rely on the the size of getPredicateCalls() here since (most of?) the return and no return atomic ops have one "predicate call" that does the address space check, memory-vt check and the no use check (if it's a no-return one). I'm not sure if there's a simple way to get the number of predicates specified in tablegen from TreePredicateFn other than calling each of its predicate checking functions (TreePredicateFn::isLoad(), TreePredicateFn::getMemoryVT() etc.).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128241/new/

https://reviews.llvm.org/D128241



More information about the llvm-commits mailing list