[all-commits] [llvm/llvm-project] ad16c6: [X86][AVX] Ensure we retain zero elements in selec...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Oct 11 06:50:50 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad16c6e52fb74c2e784530f14c19e72d93c9ad62
      https://github.com/llvm/llvm-project/commit/ad16c6e52fb74c2e784530f14c19e72d93c9ad62
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-10-11 (Mon, 11 Oct 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll

  Log Message:
  -----------
  [X86][AVX] Ensure we retain zero elements in select(pshufb,pshufb) -> or(pshufb,pshufb) fold (PR52122)

The select(pshufb,pshufb) -> or(pshufb,pshufb) fold uses getConstVector to create the refreshed pshufb masks, which treats all negative indices as undef.

PR52122 shows that if we were selecting an element that the PSHUFB has set to zero we must set it back to 0x80 when we recreate the PSHUFB mask and not just leave it as SM_SentinelZero




More information about the All-commits mailing list