[Mlir-commits] [mlir] [mlir][EmitC]Allow Fields to have initial values (PR #151437)
Paul Kirth
llvmlistbot at llvm.org
Thu Jul 31 07:48:03 PDT 2025
================
@@ -39,13 +37,46 @@ emitc.class final @finalClass {
// CHECK-LABEL: class finalClass final {
// CHECK-NEXT: public:
-// CHECK-NEXT: float[1] fieldName0;
-// CHECK-NEXT: float[1] fieldName1;
+// CHECK-NEXT: float fieldName0[1];
+// CHECK-NEXT: float fieldName1[1];
// CHECK-NEXT: void execute() {
// CHECK-NEXT: size_t v1 = 0;
-// CHECK-NEXT: float[1] v2 = fieldName0;
-// CHECK-NEXT: float[1] v3 = fieldName1;
// CHECK-NEXT: return;
----------------
ilovepi wrote:
These seem to go away, but I'm not sure what in this change causes that, given that you didn't change the input IR w/ an initial value. I can see that you're changing how the fields are printed, but that doesn't seem to be related to these statements. What part of this changes removed these? Should these assignments have been removed(I assume yes)? Do you need some calculation in `execute()` to keep those alive, or show the usage of the fields (e.g. `float x = v3[0] + v2[0]`)?
https://github.com/llvm/llvm-project/pull/151437
More information about the Mlir-commits
mailing list