[Mlir-commits] [mlir] [mlir][emitc] Inline constant when translate (PR #143485)
Matthias Gehre
llvmlistbot at llvm.org
Tue Jun 10 01:48:34 PDT 2025
================
@@ -59,16 +57,12 @@ func.func @two_results() -> (i32, f32) {
return %0, %1 : i32, f32
}
// CPP-DEFAULT: std::tuple<int32_t, float> two_results() {
-// CPP-DEFAULT: int32_t [[V0:[^ ]*]] = 0;
-// CPP-DEFAULT: float [[V1:[^ ]*]] = 1.000000000e+00f;
-// CPP-DEFAULT: return std::make_tuple([[V0]], [[V1]]);
+// CPP-DEFAULT: return std::make_tuple(0, 1.000000000e+00f);
----------------
mgehre-amd wrote:
Do we emit casts to ensure that the integer literal has the right type? Otherwise this will cause template type inference to change. E.g. If `V0` was int64_t here, how would the C++ code look? Maybe you can add a test case to show that
https://github.com/llvm/llvm-project/pull/143485
More information about the Mlir-commits
mailing list