[PATCH] D128097: [Clang] Fix compile time regression caused by D126061.

Dawid Jurczak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 23 03:18:46 PDT 2022


yurai007 added a comment.

Disclaimer: I'm not front-end guy.

After running 7zip benchmark under perf and comparing origin (7acc88be031 <https://reviews.llvm.org/rG7acc88be0312c721bc082ed9934e381d297f4707>) with fix (0d300da799b0 <https://reviews.llvm.org/rG0d300da799b06931eb6b974198d683548a8c8392>) following diff can be seen:

Instructions change  |	Symbol
+0.12% 		     	   |     clang::Preprocessor::getMacroDefinition 
+0.07% 			   |     GetDeclSpecTypeForDeclarator 
+0.04% 			   |     clang::Parser::ParseDirectDeclarator 
+0.03% 			   |     clang::Sema::ActOnFunctionDeclarator 
+0.03% 			   |     clang::Sema::ProcessDeclAttributes

In 8c7b64b5ae2a <https://reviews.llvm.org/rG8c7b64b5ae2a09027c38db969a04fc9ddd0cd6bb> commit those 2 code changes catch my eyes as (maybe) relevant to above perf diff:

1. Change in Parser::ParseDeclGroup. That function looks quite heavy and it's caller of ParseDirectDeclarator/ActOnFunctionDeclarator (and even getMacroDefinition?)
2. Change in GetDeclSpecTypeForDeclarator. After 8c7b64b5ae2a <https://reviews.llvm.org/rG8c7b64b5ae2a09027c38db969a04fc9ddd0cd6bb> distributeTypeAttrsFromDeclarator is called unconditionally which maybe matters.

Hope it helps a bit in finding proper solution for slowdown.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128097/new/

https://reviews.llvm.org/D128097



More information about the cfe-commits mailing list