llvm-project/llvm/test/Transforms/Mem2Reg
Joseph Tremoulet 27b1e3bd4f [Mem2Reg] Fix nondeterministic corner case
Summary:
When mem2reg inserts phi nodes in blocks with unreachable predecessors,
it adds undef operands for those incoming edges.  When there are
multiple such predecessors, the order is currently based on the address
of the BasicBlocks.  This change fixes that by using the BBNumbers in
the sort/search predicates, as is done elsewhere in mem2reg to ensure
determinism.

Also adds a testcase with a bunch of unreachable preds, which
(nodeterministically) fails without the fix.


Reviewers: majnemer

Reviewed By: majnemer

Subscribers: mgrang, llvm-commits

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

llvm-svn: 348024
2018-11-30 19:20:02 +00:00
..
2002-03-28-UninitializedVal.ll
2002-05-01-ShouldNotPromoteThisAlloca.ll
2003-04-10-DFNotFound.ll
2003-04-18-DeadBlockProblem.ll
2003-04-24-MultipleIdenticalSuccessors.ll
2003-06-26-IterativePromote.ll
2003-10-05-DeadPHIInsertion.ll
2005-06-30-ReadBeforeWrite.ll
2005-11-28-Crash.ll
2007-08-27-VolatileLoadsStores.ll
ConvertDebugInfo.ll
ConvertDebugInfo2.ll
PromoteMemToRegister.ll [Debugify] Avoid printing unnecessary square braces, NFC 2018-05-24 23:00:22 +00:00
UndefValuesMerge.ll
atomic.ll
crash.ll
dbg-addr-inline-dse.ll
dbg-addr.ll
dbg-inline-scope-for-phi.ll
debug-alloca-phi-2.ll Re-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue" 2018-06-15 13:48:55 +00:00
debug-alloca-phi.ll
debug-alloca-vla-1.ll Improve ConvertDebugDeclareToDebugValue 2018-06-26 06:17:00 +00:00
debug-alloca-vla-2.ll Improve ConvertDebugDeclareToDebugValue 2018-06-26 06:17:00 +00:00
ignore-lifetime.ll
optnone.ll
pr24179.ll
pr37632-unreachable-list-of-stores.ll [Mem2Reg] Avoid replacing load with itself in promoteSingleBlockAlloca. 2018-06-07 11:09:05 +00:00
preserve-nonnull-load-metadata.ll
undef-order.ll [Mem2Reg] Fix nondeterministic corner case 2018-11-30 19:20:02 +00:00