[PATCH] D114394: Compile-time computation of string attribute hashes
    Reid Kleckner via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Dec 14 16:49:25 PST 2021
    
    
  
rnk added a comment.
That's interesting, somehow clang spends 1% of its time for sqlite3 in attribute lookup. I wonder how we ended up doing so much string-based attribute lookup. These were not really ever intended to be used for anything semantically interesting for the middle end, they were designed as a way to pass through uninteresting target-specific details like SSE features through to the backend. I guess what happened next is that we added rules to the inliner to block inlining between functions with mismatched CPU features, and that's where these string attribute lookups are coming from. Perhaps there's a design lesson here.
Regarding LLVMGetStringAttributeAtIndex and the C API, I don't imagine that most non-C++ frontends do a lot of attribute lookups. They mainly generate IR. I think, on balance, the performance improvements in LLVM itself will outweigh any regressions from doing extra lookups via the C API during IR generation.
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114394/new/
https://reviews.llvm.org/D114394
    
    
More information about the llvm-commits
mailing list