llvm-project/llvm/lib/Transforms
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
..
AggressiveInstCombine [Aggressive InstCombine] Move C bindings to their own header file. 2018-09-05 11:41:12 +00:00
Coroutines [TI removal] Make `getTerminator()` return a generic `Instruction`. 2018-10-15 10:42:50 +00:00
Hello
IPO [ThinLTO] Import local variables from the same module as caller 2018-11-29 17:02:42 +00:00
InstCombine Revert r347871 "Fix: Add support for TFE/LWE in image intrinsic" 2018-11-29 20:14:17 +00:00
Instrumentation [ProfileSummary] Standardize methods and fix comment 2018-11-19 05:23:16 +00:00
ObjCARC [TI removal] Switch ObjCARC code to directly use the nice range-based 2018-10-18 00:38:34 +00:00
Scalar [LoopSimplifyCFG] Update MemorySSA in terminator folding. PR39783 2018-11-30 10:06:23 +00:00
Utils [Mem2Reg] Fix nondeterministic corner case 2018-11-30 19:20:02 +00:00
Vectorize [SLP]PR39774: Update references of the replaced external instructions. 2018-11-30 15:14:20 +00:00
CMakeLists.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
LLVMBuild.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00