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
4468

Can reduce the indentation of the 2 defvars above

4751

Fix the indentation

5631–5632

Indent since you create a new scope

6342–6343

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?

4451

Indent

4487

Indent

4504

Indent

4523

Indent

4850

Indent

6479

Indent

6809

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