[all-commits] [llvm/llvm-project] 5a6e66: [InstCombine] add folds for icmp+ctpop

RotateRight via All-commits all-commits at lists.llvm.org
Mon Oct 26 13:49:24 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a6e66ec72382d370046e04c415f8c3cb7e8b68d
      https://github.com/llvm/llvm-project/commit/5a6e66ec72382d370046e04c415f8c3cb7e8b68d
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/cmp-intrinsic.ll

  Log Message:
  -----------
  [InstCombine] add folds for icmp+ctpop

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

  define void @src(i64 %value) {
    %t0 = call i64 @llvm.ctpop.i64(i64 %value)
    %gt = icmp ugt i64 %t0, 63
    %lt = icmp ult i64 %t0, 64
    call void @use(i1 %gt, i1 %lt)
    ret void
  }

  define void @tgt(i64 %value) {
    %eq = icmp eq i64 %value, -1
    %ne = icmp ne i64 %value, -1
    call void @use(i1 %eq, i1 %ne)
    ret void
  }

  declare i64 @llvm.ctpop.i64(i64) #1
  declare void @use(i1, i1)




More information about the All-commits mailing list