================ @@ -3,9 +3,32 @@ // CHECK: acc.reduction.recipe @reduction_lor__ZTSA5_f : !cir.ptr<!cir.array<!cir.float x 5>> reduction_operator <lor> init { // CHECK-NEXT: ^bb0(%[[ARG:.*]]: !cir.ptr<!cir.array<!cir.float x 5>>{{.*}}) -// CHECK-NEXT: cir.alloca !cir.array<!cir.float x 5>, !cir.ptr<!cir.array<!cir.float x 5>>, ["openacc.reduction.init"] -// TODO OpenACC: Expecting an initialization to... SOME value here. +// CHECK-NEXT: %[[ALLOCA:.*]] = cir.alloca !cir.array<!cir.float x 5>, !cir.ptr<!cir.array<!cir.float x 5>>, ["openacc.reduction.init", init] +// CHECK-NEXT: %[[TEMP_ITR:.*]] = cir.alloca !cir.ptr<!cir.float>, !cir.ptr<!cir.ptr<!cir.float>>, ["arrayinit.temp"] +// CHECK-NEXT: %[[DECAY:.*]] = cir.cast(array_to_ptrdecay, %[[ALLOCA]] : !cir.ptr<!cir.array<!cir.float x 5>>), !cir.ptr<!cir.float> +// CHECK-NEXT: %[[ZERO_INT:.*]] = cir.const #cir.int<0> : !s32i +// CHECK-NEXT: %[[ZERO:.*]] = cir.cast(int_to_float, %[[ZERO_INT]] : !s32i), !cir.float ---------------- andykaylor wrote:
This seems wrong. We're initializing the first element of the array to `(float)(int)(0)` but then the rest of the array gets initialized to `(float)0.0`? I think this is happening because you constructed an ILE with a single integer zero element. Could you have just constructed an empty list and gotten consistent zero-initialization for every element? https://github.com/llvm/llvm-project/pull/155924 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits