[all-commits] [llvm/llvm-project] d1f4d6: Merging r370547:

tstellar via All-commits all-commits at lists.llvm.org
Wed Nov 20 19:38:40 PST 2019


  Branch: refs/heads/release/9.x
  Home:   https://github.com/llvm/llvm-project
  Commit: d1f4d6a49343c2ed5df3c8a6cea99ae8de7b96ac
      https://github.com/llvm/llvm-project/commit/d1f4d6a49343c2ed5df3c8a6cea99ae8de7b96ac
  Author: Wei Mi <wmi at google.com>
  Date:   2019-11-20 (Wed, 20 Nov 2019)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/GVN.h
    M llvm/lib/Transforms/Scalar/GVN.cpp
    A llvm/test/Transforms/GVN/pr42605.ll

  Log Message:
  -----------
  Merging r370547:

------------------------------------------------------------------------
r370547 | wmi | 2019-08-30 16:01:22 -0700 (Fri, 30 Aug 2019) | 24 lines

[GVN] Verify value equality before doing phi translation for call instruction

This is an updated version of https://reviews.llvm.org/D66909 to fix PR42605.

Basically, current phi translatation translates an old value number to an new
value number for a call instruction based on the literal equality of call
expression, without verifying there is no clobber in between. This is incorrect.

To get a finegrain check, use MachineDependence analysis to do the job. However,
this is still not ideal. Although given a call instruction,
`MemoryDependenceResults::getCallDependencyFrom` returns identical call
instructions without clobber in between using MemDepResult with its DepType to
be `Def`. However, identical is too strict here and we want it to be relaxed a
little to consider phi-translation -- callee is the same, param operands can be
different. That means changing the semantic of `MemDepResult::Def` and I don't
know the potential impact.

So currently the patch is still conservative to only handle
MemDepResult::NonFuncLocal, which means the current call has no function local
clobber. If there is clobber, even if the clobber doesn't stand in between the
current call and the call with the new value, we won't do phi-translate.

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

------------------------------------------------------------------------




More information about the All-commits mailing list