Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 6,880 Lines • ▼ Show 20 Lines | SystemZTargetLowering::emitSelect(MachineInstr &MI, | ||||
// a single pair of basic blocks using the same condition. | // a single pair of basic blocks using the same condition. | ||||
SmallVector<MachineInstr*, 8> Selects; | SmallVector<MachineInstr*, 8> Selects; | ||||
SmallVector<MachineInstr*, 8> DbgValues; | SmallVector<MachineInstr*, 8> DbgValues; | ||||
Selects.push_back(&MI); | Selects.push_back(&MI); | ||||
unsigned Count = 0; | unsigned Count = 0; | ||||
for (MachineBasicBlock::iterator NextMIIt = | for (MachineBasicBlock::iterator NextMIIt = | ||||
std::next(MachineBasicBlock::iterator(MI)); | std::next(MachineBasicBlock::iterator(MI)); | ||||
NextMIIt != MBB->end(); ++NextMIIt) { | NextMIIt != MBB->end(); ++NextMIIt) { | ||||
if (NextMIIt->definesRegister(SystemZ::CC)) | |||||
break; | |||||
if (isSelectPseudo(*NextMIIt)) { | if (isSelectPseudo(*NextMIIt)) { | ||||
uweigand: Isn't this always true for select pseudos? Why doesn't make the rest of this loop a no-op? | |||||
Oops! Sorry. jonpa: Oops! Sorry. | |||||
Not Done ReplyInline ActionsInteresting that this didn't cause any test to fail ... Don't we have tests that verify this loop does something? uweigand: Interesting that this didn't cause any test to fail ... Don't we have tests that verify this… | |||||
We do and they were failing, it was just me who was too happy finding the cause of this problem and then forgetting to run the tests before submitting... jonpa: We do and they were failing, it was just me who was too happy finding the cause of this problem… | |||||
assert(NextMIIt->getOperand(3).getImm() == CCValid && | assert(NextMIIt->getOperand(3).getImm() == CCValid && | ||||
"Bad CCValid operands since CC was not redefined."); | "Bad CCValid operands since CC was not redefined."); | ||||
if (NextMIIt->getOperand(4).getImm() == CCMask || | if (NextMIIt->getOperand(4).getImm() == CCMask || | ||||
NextMIIt->getOperand(4).getImm() == (CCValid ^ CCMask)) { | NextMIIt->getOperand(4).getImm() == (CCValid ^ CCMask)) { | ||||
Selects.push_back(&*NextMIIt); | Selects.push_back(&*NextMIIt); | ||||
continue; | continue; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
if (NextMIIt->definesRegister(SystemZ::CC) || | |||||
NextMIIt->usesCustomInsertionHook()) | |||||
break; | |||||
bool User = false; | bool User = false; | ||||
for (auto SelMI : Selects) | for (auto SelMI : Selects) | ||||
if (NextMIIt->readsVirtualRegister(SelMI->getOperand(0).getReg())) { | if (NextMIIt->readsVirtualRegister(SelMI->getOperand(0).getReg())) { | ||||
User = true; | User = true; | ||||
break; | break; | ||||
} | } | ||||
if (NextMIIt->isDebugInstr()) { | if (NextMIIt->isDebugInstr()) { | ||||
if (User) { | if (User) { | ||||
▲ Show 20 Lines • Show All 1,152 Lines • Show Last 20 Lines |
Isn't this always true for select pseudos? Why doesn't make the rest of this loop a no-op?