Skip to content

[InstCombine] Missed optimization for trunc (Pow2 >> X) to i1 #156898

@nikic

Description

@nikic

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

define i1 @src(i8 %x) {
  %lshr = lshr i8 4, %x
  %trunc = trunc i8 %lshr to i1
  ret i1 %trunc
}

define i1 @tgt(i8 %x) {
  %cmp = icmp eq i8 %x, 2
  ret i1 %cmp
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions