OSDN Git Service

[GVN] Remove stale entries in phitranslate cache when new phi is generated for PRE
authorWei Mi <wmi@google.com>
Tue, 8 Aug 2017 21:40:14 +0000 (21:40 +0000)
committerWei Mi <wmi@google.com>
Tue, 8 Aug 2017 21:40:14 +0000 (21:40 +0000)
commita39bc3c640c1e93d07beb35dc8dc9e96c5f51196
tree55c8b0c6c61ed2daa7fb34356820c79aa2bf516c
parentb95a570738179e6047bf05bdc1f923afb02f8996
[GVN] Remove stale entries in phitranslate cache when new phi is generated for PRE

When a new phi is generated for scalarpre of an expression, the phiTranslate cache
will become stale: Before PRE, the candidate expression must not be available in a
predecessor block, and phitranslate will cache the information. After PRE, the
expression will become available in all predecessor blocks, so the related entries
in phiTranslate cache becomes stale. The patch will simply remove the stale entries
so phiTranslate can be recomputed next time.

The stale entries in phitranslate cache will not affect correctness but will cause
missing PRE opportunity for later instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310421 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Scalar/GVN.h
lib/Transforms/Scalar/GVN.cpp
test/Transforms/GVN/PRE/phi-translate-2.ll