Landing: 32dc4bc481a0

Project / Subsystem

gcc / risc-v

Date

2026-09-01

Author

Wang Yaduo

Commit

32dc4bc481a0f3b94bf2129e908e15917f75b45f

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
risc-v
patch_id
—
commit_hash
32dc4bc481a0f3b94bf2129e908e15917f75b45f
source_type
github
headline
Correct scalar floating-point costs for RISC-V vector operations
tldr
RISC-V vector cost calculation now correctly handles scalar floating-point operations.
author
Wang Yaduo
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • risc-v
  • • vectorization
  • • optimization
  • • cost model
discussion_id_link
—
bugzilla_pr
—
date
2026-09-01T00:00:00.000Z

The RISC-V backend’s cost model for vector operations was incorrectly applying integer costs to scalar floating-point operations due to receiving a null vectype. This commit corrects the cost calculation by properly recovering the scalar type and ensures that LMUL (vector length multiplier) adjustments are restricted to actual vector types, improving instruction selection accuracy.