diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-14 21:10:25 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-05-14 21:10:25 +0000 |
| commit | dc2e0cd44a81c546aacba772d524f8af98b00f93 (patch) | |
| tree | a11bd454c4c8d43588b044514a7104d34609d9b8 /llvm/lib/CodeGen/RegAllocFast.cpp | |
| parent | a968caf8e024c51cb90872fef60cd529043e25d0 (diff) | |
| download | bcm5719-llvm-dc2e0cd44a81c546aacba772d524f8af98b00f93.tar.gz bcm5719-llvm-dc2e0cd44a81c546aacba772d524f8af98b00f93.zip | |
Fix PR12821.
RAFast must add an <imp-def> operand when it is rewriting a sub-register
def that isn't a read-modify-write.
llvm-svn: 156777
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocFast.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocFast.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp index 70fbfd4c5ca..15485b13dad 100644 --- a/llvm/lib/CodeGen/RegAllocFast.cpp +++ b/llvm/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(); } |

