[llvm-commits] [llvm] r148043 - /llvm/trunk/lib/CodeGen/BranchFolding.cpp
Evan Cheng
evan.cheng at apple.com
Thu Jan 12 12:31:24 PST 2012
Author: evancheng
Date: Thu Jan 12 14:31:24 2012
New Revision: 148043
URL: http://llvm.org/viewvc/llvm-project?rev=148043&view=rev
Log:
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
Modified:
llvm/trunk/lib/CodeGen/BranchFolding.cpp
Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=148043&r1=148042&r2=148043&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Thu Jan 12 14:31:24 2012
@@ -1618,6 +1618,11 @@
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)
More information about the llvm-commits
mailing list