[clang] [Clang] Remove unnecessary Decl transform & profiles for SizeOfPackExpr (PR #124533)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 27 23:58:06 PST 2025
zyn0217 wrote:
@shafik @AaronBallman Here is the complete backstory:
We were not performing well in out-of-line concept comparison, especially for expressions involving packs. I tried to address these issues around commit 04d20b170, but it quickly became evident that the fix was insufficient for https://github.com/llvm/llvm-project/issues/101735. To resolve that, we harnessed a feature that TreeTransform would expand function parameters if the parameters were instantiated as a pack, rather than keeping them in non-expanded forms.
That solution (developed during the 20 cycle and backported to 19) worked but introduced a pitfall: if we needed to transform a pack declaration within an expression, we would also need a valid ArgumentPackSubstitutionIndex to expand the pack.
Shortly after, I addressed #93099 (also during the 20 development cycle), where a SizeOfPackExpr was improperly profiled for constraint comparison due to its declaration being non-transformed. To that end, I added a declaration transformation step when normalizing constraints. Combined with the previously mentioned pitfall, this again crashed #124161 since no ArgumentPackSubstitutionIndex was set.
Technically, this should have worked at some point, as @shafik observed, which I believe was prior to the fix for #93099. And as far as I can tell, the latest crash was introduced by the fix for #93099, so I didn’t add a release note as usual.
https://github.com/llvm/llvm-project/pull/124533
More information about the cfe-commits
mailing list