[llvm] [mlir] [mlir][emitc] Arith to EmitC conversion: constants (PR #83798)
Simon Camphausen via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 07:20:14 PST 2024
================
@@ -1,37 +1,6 @@
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP
-func.func @std_constant() {
- %c0 = arith.constant 0 : i32
- %c1 = arith.constant 2 : index
- %c2 = arith.constant 2.0 : f32
- %c3 = arith.constant dense<0> : tensor<i32>
- %c4 = arith.constant dense<[0, 1]> : tensor<2xindex>
- %c5 = arith.constant dense<[[0.0, 1.0], [2.0, 3.0]]> : tensor<2x2xf32>
----------------
simon-camp wrote:
Can you convert these into `emitc.constants`and add them [here](https://github.com/llvm/llvm-project/blob/9e0f5909d0af3911b19bb1f97fb400c3ce431f63/mlir/test/Target/Cpp/const.mlir#L11)
https://github.com/llvm/llvm-project/pull/83798
More information about the llvm-commits
mailing list