Adds an integer absolute value op to the math dialect.
When converting to LLVM, this op is lowered to the LLVM abs intrinsic.
When converting to SPIRV, this op is lowered to spv.GL.SAbs.
Depends on D131325
Paths
| Differential D131327
[mlir][math] Add `math.absi` op ClosedPublic Authored by Mogball on Aug 6 2022, 9:12 AM.
Details
Summary Adds an integer absolute value op to the math dialect. When converting to LLVM, this op is lowered to the LLVM abs intrinsic. Depends on D131325
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Aug 8 2022, 6:11 AM This revision was landed with ongoing or failed builds.Aug 8 2022, 8:05 AM Closed by commit rG7d9fc95b85c4: [mlir][math] Add `math.absi` op (authored by Mogball). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 450811 mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
mlir/include/mlir/Dialect/Math/IR/MathOps.td
mlir/lib/Conversion/MathToLLVM/MathToLLVM.cpp
mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
mlir/lib/Dialect/Math/IR/MathOps.cpp
mlir/test/Conversion/MathToLLVM/math-to-llvm.mlir
mlir/test/Conversion/MathToSPIRV/math-to-gl-spirv.mlir
|
Did you test this end-to-end? The actual intrinsic takes an extra parameter
declare i32 @llvm.abs.i32(i32 <src>, i1 <is_int_min_poison>)
so I am not sure this will actually execute properly when using the execution engine on the resulting LLVM IR?