[llvm-commits] [llvm] r149360 - /llvm/trunk/lib/CodeGen/RegAllocFast.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Jan 31 10:27:52 PST 2012
On Jan 30, 2012, at 9:55 PM, Andrew Trick wrote:
> + unsigned OperReg = MO.getReg();
> + for (const unsigned *AS = TRI->getOverlaps(Reg); *AS; ++AS) {
> + if (OperReg != *AS)
> + continue;
> + if (OperReg == Reg || TRI->isSuperRegister(OperReg, Reg)) {
> + // If the ret already has an operand for this physreg or a superset,
> + // don't duplicate it. Set the kill flag if the value is defined.
> + if (hasDef && !MO.isKill())
> + MO.setIsKill();
> + Found = true;
> + break;
> + }
> + }
This loop looks weird. Can't you just go:
> + if (OperReg == Reg || TRI->isSuperRegister(OperReg, Reg)) {
> + // If the ret already has an operand for this physreg or a superset,
> + // don't duplicate it. Set the kill flag if the value is defined.
> + if (hasDef && !MO.isKill())
> + MO.setIsKill();
> + Found = true;
> + break;
> + }
More information about the llvm-commits
mailing list