[all-commits] [llvm/llvm-project] 2b9509: [GuardWidening] Fix the crash while replacing the ...

serguei-katkov via All-commits all-commits at lists.llvm.org
Mon Apr 3 03:21:09 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b9509627caa2b0ca27eb1b05099eb016491f027
      https://github.com/llvm/llvm-project/commit/2b9509627caa2b0ca27eb1b05099eb016491f027
  Author: Serguei Katkov <serguei.katkov at azul.com>
  Date:   2023-04-03 (Mon, 03 Apr 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/GuardWidening.cpp
    M llvm/test/Transforms/GuardWidening/hang.ll
    M llvm/test/Transforms/GuardWidening/posion.ll

  Log Message:
  -----------
  [GuardWidening] Fix the crash while replacing the users of poison.

When we replace poison with freeze poison it might appear
that user of poison is a constant (for example vector constant).

In this case we will get that constant will get non-constant operand.

Moreover replacing poison and GlobalValue everywhere in module seems
to be overkill. So the solution will be just make a replacement
only in instructions we visited (contributing to hoisted condition).
Moreover if user of posion is constant, this constant also should need
a freeze and it does not make sense to replace poison with frozen version,
just freeze another constant.

Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D147429




More information about the All-commits mailing list