Reverting r243386 because it has serious post-commit concerns that have not been addressed. Also reverts r243389, which relied on this commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243527 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aaron Ballman
2015-07-29 15:57:49 +00:00
parent edbf9d742e
commit a229846f3f
4 changed files with 15 additions and 148 deletions

View File

@@ -14,7 +14,6 @@
#ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
#define LLVM_CODEGEN_MACHINEBASICBLOCK_H
#include "llvm/ADT/SortedVector.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/Support/DataTypes.h"
@@ -81,7 +80,7 @@ class MachineBasicBlock : public ilist_node<MachineBasicBlock> {
/// LiveIns - Keep track of the physical registers that are livein of
/// the basicblock.
mutable SortedVector<unsigned> LiveIns;
std::vector<unsigned> LiveIns;
/// Alignment - Alignment of the basic block. Zero if the basic block does
/// not need to be aligned.
@@ -319,12 +318,15 @@ public:
/// Adds the specified register as a live in. Note that it is an error to add
/// the same register to the same set more than once unless the intention is
/// to call sortUniqueLiveIns after all registers are added.
void addLiveIn(unsigned Reg) { LiveIns.insert(Reg); }
void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); }
/// Sorts and uniques the LiveIns vector. It can be significantly faster to do
/// this than repeatedly calling isLiveIn before calling addLiveIn for every
/// LiveIn insertion.
void sortUniqueLiveIns() { LiveIns.sortUnique(); }
void sortUniqueLiveIns() {
std::sort(LiveIns.begin(), LiveIns.end());
LiveIns.erase(std::unique(LiveIns.begin(), LiveIns.end()), LiveIns.end());
}
/// Add PhysReg as live in to this block, and ensure that there is a copy of
/// PhysReg to a virtual register of class RC. Return the virtual register
@@ -337,20 +339,14 @@ public:
/// isLiveIn - Return true if the specified register is in the live in set.
///
bool isLiveIn(unsigned Reg) const { return LiveIns.has(Reg); }
bool isLiveIn(unsigned Reg) const;
// Iteration support for live in sets. These sets are kept in sorted
// order by their register number.
typedef std::vector<unsigned>::const_iterator livein_iterator;
livein_iterator livein_begin() const { return LiveIns.begin(); }
livein_iterator livein_end() const { return LiveIns.end(); }
bool livein_empty() const { return LiveIns.empty(); }
livein_iterator livein_begin() const {
LiveIns.sortUnique();
return LiveIns.begin();
}
livein_iterator livein_end() const {
LiveIns.sortUnique();
return LiveIns.end();
}
/// getAlignment - Return alignment of the basic block.
/// The alignment is specified as log2(bytes).