[llvm] 7bb9d70 - [NFC] Remove unneccessary `llvm::` in MachineOutliner/SuffixTree

Jessica Paquette via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 16:41:55 PST 2023


Author: Jessica Paquette
Date: 2023-02-03T16:41:02-08:00
New Revision: 7bb9d70bbb984b78f48e82ff0fb862abd45bf6ee

URL: https://github.com/llvm/llvm-project/commit/7bb9d70bbb984b78f48e82ff0fb862abd45bf6ee
DIFF: https://github.com/llvm/llvm-project/commit/7bb9d70bbb984b78f48e82ff0fb862abd45bf6ee.diff

LOG: [NFC] Remove unneccessary `llvm::` in MachineOutliner/SuffixTree

We have `using llvm`, we don't need to say `llvm::`.

Added: 
    

Modified: 
    llvm/include/llvm/Support/SuffixTree.h
    llvm/lib/CodeGen/MachineOutliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/SuffixTree.h b/llvm/include/llvm/Support/SuffixTree.h
index 70a12efd4a10..4fb8da51d56b 100644
--- a/llvm/include/llvm/Support/SuffixTree.h
+++ b/llvm/include/llvm/Support/SuffixTree.h
@@ -44,7 +44,7 @@ struct SuffixTreeNode {
   /// A child existing on an unsigned integer implies that from the mapping
   /// represented by the current node, there is a way to reach another
   /// mapping by tacking that character on the end of the current string.
-  llvm::DenseMap<unsigned, SuffixTreeNode *> Children;
+  DenseMap<unsigned, SuffixTreeNode *> Children;
 
   /// The start index of this node's substring in the main string.
   unsigned StartIdx = EmptyIdx;
@@ -137,7 +137,7 @@ struct SuffixTreeNode {
 class SuffixTree {
 public:
   /// Each element is an integer representing an instruction in the module.
-  llvm::ArrayRef<unsigned> Str;
+  ArrayRef<unsigned> Str;
 
   /// A repeated substring in the tree.
   struct RepeatedSubstring {
@@ -150,7 +150,7 @@ class SuffixTree {
 
 private:
   /// Maintains each node in the tree.
-  llvm::SpecificBumpPtrAllocator<SuffixTreeNode> NodeAllocator;
+  SpecificBumpPtrAllocator<SuffixTreeNode> NodeAllocator;
 
   /// The root of the suffix tree.
   ///
@@ -165,7 +165,7 @@ class SuffixTree {
   /// every step. Therefore, we need to store leaf end indices by reference
   /// to avoid updating O(N) leaves at every step of construction. Thus,
   /// every internal node must be allocated its own end index.
-  llvm::BumpPtrAllocator InternalEndIdxAllocator;
+  BumpPtrAllocator InternalEndIdxAllocator;
 
   /// The end index of each leaf in the tree.
   unsigned LeafEndIdx = -1;

diff  --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 358a22f341eb..aac60d616f05 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -361,8 +361,8 @@ struct InstructionMapper {
       // repeated substring.
       mapToIllegalUnsigned(It, CanOutlineWithPrevInstr, UnsignedVecForMBB,
                            InstrListForMBB);
-      llvm::append_range(InstrList, InstrListForMBB);
-      llvm::append_range(UnsignedVec, UnsignedVecForMBB);
+      append_range(InstrList, InstrListForMBB);
+      append_range(UnsignedVec, UnsignedVecForMBB);
     }
   }
 
@@ -598,8 +598,8 @@ void MachineOutliner::findCandidates(
       // That is, one must either
       // * End before the other starts
       // * Start after the other ends
-      if (llvm::all_of(CandidatesForRepeatedSeq, [&StartIdx,
-                                                  &EndIdx](const Candidate &C) {
+      if (all_of(CandidatesForRepeatedSeq, [&StartIdx,
+                                            &EndIdx](const Candidate &C) {
             return (EndIdx < C.getStartIdx() || StartIdx > C.getEndIdx());
           })) {
         // It doesn't overlap with anything, so we can outline it.
@@ -759,7 +759,7 @@ MachineFunction *MachineOutliner::createOutlinedFunction(
     Mangler Mg;
     // Get the mangled name of the function for the linkage name.
     std::string Dummy;
-    llvm::raw_string_ostream MangledNameStream(Dummy);
+    raw_string_ostream MangledNameStream(Dummy);
     Mg.getNameWithPrefix(MangledNameStream, F, false);
 
     DISubprogram *OutlinedSP = DB.createFunction(
@@ -793,10 +793,10 @@ bool MachineOutliner::outline(Module &M,
   bool OutlinedSomething = false;
 
   // Sort by benefit. The most beneficial functions should be outlined first.
-  llvm::stable_sort(FunctionList, [](const OutlinedFunction &LHS,
-                                     const OutlinedFunction &RHS) {
-    return LHS.getBenefit() > RHS.getBenefit();
-  });
+  stable_sort(FunctionList,
+              [](const OutlinedFunction &LHS, const OutlinedFunction &RHS) {
+                return LHS.getBenefit() > RHS.getBenefit();
+              });
 
   // Walk over each function, outlining them as we go along. Functions are
   // outlined greedily, based off the sort above.
@@ -899,8 +899,8 @@ bool MachineOutliner::outline(Module &M,
 
       // Keep track of what we removed by marking them all as -1.
       for (unsigned &I :
-           llvm::make_range(Mapper.UnsignedVec.begin() + C.getStartIdx(),
-                            Mapper.UnsignedVec.begin() + C.getEndIdx() + 1))
+           make_range(Mapper.UnsignedVec.begin() + C.getStartIdx(),
+                      Mapper.UnsignedVec.begin() + C.getEndIdx() + 1))
         I = static_cast<unsigned>(-1);
       OutlinedSomething = true;
 


        


More information about the llvm-commits mailing list