[PATCH] D47010: [NewGVN] Minor cleanups

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 17 04:49:47 PDT 2018


nikic created this revision.
nikic added a reviewer: dberlin.
Herald added subscribers: llvm-commits, Prazek.

This patch implements a number of minor cleanups in NewGVN. If desired I can split this up further.

- In setMemoryClass(), assert that the memory access is already in MemoryAccessToClass. Previously the code simply did nothing if it was not in the map, which is confusing.
- Add a missing deleteExpression() in PHI Evaluation.
- Simplify handling of the false edge of branch predicates. We can handle this the same way as the true edge with an inverted predicate. This is both more general and simpler than the previous code.
- Fix a copy&paste mistake in addPredicateUsers which caused assumes() to not be handled. I think that due to the specific circumstances of the use, this did not cause issues.
- Simplify SwitchInst edge processing. Don't create an unused SwitchEdges map and handle default+cases the same. This code was probably doing something more prior to the introduction of PredicateInfo and this got left behind.
- Fix some comments.


Repository:
  rL LLVM

https://reviews.llvm.org/D47010

Files:
  lib/Transforms/Scalar/NewGVN.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47010.147291.patch
Type: text/x-patch
Size: 8809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180517/70488bd2/attachment.bin>


More information about the llvm-commits mailing list