[all-commits] [llvm/llvm-project] 908c1b: [RISCV] Fix incorrect extend type in vwmulsu combine.

Amy Kwan via All-commits all-commits at lists.llvm.org
Mon Feb 21 11:21:27 PST 2022


  Branch: refs/heads/release/14.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 908c1bae6e7fa2339e8b9b7856d849f20e98f653
      https://github.com/llvm/llvm-project/commit/908c1bae6e7fa2339e8b9b7856d849f20e98f653
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwmulsu.ll

  Log Message:
  -----------
  [RISCV] Fix incorrect extend type in vwmulsu combine.

While matching widening multiply, if we matched an extend from i8->i32,
i16->i64 or i8->i64, we need to reintroduce a narrower extend. If we're
matching a vwmulsu we need to use a sext for op0 and a zext for op1.

This bug exists in LLVM 14 and will need to be backported.

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

(cherry picked from commit 478c237e21b2c3a83e46f26fcbeb3876682f9b14)


  Commit: 1e340705f142ee7379272f94df888d6ddaaa32db
      https://github.com/llvm/llvm-project/commit/1e340705f142ee7379272f94df888d6ddaaa32db
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2022-02-21 (Mon, 21 Feb 2022)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.h
    A llvm/test/CodeGen/PowerPC/p10-handle-split-promote-vec.ll

  Log Message:
  -----------
  [PowerPC] Add default handling for single element vectors, and split/promote vNi1 vectors.

This patch updates the handling of vectors in getPreferredVectorAction():

For single-element and scalable vectors, fall back to default vector legalization
handling. For vNi1 vectors, add handling to either split or promote them in
order to prevent the production of wide v256i1/v512i1 types.

The following assertion is fixed by this patch, as we ended up producing the
wide vector types (that are used for MMA) in the backend prior to this fix.

```
Assertion failed: VT.getSizeInBits() == Operand.getValueSizeInBits() &&
"Cannot BITCAST between types of different sizes!"
```

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

(cherry picked from commit ac5a5a9cfe7c83ee5fbbc48118b4239e7e6cf6c9)


Compare: https://github.com/llvm/llvm-project/compare/42a797ef011b...1e340705f142


More information about the All-commits mailing list