[all-commits] [llvm/llvm-project] 29dfc6: [InstCombine] Fold redundant select guards for ctp...

Sai Sanjay Chikne via All-commits all-commits at lists.llvm.org
Mon May 4 03:43:47 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29dfc683a285f71063b2084fb64ad9a2bdf60240
      https://github.com/llvm/llvm-project/commit/29dfc683a285f71063b2084fb64ad9a2bdf60240
  Author: Sai Sanjay Chikne <74251419+sai18022001 at users.noreply.github.com>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    A llvm/test/Transforms/InstCombine/select-ctpop-fold.ll

  Log Message:
  -----------
  [InstCombine] Fold redundant select guards for ctpop (#195443)

Fixes #194207

Folds select patterns that guard ctpop for edge cases:
  `select (icmp ult X, 2), X, ctpop(X)`       --> `ctpop(X)`

These guards are unconditionally redundant since `ctpop(0)==0`,
`ctpop(1)==1` already.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list