[all-commits] [llvm/llvm-project] 671cef: [AggressiveInstcombine] Fold away shift in or redu...

David Green via All-commits all-commits at lists.llvm.org
Tue May 13 02:33:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 671cef029fc13ea652ca6605b6b508c0d7332fa9
      https://github.com/llvm/llvm-project/commit/671cef029fc13ea652ca6605b6b508c0d7332fa9
  Author: David Green <david.green at arm.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
    M llvm/test/Transforms/AggressiveInstCombine/or-shift-chain.ll

  Log Message:
  -----------
  [AggressiveInstcombine] Fold away shift in or reduction chain. (#137875)

If we have `icmp eq or(a, shl(b)), 0` then the shift can be removed so
long as it is nuw or nsw. It is still comparing that some bits are
non-zero.
https://alive2.llvm.org/ce/z/nhrBVX.

This is also true of ne, and true for longer or chains.



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