[PATCH] D66977: [GVN] Propagate simple equalities from assumes within the tail of the block

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 15:23:22 PDT 2019


reames created this revision.
reames added reviewers: dberlin, fhahn, nikic.
Herald added subscribers: bollu, mcrosier.
Herald added a project: LLVM.

This extends the existing logic for propagating constant expressions in an analogous manner for what we do across basic blocks.  The core point is that we chose some order of operands, and canonicalize uses towards that one.

The heuristic used is inspired by the one used across blocks; in a follow up change, I'd like to common them so that the cross block version uses the slightly stronger ordering herein.  If preferred, I can weaken this one to match the cross block, then strengthen both in a single patch.

As noted by the TODOs in the code, there's a good amount of room for improving the existing code and making it more powerful.  Unless there's strong objection, I'd like to land this first, then iterate.  I am willing to commit to the findLeader change, and *maybe* the general restructure of propagateEqualities (depending on how much that snowballs - the tests are *super fragile*).


Repository:
  rL LLVM

https://reviews.llvm.org/D66977

Files:
  include/llvm/Transforms/Scalar/GVN.h
  lib/Transforms/Scalar/GVN.cpp
  test/Transforms/GVN/equality-assume.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66977.217984.patch
Type: text/x-patch
Size: 7705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190829/12e1fc71/attachment.bin>


More information about the llvm-commits mailing list