llvm-6502/lib/Transforms/Scalar
Arnaud A. de Grandmaison beeec3231e Fix tail recursion elimination
When the BasicBlock containing the return instrution has a PHI with 2
incoming values, FoldReturnIntoUncondBranch will remove the no longer
used incoming value and remove the no longer needed phi as well. This
leaves us with a BB that no longer has a PHI, but the subsequent call
to FoldReturnIntoUncondBranch from FoldReturnAndProcessPred will not
remove the return instruction (which still uses the result of the call
instruction). This prevents EliminateRecursiveTailCall to remove
the value, as it is still being used in a basicblock which has no
predecessors.

The basicblock can not be erased on the spot, because its iterator is
still being used in runTRE.

This issue was exposed when removing the threshold on size for lifetime
marker insertion for named temporaries in clang. The testcase is a much
reduced version of peelOffOuterExpr(const Expr*, const ExplodedNode *)
from clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222354 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19 13:32:51 +00:00
..
ADCE.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
AlignmentFromAssumptions.cpp
CMakeLists.txt
ConstantHoisting.cpp
ConstantProp.cpp
CorrelatedValuePropagation.cpp
DCE.cpp
DeadStoreElimination.cpp
EarlyCSE.cpp Tweak EarlyCSE to recognize series of dead stores 2014-11-18 17:46:32 +00:00
FlattenCFGPass.cpp
GVN.cpp Revert r222039 because of bot failure. 2014-11-19 00:13:26 +00:00
IndVarSimplify.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
JumpThreading.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
LICM.cpp
LLVMBuild.txt
LoadCombine.cpp
LoopDeletion.cpp
LoopIdiomRecognize.cpp
LoopInstSimplify.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
LoopRerollPass.cpp
LoopRotation.cpp
LoopStrengthReduce.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
LoopUnrollPass.cpp
LoopUnswitch.cpp
LowerAtomic.cpp
Makefile
MemCpyOptimizer.cpp
MergedLoadStoreMotion.cpp
PartiallyInlineLibCalls.cpp
Reassociate.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
Reg2Mem.cpp
SampleProfile.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
Scalar.cpp
Scalarizer.cpp Revert "IR: MDNode => Value" 2014-11-11 21:30:22 +00:00
ScalarReplAggregates.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
SCCP.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
SeparateConstOffsetFromGEP.cpp [SeparateConstOffsetFromGEP] Allow SeparateConstOffsetFromGEP pass to lower GEPs. 2014-11-19 06:24:44 +00:00
SimplifyCFGPass.cpp
Sink.cpp
SROA.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
StructurizeCFG.cpp
TailRecursionElimination.cpp Fix tail recursion elimination 2014-11-19 13:32:51 +00:00