From cdc20ff6a7f12464aed70d9b6e67ea07da9f0399 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 9 Jan 2024 21:00:28 +0100 Subject: Merge llvm-project main llvmorg-18-init-16595-g7c00a5be5cde This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-16595-g7c00a5be5cde. PR: 276104 MFC after: 1 month (cherry picked from commit 1db9f3b21e39176dd5b67cf8ac378633b172463e) --- .../llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp') diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index 760a626c8b6f..a7cd68e860e4 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -3735,26 +3735,8 @@ Value *LibCallSimplifier::optimizeCall(CallInst *CI, IRBuilderBase &Builder) { // Also try to simplify calls to fortified library functions. if (Value *SimplifiedFortifiedCI = - FortifiedSimplifier.optimizeCall(CI, Builder)) { - // Try to further simplify the result. - CallInst *SimplifiedCI = dyn_cast(SimplifiedFortifiedCI); - if (SimplifiedCI && SimplifiedCI->getCalledFunction()) { - // Ensure that SimplifiedCI's uses are complete, since some calls have - // their uses analyzed. - replaceAllUsesWith(CI, SimplifiedCI); - - // Set insertion point to SimplifiedCI to guarantee we reach all uses - // we might replace later on. - IRBuilderBase::InsertPointGuard Guard(Builder); - Builder.SetInsertPoint(SimplifiedCI); - if (Value *V = optimizeStringMemoryLibCall(SimplifiedCI, Builder)) { - // If we were able to further simplify, remove the now redundant call. - substituteInParent(SimplifiedCI, V); - return V; - } - } + FortifiedSimplifier.optimizeCall(CI, Builder)) return SimplifiedFortifiedCI; - } // Then check for known library functions. if (TLI->getLibFunc(*Callee, Func) && isLibFuncEmittable(M, TLI, Func)) { -- cgit v1.2.3