[clang] [RISCV] Reduce the size of the index used for RVV intrinsics. NFC (PR #74906)

Philip Reames via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 11:16:29 PST 2023


preames wrote:

> > LGTM - though maybe use uint32_t?
> > Looking at this code, the whole Intrinsics map vs OverloadIntrinsic map structure loops to have heavy redundancy and could be greatly simplified. Maybe a follow up?
> 
> Did you have a specific idea in mind? Maybe we could use a single map and use the size of the vector being more than 1 to detect overloaded?
> 
> I'm skeptical that the `8` is the correct inline space for the SmallVector in OverloadedIntrinsicMap.

That's basically where I was going.  We track every name to index mapping twice, and we really only need to do so once.  Maybe the cost of a SmallVector<uint32_t, 1> is high enough to be worth two structures, but then why not have a signal value in the primary map and a much smaller index keyed overload structure?

https://github.com/llvm/llvm-project/pull/74906


More information about the cfe-commits mailing list