llvm-project/llvm/lib/Transforms/Scalar
Brian M. Rzycki 887865c1ad [JumpThreading] Fix incorrect fold conditional after indirectbr/callbr
Fixes bug 40992: https://bugs.llvm.org/show_bug.cgi?id=40992

There is potential for miscompiled code emitted from JumpThreading when
analyzing a block with one or more indirectbr or callbr predecessors. The
ProcessThreadableEdges() function incorrectly folds conditional branches
into an unconditional branch.

This patch prevents incorrect branch folding without fully pessimizing
other potential threading opportunities through the same basic block.

This IR shape was manually fed in via opt and is unclear if clang and the
full pass pipeline will ever emit similar code shapes.

Thanks to Matthias Liedtke for the bug report and simplified IR example.

Differential Revision: https://reviews.llvm.org/D60284

llvm-svn: 357930
2019-04-08 18:20:35 +00:00
..
ADCE.cpp Move DomTreeUpdater from IR to Analysis 2019-02-06 02:52:52 +00:00
AlignmentFromAssumptions.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BDCE.cpp [BDCE] Optimize find+insert with early insert 2019-03-07 06:38:03 +00:00
CMakeLists.txt Default lowering for experimental.widenable.condition 2019-01-31 09:10:17 +00:00
CallSiteSplitting.cpp [DTU] Refine the interface and logic of applyUpdates 2019-02-22 13:48:38 +00:00
ConstantHoisting.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
ConstantProp.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CorrelatedValuePropagation.cpp [DTU] Refine the interface and logic of applyUpdates 2019-02-22 13:48:38 +00:00
DCE.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeadStoreElimination.cpp Recommit "[DSE] Preserve basic block ordering using OrderedBasicBlock." 2019-03-29 14:10:24 +00:00
DivRemPairs.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EarlyCSE.cpp Very minor typo. NFC 2019-03-12 07:08:19 +00:00
FlattenCFGPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Float2Int.cpp [ConstantRange] Add getFull() + getEmpty() named constructors; NFC 2019-03-24 09:34:40 +00:00
GVN.cpp Implementation of asm-goto support in LLVM 2019-02-08 20:48:56 +00:00
GVNHoist.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GVNSink.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GuardWidening.cpp [NFC] Add const qualifiers where possible 2019-02-13 11:54:45 +00:00
IVUsersPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IndVarSimplify.cpp [IndVars] Fix corner case with unreachable Phi inputs. PR40454 2019-02-12 09:59:44 +00:00
InductiveRangeCheckElimination.cpp Enable IRCE for narrow latch by defailt 2019-01-30 11:25:12 +00:00
InferAddressSpaces.cpp [InferAddressSpaces] Fix fallthrough error 2019-02-21 13:10:37 +00:00
InstSimplifyPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
JumpThreading.cpp [JumpThreading] Fix incorrect fold conditional after indirectbr/callbr 2019-04-08 18:20:35 +00:00
LICM.cpp [NFC] Remove dead parameter "FreeInLoop", fix some typos and trailing whitespace. 2019-04-01 20:37:56 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopAccessAnalysisPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopDataPrefetch.cpp [opaque pointer types] Pass function types to CallInst creation. 2019-02-01 20:43:25 +00:00
LoopDeletion.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopDistribute.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopIdiomRecognize.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
LoopInstSimplify.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopInterchange.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopLoadElimination.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
LoopPassManager.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopPredication.cpp [LoopPredication] Simplify widenable condition handling [NFC] 2019-04-02 02:42:57 +00:00
LoopRerollPass.cpp [LoopReroll] Fix reroll root legality checking. 2019-02-12 00:33:25 +00:00
LoopRotation.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopSimplifyCFG.cpp [LoopSimplifyCFG] Update MemorySSA after r353911. 2019-02-21 19:54:05 +00:00
LoopSink.cpp [LICM&MSSA] Limit store hoisting. 2019-02-11 19:07:15 +00:00
LoopStrengthReduce.cpp [LSR] Fix signed overflow in GenerateCrossUseConstantOffsets. 2019-03-28 22:17:29 +00:00
LoopUnrollAndJamPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopUnrollPass.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
LoopUnswitch.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
LoopVersioningLICM.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LowerAtomic.cpp [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
LowerExpectIntrinsic.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LowerGuardIntrinsic.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LowerWidenableCondition.cpp Update more files added with the old header to the new one. 2019-02-11 08:25:56 +00:00
MakeGuardsExplicit.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MemCpyOptimizer.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
MergeICmps.cpp [MergeICmps] Make base ordering really deterministic. 2019-02-15 14:17:17 +00:00
MergedLoadStoreMotion.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NaryReassociate.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
NewGVN.cpp [format] \t => ' ' 2019-03-12 14:48:32 +00:00
PartiallyInlineLibCalls.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PlaceSafepoints.cpp [CallSite removal] Migrate the statepoint GC infrastructure to use the 2019-02-11 07:42:30 +00:00
Reassociate.cpp Fix non-determinism in Reassociate caused by address coincidences 2019-03-22 20:16:35 +00:00
Reg2Mem.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RewriteStatepointsForGC.cpp [CallSite removal] Migrate the statepoint GC infrastructure to use the 2019-02-11 07:42:30 +00:00
SCCP.cpp [CallSite removal] Migrate ConstantFolding APIs and implementation to 2019-02-11 07:51:44 +00:00
SROA.cpp [SROA] Fix a crash when trying to convert a memset to an non-integral pointer type 2019-03-12 20:15:05 +00:00
Scalar.cpp Default lowering for experimental.widenable.condition 2019-01-31 09:10:17 +00:00
Scalarizer.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
SeparateConstOffsetFromGEP.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SimpleLoopUnswitch.cpp [MemorySSA & LoopPassManager] Resolve PR40038. 2019-02-22 07:18:37 +00:00
SimplifyCFGPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sink.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SpeculateAroundPHIs.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SpeculativeExecution.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StraightLineStrengthReduce.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
StructurizeCFG.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TailRecursionElimination.cpp [DTU] Deprecate insertEdge*/deleteEdge* 2019-02-22 05:41:43 +00:00
WarnMissedTransforms.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00