diff --git a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp --- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp @@ -1729,6 +1729,7 @@ using OrOpLowering = VectorConvertToLLVMPattern; using PowFOpLowering = VectorConvertToLLVMPattern; using RemFOpLowering = VectorConvertToLLVMPattern; +using SIToFPOpLowering = VectorConvertToLLVMPattern; using SelectOpLowering = VectorConvertToLLVMPattern; using SignExtendIOpLowering = VectorConvertToLLVMPattern; @@ -3112,11 +3113,6 @@ } }; -struct SIToFPLowering - : public OneToOneConvertToLLVMPattern { - using Super::Super; -}; - struct UIToFPLowering : public OneToOneConvertToLLVMPattern { using Super::Super; @@ -3922,7 +3918,7 @@ RemFOpLowering, ReturnOpLowering, RsqrtOpLowering, - SIToFPLowering, + SIToFPOpLowering, SelectOpLowering, ShiftLeftOpLowering, SignExtendIOpLowering, diff --git a/mlir/test/Conversion/StandardToLLVM/convert-nd-vector-to-llvmir.mlir b/mlir/test/Conversion/StandardToLLVM/convert-nd-vector-to-llvmir.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-nd-vector-to-llvmir.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-nd-vector-to-llvmir.mlir @@ -47,3 +47,16 @@ %0 = zexti %arg0: vector<1x2x3xi32> to vector<1x2x3xi64> return } + +// CHECK-LABEL: @sitofp +func @sitofp_vector(%arg0 : vector<1x2x3xi32>) -> vector<1x2x3xf32> { + // CHECK: llvm.mlir.undef : !llvm.array<1 x array<2 x vector<3xf32>>> + // CHECK: llvm.extractvalue %{{.*}}[0, 0] : !llvm.array<1 x array<2 x vector<3xi32>>> + // CHECK: llvm.sitofp %{{.*}} : vector<3xi32> to vector<3xf32> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0, 0] : !llvm.array<1 x array<2 x vector<3xf32>>> + // CHECK: llvm.extractvalue %{{.*}}[0, 1] : !llvm.array<1 x array<2 x vector<3xi32>>> + // CHECK: llvm.sitofp %{{.*}} : vector<3xi32> to vector<3xf32> + // CHECK: llvm.insertvalue %{{.*}}, %{{.*}}[0, 1] : !llvm.array<1 x array<2 x vector<3xf32>>> + %0 = sitofp %arg0: vector<1x2x3xi32> to vector<1x2x3xf32> + return %0 : vector<1x2x3xf32> +}