diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index f3b8623..06813ba 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -4141,7 +4141,8 @@ bool llvm::recognizeBSwapOrBitReverseIdiom( else return false; - Function *F = Intrinsic::getDeclaration(I->getModule(), Intrin, DemandedTy); + Function *F = + Intrinsic::getOrInsertDeclaration(I->getModule(), Intrin, DemandedTy); Value *Provider = Res->Provider; // We may need to truncate the provider. |