[all-commits] [llvm/llvm-project] 71d2de: [X86] Promote cttz_i32(x) -> cttz_i64((i64)x | (1 ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Aug 13 02:16:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 71d2de8ecd793bd1a1ea51b61d22c233029b3fe8
      https://github.com/llvm/llvm-project/commit/71d2de8ecd793bd1a1ea51b61d22c233029b3fe8
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2024-08-13 (Tue, 13 Aug 2024)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/cttz.ll
    M llvm/test/CodeGen/X86/known-never-zero.ll
    M llvm/test/CodeGen/X86/pr89877.ll
    M llvm/test/CodeGen/X86/pr90847.ll

  Log Message:
  -----------
  [X86] Promote cttz_i32(x) -> cttz_i64((i64)x | (1 << 32)) (#102900)

On 64bit targets we can promote i32 CTTZ nodes to i64 CTTZ_ZERO_UNDEF by setting the 32nd bit.

#57811 also queried about whether we should use BTS instead of MOVABS+OR to avoid a i64 immediate - I'm willing to tweak the DAGToDAG isel peephole for these cases if reviewers think it worthwhile. But most recent CPUs can actually handle MOVABS faster than BTS/C/R.......

Fixes #57811



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