[all-commits] [llvm/llvm-project] 3210ce: [X86] Fold (iX bitreverse(bitcast(vXi1 X))) -> (iX...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jan 9 11:06:55 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3210ce276350a247220b193db12a9b45d1034724
      https://github.com/llvm/llvm-project/commit/3210ce276350a247220b193db12a9b45d1034724
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/pr77459.ll

  Log Message:
  -----------
  [X86] Fold (iX bitreverse(bitcast(vXi1 X))) -> (iX bitcast(shuffle(X)))

X86 doesn't have a BITREVERSE instruction, so if we're working with a casted boolean vector, we're better off shuffling the vector instead if we have PSHUFB (SSSE3 or later)

Fixes #77459




More information about the All-commits mailing list