hliao added a comment. In D89980#2371966 <https://reviews.llvm.org/D89980#2371966>, @arsenm wrote:
> In D89980#2371952 <https://reviews.llvm.org/D89980#2371952>, @hliao wrote: > >> In D89980#2371850 <https://reviews.llvm.org/D89980#2371850>, @arsenm wrote: >> >>> This should use byref, but I don't think this should come at the cost of >>> the promotion. I would still like to see this promotion occur for the >>> in-memory byref type >> >> Once we use `byref`, that in-memory byref type has no way to be preserved >> based on C model as it will be treated as a local variable. The initial >> value with the coerced type won't be preserved after that. That happens to >> the case with static index as well, but the promotion helps to build the >> chain from the initial value to the final use. But, if we cannot promote >> `alloca` finally, we lost that information or cannot assume that. > > Then the promotion can also be applied to the temporary argument slot That's not safe to do that in the frontend as all arguments are local variables as well. They may be modified later. Such an assumption (pointers from argument is GLOBAL or CONSTANT) won't hold anymore. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89980/new/ https://reviews.llvm.org/D89980 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits