summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-10-11 22:42:31 +0000
committerBill Wendling <isanbard@gmail.com>2011-10-11 22:42:31 +0000
commit579ff6c39c32c0a39259f155c8a5d9fb7a9cacca (patch)
treeab48a27462dbe507ab3bb880f9ad3ceeba8f8da8
parent94ab9308d73811ae45258462d74a7b77e59bc791 (diff)
downloadbcm5719-llvm-579ff6c39c32c0a39259f155c8a5d9fb7a9cacca.tar.gz
bcm5719-llvm-579ff6c39c32c0a39259f155c8a5d9fb7a9cacca.zip
N.B. This is with the new EH scheme:
The blocks with invokes have branches to the dispatch block, because that more correctly models the behavior of the CFG. The dispatch of course has edges to the landing pads. Those landing pads could contain invokes, which then have branches back to the dispatch. This creates a loop. The machine LICM pass looks at this loop and thinks it can hoist elements out of it. But because the dispatch is an alternate entry point into the program, the hoisted instructions won't be executed. I wasn't able to get a testcase which was small and could reproduce all of the time. The function_try_block.cpp in llvm-test was where this showed up. llvm-svn: 141726
-rw-r--r--llvm/lib/CodeGen/MachineLICM.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index f6a08d36208..70da9828e67 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -336,6 +336,11 @@ bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
continue;
}
+ // If the header is a landing pad, then we don't want to hoist instructions
+ // out of it. This can happen with SjLj exception handling which has a
+ // dispatch table as the landing pad.
+ if (CurLoop->getHeader()->isLandingPad()) continue;
+
if (!PreRegAlloc)
HoistRegionPostRA();
else {
OpenPOWER on IntegriCloud