Skip to content

[InstCombine] Failure to simplify nested selects #59393

@nikic

Description

@nikic

https://alive2.llvm.org/ce/z/GjCXkB

define i32 @src(i1 %t1, i1 %t2, i32 %a, i32 %b, i32 %c) {
  %s1 = select i1 %t1, i32 %a, i32 %b
  %and = select i1 %t1, i1 %t2, i1 false
  %s2 = select i1 %and, i32 %c, i32 %s1
  ret i32 %s2
}
define i32 @tgt(i1 %t1, i1 %t2, i32 %a, i32 %b, i32 %c) {
  %s1 = select i1 %t2, i32 %c, i32 %a
  %s2 = select i1 %t1, i32 %s1, i32 %b
  ret i32 %s2
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions