Landing: cb3ca149a51b

Project / Subsystem

gcc / risc-v

Date

2026-04-27

Author

Pan Li

Commit

cb3ca149a51be12f835df60b88e830aea35a3bbd

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
risc-v
patch_id
commit_hash
cb3ca149a51be12f835df60b88e830aea35a3bbd
source_type
github
headline
RISC-V: Combine vec_duplicate + vmsgtu.vv to vmsgtu.vx based on GR2VR cost
tldr
Combines vec_duplicate + vmsgtu.vv to vmsgtu.vx when the cost of GR2VR is zero.
author
Pan Li
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • risc-v
  • rvv
  • vectorization
  • optimization
discussion_id_link
bugzilla_pr
date
2026-04-27T00:00:00.000Z

This commit optimizes RISC-V vector code by combining the vec_duplicate and vmsgtu.vv instructions into a single vmsgtu.vx instruction when the cost of transferring data from general-purpose registers to vector registers (GR2VR) is zero. This optimization reduces the number of instructions executed, improving performance. The combination is skipped if the GR2VR cost is greater than zero.