[llvm-branch-commits] [llvm-branch] r292340 - Merging r291966:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jan 17 20:56:54 PST 2017
Author: hans
Date: Tue Jan 17 22:56:54 2017
New Revision: 292340
URL: http://llvm.org/viewvc/llvm-project?rev=292340&view=rev
Log:
Merging r291966:
------------------------------------------------------------------------
r291966 | majnemer | 2017-01-13 14:24:27 -0800 (Fri, 13 Jan 2017) | 6 lines
[LoopStrengthReduce] Don't bother rewriting PHIs in catchswitch blocks
The catchswitch instruction cannot be split, don't bother trying to
rewrite it.
This fixes PR31627.
------------------------------------------------------------------------
Added:
llvm/branches/release_40/test/Transforms/LoopStrengthReduce/pr31627.ll
- copied unchanged from r291966, llvm/trunk/test/Transforms/LoopStrengthReduce/pr31627.ll
Modified:
llvm/branches/release_40/ (props changed)
llvm/branches/release_40/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Propchange: llvm/branches/release_40/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 17 22:56:54 2017
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,291863,291875,291968,291979,292133,292242,292255
+/llvm/trunk:155241,291863,291875,291966,291968,291979,292133,292242,292255
Modified: llvm/branches/release_40/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_40/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=292340&r1=292339&r2=292340&view=diff
==============================================================================
--- llvm/branches/release_40/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/branches/release_40/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Jan 17 22:56:54 2017
@@ -3163,6 +3163,9 @@ LSRInstance::CollectLoopInvariantFixupsA
// Don't bother if the instruction is in a BB which ends in an EHPad.
if (UseBB->getTerminator()->isEHPad())
continue;
+ // Don't bother rewriting PHIs in catchswitch blocks.
+ if (isa<CatchSwitchInst>(UserInst->getParent()->getTerminator()))
+ continue;
// Ignore uses which are part of other SCEV expressions, to avoid
// analyzing them multiple times.
if (SE.isSCEVable(UserInst->getType())) {
@@ -4672,7 +4675,8 @@ void LSRInstance::RewriteForPHI(PHINode
// is the canonical backedge for this loop, which complicates post-inc
// users.
if (e != 1 && BB->getTerminator()->getNumSuccessors() > 1 &&
- !isa<IndirectBrInst>(BB->getTerminator())) {
+ !isa<IndirectBrInst>(BB->getTerminator()) &&
+ !isa<CatchSwitchInst>(BB->getTerminator())) {
BasicBlock *Parent = PN->getParent();
Loop *PNLoop = LI.getLoopFor(Parent);
if (!PNLoop || Parent != PNLoop->getHeader()) {
More information about the llvm-branch-commits
mailing list