diff options
author | dim <dim@FreeBSD.org> | 2016-02-21 16:23:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-02-21 16:23:44 +0000 |
commit | 5082f936dc42b118ee4ffb925af6e5979070b01f (patch) | |
tree | c3ed2eba6ed6d6a807aca69342c053354fb156ea /contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | 2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c (diff) | |
download | FreeBSD-src-5082f936dc42b118ee4ffb925af6e5979070b01f.zip FreeBSD-src-5082f936dc42b118ee4ffb925af6e5979070b01f.tar.gz |
Update llvm and clang to release_38 branch r261369.
Diffstat (limited to 'contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 2101225..acfdec4 100644 --- a/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -4799,6 +4799,17 @@ LSRInstance::LSRInstance(Loop *L, IVUsers &IU, ScalarEvolution &SE, DEBUG(dbgs() << "LSR skipping loop, too many IV Users in " << U << "\n"); return; } + // Bail out if we have a PHI on an EHPad that gets a value from a + // CatchSwitchInst. Because the CatchSwitchInst cannot be split, there is + // no good place to stick any instructions. + if (auto *PN = dyn_cast<PHINode>(U.getUser())) { + auto *FirstNonPHI = PN->getParent()->getFirstNonPHI(); + if (isa<FuncletPadInst>(FirstNonPHI) || + isa<CatchSwitchInst>(FirstNonPHI)) + for (BasicBlock *PredBB : PN->blocks()) + if (isa<CatchSwitchInst>(PredBB->getFirstNonPHI())) + return; + } } #ifndef NDEBUG |