diff --git a/mlir/test/mlir-rocm-runner/vecadd.mlir b/mlir/test/mlir-rocm-runner/vecadd.mlir --- a/mlir/test/mlir-rocm-runner/vecadd.mlir +++ b/mlir/test/mlir-rocm-runner/vecadd.mlir @@ -17,12 +17,20 @@ // CHECK: [2.46, 2.46, 2.46, 2.46, 2.46] func @main() { + %c0 = constant 0 : index + %c1 = constant 1 : index + %c5 = constant 5 : index + %cf1dot23 = constant 1.23 : f32 %0 = alloc() : memref<5xf32> %1 = alloc() : memref<5xf32> %2 = alloc() : memref<5xf32> %3 = memref_cast %0 : memref<5xf32> to memref %4 = memref_cast %1 : memref<5xf32> to memref %5 = memref_cast %2 : memref<5xf32> to memref + scf.for %i = %c0 to %c5 step %c1 { + store %cf1dot23, %3[%i] : memref + store %cf1dot23, %4[%i] : memref + } %6 = memref_cast %3 : memref to memref<*xf32> %7 = memref_cast %4 : memref to memref<*xf32> %8 = memref_cast %5 : memref to memref<*xf32> diff --git a/mlir/test/mlir-rocm-runner/vector-transferops.mlir b/mlir/test/mlir-rocm-runner/vector-transferops.mlir --- a/mlir/test/mlir-rocm-runner/vector-transferops.mlir +++ b/mlir/test/mlir-rocm-runner/vector-transferops.mlir @@ -44,7 +44,11 @@ } func @main() { + %c0 = constant 0 : index + %c1 = constant 1 : index + %c4 = constant 4 : index %cf1 = constant 1.0 : f32 + %cf1dot23 = constant 1.23 : f32 %arg0 = alloc() : memref<4xf32> %arg1 = alloc() : memref<4xf32> @@ -52,6 +56,11 @@ %22 = memref_cast %arg0 : memref<4xf32> to memref %23 = memref_cast %arg1 : memref<4xf32> to memref + scf.for %i = %c0 to %c4 step %c1 { + store %cf1dot23, %22[%i] : memref + store %cf1dot23, %23[%i] : memref + } + %cast0 = memref_cast %22 : memref to memref<*xf32> %cast1 = memref_cast %23 : memref to memref<*xf32>