This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add basic cost modelling for fixed length vector arithmetic
AbandonedPublic

Authored by liaolucy on May 20 2022, 3:56 AM.

Diff Detail

Event Timeline

liaolucy created this revision.May 20 2022, 3:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2022, 3:56 AM
liaolucy requested review of this revision.May 20 2022, 3:56 AM
reames added a subscriber: reames.May 20 2022, 7:19 AM

Minor style comments only. Don't have enough experience with cost modeling to comment on the heuristic itself and will leave that to others.

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
213

I'd fold this into the prior if in this case.

221

A switch would be much more readable here.

liaolucy updated this revision to Diff 431581.May 23 2022, 9:16 PM
liaolucy marked 2 inline comments as done.

Address reames's comments. rebase

craig.topper added inline comments.May 23 2022, 9:23 PM
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
236

LT.first is usually a multiplier. Why is this addition?

craig.topper added inline comments.May 23 2022, 9:27 PM
llvm/test/Analysis/CostModel/RISCV/arith-fp.ll
22

Should you add +experimental-zvfh?

liaolucy updated this revision to Diff 431601.May 24 2022, 12:16 AM
liaolucy marked an inline comment as done.

thanks craig.topper, testcases add +experimental-zvfh.
change LT.first + 1 to LT.first * 2

liaolucy added inline comments.May 24 2022, 12:21 AM
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
236

I'm still not sure it's accurate. Maybe the integer type needs to return LT.first.

liaolucy abandoned this revision.May 24 2023, 5:54 AM
evandro removed a subscriber: evandro.May 24 2023, 1:47 PM