[PATCH] D44704: [GlobalISel][X86][ARM] Relaxing type constraints on G_SHL and friends

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 15:33:16 PDT 2018


dsanders added a comment.

It's worth mentioning that:

  %1:_(s64) = G_INTTOPTR %0(<4 x s16>)

isn't a valid G_INTTOPTR. The result should be a pointer type and the input should be a scalar. However, your point stands even with that fixed.

The first problem is that it should be using the pair version of legalFor() like so:

  .legalFor({{s64, p0}});

I see your point that it's too easy to mix these two overloads up at the moment:

  LegalizeRuleSet &legalFor(std::initializer_list<LLT> Types);
  LegalizeRuleSet &legalFor(std::initializer_list<std::pair<LLT, LLT>> Types);

A partial fix would be to rename the latter legalForPair() or similar which would make it easier to spot but even then we'd still want something to make sure we don't mix up legalFor() and legalForPair()

The next problem is that the types are backwards. It should be:

  .legalFor({{p0, s64}});


Repository:
  rL LLVM

https://reviews.llvm.org/D44704





More information about the llvm-commits mailing list