[all-commits] [llvm/llvm-project] 59ced7: [ValueTracking] Add rotate idiom to haveNoCommonBi...

Alex MacLean via All-commits all-commits at lists.llvm.org
Fri Jan 10 09:18:05 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59ced72bc211f150518cf31606b58b11cb6ff310
      https://github.com/llvm/llvm-project/commit/59ced72bc211f150518cf31606b58b11cb6ff310
  Author: Alex MacLean <amaclean at nvidia.com>
  Date:   2025-01-10 (Fri, 10 Jan 2025)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstCombine/rotate.ll

  Log Message:
  -----------
  [ValueTracking] Add rotate idiom to haveNoCommonBitsSet special cases (#122165)

An occasional idiom for rotation is "(A << B) + (A >> (BitWidth - B))".
Currently this is not well handled on targets with native
funnel-shift/rotate support. Add a special case to haveNoCommonBitsSet
to ensure that the addition is converted to a disjoint or in InstCombine
so during instruction selection the idiom can be converted to an
efficient rotation implementation.

Proof: https://alive2.llvm.org/ce/z/WdCZsN



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