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

RotateRight via All-commits all-commits at lists.llvm.org
Sat Feb 27 06:58:50 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 356cdabd3a9e0ff919ea2c1a35c8706ecb915297
      https://github.com/llvm/llvm-project/commit/356cdabd3a9e0ff919ea2c1a35c8706ecb915297
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-02-27 (Sat, 27 Feb 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




More information about the All-commits mailing list