Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
Show First 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | for (unsigned Idx = StatepointOpers(&MI).getVarIdx(), | ||||
MachineOperand &MO = MI.getOperand(Idx); | MachineOperand &MO = MI.getOperand(Idx); | ||||
// Leave `undef` operands as is, StackMaps will rewrite them | // Leave `undef` operands as is, StackMaps will rewrite them | ||||
// into a constant. | // into a constant. | ||||
if (!MO.isReg() || MO.isImplicit() || MO.isUndef()) | if (!MO.isReg() || MO.isImplicit() || MO.isUndef()) | ||||
continue; | continue; | ||||
Register Reg = MO.getReg(); | Register Reg = MO.getReg(); | ||||
assert(Reg.isPhysical() && "Only physical regs are expected"); | assert(Reg.isPhysical() && "Only physical regs are expected"); | ||||
if (isCalleeSaved(Reg) && (AllowGCPtrInCSR || !is_contained(GCRegs, Reg))) | if (isCalleeSaved(Reg) && (AllowGCPtrInCSR || !GCRegs.contains(Reg))) | ||||
continue; | continue; | ||||
LLVM_DEBUG(dbgs() << "Will spill " << printReg(Reg, &TRI) << " at index " | LLVM_DEBUG(dbgs() << "Will spill " << printReg(Reg, &TRI) << " at index " | ||||
<< Idx << "\n"); | << Idx << "\n"); | ||||
if (VisitedRegs.insert(Reg).second) | if (VisitedRegs.insert(Reg).second) | ||||
RegsToSpill.push_back(Reg); | RegsToSpill.push_back(Reg); | ||||
OpsToSpill.push_back(Idx); | OpsToSpill.push_back(Idx); | ||||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |