[all-commits] [llvm/llvm-project] 3d850d: [SelectionDAG] Fix illegal widening of scalable-ve...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Mon Oct 18 02:08:55 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d850d03ae4d167f929c4469f858446d4a866c01
      https://github.com/llvm/llvm-project/commit/3d850d03ae4d167f929c4469f858446d4a866c01
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-10-18 (Mon, 18 Oct 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
    A llvm/test/CodeGen/RISCV/rvv/legalize-load-sdnode.ll
    A llvm/test/CodeGen/RISCV/rvv/legalize-store-sdnode.ll

  Log Message:
  -----------
  [SelectionDAG] Fix illegal widening of scalable-vector loads

The process of widening simple vector loads attempts to use a load of a
wider vector type if the original load is sufficiently aligned to avoid
memory faults.

However this optimization is only legal when performed on fixed-length
vector types. For scalable vector types this is invalid (unless vscale
happens to be 1).

This patch does increase the likelihood of compiler crashes (from
`FindMemType` failing to find a suitable type) but this now better
matches how widening non-simple loads, insufficiently-aligned loads, and
scalable-vector stores are handled.

Patches will be introduced later by which loads and stores can be
widened on targets with support for masked or predicated operations.

Reviewed By: craig.topper

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




More information about the All-commits mailing list