summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-14 21:10:25 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-14 21:10:25 +0000
commit4d10829e1296b7aea0455e000fc318b147182c1c (patch)
tree4cc8df441ee344dd4a463af800bad6952a1d99ce /lib/CodeGen/RegAllocFast.cpp
parent3a884f5c17ac32e34e7e62b4602a0d73eeda1ce8 (diff)
downloadllvm-4d10829e1296b7aea0455e000fc318b147182c1c.tar.gz
llvm-4d10829e1296b7aea0455e000fc318b147182c1c.tar.bz2
llvm-4d10829e1296b7aea0455e000fc318b147182c1c.tar.xz
Fix PR12821.
RAFast must add an <imp-def> operand when it is rewriting a sub-register def that isn't a read-modify-write. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--lib/CodeGen/RegAllocFast.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp
index 70fbfd4c5c..15485b13da 100644
--- a/lib/CodeGen/RegAllocFast.cpp
+++ b/lib/CodeGen/RegAllocFast.cpp
@@ -674,6 +674,12 @@ bool RAFast::setPhysReg(MachineInstr *MI, unsigned OpNum, unsigned PhysReg) {
MI->addRegisterKilled(PhysReg, TRI, true);
return true;
}
+
+ // A <def,read-undef> of a sub-register requires an implicit def of the full
+ // register.
+ if (MO.isDef() && MO.isUndef())
+ MI->addRegisterDefined(PhysReg, TRI);
+
return MO.isDead();
}