Unroll ops that map to intrinsics when lowering to LLVM, because intrinsics don't support vector operands/results.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Just passing by :). It looks like this is scalarizing a vector operation which sounds like a generic utility that might be worth moving out of GPU? Perhaps VectorUtils.h is a good place?
I'm also wondering if we already have something like that already since we have some vector unrolling transformations to unroll multi-dim vectors into 1-d vectors. Maybe the can be extended and parametrized to how many dims we want to unroll, including all of them? Otherwise, we may want to call this scalarizeVectorOp or something like that?
Hopefully that helps!
Thanks Diego.
I think the vector unroll code should be the generic one, and these rewrites are merely to cope with intrinsics not being available for vectors.
I like scalarizeVectorOp.
Switch from lambda to template function: uglier formatting, but no uncommon c++ pattern.
mlir/lib/Conversion/GPUCommon/GPUOpsLowering.h | ||
---|---|---|
88 | nit: operating on |
nit: operating on