Create dedicated isBaseOf method without calculating
distance.
Tested on RISCVISelDAGToDAG.cpp with:
clang-tidy --checks=*,-bugprone-unchecked-optional-access
Amount of CPU cycles for isBaseOf reduced by ~15% (according to perf).
Paths
| Differential D149518
[clang][NFC] Optimize clang::ASTNodeKind::isBaseOf ClosedPublic Authored by PiotrZSL on Apr 29 2023, 7:42 AM.
Details Summary Create dedicated isBaseOf method without calculating Tested on RISCVISelDAGToDAG.cpp with: Amount of CPU cycles for isBaseOf reduced by ~15% (according to perf).
Diff Detail
Event TimelineComment Actions Lookup matrix gives best result (~-80%), but it consume lot of memory due to big amount of enumerators (~950). Comment Actions Oh wow, I'm surprised that calculating the distance has that much compile time impact. Great catch! Please add NFC to the commit summary so folks know why there are no tests. LGTM! This revision is now accepted and ready to land.May 5 2023, 10:30 AM PiotrZSL retitled this revision from [clang] Optimize clang::ASTNodeKind::isBaseOf to [clang][NFC] Optimize clang::ASTNodeKind::isBaseOf.May 5 2023, 10:40 AM This revision was landed with ongoing or failed builds.May 6 2023, 5:22 AM Closed by commit rGc3d16514d061: [clang][NFC] Optimize clang::ASTNodeKind::isBaseOf (authored by PiotrZSL). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 520073 clang/include/clang/AST/ASTTypeTraits.h
clang/lib/AST/ASTTypeTraits.cpp
|