[Mlir-commits] [mlir] [mlir][emitc] Inline constant when translate (PR #143485)

Jianjian Guan llvmlistbot at llvm.org
Tue Jun 10 02:29:06 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);
----------------
jacquesguan wrote:

Yes, same integer width doesn't mean the same type, so when the user of constant is a call or std::tuple and std::tie, we need emit a explicit type cast around it.

https://github.com/llvm/llvm-project/pull/143485


More information about the Mlir-commits mailing list