[all-commits] [llvm/llvm-project] 9c9161: [CVP] Guard against poison in common phi value tra...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue May 25 11:47:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9c91614959f31d743470c1cb2f4828abd8fcb517
      https://github.com/llvm/llvm-project/commit/9c91614959f31d743470c1cb2f4828abd8fcb517
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-05-25 (Tue, 25 May 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
    M llvm/test/Transforms/CorrelatedValuePropagation/phi-common-val.ll

  Log Message:
  -----------
  [CVP] Guard against poison in common phi value transform (PR50399)

The common phi value transform replaces constants with values that
have the same value as the constant on a given edge. However, LVI
generally only provides information that is correct up to poison,
so this can end up replacing a well-defined value with poison.
D69442 addressed an instance of this problem by clearing poison
flags on the generating instruction, which was sufficient at the
time. rGa917fb89dc28 made LVI's edge value analysis slightly more
powerful, and clearing poison flags is no longer sufficient.

This patch changes the transform to instead explicitly guard against
a poison value instead. This should be satisfied for most cases due
to a prior branch on poison.

Fixes https://bugs.llvm.org/show_bug.cgi?id=50399.

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




More information about the All-commits mailing list