]> granicus.if.org Git - llvm/commit
[GVN] Propagate simple equalities from assumes within the tail of the block
authorPhilip Reames <listmail@philipreames.com>
Tue, 3 Sep 2019 17:31:19 +0000 (17:31 +0000)
committerPhilip Reames <listmail@philipreames.com>
Tue, 3 Sep 2019 17:31:19 +0000 (17:31 +0000)
commit9124b7237228ceccd967873a5be9fe8ee459e8ee
tree4bad1113798a1736fe0fa7d0fc09a54977c756fb
parent3487d71788c15668bd4cc9f9c56c286c6b6eabb3
[GVN] Propagate simple equalities from assumes within the tail of the block

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 plan to common them so that the cross block version uses the slightly stronger ordering herein.

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.  Some follow up work planned.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370791 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Scalar/GVN.h
lib/Transforms/Scalar/GVN.cpp
test/Transforms/GVN/equality-assume.ll