projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[TwoAddressInstructionPass] When looking for a 3 addr conversion after commuting...
[oota-llvm.git]
/
lib
/
CodeGen
/
TwoAddressInstructionPass.cpp
diff --git
a/lib/CodeGen/TwoAddressInstructionPass.cpp
b/lib/CodeGen/TwoAddressInstructionPass.cpp
index 717b07ca0591c8290f217b7466d8eff594eae026..1b4fe705eb85a35eef5763873ac4ab0c32d113a4 100644
(file)
--- a/
lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/
lib/CodeGen/TwoAddressInstructionPass.cpp
@@
-1265,6
+1265,13
@@
tryInstructionTransform(MachineBasicBlock::iterator &mi,
return true;
}
return true;
}
+ // If we commuted, regB may have changed so we should re-sample it to avoid
+ // confusing the three address conversion below.
+ if (Commuted) {
+ regB = MI.getOperand(SrcIdx).getReg();
+ regBKilled = isKilled(MI, regB, MRI, TII, LIS, true);
+ }
+
if (MI.isConvertibleTo3Addr()) {
// This instruction is potentially convertible to a true
// three-address instruction. Check if it is profitable.
if (MI.isConvertibleTo3Addr()) {
// This instruction is potentially convertible to a true
// three-address instruction. Check if it is profitable.