diff options
author | Evan Cheng <evan.cheng@apple.com> | 2012-01-12 20:31:24 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2012-01-12 20:31:24 +0000 |
commit | c16c25fbc3b53da99dcaf27685a6116249f79b30 (patch) | |
tree | f045d33ccfeba07c2fa4026b803840797ecedac9 /lib/CodeGen/BranchFolding.cpp | |
parent | 0577c59196565259cf3d6c58860f16ce6fe44823 (diff) | |
download | external_llvm-c16c25fbc3b53da99dcaf27685a6116249f79b30.zip external_llvm-c16c25fbc3b53da99dcaf27685a6116249f79b30.tar.gz external_llvm-c16c25fbc3b53da99dcaf27685a6116249f79b30.tar.bz2 |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index 89894c3..793e4f0 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/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) |