[all-commits] [llvm/llvm-project] 47b819: [LoongArch] Fix vpermi.w legalization with undef e...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jul 7 00:30:31 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 47b819b866636fb1770f78da3f45ebd64d5f9875
      https://github.com/llvm/llvm-project/commit/47b819b866636fb1770f78da3f45ebd64d5f9875
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/test/CodeGen/LoongArch/lasx/ir-instruction/shuffle-as-xvpermi.ll

  Log Message:
  -----------
  [LoongArch] Fix vpermi.w legalization with undef elements (#207751)

For the MaskSize==8 case, the code was comparing mask elements that
could be undef (-1). This could result in a miscompile (where -1 + 4 ==
3, which crosses from the high half to the low half) or the pattern not
matching (because -1 doesn't match the other mask element).

Fix this by explicitly handling undef elements in the code. If the high
half is undef, we can just ignore. If the low half is undef, we need to
use the value from the high half shifted down by 4. If neither are
undef, use the original check.



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