]> granicus.if.org Git - llvm/commitdiff
[AArch64] Fix order of checks in shouldScheduleAdjacent.
authorFlorian Hahn <florian.hahn@arm.com>
Mon, 19 Jun 2017 13:45:41 +0000 (13:45 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Mon, 19 Jun 2017 13:45:41 +0000 (13:45 +0000)
We need to check the opcode of FirstMI before accessing the operands. This
caused a buildbot failure during bootstrapping on AArch64.

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

lib/Target/AArch64/AArch64MacroFusion.cpp

index 7e97b6ccb4805144c42c65836a8021668db96054..ccc9d2ad1b482d0716a4309a7601b293f22c0d8d 100644 (file)
@@ -144,8 +144,8 @@ static bool shouldScheduleAdjacent(const TargetInstrInfo &TII,
       return FirstOpcode == AArch64::INSTRUCTION_LIST_END ||
              (FirstOpcode == AArch64::MOVZXi &&
               SecondMI.getOperand(3).getImm() == 16) ||
-             (FirstMI->getOperand(3).getImm() == 32 &&
-              FirstOpcode == AArch64::MOVKXi &&
+             (FirstOpcode == AArch64::MOVKXi &&
+              FirstMI->getOperand(3).getImm() == 32 &&
               SecondMI.getOperand(3).getImm() == 48);
     }