[PATCH] D94223: [SelectionDAG] Extend immAll(Ones|Zeros)V to handle ISD::SPLAT_VECTOR

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 01:18:08 PST 2021


frasercrmck added a comment.

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

> New idea, just pick opcode based on the node value type being a scalable vector.
>
> Note, I had to use std::string because getSDNodeNamed takes a const std::string &. I'll investigate changing it to StringRef. We only ever call it with string literals so it's dumb to force a std::string temporary.

Oh, neat! That hadn't occurred to me; I wasn't in the TableGen headspace. I was thinking last night that it's not ideal to add "redundant" SPLAT_VECTOR code to other targets' tables, so I like that your idea avoids that. I would prefer if it could act identically on both opcodes (and it would make the RVV fixed-length implementation simpler if we could assume splats everywhere) but I think the fixed-length<->BUILD_VECTOR relationship goes quite deep for obvious reasons so it's probably not achievable.

I'll add your idea to this patch if that's alright.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94223



More information about the llvm-commits mailing list