[LegalizerInfo] Don't evaluate end boundary every time through the loop

Match the LLVM coding standard for loop conditions.

NFC.

llvm-svn: 315757
This commit is contained in:
Quentin Colombet 2017-10-13 21:16:13 +00:00
parent 86220488b4
commit b1a3bd1529
1 changed files with 4 additions and 3 deletions

View File

@ -58,7 +58,7 @@ LegalizerInfo::LegalizerInfo() {
void LegalizerInfo::computeTables() {
for (unsigned Opcode = 0; Opcode <= LastOp - FirstOp; ++Opcode) {
for (unsigned Idx = 0; Idx != Actions[Opcode].size(); ++Idx) {
for (unsigned Idx = 0, End = Actions[Opcode].size(); Idx != End; ++Idx) {
for (auto &Action : Actions[Opcode][Idx]) {
LLT Ty = Action.first;
if (!Ty.isVector())
@ -145,8 +145,9 @@ std::tuple<LegalizerInfo::LegalizeAction, unsigned, LLT>
LegalizerInfo::getAction(const MachineInstr &MI,
const MachineRegisterInfo &MRI) const {
SmallBitVector SeenTypes(8);
const MCOperandInfo *OpInfo = MI.getDesc().OpInfo;
for (unsigned i = 0; i < MI.getDesc().getNumOperands(); ++i) {
const MCInstrDesc &MCID = MI.getDesc();
const MCOperandInfo *OpInfo = MCID.OpInfo;
for (unsigned i = 0, e = MCID.getNumOperands(); i != e; ++i) {
if (!OpInfo[i].isGenericType())
continue;