[Mlir-commits] [mlir] 0298f2c - [mlir] Fix wrong type in WmmaConstantOpToNVVMLowering
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jun 30 09:11:24 PDT 2021
Author: thomasraoux
Date: 2021-06-30T09:10:02-07:00
New Revision: 0298f2cfb1df80741a08fb7cd1eec9da70ed3441
URL: https://github.com/llvm/llvm-project/commit/0298f2cfb1df80741a08fb7cd1eec9da70ed3441
DIFF: https://github.com/llvm/llvm-project/commit/0298f2cfb1df80741a08fb7cd1eec9da70ed3441.diff
LOG: [mlir] Fix wrong type in WmmaConstantOpToNVVMLowering
InsertElement takes a scalar integer attribute not an array of integer.
Differential Revision: https://reviews.llvm.org/D105174
Added:
Modified:
mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir
Removed:
################################################################################
diff --git a/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp b/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
index d46a185dec22c..d955673d4b898 100644
--- a/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
+++ b/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
@@ -371,7 +371,7 @@ struct WmmaConstantOpToNVVMLowering
for (int64_t vecEl = 0; vecEl < vecType.getNumElements(); vecEl++) {
Value idx = rewriter.create<LLVM::ConstantOp>(
loc, typeConverter->convertType(rewriter.getIntegerType(32)),
- rewriter.getI32ArrayAttr(vecEl));
+ rewriter.getI32IntegerAttr(vecEl));
vecCst = rewriter.create<LLVM::InsertElementOp>(loc, vecType, vecCst,
cst, idx);
}
diff --git a/mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir b/mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir
index f692dffdfcbad..6eb641b0e897a 100644
--- a/mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir
+++ b/mlir/test/Conversion/GPUToNVVM/wmma-ops-to-nvvm.mlir
@@ -160,9 +160,9 @@ gpu.module @test_module {
// CHECK-LABEL: func @gpu_wmma_constant_op
// CHECK: %[[CST:.+]] = llvm.mlir.constant(1.000000e+00 : f16) : f16
// CHECK: %[[V0:.+]] = llvm.mlir.undef : vector<2xf16>
-// CHECK: %[[C0:.+]] = llvm.mlir.constant([0 : i32]) : i32
+// CHECK: %[[C0:.+]] = llvm.mlir.constant(0 : i32) : i32
// CHECK: %[[V1:.+]] = llvm.insertelement %[[CST]], %[[V0]][%[[C0]] : i32] : vector<2xf16>
-// CHECK: %[[C1:.+]] = llvm.mlir.constant([1 : i32]) : i32
+// CHECK: %[[C1:.+]] = llvm.mlir.constant(1 : i32) : i32
// CHECK: %[[V2:.+]] = llvm.insertelement %[[CST]], %[[V1]][%[[C1]] : i32] : vector<2xf16>
// CHECK: %[[M0:.+]] = llvm.mlir.undef : !llvm.struct<(vector<2xf16>, vector<2xf16>, vector<2xf16>, vector<2xf16>)>
// CHECK: %[[M1:.+]] = llvm.insertvalue %[[V2]], %[[M0]][0 : i32] : !llvm.struct<(vector<2xf16>, vector<2xf16>, vector<2xf16>, vector<2xf16>)>
More information about the Mlir-commits
mailing list