[all-commits] [llvm/llvm-project] f73ba0: [SimplifyCFG] avoid illegal phi with both poison a...

RotateRight via All-commits all-commits at lists.llvm.org
Tue Mar 2 20:04:22 PST 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: f73ba0f3582ba33984ad996c124d106a9737cd90
      https://github.com/llvm/llvm-project/commit/f73ba0f3582ba33984ad996c124d106a9737cd90
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-03-02 (Tue, 02 Mar 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/Local.cpp
    A llvm/test/Transforms/SimplifyCFG/poison-merge.ll

  Log Message:
  -----------
  [SimplifyCFG] avoid illegal phi with both poison and undef

In the example based on:
https://llvm.org/PR49218
...we are crashing because poison is a subclass of undef, so we merge blocks and create:

PHI node has multiple entries for the same basic block with different incoming values!
  %k3 = phi i64 [ poison, %entry ], [ %k3, %g ], [ undef, %entry ]

If both poison and undef values are incoming, we soften the poison values to undef.

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

(cherry picked from commit 356cdabd3a9e0ff919ea2c1a35c8706ecb915297)




More information about the All-commits mailing list