summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterCoalescer.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-05 00:01:46 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-05 00:01:46 +0000
commit9d5bda9be150500db82055e8aeb20efc0c235425 (patch)
tree187cc0951d48ce7b0e8b8a0f0274559312048941 /llvm/lib/CodeGen/RegisterCoalescer.cpp
parentb0e6c8a3500c16f35bae030d5add46c942639ef7 (diff)
downloadbcm5719-llvm-9d5bda9be150500db82055e8aeb20efc0c235425.tar.gz
bcm5719-llvm-9d5bda9be150500db82055e8aeb20efc0c235425.zip
Also add <def,undef> flags when coalescing sub-registers.
RegisterCoalescer can create sub-register defs when it is joining a register with a sub-register. Add <undef> flags to these new sub-register defs where appropriate. llvm-svn: 141138
Diffstat (limited to 'llvm/lib/CodeGen/RegisterCoalescer.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 990ef370bb3..361ae7a63f0 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -967,6 +967,14 @@ RegisterCoalescer::UpdateRegDefsUses(const CoalescerPair &CP) {
Kills |= MO.isKill();
Deads |= MO.isDead();
+ // Make sure we don't create read-modify-write defs accidentally. We
+ // assume here that a SrcReg def cannot be joined into a live DstReg. If
+ // RegisterCoalescer starts tracking partially live registers, we will
+ // need to check the actual LiveInterval to determine if DstReg is live
+ // here.
+ if (SubIdx && !Reads)
+ MO.setIsUndef();
+
if (DstIsPhys)
MO.substPhysReg(DstReg, *TRI);
else
OpenPOWER on IntegriCloud