summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterCoalescer.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-09-22 03:44:41 +0000
committerMatthias Braun <matze@braunis.de>2015-09-22 03:44:41 +0000
commitd3dd1354a49c321324878269189cdff7e0e151bb (patch)
tree8e2679c0255c036a28de407235dcfc7a271bbc77 /llvm/lib/CodeGen/RegisterCoalescer.cpp
parent927a11e380d5c5fb1e618a6ce6bdf6c1f423e53f (diff)
downloadbcm5719-llvm-d3dd1354a49c321324878269189cdff7e0e151bb.tar.gz
bcm5719-llvm-d3dd1354a49c321324878269189cdff7e0e151bb.zip
LiveIntervalAnalysis: Factor common code into splitSeparateComponents; NFC
llvm-svn: 248241
Diffstat (limited to 'llvm/lib/CodeGen/RegisterCoalescer.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 581f6e414b7..3222377a17a 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -224,30 +224,17 @@ namespace {
/// Dst, we can drop \p Copy.
bool applyTerminalRule(const MachineInstr &Copy) const;
- /// Check whether or not \p LI is composed by multiple connected
- /// components and if that is the case, fix that.
- void splitNewRanges(LiveInterval *LI) {
- ConnectedVNInfoEqClasses ConEQ(*LIS);
- unsigned NumComps = ConEQ.Classify(LI);
- if (NumComps <= 1)
- return;
- SmallVector<LiveInterval*, 8> NewComps(1, LI);
- for (unsigned i = 1; i != NumComps; ++i) {
- unsigned VReg = MRI->createVirtualRegister(MRI->getRegClass(LI->reg));
- NewComps.push_back(&LIS->createEmptyInterval(VReg));
- }
-
- ConEQ.Distribute(&NewComps[0], *MRI);
- }
-
/// Wrapper method for \see LiveIntervals::shrinkToUses.
/// This method does the proper fixing of the live-ranges when the afore
/// mentioned method returns true.
void shrinkToUses(LiveInterval *LI,
SmallVectorImpl<MachineInstr * > *Dead = nullptr) {
- if (LIS->shrinkToUses(LI, Dead))
- // We may have created multiple connected components, split them.
- splitNewRanges(LI);
+ if (LIS->shrinkToUses(LI, Dead)) {
+ /// Check whether or not \p LI is composed by multiple connected
+ /// components and if that is the case, fix that.
+ SmallVector<LiveInterval*, 8> SplitLIs;
+ LIS->splitSeparateComponents(*LI, SplitLIs);
+ }
}
public:
OpenPOWER on IntegriCloud