]> granicus.if.org Git - llvm/commitdiff
[LegalizerInfo] Don't evaluate end boundary every time through the loop
authorQuentin Colombet <qcolombet@apple.com>
Fri, 13 Oct 2017 21:16:13 +0000 (21:16 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 13 Oct 2017 21:16:13 +0000 (21:16 +0000)
Match the LLVM coding standard for loop conditions.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315757 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/GlobalISel/LegalizerInfo.cpp

index 4fc4fa7d3ebd04eb5874f19629074344a16f3bb3..e7a46eadb443fc85e399ae54c4a179bbee750c97 100644 (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;