[all-commits] [llvm/llvm-project] 98a07f: [X86] LowerCTPOP - "ctpop(i2 x) --> sub(x, (x >> 1))"

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Feb 21 05:55:52 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98a07f72eefb43476ca9e7af3178879d6ef71464
      https://github.com/llvm/llvm-project/commit/98a07f72eefb43476ca9e7af3178879d6ef71464
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/ctpop-mask.ll

  Log Message:
  -----------
  [X86] LowerCTPOP - "ctpop(i2 x) --> sub(x, (x >> 1))"

If we only have 2 active bits then we can avoid the i8 CTPOP multiply expansion entirely

Another expansion pulled from #79823


  Commit: b8c9b0613465b2770d2ae7f61364ddce6bba4511
      https://github.com/llvm/llvm-project/commit/b8c9b0613465b2770d2ae7f61364ddce6bba4511
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/ctpop-mask.ll

  Log Message:
  -----------
  [X86] LowerCTPOP - add i3 and i4 LUT 'shift+mask' expansions

Use the 3 or 4 active bits as a shift amount into a i32/i64 constant representing the number of set bits.

In future, it might be worthwhile to move this into a generic location in case other targets want to make use of them.

Another expansion pulled from #79823


  Commit: 88a18556aeeaf70315990ed9fb23c28834edf454
      https://github.com/llvm/llvm-project/commit/88a18556aeeaf70315990ed9fb23c28834edf454
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp

  Log Message:
  -----------
  Fix MSVC signed/unsigned mismatch warning


  Commit: e3d4cac2bcbdb719a0d29055c8c60df0e98e0126
      https://github.com/llvm/llvm-project/commit/e3d4cac2bcbdb719a0d29055c8c60df0e98e0126
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp

  Log Message:
  -----------
  Fix MSVC "not all control paths return a value" warning


Compare: https://github.com/llvm/llvm-project/compare/69279a8413e0...e3d4cac2bcbd

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