Skip to content

Commit 10a7d31

Browse files
zhongjuzheIncarnation-p-lee
authored andcommitted
RISC-V: Clang format riscv-vsetvl.cc[NFC]
Commited. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (change_insn): Clang format. (vector_infos_manager::all_same_ratio_p): Ditto. (vector_infos_manager::all_same_avl_p): Ditto. (pass_vsetvl::refine_vsetvls): Ditto. (pass_vsetvl::cleanup_vsetvls): Ditto. (pass_vsetvl::commit_vsetvls): Ditto. (pass_vsetvl::local_eliminate_vsetvl_insn): Ditto. (pass_vsetvl::global_eliminate_vsetvl_insn): Ditto. (pass_vsetvl::compute_probabilities): Ditto.
1 parent b817bfa commit 10a7d31

File tree

1 file changed

+29
-36
lines changed

1 file changed

+29
-36
lines changed

gcc/config/riscv/riscv-vsetvl.cc

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ change_insn (function_info *ssa, insn_change change, insn_info *insn,
907907
] UNSPEC_VPREDICATE)
908908
(plus:RVVM4DI (reg/v:RVVM4DI 104 v8 [orig:137 op1 ] [137])
909909
(sign_extend:RVVM4DI (vec_duplicate:RVVM4SI (reg:SI 15 a5
910-
[140])))) (unspec:RVVM4DI [ (const_int 0 [0]) ] UNSPEC_VUNDEF))) "rvv.c":8:12
911-
2784 {pred_single_widen_addsvnx8di_scalar} (expr_list:REG_EQUIV
910+
[140])))) (unspec:RVVM4DI [ (const_int 0 [0]) ] UNSPEC_VUNDEF)))
911+
"rvv.c":8:12 2784 {pred_single_widen_addsvnx8di_scalar} (expr_list:REG_EQUIV
912912
(mem/c:RVVM4DI (reg:DI 10 a0 [142]) [1 <retval>+0 S[64, 64] A128])
913913
(expr_list:REG_EQUAL (if_then_else:RVVM4DI (unspec:RVVMF8BI [
914914
(const_vector:RVVMF8BI repeat [
@@ -2428,12 +2428,12 @@ vector_infos_manager::all_same_ratio_p (sbitmap bitdata) const
24282428
sbitmap_iterator sbi;
24292429

24302430
EXECUTE_IF_SET_IN_BITMAP (bitdata, 0, bb_index, sbi)
2431-
{
2432-
if (ratio == -1)
2433-
ratio = vector_exprs[bb_index]->get_ratio ();
2434-
else if (vector_exprs[bb_index]->get_ratio () != ratio)
2435-
return false;
2436-
}
2431+
{
2432+
if (ratio == -1)
2433+
ratio = vector_exprs[bb_index]->get_ratio ();
2434+
else if (vector_exprs[bb_index]->get_ratio () != ratio)
2435+
return false;
2436+
}
24372437
return true;
24382438
}
24392439

@@ -2473,10 +2473,10 @@ vector_infos_manager::all_same_avl_p (const basic_block cfg_bb,
24732473
sbitmap_iterator sbi;
24742474

24752475
EXECUTE_IF_SET_IN_BITMAP (bitdata, 0, bb_index, sbi)
2476-
{
2477-
if (vector_exprs[bb_index]->get_avl_info () != avl)
2478-
return false;
2479-
}
2476+
{
2477+
if (vector_exprs[bb_index]->get_avl_info () != avl)
2478+
return false;
2479+
}
24802480
return true;
24812481
}
24822482

@@ -3892,7 +3892,7 @@ pass_vsetvl::refine_vsetvls (void) const
38923892
basic_block cfg_bb;
38933893
FOR_EACH_BB_FN (cfg_bb, cfun)
38943894
{
3895-
auto info = get_block_info(cfg_bb).local_dem;
3895+
auto info = get_block_info (cfg_bb).local_dem;
38963896
insn_info *insn = info.get_insn ();
38973897
if (!info.valid_p ())
38983898
continue;
@@ -3938,8 +3938,7 @@ pass_vsetvl::cleanup_vsetvls ()
39383938
basic_block cfg_bb;
39393939
FOR_EACH_BB_FN (cfg_bb, cfun)
39403940
{
3941-
auto &info
3942-
= get_block_info(cfg_bb).reaching_out;
3941+
auto &info = get_block_info (cfg_bb).reaching_out;
39433942
gcc_assert (m_vector_manager->expr_set_num (
39443943
m_vector_manager->vector_del[cfg_bb->index])
39453944
<= 1);
@@ -3951,9 +3950,7 @@ pass_vsetvl::cleanup_vsetvls ()
39513950
info.set_unknown ();
39523951
else
39533952
{
3954-
const auto dem
3955-
= get_block_info(cfg_bb)
3956-
.local_dem;
3953+
const auto dem = get_block_info (cfg_bb).local_dem;
39573954
gcc_assert (dem == *m_vector_manager->vector_exprs[i]);
39583955
insn_info *insn = dem.get_insn ();
39593956
gcc_assert (insn && insn->rtl ());
@@ -4020,8 +4017,7 @@ pass_vsetvl::commit_vsetvls (void)
40204017
for (const bb_info *bb : crtl->ssa->bbs ())
40214018
{
40224019
basic_block cfg_bb = bb->cfg_bb ();
4023-
const auto reaching_out
4024-
= get_block_info(cfg_bb).reaching_out;
4020+
const auto reaching_out = get_block_info (cfg_bb).reaching_out;
40254021
if (!reaching_out.dirty_p ())
40264022
continue;
40274023

@@ -4035,14 +4031,14 @@ pass_vsetvl::commit_vsetvls (void)
40354031
sbitmap avin = m_vector_manager->vector_avin[cfg_bb->index];
40364032
bool available_p = false;
40374033
EXECUTE_IF_SET_IN_BITMAP (avin, 0, bb_index, sbi)
4038-
{
4039-
if (m_vector_manager->vector_exprs[bb_index]->available_p (
4040-
reaching_out))
4041-
{
4042-
available_p = true;
4043-
break;
4044-
}
4045-
}
4034+
{
4035+
if (m_vector_manager->vector_exprs[bb_index]->available_p (
4036+
reaching_out))
4037+
{
4038+
available_p = true;
4039+
break;
4040+
}
4041+
}
40464042
if (available_p)
40474043
continue;
40484044
}
@@ -4263,7 +4259,8 @@ pass_vsetvl::local_eliminate_vsetvl_insn (const bb_info *bb) const
42634259

42644260
/* Local AVL compatibility checking is simpler than global, we only
42654261
need to check the REGNO is same. */
4266-
if (prev_dem.valid_or_dirty_p () && prev_dem.skip_avl_compatible_p (curr_dem)
4262+
if (prev_dem.valid_or_dirty_p ()
4263+
&& prev_dem.skip_avl_compatible_p (curr_dem)
42674264
&& local_avl_compatible_p (prev_avl, curr_avl))
42684265
{
42694266
/* curr_dem and prev_dem is compatible! */
@@ -4365,9 +4362,7 @@ pass_vsetvl::global_eliminate_vsetvl_insn (const bb_info *bb) const
43654362
vsetvl_rinsn = get_vsetvl_at_end (bb, &dem);
43664363

43674364
/* No need to optimize if block doesn't have vsetvl instructions. */
4368-
if (!dem.valid_or_dirty_p ()
4369-
|| !vsetvl_rinsn
4370-
|| !dem.get_avl_source ()
4365+
if (!dem.valid_or_dirty_p () || !vsetvl_rinsn || !dem.get_avl_source ()
43714366
|| !dem.has_avl_reg ())
43724367
return false;
43734368

@@ -4655,8 +4650,7 @@ pass_vsetvl::compute_probabilities (void)
46554650
for (const bb_info *bb : crtl->ssa->bbs ())
46564651
{
46574652
basic_block cfg_bb = bb->cfg_bb ();
4658-
auto &curr_prob
4659-
= get_block_info(cfg_bb).probability;
4653+
auto &curr_prob = get_block_info (cfg_bb).probability;
46604654

46614655
/* GCC assume entry block (bb 0) are always so
46624656
executed so set its probability as "always". */
@@ -4669,8 +4663,7 @@ pass_vsetvl::compute_probabilities (void)
46694663
gcc_assert (curr_prob.initialized_p ());
46704664
FOR_EACH_EDGE (e, ei, cfg_bb->succs)
46714665
{
4672-
auto &new_prob
4673-
= get_block_info(e->dest).probability;
4666+
auto &new_prob = get_block_info (e->dest).probability;
46744667
if (!new_prob.initialized_p ())
46754668
new_prob = curr_prob * e->probability;
46764669
else if (new_prob == profile_probability::always ())

0 commit comments

Comments
 (0)