diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-12-18 18:12:35 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-12-18 18:12:35 +0000 |
commit | 123048d26ad0950348081a4698731b82f40dd0e2 (patch) | |
tree | b12c3c479fb30951f4cc3d8dc6b0bd447bc7fbbe /llvm/lib/Transforms/Utils/LCSSA.cpp | |
parent | 3509d64c24163b17add750a2c59d9feb4d3a17bd (diff) | |
download | llvm-123048d26ad0950348081a4698731b82f40dd0e2.zip llvm-123048d26ad0950348081a4698731b82f40dd0e2.tar.gz llvm-123048d26ad0950348081a4698731b82f40dd0e2.tar.bz2 |
[WinEH] Update LCSSA to handle catchswitch with handlers inside and outside a loop
Differential Revision: http://reviews.llvm.org/D15630
llvm-svn: 256005
Diffstat (limited to 'llvm/lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LCSSA.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp index ef2f504..b4b2e14 100644 --- a/llvm/lib/Transforms/Utils/LCSSA.cpp +++ b/llvm/lib/Transforms/Utils/LCSSA.cpp @@ -66,6 +66,13 @@ static bool processInstruction(Loop &L, Instruction &Inst, DominatorTree &DT, PredIteratorCache &PredCache, LoopInfo *LI) { SmallVector<Use *, 16> UsesToRewrite; + // Tokens cannot be used in PHI nodes, so we skip over them. + // We can run into tokens which are live out of a loop with catchswitch + // instructions in Windows EH if the catchswitch has one catchpad which + // is inside the loop and another which is not. + if (Inst.getType()->isTokenTy()) + return false; + BasicBlock *InstBB = Inst.getParent(); for (Use &U : Inst.uses()) { |