[llvm] r262766 - RegisterPressure: Small cleanup
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 4 20:36:08 PST 2016
Author: matze
Date: Fri Mar 4 22:36:08 2016
New Revision: 262766
URL: http://llvm.org/viewvc/llvm-project?rev=262766&view=rev
Log:
RegisterPressure: Small cleanup
Modified:
llvm/trunk/lib/CodeGen/RegisterPressure.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.cpp?rev=262766&r1=262765&r2=262766&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp Fri Mar 4 22:36:08 2016
@@ -326,8 +326,8 @@ void RegPressureTracker::initLiveThru(co
}
}
-static unsigned getRegLanes(ArrayRef<RegisterMaskPair> RegUnits,
- unsigned RegUnit) {
+static LaneBitmask getRegLanes(ArrayRef<RegisterMaskPair> RegUnits,
+ unsigned RegUnit) {
auto I = std::find_if(RegUnits.begin(), RegUnits.end(),
[RegUnit](const RegisterMaskPair Other) {
return Other.RegUnit == RegUnit;
@@ -528,11 +528,6 @@ void RegisterOperands::adjustLaneLivenes
for (auto I = Defs.begin(); I != Defs.end(); ) {
LaneBitmask LiveAfter = getLiveLanesAt(LIS, MRI, true, I->RegUnit,
Pos.getDeadSlot());
-#if 0
- unsigned DeadDef = I->LaneMask & ~LiveAfter;
- if (DeadDef != 0)
- addRegLanes(DeadDefs, RegisterMaskPair(I->RegUnit, DeadDef));
-#endif
// If the the def is all that is live after the instruction, then in case
// of a subregister def we need a read-undef flag.
unsigned RegUnit = I->RegUnit;
@@ -540,7 +535,7 @@ void RegisterOperands::adjustLaneLivenes
AddFlagsMI != nullptr && (LiveAfter & ~I->LaneMask) == 0)
AddFlagsMI->setRegisterDefReadUndef(RegUnit);
- unsigned LaneMask = I->LaneMask & LiveAfter;
+ LaneBitmask LaneMask = I->LaneMask & LiveAfter;
if (LaneMask == 0) {
I = Defs.erase(I);
// Make sure the operand is properly marked as Dead.
@@ -554,7 +549,7 @@ void RegisterOperands::adjustLaneLivenes
for (auto I = Uses.begin(); I != Uses.end(); ) {
LaneBitmask LiveBefore = getLiveLanesAt(LIS, MRI, true, I->RegUnit,
Pos.getBaseIndex());
- unsigned LaneMask = I->LaneMask & LiveBefore;
+ LaneBitmask LaneMask = I->LaneMask & LiveBefore;
if (LaneMask == 0) {
I = Uses.erase(I);
} else {
@@ -636,8 +631,8 @@ void PressureDiff::addPressureChange(uns
/// Force liveness of registers.
void RegPressureTracker::addLiveRegs(ArrayRef<RegisterMaskPair> Regs) {
for (const RegisterMaskPair &P : Regs) {
- unsigned PrevMask = LiveRegs.insert(P);
- unsigned NewMask = PrevMask | P.LaneMask;
+ LaneBitmask PrevMask = LiveRegs.insert(P);
+ LaneBitmask NewMask = PrevMask | P.LaneMask;
increaseRegPressure(P.RegUnit, PrevMask, NewMask);
}
}
More information about the llvm-commits
mailing list