llvm-project/llvm/lib/Transforms
Davide Italiano d6bb8cab03 [NewGVN] Fix a consistent order for phi nodes operands.
The way we currently define congruency for two PHIExpression(s) is:

1) The operands to the phi functions are congruent
2) The PHIs are defined in the same BasicBlock.

NewGVN works under the assumption that phi operands are in predecessor
order, or at least in some consistent order. OTOH, is valid IR:

patatino:
  %meh = phi i16 [ %0, %winky ], [ %conv1, %tinky ]
  %banana = phi i16 [ %0, %tinky ], [ %conv1, %winky ]
  br label %end

and the in-memory representations of the two SSA registers have an
inconsistent order. This violation of NewGVN assumptions results into
two PHIs found congruent when they're not. While we think it's useful
to have always a consistent order enforced, let's fix this in NewGVN
sorting uses in predecessor order before creating a PHI expression.

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

llvm-svn: 302552
2017-05-09 16:58:28 +00:00
..
Coroutines [IR] Abstract away ArgNo+1 attribute indexing as much as possible 2017-05-03 18:17:31 +00:00
Hello Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
IPO [PartialInlining] Capture by reference rather than by value. 2017-05-08 20:44:01 +00:00
InstCombine [InstCombineCasts] Fix checks in sext->lshr->trunc pattern. 2017-05-09 16:24:59 +00:00
Instrumentation [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. llvm part. 2017-05-05 23:14:40 +00:00
ObjCARC [IR] Abstract away ArgNo+1 attribute indexing as much as possible 2017-05-03 18:17:31 +00:00
Scalar [NewGVN] Fix a consistent order for phi nodes operands. 2017-05-09 16:58:28 +00:00
Utils Revert r302469 "Make it illegal for two Functions to point to the same DISubprogram" 2017-05-09 14:44:15 +00:00
Vectorize [LV] Fix insertion point for shuffle vectors in first order recurrence 2017-05-09 14:29:33 +00:00
CMakeLists.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00
LLVMBuild.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00