Skip to content

[InstCombine] Missing zext(shl(trunc)) fold #61650

@nikic

Description

@nikic

From https://reviews.llvm.org/D146637:

define i32 @src(i32 %a) {
  %trunc = trunc i32 %a to i16
  %shl = shl i16 %trunc, 8
  %ext = zext i16 %shl to i32
  ret i32 %ext
}

define i32 @tgt(i32 %a) {
  %shl = shl i32 %a, 8
  %and = and i32 %shl, 65280
  ret i32 %and
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passestest-suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions