llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[InstCombine] Add of select and zext/sext of the select condition not simplified

Open nikic opened this issue 3 years ago • 1 comments

define i64 @src0(i1 %c) {
  %tmp0 = select i1 %c, i64 64, i64 1
  %ext = zext i1 %c to i64
  %tmp1 = add i64 %tmp0, %ext
  ret i64 %tmp1
}

define i64 @tgt0(i1 %c) {
  %tmp0 = select i1 %c, i64 65, i64 1
  ret i64 %tmp0
}

Some more variants: https://alive2.llvm.org/ce/z/bmtPuH

nikic avatar Jun 23 '23 13:06 nikic

Fix in progress at: https://reviews.llvm.org/D153963

dc03 avatar Jun 30 '23 10:06 dc03