aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-10-23 20:14:40 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-10-23 20:14:40 +0000
commitb5130eb0d47d69561c2b907f082a757ed38cfb32 (patch)
treef02840df05b60095ddd0cd5e3939f8bc4f503273 /lib/CodeGen/TwoAddressInstructionPass.cpp
parent1b953f0761c68244ad46d6dbe1b3676a1745f21c (diff)
downloadexternal_llvm-b5130eb0d47d69561c2b907f082a757ed38cfb32.zip
external_llvm-b5130eb0d47d69561c2b907f082a757ed38cfb32.tar.gz
external_llvm-b5130eb0d47d69561c2b907f082a757ed38cfb32.tar.bz2
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
Diffstat (limited to 'lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index 53b08d6..277257b 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();