1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test/Transforms
Chuang-Yu Cheng 13c5bb4a2e Don't delete empty preheaders in CodeGenPrepare if it would create a critical edge
Presently, CodeGenPrepare deletes all nearly empty (only phi and branch)
basic blocks. This pass can delete loop preheaders which frequently creates
critical edges. A preheader can be a convenient place to spill registers to
the stack. If the entrance to a loop body is a critical edge, then spills
may occur in the loop body rather than immediately before it. This patch
protects loop preheaders from deletion in CodeGenPrepare even if they are
nearly empty.

Since the patch alters the CFG, it affects a large number of test cases.
In most cases, the changes are merely cosmetic (basic blocks have different
names or instruction orders change slightly). I am somewhat concerned about
the test/CodeGen/Mips/brdelayslot.ll test case. If the loop preheader is not
deleted, then the MIPS backend does not take advantage of a branch delay
slot. Consequently, I would like some close review by a MIPS expert.

The patch also partially subsumes D16893 from George Burgess IV. George
correctly notes that CodeGenPrepare does not actually preserve the dominator
tree. I think the dominator tree was usually not valid when CodeGenPrepare
ran, but I am using LoopInfo to mark preheaders, so the dominator tree is
now always valid before CodeGenPrepare.

Author: Tom Jablin (tjablin)
Reviewers: hfinkel george.burgess.iv vkalintiris dsanders kbarton cycheng

http://reviews.llvm.org/D16984

llvm-svn: 265397
2016-04-05 14:06:20 +00:00
..
ADCE testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
AddDiscriminators testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
AlignmentFromAssumptions
ArgumentPromotion testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
AtomicExpand ARM: sink atomic release barrier as far as possible into cmpxchg. 2016-02-22 20:55:50 +00:00
BBVectorize
BDCE
BranchFolding
CodeExtractor
CodeGenPrepare [CodeGenPrepare] Avoid sinking soft-FP comparisons 2016-04-03 16:36:17 +00:00
ConstantHoisting
ConstantMerge
ConstProp
CorrelatedValuePropagation [CVP] Convert an SDiv to a UDiv if both operands are known to be nonnegative 2016-03-14 03:24:28 +00:00
CrossDSOCFI [cfi] Cross-DSO CFI diagnostic mode (LLVM part). 2016-01-25 23:35:03 +00:00
DeadArgElim testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
DeadStoreElimination testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
EarlyCSE
EliminateAvailableExternally
Float2Int
ForcedFunctionAttrs
FunctionAttrs [attrs] Handle convergent CallSites. 2016-03-14 20:18:54 +00:00
FunctionImport Fix bot errors from r265327, exact GUID which depends on path 2016-04-04 19:11:00 +00:00
GCOVProfiling testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
GlobalDCE
GlobalOpt testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
GVN Allow value forwarding past release fences in GVN 2016-03-25 22:40:35 +00:00
IndVarSimplify [IndVarSimplify] Don't insert after a catchswitch 2016-03-30 21:12:06 +00:00
InferFunctionAttrs [NVPTX] Infer __nvvm_reflect as nounwind, readnone 2016-03-31 21:29:57 +00:00
Inline Don't insert stackrestore on deoptimizing returns 2016-04-01 02:51:30 +00:00
InstCombine [InstCombine] Don't sink an instr after a catchswitch 2016-04-01 17:28:17 +00:00
InstMerge fixed typo - CHECK-LABEL 2016-03-29 06:49:38 +00:00
InstSimplify [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
Internalize
IPConstantProp [SCCP] Don't violate the lattice invariants 2016-01-07 21:36:16 +00:00
IRCE [SCEV] Try to reuse existing value during SCEV expansion 2016-02-04 01:27:38 +00:00
JumpThreading [JumpThreading] See through Cast Instructions 2016-03-16 04:52:52 +00:00
LCSSA
LICM Mark some FP intrinsics as safe to speculatively execute 2016-04-03 12:30:46 +00:00
LoadCombine
LoopDataPrefetch [LoopDataPrefetch] Centralize the tuning cl::opts under the pass 2016-03-29 23:45:52 +00:00
LoopDeletion
LoopDistribute
LoopIdiom testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
LoopInterchange
LoopLoadElim [LLE] Check for mismatching types between the store and the load earlier 2016-03-24 17:59:26 +00:00
LoopReroll testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
LoopRotate testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
LoopSimplify
LoopSimplifyCFG Add LoopSimplifyCFG pass 2016-01-29 22:35:36 +00:00
LoopStrengthReduce Don't delete empty preheaders in CodeGenPrepare if it would create a critical edge 2016-04-05 14:06:20 +00:00
LoopUnroll Adds the ability to use an epilog remainder loop during loop unrolling and makes 2016-04-05 12:19:35 +00:00
LoopUnswitch [SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops 2016-03-29 04:08:57 +00:00
LoopVectorize testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
LoopVersioning [LVers] Change CHECK_LABEL to CHECK-LABEL (underscore->dash) 2016-03-28 21:04:13 +00:00
LoopVersioningLICM Corrected tests for Loop Versioning LICM, by adding “REQUIRES: asserts”. 2016-02-06 12:34:41 +00:00
LowerAtomic
LowerBitSets
LowerExpectIntrinsic
LowerGuardIntrinsic Introduce a @llvm.experimental.guard intrinsic 2016-03-31 00:18:46 +00:00
LowerInvoke
LowerSwitch
Mem2Reg testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
MemCpyOpt Imporove load to store => memcpy 2016-03-14 22:52:27 +00:00
MergeFunc
MetaRenamer
NaryReassociate
ObjCARC testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
PartiallyInlineLibCalls
PGOProfile [PGO] Avoid instrumenting direct callee's at value sites. 2016-04-04 18:56:36 +00:00
PhaseOrdering
PlaceSafepoints [PlaceSafepoints] Clamp NoStatepoints to true 2016-01-28 21:51:14 +00:00
PruneEH [PruneEH] Don't try to insert a terminator after another terminator 2016-01-23 06:00:44 +00:00
Reassociate Reassociate: Reprocess RedoInsts after each inst 2016-01-26 18:42:36 +00:00
Reg2Mem
RewriteStatepointsForGC [RS4GC] Lower calls to @llvm.experimental.deoptimize 2016-03-25 20:12:13 +00:00
SafeStack testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
SampleProfile testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
Scalarizer testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
ScalarRepl testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
SCCP
SeparateConstOffsetFromGEP [ValueTracking] Remove dead code from an old experiment 2016-03-03 19:44:06 +00:00
SimplifyCFG testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
Sink
SLPVectorizer [SLPVectorizer] Don't insert an extractelement before a catchswitch 2016-04-01 17:28:15 +00:00
SpeculativeExecution
SROA Have DataLayout::isLegalInteger() accept uint64_t 2016-03-18 23:19:29 +00:00
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
StructurizeCFG AMDGPU: Remove some old intrinsic uses from tests 2016-02-11 06:02:01 +00:00
TailCallElim Push isDereferenceableAndAlignedPointer down into isSafeToLoadUnconditionally 2016-01-17 12:35:29 +00:00
Util testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
WholeProgramDevirt WholeProgramDevirt: introduce. 2016-02-09 22:50:34 +00:00