@javiersetoain Thanks for the detailed explanation.
Yes, it depends on your purpose @tju_panyizhe
From my perspective, mapping C intrinsics to MLIR dialect operations somewhat resembles raising the abstraction level (going from LLVM IR to MLIR).
The original motivation for working on the RVV dialect and using VP intrinsics was not to interface with C intrinsics. The goal from my side was to compile higher-level MLIR IR (e.g., Linalg) into RVV-specific dialect, and eventually generate better RISC-V code.
We maintain an implementation in buddy-mlir. In my experience, using an RVV dialect setvl operation together with VP intrinsics can cover many scenarios, and the scalable vector type can help implicitly control LMUL.
In my use cases, there are no significant issues. (There were some code generation problems in very early stage, but those have already been resolved.)
@tju_panyizhe Hope this helps. Feel free to reach out if you have further questions.