[PATCH] D37431: [X86] Mark the FMA nodes as commutable so tablegen will auto generate the patterns.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 3 15:41:36 PDT 2017


craig.topper created this revision.

This uses the capability proposed in https://reviews.llvm.org/D37430 to make SDNode patterns commutable on the first two operands.

This allows us to remove some of the extra FMA patterns that have to put loads and mask operands in different places to cover all cases. This even includes patterns that were missing to support match a load in the first operand with FMA4. Non-broadcast loads with masking for AVX512.

I believe this is causing us to generate some duplicate patterns because tablegen's isomorphism checks don't catch isomorphism between the patterns as written in the td. It only detects isomorphism in the commuted variants it tries to create. The the unmasked 231 and 132 memory forms are isomorphic as written in the td file so we end up keeping both. I think we precommute the 132 pattern to fix this.

We also need a follow up patch to go back to the legacy FMA3 instructions and add patterns to the 231 and 132 forms which we currently don't have.


https://reviews.llvm.org/D37431

Files:
  lib/Target/X86/X86InstrAVX512.td
  lib/Target/X86/X86InstrFMA.td
  lib/Target/X86/X86InstrFragmentsSIMD.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37431.113714.patch
Type: text/x-patch
Size: 11394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170903/24da0547/attachment.bin>


More information about the llvm-commits mailing list