[all-commits] [llvm/llvm-project] 33d2c0: [X86] Add test showing a bug where a BLENDV mask i...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Sat Mar 19 09:33:19 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 33d2c00814b27437a1681cc3d1fb5fa6ca7e1536
      https://github.com/llvm/llvm-project/commit/33d2c00814b27437a1681cc3d1fb5fa6ca7e1536
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-19 (Sat, 19 Mar 2022)

  Changed paths:
    M llvm/test/CodeGen/X86/avx-select.ll

  Log Message:
  -----------
  [X86] Add test showing a bug where a BLENDV mask is being constant folded as VSELECT mask

combineSelect doesn't expect X86ISD::BLENDV ops to appear before legalization and is treating the constant mask as a vselect mask (mask != 0) instead of blendv (mask < 0)


  Commit: a6c18bfbe39dc494d18fb8e66b16d0e292ed25e4
      https://github.com/llvm/llvm-project/commit/a6c18bfbe39dc494d18fb8e66b16d0e292ed25e4
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-19 (Sat, 19 Mar 2022)

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

  Log Message:
  -----------
  [X86] combineSelect - don't constant fold BLENDV nodes like VSELECT

If a X86ISD::BLENDV op appears before legalization (in this test case due to the icmp_slt x, 0) its constant mask was being treated as a vselect mask (mask != 0) instead of blendv (mask < 0)

This just prevents constant folding entirely for non-VSELECT ops.


Compare: https://github.com/llvm/llvm-project/compare/d5fbcf76fd9b...a6c18bfbe39d


More information about the All-commits mailing list