diff options
author | Nikita Popov <npopov@redhat.com> | 2023-11-22 11:18:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-22 11:18:43 +0100 |
commit | 510fb8711e9ad68afdf2b9ef0f2bbf312bf9ccf5 (patch) | |
tree | 0318f9d62070977b90d42f0a5f6929bb34b9b6bb /llvm/lib/IR/Value.cpp | |
parent | 74cdb8e6f8c88b97204f540601a553b412d1cd56 (diff) | |
download | llvm-510fb8711e9ad68afdf2b9ef0f2bbf312bf9ccf5.zip llvm-510fb8711e9ad68afdf2b9ef0f2bbf312bf9ccf5.tar.gz llvm-510fb8711e9ad68afdf2b9ef0f2bbf312bf9ccf5.tar.bz2 |
[IR][TLI] Cache getLibFunc() result on Function (NFC) (#72867)
Cache the result of the TLI libfunc lookup in the Function object. This
only caches the actual lookup of the LibFunc in the TLI map, but not the
prototype validation, as that might differ between different TLI
instances.
This uses the existing mechanism for invalidating the intrinsic ID when
the function name changes. The libfunc will be invalidated in that case
as well.
I don't believe this increases the size of Function on 64bit (which
currently has a trailing `bool` member), and I don't think we would
particularly care if it did, as Functions are uncommon as Values go.
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index c05f9ac..b6e25c4 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -377,7 +377,7 @@ void Value::setNameImpl(const Twine &NewName) { void Value::setName(const Twine &NewName) { setNameImpl(NewName); if (Function *F = dyn_cast<Function>(this)) - F->recalculateIntrinsicID(); + F->updateAfterNameChange(); } void Value::takeName(Value *V) { |