[llvm] r268814 - DetectDeadLanes: Cleanup, assert on some impossible cases.
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri May 6 15:43:47 PDT 2016
Author: matze
Date: Fri May 6 17:43:46 2016
New Revision: 268814
URL: http://llvm.org/viewvc/llvm-project?rev=268814&view=rev
Log:
DetectDeadLanes: Cleanup, assert on some impossible cases.
Modified:
llvm/trunk/lib/CodeGen/DetectDeadLanes.cpp
Modified: llvm/trunk/lib/CodeGen/DetectDeadLanes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DetectDeadLanes.cpp?rev=268814&r1=268813&r2=268814&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DetectDeadLanes.cpp (original)
+++ llvm/trunk/lib/CodeGen/DetectDeadLanes.cpp Fri May 6 17:43:46 2016
@@ -76,7 +76,7 @@ private:
void transferUsedLanesStep(const MachineOperand &Def, LaneBitmask UsedLanes);
/// Given a use regiser operand \p Use and a mask of defined lanes, check
- /// if the operand belongs to a lowerToCopies() instruction, transfer the
+ /// if the operand belongs to a lowersToCopies() instruction, transfer the
/// mask to the def and put the instruction into the worklist.
void transferDefinedLanesStep(const MachineOperand &Use,
LaneBitmask DefinedLanes);
@@ -85,7 +85,7 @@ private:
/// of COPY-like instruction, determine which lanes are defined at the output
/// operand \p Def.
LaneBitmask transferDefinedLanes(const MachineOperand &Def, unsigned OpNum,
- LaneBitmask DefinedLanes);
+ LaneBitmask DefinedLanes) const;
LaneBitmask determineInitialDefinedLanes(unsigned Reg);
LaneBitmask determineInitialUsedLanes(unsigned Reg);
@@ -294,8 +294,7 @@ void DetectDeadLanes::transferDefinedLan
}
LaneBitmask DetectDeadLanes::transferDefinedLanes(const MachineOperand &Def,
- unsigned OpNum,
- LaneBitmask DefinedLanes) {
+ unsigned OpNum, LaneBitmask DefinedLanes) const {
const MachineInstr &MI = *Def.getParent();
// Translate DefinedLanes if necessary.
switch (MI.getOpcode()) {
@@ -330,8 +329,8 @@ LaneBitmask DetectDeadLanes::transferDef
llvm_unreachable("function must be called with COPY-like instruction");
}
- unsigned SubIdx = Def.getSubReg();
- DefinedLanes = TRI->composeSubRegIndexLaneMask(SubIdx, DefinedLanes);
+ assert(Def.getSubReg() == 0 &&
+ "Should not have subregister defs in machine SSA phase");
DefinedLanes &= MRI->getMaxLaneMaskForVReg(Def.getReg());
return DefinedLanes;
}
@@ -396,9 +395,9 @@ LaneBitmask DetectDeadLanes::determineIn
if (DefMI.isImplicitDef() || Def.isDead())
return 0;
- unsigned SubReg = Def.getSubReg();
- return SubReg != 0 ? TRI->getSubRegIndexLaneMask(SubReg)
- : MRI->getMaxLaneMaskForVReg(Reg);
+ assert(Def.getSubReg() == 0 &&
+ "Should not have subregister defs in machine SSA phase");
+ return MRI->getMaxLaneMaskForVReg(Reg);
}
LaneBitmask DetectDeadLanes::determineInitialUsedLanes(unsigned Reg) {
More information about the llvm-commits
mailing list