[llvm] r321037 - LiveStacks: Rename LiveStack.{h|cpp} to LiveStacks.{h|cpp}; NFC
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 18 15:19:44 PST 2017
Author: matze
Date: Mon Dec 18 15:19:44 2017
New Revision: 321037
URL: http://llvm.org/viewvc/llvm-project?rev=321037&view=rev
Log:
LiveStacks: Rename LiveStack.{h|cpp} to LiveStacks.{h|cpp}; NFC
Filenames should match the name of the class they contain.
Added:
llvm/trunk/include/llvm/CodeGen/LiveStacks.h
- copied, changed from r321036, llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h
llvm/trunk/lib/CodeGen/LiveStacks.cpp
- copied, changed from r321036, llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp
Removed:
llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h
llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp
Modified:
llvm/trunk/lib/CodeGen/CMakeLists.txt
llvm/trunk/lib/CodeGen/InlineSpiller.cpp
llvm/trunk/lib/CodeGen/MachineVerifier.cpp
llvm/trunk/lib/CodeGen/README.txt
llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
llvm/trunk/lib/CodeGen/StackSlotColoring.cpp
llvm/trunk/lib/CodeGen/VirtRegMap.cpp
Removed: llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h?rev=321036&view=auto
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (removed)
@@ -1,103 +0,0 @@
-//===- LiveStackAnalysis.h - Live Stack Slot Analysis -----------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the live stack slot analysis pass. It is analogous to
-// live interval analysis except it's analyzing liveness of stack slots rather
-// than registers.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_LIVESTACKANALYSIS_H
-#define LLVM_CODEGEN_LIVESTACKANALYSIS_H
-
-#include "llvm/CodeGen/LiveInterval.h"
-#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Pass.h"
-#include <cassert>
-#include <map>
-#include <unordered_map>
-
-namespace llvm {
-
-class TargetRegisterClass;
-class TargetRegisterInfo;
-
-class LiveStacks : public MachineFunctionPass {
- const TargetRegisterInfo *TRI;
-
- /// Special pool allocator for VNInfo's (LiveInterval val#).
- ///
- VNInfo::Allocator VNInfoAllocator;
-
- /// S2IMap - Stack slot indices to live interval mapping.
- using SS2IntervalMap = std::unordered_map<int, LiveInterval>;
- SS2IntervalMap S2IMap;
-
- /// S2RCMap - Stack slot indices to register class mapping.
- std::map<int, const TargetRegisterClass *> S2RCMap;
-
-public:
- static char ID; // Pass identification, replacement for typeid
-
- LiveStacks() : MachineFunctionPass(ID) {
- initializeLiveStacksPass(*PassRegistry::getPassRegistry());
- }
-
- using iterator = SS2IntervalMap::iterator;
- using const_iterator = SS2IntervalMap::const_iterator;
-
- const_iterator begin() const { return S2IMap.begin(); }
- const_iterator end() const { return S2IMap.end(); }
- iterator begin() { return S2IMap.begin(); }
- iterator end() { return S2IMap.end(); }
-
- unsigned getNumIntervals() const { return (unsigned)S2IMap.size(); }
-
- LiveInterval &getOrCreateInterval(int Slot, const TargetRegisterClass *RC);
-
- LiveInterval &getInterval(int Slot) {
- assert(Slot >= 0 && "Spill slot indice must be >= 0");
- SS2IntervalMap::iterator I = S2IMap.find(Slot);
- assert(I != S2IMap.end() && "Interval does not exist for stack slot");
- return I->second;
- }
-
- const LiveInterval &getInterval(int Slot) const {
- assert(Slot >= 0 && "Spill slot indice must be >= 0");
- SS2IntervalMap::const_iterator I = S2IMap.find(Slot);
- assert(I != S2IMap.end() && "Interval does not exist for stack slot");
- return I->second;
- }
-
- bool hasInterval(int Slot) const { return S2IMap.count(Slot); }
-
- const TargetRegisterClass *getIntervalRegClass(int Slot) const {
- assert(Slot >= 0 && "Spill slot indice must be >= 0");
- std::map<int, const TargetRegisterClass *>::const_iterator I =
- S2RCMap.find(Slot);
- assert(I != S2RCMap.end() &&
- "Register class info does not exist for stack slot");
- return I->second;
- }
-
- VNInfo::Allocator &getVNInfoAllocator() { return VNInfoAllocator; }
-
- void getAnalysisUsage(AnalysisUsage &AU) const override;
- void releaseMemory() override;
-
- /// runOnMachineFunction - pass entry point
- bool runOnMachineFunction(MachineFunction &) override;
-
- /// print - Implement the dump method.
- void print(raw_ostream &O, const Module * = nullptr) const override;
-};
-
-} // end namespace llvm
-
-#endif // LLVM_CODEGEN_LIVESTACK_ANALYSIS_H
Copied: llvm/trunk/include/llvm/CodeGen/LiveStacks.h (from r321036, llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveStacks.h?p2=llvm/trunk/include/llvm/CodeGen/LiveStacks.h&p1=llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h&r1=321036&r2=321037&rev=321037&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveStacks.h Mon Dec 18 15:19:44 2017
@@ -1,4 +1,4 @@
-//===- LiveStackAnalysis.h - Live Stack Slot Analysis -----------*- C++ -*-===//
+//===- LiveStacks.h - Live Stack Slot Analysis ------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -13,8 +13,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CODEGEN_LIVESTACKANALYSIS_H
-#define LLVM_CODEGEN_LIVESTACKANALYSIS_H
+#ifndef LLVM_CODEGEN_LIVESTACKS_H
+#define LLVM_CODEGEN_LIVESTACKS_H
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
@@ -100,4 +100,4 @@ public:
} // end namespace llvm
-#endif // LLVM_CODEGEN_LIVESTACK_ANALYSIS_H
+#endif
Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CMakeLists.txt (original)
+++ llvm/trunk/lib/CodeGen/CMakeLists.txt Mon Dec 18 15:19:44 2017
@@ -51,7 +51,7 @@ add_llvm_library(LLVMCodeGen
LiveRangeShrink.cpp
LiveRegMatrix.cpp
LiveRegUnits.cpp
- LiveStackAnalysis.cpp
+ LiveStacks.cpp
LiveVariables.cpp
LLVMTargetMachine.cpp
LocalStackSlotAllocation.cpp
Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original)
+++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Mon Dec 18 15:19:44 2017
@@ -28,7 +28,7 @@
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRangeEdit.h"
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
Removed: llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp?rev=321036&view=auto
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp (removed)
@@ -1,88 +0,0 @@
-//===-- LiveStackAnalysis.cpp - Live Stack Slot Analysis ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the live stack slot analysis pass. It is analogous to
-// live interval analysis except it's analyzing liveness of stack slots rather
-// than registers.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/LiveStackAnalysis.h"
-#include "llvm/CodeGen/LiveIntervals.h"
-#include "llvm/CodeGen/Passes.h"
-#include "llvm/CodeGen/TargetRegisterInfo.h"
-#include "llvm/CodeGen/TargetSubtargetInfo.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace llvm;
-
-#define DEBUG_TYPE "livestacks"
-
-char LiveStacks::ID = 0;
-INITIALIZE_PASS_BEGIN(LiveStacks, DEBUG_TYPE,
- "Live Stack Slot Analysis", false, false)
-INITIALIZE_PASS_DEPENDENCY(SlotIndexes)
-INITIALIZE_PASS_END(LiveStacks, DEBUG_TYPE,
- "Live Stack Slot Analysis", false, false)
-
-char &llvm::LiveStacksID = LiveStacks::ID;
-
-void LiveStacks::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addPreserved<SlotIndexes>();
- AU.addRequiredTransitive<SlotIndexes>();
- MachineFunctionPass::getAnalysisUsage(AU);
-}
-
-void LiveStacks::releaseMemory() {
- // Release VNInfo memory regions, VNInfo objects don't need to be dtor'd.
- VNInfoAllocator.Reset();
- S2IMap.clear();
- S2RCMap.clear();
-}
-
-bool LiveStacks::runOnMachineFunction(MachineFunction &MF) {
- TRI = MF.getSubtarget().getRegisterInfo();
- // FIXME: No analysis is being done right now. We are relying on the
- // register allocators to provide the information.
- return false;
-}
-
-LiveInterval &
-LiveStacks::getOrCreateInterval(int Slot, const TargetRegisterClass *RC) {
- assert(Slot >= 0 && "Spill slot indice must be >= 0");
- SS2IntervalMap::iterator I = S2IMap.find(Slot);
- if (I == S2IMap.end()) {
- I = S2IMap.emplace(std::piecewise_construct, std::forward_as_tuple(Slot),
- std::forward_as_tuple(
- TargetRegisterInfo::index2StackSlot(Slot), 0.0F))
- .first;
- S2RCMap.insert(std::make_pair(Slot, RC));
- } else {
- // Use the largest common subclass register class.
- const TargetRegisterClass *OldRC = S2RCMap[Slot];
- S2RCMap[Slot] = TRI->getCommonSubClass(OldRC, RC);
- }
- return I->second;
-}
-
-/// print - Implement the dump method.
-void LiveStacks::print(raw_ostream &OS, const Module*) const {
-
- OS << "********** INTERVALS **********\n";
- for (const_iterator I = begin(), E = end(); I != E; ++I) {
- I->second.print(OS);
- int Slot = I->first;
- const TargetRegisterClass *RC = getIntervalRegClass(Slot);
- if (RC)
- OS << " [" << TRI->getRegClassName(RC) << "]\n";
- else
- OS << " [Unknown]\n";
- }
-}
Copied: llvm/trunk/lib/CodeGen/LiveStacks.cpp (from r321036, llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveStacks.cpp?p2=llvm/trunk/lib/CodeGen/LiveStacks.cpp&p1=llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp&r1=321036&r2=321037&rev=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveStacks.cpp Mon Dec 18 15:19:44 2017
@@ -1,4 +1,4 @@
-//===-- LiveStackAnalysis.cpp - Live Stack Slot Analysis ------------------===//
+//===-- LiveStacks.cpp - Live Stack Slot Analysis -------------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -13,7 +13,7 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Mon Dec 18 15:19:44 2017
@@ -37,7 +37,7 @@
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
Modified: llvm/trunk/lib/CodeGen/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/README.txt?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/README.txt (original)
+++ llvm/trunk/lib/CodeGen/README.txt Mon Dec 18 15:19:44 2017
@@ -164,7 +164,7 @@ synthesize the various copy insertion/in
Stack coloring improvements:
-1. Do proper LiveStackAnalysis on all stack objects including those which are
+1. Do proper LiveStacks analysis on all stack objects including those which are
not spill slots.
2. Reorder objects to fill in gaps between objects.
e.g. 4, 1, <gap>, 4, 1, 1, 1, <gap>, 4 => 4, 1, 1, 1, 1, 4, 4
Modified: llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBasic.cpp?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocBasic.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocBasic.cpp Mon Dec 18 15:19:44 2017
@@ -21,7 +21,7 @@
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRangeEdit.h"
#include "llvm/CodeGen/LiveRegMatrix.h"
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Mon Dec 18 15:19:44 2017
@@ -39,7 +39,7 @@
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRangeEdit.h"
#include "llvm/CodeGen/LiveRegMatrix.h"
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Mon Dec 18 15:19:44 2017
@@ -45,7 +45,7 @@
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveRangeEdit.h"
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Mon Dec 18 15:19:44 2017
@@ -16,7 +16,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=321037&r1=321036&r2=321037&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Mon Dec 18 15:19:44 2017
@@ -22,7 +22,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
-#include "llvm/CodeGen/LiveStackAnalysis.h"
+#include "llvm/CodeGen/LiveStacks.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
More information about the llvm-commits
mailing list