From: Evan Cheng Date: Tue, 23 Oct 2007 20:14:40 +0000 (+0000) Subject: It's possible to commute instrctions with more than 3 operands. X-Git-Tag: android-x86-6.0-r1~1003^2~32126 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7bb175b4d12e3a22a66a26f0e9ba2ebd4406acc7;p=android-x86%2Fexternal-llvm.git It's possible to commute instrctions with more than 3 operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43256 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 53b08d6bf0f..277257bd61d 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -143,7 +143,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { // so, swap the B and C operands. This makes the live ranges of A // and C joinable. // FIXME: This code also works for A := B op C instructions. - if ((TID->Flags & M_COMMUTABLE) && mi->getNumOperands() == 3) { + if ((TID->Flags & M_COMMUTABLE) && mi->getNumOperands() >= 3) { assert(mi->getOperand(3-si).isRegister() && "Not a proper commutative instruction!"); unsigned regC = mi->getOperand(3-si).getReg();