[llvm] [clang] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

Paulo Matos via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 3 00:45:44 PDT 2023


pmatos wrote:

> @pmatos If you don't want to go all the way to target extension types, is it possible to gracefully handle this in wasm's TTI cost model? Return an invalid or very high cost in this case?

Unfortunately that actually doesn't work. We never get to the point of calculating a cost because before doing that we calculate in `SLPVectorizerPass::tryToVectorizeList` we call `TTI->getNumberOfParts(VecTy)`. It's deep inside getNumberOfParts that we fail because we cannot calculate how many parts there are. Which is fair enough, since we build a vector of externref that can't be built. Only later in the function we try to calculate the cost but by then we have asserted long before.

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


More information about the cfe-commits mailing list