This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Refactor predicates for rvv intrinsic patterns.
ClosedPublic

Authored by jacquesguan on May 15 2023, 2:24 AM.

Details

Summary

This patch does the following things:

1, Add accurate Predicates in intrinsic-pseudo pattern class depending on the vector type.
2, Make vmulh, vmulhsu, vmulhu and vsmul intrinsic only able to select in v extension.

Diff Detail

Event Timeline

jacquesguan created this revision.May 15 2023, 2:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2023, 2:24 AM
jacquesguan requested review of this revision.May 15 2023, 2:24 AM
craig.topper added inline comments.May 15 2023, 10:39 AM
llvm/lib/Target/RISCV/RISCVFeatures.td
456

Multify -> Multiply

457

I don't think you need an assembler predicate. This is only use for CodeGenOnly pseudos.

460

You don't need an AssemblerPredicate

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
4465

Can reduce the indentation of the 2 defvars above

4748

Fix the indentation

5628–5629

Indent since you create a new scope

6339–6340

Indent

Address comment.

jacquesguan marked 7 inline comments as done.May 15 2023, 10:45 PM

Done, thanks.

craig.topper added inline comments.May 15 2023, 11:14 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
682

Why not use !eq(vti.Scalar, f16), !eq(vti.Scalar, f32), !eq(vti.Scalar, f64), !eq(vti.Scalar, i64) as the conditions and get rid of IsFloat?

4446–4447

Indent

4482–4483

Indent

4499–4500

Indent

4518–4519

Indent

4844–4845

Indent

6474–6475

Indent

6804–6805

Indent

Address comment.

jacquesguan marked 7 inline comments as done.

Fix more indentation.

jacquesguan marked an inline comment as done.May 16 2023, 1:59 AM
jacquesguan added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
682

The field Scalar depends on XLEN for integer vector, we need to use SEW to determine the spported integer EEW.

This revision is now accepted and ready to land.May 16 2023, 5:57 PM