[PATCH] D106512: [RISCV] Remove the _COMMUTABLE and _TA versions of FMA and wide FMA vector instructions.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 29 01:51:21 PDT 2021


frasercrmck accepted this revision.
frasercrmck added a comment.
This revision is now accepted and ready to land.

In D106512#2907644 <https://reviews.llvm.org/D106512#2907644>, @craig.topper wrote:

> In D106512#2906965 <https://reviews.llvm.org/D106512#2906965>, @frasercrmck wrote:
>
>> I'm a bit concerned that LLVM has (at least in theory) the right to assume these instructions are commutable by checking the static `MI.isCommutable()` method without asking us about the tail policy. Maybe that's academic, I dunno.
>
> There's no guarantee that the first two operands are commutable. So I think any user of isCommutable() needs to call findCommutedOpIndices. X86 has checks for specific immediate values for vectors compares and vector shuffles in its implementation of findCommutedOpIndices.

Fair enough, yeah. It's just a fairly unclear contract that's being entered into when you set some of these properties in TableGen, if you ask me. It's encouraging that we're not the only backend that would be affected if someone interpreted `isCommutable` as doing what it says on the tin.

LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106512



More information about the llvm-commits mailing list