diff options
author | Rahul Joshi <rjoshi@nvidia.com> | 2024-10-16 07:21:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-16 07:21:10 -0700 |
commit | 6924fc03260370876f7091ba06cdc350989ac3c5 (patch) | |
tree | 4cf2c376bef512f593eb6707be5a7aea6785050e /llvm/lib/LTO/LTO.cpp | |
parent | cba7b369b2a511082897fc5dc5a9c95a36c2743d (diff) | |
download | llvm-6924fc03260370876f7091ba06cdc350989ac3c5.zip llvm-6924fc03260370876f7091ba06cdc350989ac3c5.tar.gz llvm-6924fc03260370876f7091ba06cdc350989ac3c5.tar.bz2 |
[LLVM] Add `Intrinsic::getDeclarationIfExists` (#112428)
Add `Intrinsic::getDeclarationIfExists` to lookup an existing
declaration of an intrinsic in a `Module`.
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 90c4e2c..0f53c60 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -1120,13 +1120,13 @@ Error LTO::checkPartiallySplit() { if (!ThinLTO.CombinedIndex.partiallySplitLTOUnits()) return Error::success(); - Function *TypeTestFunc = RegularLTO.CombinedModule->getFunction( - Intrinsic::getName(Intrinsic::type_test)); - Function *TypeCheckedLoadFunc = RegularLTO.CombinedModule->getFunction( - Intrinsic::getName(Intrinsic::type_checked_load)); - Function *TypeCheckedLoadRelativeFunc = - RegularLTO.CombinedModule->getFunction( - Intrinsic::getName(Intrinsic::type_checked_load_relative)); + const Module *Combined = RegularLTO.CombinedModule.get(); + Function *TypeTestFunc = + Intrinsic::getDeclarationIfExists(Combined, Intrinsic::type_test); + Function *TypeCheckedLoadFunc = + Intrinsic::getDeclarationIfExists(Combined, Intrinsic::type_checked_load); + Function *TypeCheckedLoadRelativeFunc = Intrinsic::getDeclarationIfExists( + Combined, Intrinsic::type_checked_load_relative); // First check if there are type tests / type checked loads in the // merged regular LTO module IR. |