[all-commits] [llvm/llvm-project] a1e59b: [GlobalISel] Make scalar G_SHUFFLE_VECTOR illegal....

David Green via All-commits all-commits at lists.llvm.org
Fri Oct 24 00:21:56 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a1e59bdc173187ec47e6ede69c99316eaee9e375
      https://github.com/llvm/llvm-project/commit/a1e59bdc173187ec47e6ede69c99316eaee9e375
  Author: David Green <david.green at arm.com>
  Date:   2025-10-24 (Fri, 24 Oct 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
    M llvm/include/llvm/Target/GlobalISel/Combine.td
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    M llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
    M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
    M llvm/lib/CodeGen/MIRParser/MIParser.cpp
    M llvm/lib/CodeGen/MachineVerifier.cpp
    M llvm/lib/Target/AArch64/AArch64Combine.td
    M llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-shuffle-vector.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-shuffle-vector-disjoint-mask.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-shuffle-vector-undef-rhs.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-shuffle-vector.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-shuffle-vector.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/prelegalizer-combiner-shuffle.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/shufflevector-pointer-crash.mir
    M llvm/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
    A llvm/test/CodeGen/MIR/AArch64/parse-shufflemask-invalid-scalar.mir
    M llvm/test/CodeGen/MIR/AArch64/parse-shufflemask.mir
    M llvm/test/MachineVerifier/test_g_shuffle_vector.mir

  Log Message:
  -----------
  [GlobalISel] Make scalar G_SHUFFLE_VECTOR illegal. (#140508)

I'm not sure if this is the best way forward or not, but we have a lot
of issues with forgetting that shuffle_vectors can be scalar again and
again. (There is another example from the recent known-bits code added
recently). As a scalar-dst shuffle vector is just an extract, and a
scalar-source shuffle vector is just a build vector, this patch makes
scalar shuffle vector illegal and adjusts the irbuilder to create the
correct node as required.

Most targets do this already through lowering or combines. Making scalar
shuffles illegal simplifies gisel as a whole, it just requires that
transforms that create shuffles of new sizes to account for the scalar
shuffle being illegal (mostly IRBuilder and LessElements).



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