[clang] Performance optimizations for function effects (nonblocking attribute etc.) (PR #96844)
Doug Wyatt via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 26 21:09:48 PDT 2024
================
@@ -3857,9 +3857,19 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
}
epi.ExtInfo.Profile(ID);
- ID.AddInteger((epi.AArch64SMEAttributes << 1) | epi.HasTrailingReturn);
- epi.FunctionEffects.Profile(ID);
+ unsigned EffectCount = epi.FunctionEffects.size();
+ bool HasConds = !epi.FunctionEffects.Conditions.empty();
+
+ ID.AddInteger(
+ (EffectCount << 3) | (HasConds << 2) |
+ (epi.AArch64SMEAttributes << 1) | epi.HasTrailingReturn);
+
+ for (unsigned Idx = 0; Idx != EffectCount; ++Idx) {
+ ID.AddInteger(epi.FunctionEffects.Effects[Idx].toOpaqueInt32());
----------------
dougsonos wrote:
Oops, I forgot to run clang-format.
https://github.com/llvm/llvm-project/pull/96844
More information about the cfe-commits
mailing list