Skip to content

[InstCombine] reduce test-for-overflow of shifted value #57338

@rotateright

Description

@rotateright

Forking this off from #57330:

define i1 @src(i8 %x) {
  %add = shl i8 %x, 1
  %cmp = icmp ult i8 %add, %x
  ret i1 %cmp
}

define i1 @tgt(i8 %x) {
  %r = icmp slt i8 %x, 0
  ret i1 %r
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions