[all-commits] [llvm/llvm-project] 93e156: [DAG] Fix a miscompile in insert_subvector undef (...

Philip Reames via All-commits all-commits at lists.llvm.org
Mon Nov 27 16:45:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 93e156833bfadfbabfa5be2afad4f002c019257f
      https://github.com/llvm/llvm-project/commit/93e156833bfadfbabfa5be2afad4f002c019257f
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2023-11-27 (Mon, 27 Nov 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/RISCV/rvv/insert-subvector.ll

  Log Message:
  -----------
  [DAG] Fix a miscompile in insert_subvector undef (insert_subvector undef, ..), idx combine (#73587)

The combine was implicitly assuming that the index on the outer
insert_subvector meant the same thing when the source was switched to be
the index of the inner insert_subvector. This is not true if the
innermost sub-vector is fixed, and the outer subvector is scalable.

I could do a less restrictive fix here - i.e. allow the case where the
scalability of the subvectors are the same - but there's no test
coverage which shows this transform actually has profit. Given that, go
for the simplest fix.




More information about the All-commits mailing list