[all-commits] [llvm/llvm-project] 715301: [PowerPC] Fix invalid cast for vector shuffles whe...

Amy Kwan via All-commits all-commits at lists.llvm.org
Mon Oct 24 07:57:16 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 715301056ee0b12d01463ea32ff0f006392f2d12
      https://github.com/llvm/llvm-project/commit/715301056ee0b12d01463ea32ff0f006392f2d12
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2022-10-24 (Mon, 24 Oct 2022)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/test/CodeGen/PowerPC/p10-splatImm32-undef.ll

  Log Message:
  -----------
  [PowerPC] Fix invalid cast for vector shuffles when lowering to the xxsplti32dx instruction.

When lowering vector shuffles into the xxsplti32dx instruction on Power10, we
canonicalize the right operand to be a BUILD_VECTOR and as a result, get the
commuted vector shuffle node.

However, a vector shuffle will not always be returned as the result for a
commuted vector shuffle. In such a scenario, this patch updates the original
cast of a shuffle into a dyn_cast<> and checks if the shuffle is a valid vector
shuffle node prior to obtaining the commuted shuffle mask.

This patch also adds a new test case that demonstrates this scenario (primarily
seen on 32-bit), and was originally a crash prior to this fix.

Differential Revision: https://reviews.llvm.org/D135024




More information about the All-commits mailing list