[PATCH] D76705: [SystemZ] Improve foldMemoryOperandImpl: vec->FP conversions

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 06:56:45 PDT 2020


jonpa updated this revision to Diff 263157.
jonpa added a comment.

> Can we instead move the W->FP mnemonic conversion back into BinaryVRRa/TernaryVRRe instead, so that the OpKey for all these vector instructions consistently holds the FP-reg instruction name? The MemFold-pseudos would then have the same mnemonic as OpKey and MemKey.
> 
>   ... Ah, that still runs into the same name collisions with the MemFold pattern as you pointed out earlier. Sorry for missing that!

Yeah, WFADB:ADBR would map to ADB, and not ADB_MemFoldPseudo which is what we need...

> So if we use an extra modifier in the OpKey for those case, then we're basically back to your version of Apr 28, 7:15 PM, except possibly with the explicit mnemonics in the .td file.

Ok, went back to that version plus added the explicit fp_mnemonic fields, which seems nice to me as they eliminate those ugly string substitutions.

> Hmm, talking about MemFold, I'm wondering about this:

​>  // Fused multiply and add/sub need to have the same dst and accumulator reg.

> Given that this check is necessary, what's then the point of having a MemFold for those ternary instructions in the first place? Can't we then directly emit the target instruction?

I believe this follows the same pattern as the other MemFold cases: A WFMADB has four register operands, which all may be different virtual registers at this point. In the case where we find that DstReg and AccReg has already been allocated to the same physical register, we proceed with a MemFold pseudo. The register allocator may still however evict live ranges and reallocate these operands, which is why we can't go directly to MADB.


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

https://reviews.llvm.org/D76705

Files:
  llvm/lib/Target/SystemZ/SystemZInstrFP.td
  llvm/lib/Target/SystemZ/SystemZInstrFormats.td
  llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
  llvm/lib/Target/SystemZ/SystemZInstrVector.td
  llvm/test/CodeGen/SystemZ/foldmemop-vec-binops.mir
  llvm/test/CodeGen/SystemZ/foldmemop-vec-cc.mir
  llvm/test/CodeGen/SystemZ/foldmemop-vec-cmp.mir
  llvm/test/CodeGen/SystemZ/foldmemop-vec-fusedfp.mir
  llvm/test/CodeGen/SystemZ/foldmemop-vec-unary.mir
  llvm/test/CodeGen/SystemZ/int-cmp-56.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76705.263157.patch
Type: text/x-patch
Size: 168253 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200511/864dc787/attachment.bin>


More information about the llvm-commits mailing list