On 07/09/2026 09:51, Tamar Christina wrote:
-----Original Message-----
From: Alfie Richards <[email protected]>
Sent: 08 August 2026 00:11
To: [email protected]
Cc: Alex Coplan <[email protected]>; Alice Carlotti
<[email protected]>; [email protected];
[email protected]; Tamar Christina <[email protected]>;
[email protected]; [email protected]; [email protected]; Alfie
Richards <[email protected]>
Subject: [PATCH v2 13/13] vect: Enable HSSR by default.

gcc/ChangeLog:

        * params.opt: Change param_vect_hssr_usage to initialize to 2.
---
  gcc/params.opt | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/params.opt b/gcc/params.opt
index 3e8f83e3fb2..dc7def2275b 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -1292,8 +1292,8 @@ Common Joined UInteger
Var(param_vect_partial_vector_usage) Init(2) IntegerRange
  Controls how loop vectorizer uses partial vectors.  0 means never, 1 means
only for loops whose need to iterate can be removed, 2 means for all loops.
The default value is 2.

  -param=vect-hssr-usage=
-Common Joined UInteger Var(param_vect_hssr_usage) Init(0)
IntegerRange(0, 3) Param Optimization NoOffload
-Controls how loop vectorizer uses hardware safe speculative loads.  0 means
never, 1 means only when profitable, 2 means whenever profitable possibly as
a versioned option, 3 means whenever possible.  The default value is 0.
+Common Joined UInteger Var(param_vect_hssr_usage) Init(2)
IntegerRange(0, 3) Param Optimization NoOffload
+Controls how loop vectorizer uses hardware safe speculative loads.  0 means
never, 1 means only when profitable, 2 means whenever profitable possibly as
a versioned option, 3 means whenever possible.  The default value is 2.


I'll comment on this one first even though you introduced it in the bigger 
patch, but
do we need 3? What's the difference between 3 and -mmax-vectorization or 
-fno-vect-cost-model?

Well 3 says to use HSSR unconditionally if its possible, including preferring loops that support HSSR (even if there is a different mode that doesnt need it, and would be faster), and never to version for it.

It was useful in testing specifically because you can make sure the HSSR loop is always emitted and taken.

I think that makes it (very marginally) different from -mmax-vectorization and -fno-vect-cost-model?

Though I could likely make -fno-vect-cost-model do the same thing (prefer HSSR over everything else, and no versioning)? If you prefer?

KR,
Alfie


Thanks,
Tamar

  -param=vect-inner-loop-cost-factor=
  Common Joined UInteger Var(param_vect_inner_loop_cost_factor) Init(50)
IntegerRange(1, 10000) Param Optimization NoOffload
--
2.43.0


Reply via email to