summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-01-12 20:31:24 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-01-12 20:31:24 +0000
commit5c03a6b8f59399d524621600e845b7715b7ce969 (patch)
tree0ccbb664f37d357e66957a98a498e4bab14aafe7 /llvm/lib/CodeGen/BranchFolding.cpp
parent9a167eeaff461e705ec06f0fd5396a549da17fd0 (diff)
downloadbcm5719-llvm-5c03a6b8f59399d524621600e845b7715b7ce969.tar.gz
bcm5719-llvm-5c03a6b8f59399d524621600e845b7715b7ce969.zip
When hoisting common code, watch out for uses which are marked "kill". If the
killed registers are needed below the insertion point, then unset the kill marker. Sorry I'm not able to find a reduced test case. rdar://10660944 llvm-svn: 148043
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 89894c37ee0..793e4f07063 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -1618,6 +1618,11 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
IsSafe = false;
break;
}
+
+ if (MO.isKill() && Uses.count(Reg))
+ // Kills a register that's read by the instruction at the point of
+ // insertion. Remove the kill marker.
+ MO.setIsKill(false);
}
}
if (!IsSafe)
OpenPOWER on IntegriCloud