[all-commits] [llvm/llvm-project] 5f5f47: [DAG] Fold extract_vector_elt (scalar_to_vector), ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jan 21 02:58:42 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f5f4785648959dfbb5c88d183816f85a0974561
      https://github.com/llvm/llvm-project/commit/5f5f4785648959dfbb5c88d183816f85a0974561
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-21 (Tue, 21 Jan 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AMDGPU/cvt_f32_ubyte.ll
    M llvm/test/CodeGen/AMDGPU/max.i16.ll

  Log Message:
  -----------
  [DAG] Fold extract_vector_elt (scalar_to_vector), K to undef (K != 0)

This was unconditionally folding this to the source operand, even if the access was out of bounds. Use undef instead of the extract is not the first element.

This helps with some cases where 3-vectors are legalized and avoids processing the 4th component.

Original Patch by: arsenm (Matt Arsenault)

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




More information about the All-commits mailing list