This patch adds the conversion patterns to lower masked reduction
operations to the corresponding vp intrinsics in LLVM.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp | ||
---|---|---|
482–504 | Is this consistent with the NaN-propagation semantics of the related intrinsics? (I would expect negative/positive infinity as neutral for max/min). | |
794–824 | Do you expect other uses for this? Otherwise, it can be merged into its only derived class. |
Thanks for the review!
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp | ||
---|---|---|
482–504 | Good point! The doc says: The neutral value is dependent on the fast-math flags. If no flags are set, the neutral value is -QNAN. If nnan and ninf are both set, then the neutral value is the smallest floating-point value for the result type. If only nnan is set then the neutral value is -Infinity. so I thought -QNAN would be the best fit for now until the min/max semantics in MLIR are revisited: https://discourse.llvm.org/t/rfc-explicitly-specifying-nan-and-signed-zero-semantics-for-minf-and-maxf/67539/25. Happy to change it if I'm missing something! | |
794–824 | Yep, that's the idea. Any other masked vector op, or llvm op in general will implement a subclass. |
Is this consistent with the NaN-propagation semantics of the related intrinsics? (I would expect negative/positive infinity as neutral for max/min).