[all-commits] [llvm/llvm-project] a66884: [DAGCombiner] Handle extending EXTRACT_VECTOR_ELTs...

Luke Lau via All-commits all-commits at lists.llvm.org
Tue Mar 5 02:31:46 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a668846202bcc34b1742f300ba1eb1a0e64fa36d
      https://github.com/llvm/llvm-project/commit/a668846202bcc34b1742f300ba1eb1a0e64fa36d
  Author: Luke Lau <luke at igalia.com>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    A llvm/test/CodeGen/RISCV/rvv/pr83920.ll

  Log Message:
  -----------
  [DAGCombiner] Handle extending EXTRACT_VECTOR_ELTs in calculateByteProvider (#83963)

An EXTRACT_VECTOR_ELT can extend the element to the width of its result
type, leaving the high bits undefined. Previously if we attempted to
query the bytes in these high bits we would recurse and hit an
assertion. This fixes it by bailing if the index is outside of the
vector element size.

I think the assertion Index < ByteWidth may still be incorrect, since
ByteWidth is calculated from Op.getValueSizeInBits(). I believe this
should be Op.getScalarValueSizeInBits() whenever VectorIndex is set
since we're querying the element now, not the vector. But I couldn't
think of a test case to trigger it. It can be addressed in a follow-up
patch.

Fixes #83920



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