diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/Transforms/IPO/GlobalOpt.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/Transforms/IPO/GlobalOpt.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/contrib/libs/llvm12/lib/Transforms/IPO/GlobalOpt.cpp b/contrib/libs/llvm12/lib/Transforms/IPO/GlobalOpt.cpp index 223a05e8ea..b06fc36b72 100644 --- a/contrib/libs/llvm12/lib/Transforms/IPO/GlobalOpt.cpp +++ b/contrib/libs/llvm12/lib/Transforms/IPO/GlobalOpt.cpp @@ -268,7 +268,7 @@ CleanupPointerRootUsers(GlobalVariable *GV, I = J; } while (true); I->eraseFromParent(); - Changed = true; + Changed = true; } } @@ -286,7 +286,7 @@ static bool CleanupConstantGlobalUsers( // we delete a constant array, we may also be holding pointer to one of its // elements (or an element of one of its elements if we're dealing with an // array of arrays) in the worklist. - SmallVector<WeakTrackingVH, 8> WorkList(V->users()); + SmallVector<WeakTrackingVH, 8> WorkList(V->users()); while (!WorkList.empty()) { Value *UV = WorkList.pop_back_val(); if (!UV) @@ -1880,8 +1880,8 @@ static bool isPointerValueDeadOnEntryToFunction( // and the number of bits loaded in L is less than or equal to // the number of bits stored in S. return DT.dominates(S, L) && - DL.getTypeStoreSize(LTy).getFixedSize() <= - DL.getTypeStoreSize(STy).getFixedSize(); + DL.getTypeStoreSize(LTy).getFixedSize() <= + DL.getTypeStoreSize(STy).getFixedSize(); })) return false; } @@ -1933,7 +1933,7 @@ static void makeAllConstantUsesInstructions(Constant *C) { SmallVector<Value*,4> UUsers; for (auto *U : Users) { UUsers.clear(); - append_range(UUsers, U->users()); + append_range(UUsers, U->users()); for (auto *UU : UUsers) { Instruction *UI = cast<Instruction>(UU); Instruction *NewU = U->getAsInstruction(); @@ -1990,8 +1990,8 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS, return true; } - bool Changed = false; - + bool Changed = false; + // If the global is never loaded (but may be stored to), it is dead. // Delete it now. if (!GS.IsLoaded) { @@ -2022,14 +2022,14 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS, // Don't actually mark a global constant if it's atomic because atomic loads // are implemented by a trivial cmpxchg in some edge-cases and that usually // requires write access to the variable even if it's not actually changed. - if (GS.Ordering == AtomicOrdering::NotAtomic) { - assert(!GV->isConstant() && "Expected a non-constant global"); + if (GS.Ordering == AtomicOrdering::NotAtomic) { + assert(!GV->isConstant() && "Expected a non-constant global"); GV->setConstant(true); - Changed = true; - } + Changed = true; + } // Clean up any obviously simplifiable users now. - Changed |= CleanupConstantGlobalUsers(GV, GV->getInitializer(), DL, GetTLI); + Changed |= CleanupConstantGlobalUsers(GV, GV->getInitializer(), DL, GetTLI); // If the global is dead now, just nuke it. if (GV->use_empty()) { @@ -2089,7 +2089,7 @@ processInternalGlobal(GlobalVariable *GV, const GlobalStatus &GS, } } - return Changed; + return Changed; } /// Analyze the specified global variable and optimize it if possible. If we @@ -2224,7 +2224,7 @@ isValidCandidateForColdCC(Function &F, BlockFrequencyInfo &CallerBFI = GetBFI(*CallerFunc); if (!isColdCallSite(CB, CallerBFI)) return false; - if (!llvm::is_contained(AllCallsCold, CallerFunc)) + if (!llvm::is_contained(AllCallsCold, CallerFunc)) return false; } return true; |