[PATCH] D83360: [InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 14:51:37 PDT 2020


efriedma added a comment.

In D83360#2140224 <https://reviews.llvm.org/D83360#2140224>, @regehr wrote:

> @craig.topper ok, I agree that should work. alive doesn't like it -- is this an alive bug @nlopes? a freeze should not yield undef.
>  https://alive2.llvm.org/ce/z/mWAsYv


Did you mean to check something like the following?

  define i32 @src(i1 %cond, i32 %x) {
    %x2 = freeze i32 %x
    %s = select i1 %cond, i32 %x2, i32 undef
    ret i32 %s
  }
  
  define i32 @tgt(i1 %cond, i32 %x) {
    %x2 = freeze i32 %x
    ret i32 %x2
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83360/new/

https://reviews.llvm.org/D83360





More information about the llvm-commits mailing list