[Mlir-commits] [mlir] [acc] Add an API to make private recipes out of firstprivate recipes (PR #170588)
Razvan Lupusoru
llvmlistbot at llvm.org
Thu Dec 4 08:11:46 PST 2025
razvanlupusoru wrote:
> When generating a private recipe, the language lowering will generate the default initialization, while when making a firstprivate recipe, it could skip that part in the init since the the value will be copy constructed in the the copy region.
This is indeed correct for CIR lowering - the init region does not call the default constructor in firstprivate recipes init region (but it does in the private recipes init region).
> One thing to point is that this assumes that the language lowering generates the same init region for a private and a firstprivate, and there is one case where I think this may not always be true which is the case of types with default initialization.
It would be more precise to say that the existence of this API suggests that it is safe to use the init region from Firstprivate recipe in Private recipe. However, it is not the burden of the API to determine this IMO, it is the burden of the caller to consider whether this would be safe. That said, you bring a valid point so having some documentation to cover potential misuse. Would this ameliorate your concern some?
https://github.com/llvm/llvm-project/pull/170588
More information about the Mlir-commits
mailing list