RISC-V: Document optimization parameter riscv-strcmp-inline-limit

Message ID 20231202211554.2319770-1-christoph.muellner@vrull.eu
State Superseded
Headers
Series RISC-V: Document optimization parameter riscv-strcmp-inline-limit |

Checks

Context Check Description
rivoscibot/toolchain-ci-rivos-lint success Lint passed
rivoscibot/toolchain-ci-rivos-apply-patch success Patch applied
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gcv-lp64d-multilib fail Build failed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gcv-lp64d-multilib fail Build failed
rivoscibot/toolchain-ci-rivos-build--linux-rv32gc_zba_zbb_zbc_zbs-ilp32d-non-multilib fail Build failed
rivoscibot/toolchain-ci-rivos-build--newlib-rv64gc-lp64d-multilib fail Build failed
rivoscibot/toolchain-ci-rivos-build--linux-rv64gc_zba_zbb_zbc_zbs-lp64d-non-multilib fail Build failed
rivoscibot/toolchain-ci-rivos-test fail Testing failed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed

Commit Message

Christoph Müllner Dec. 2, 2023, 9:15 p.m. UTC
  This patch documents the optimization parameter
riscv-strcmp-inline-limit, which can be used to tweak the behaviour
of -minline-strcmp and -minline-strncmp.

gcc/ChangeLog:

	PR target/112650
	* doc/invoke.texi: Document riscv-strcmp-inline-limit.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
 gcc/doc/invoke.texi | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Kito Cheng Dec. 4, 2023, 2:43 a.m. UTC | #1
LGTM

On Sun, Dec 3, 2023 at 5:16 AM Christoph Müllner <
christoph.muellner@vrull.eu> wrote:

> This patch documents the optimization parameter
> riscv-strcmp-inline-limit, which can be used to tweak the behaviour
> of -minline-strcmp and -minline-strncmp.
>
> gcc/ChangeLog:
>
>         PR target/112650
>         * doc/invoke.texi: Document riscv-strcmp-inline-limit.
>
> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
> ---
>  gcc/doc/invoke.texi | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 2fab4c5d71f..ba2d843b484 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -29846,6 +29846,10 @@ Inlining will only be done if the strings are
> properly aligned
>  and instructions for accelerated processing are available.
>  The default is to not inline strcmp calls.
>
> +The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
> +the maximum number of bytes compared by the inlined code.
> +The default value is 64.
> +
>  @opindex minline-strncmp
>  @item -minline-strncmp
>  @itemx -mno-inline-strncmp
> @@ -29854,6 +29858,10 @@ Inlining will only be done if the strings are
> properly aligned
>  and instructions for accelerated processing are available.
>  The default is to not inline strncmp calls.
>
> +The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
> +the maximum number of bytes compared by the inlined code.
> +The default value is 64.
> +
>  @opindex mshorten-memrefs
>  @item -mshorten-memrefs
>  @itemx -mno-shorten-memrefs
> --
> 2.41.0
>
>
  
Kito Cheng Dec. 4, 2023, 3:46 a.m. UTC | #2
Wait, I got this on my machine?

../../../../riscv-gnu-toolchain-trunk/gcc/gcc/doc/invoke.texi:29774: misplaced }
../../../../riscv-gnu-toolchain-trunk/gcc/gcc/doc/invoke.texi:29786: misplaced }


On Mon, Dec 4, 2023 at 10:43 AM Kito Cheng <kito.cheng@gmail.com> wrote:
>
> LGTM
>
> On Sun, Dec 3, 2023 at 5:16 AM Christoph Müllner <christoph.muellner@vrull.eu> wrote:
>>
>> This patch documents the optimization parameter
>> riscv-strcmp-inline-limit, which can be used to tweak the behaviour
>> of -minline-strcmp and -minline-strncmp.
>>
>> gcc/ChangeLog:
>>
>>         PR target/112650
>>         * doc/invoke.texi: Document riscv-strcmp-inline-limit.
>>
>> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
>> ---
>>  gcc/doc/invoke.texi | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
>> index 2fab4c5d71f..ba2d843b484 100644
>> --- a/gcc/doc/invoke.texi
>> +++ b/gcc/doc/invoke.texi
>> @@ -29846,6 +29846,10 @@ Inlining will only be done if the strings are properly aligned
>>  and instructions for accelerated processing are available.
>>  The default is to not inline strcmp calls.
>>
>> +The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
>> +the maximum number of bytes compared by the inlined code.
>> +The default value is 64.
>> +
>>  @opindex minline-strncmp
>>  @item -minline-strncmp
>>  @itemx -mno-inline-strncmp
>> @@ -29854,6 +29858,10 @@ Inlining will only be done if the strings are properly aligned
>>  and instructions for accelerated processing are available.
>>  The default is to not inline strncmp calls.
>>
>> +The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
>> +the maximum number of bytes compared by the inlined code.
>> +The default value is 64.
>> +
>>  @opindex mshorten-memrefs
>>  @item -mshorten-memrefs
>>  @itemx -mno-shorten-memrefs
>> --
>> 2.41.0
>>
  
Christoph Müllner Dec. 4, 2023, 9:56 a.m. UTC | #3
On Mon, Dec 4, 2023 at 4:46 AM Kito Cheng <kito.cheng@gmail.com> wrote:
>
> Wait, I got this on my machine?
>
> ../../../../riscv-gnu-toolchain-trunk/gcc/gcc/doc/invoke.texi:29774: misplaced }
> ../../../../riscv-gnu-toolchain-trunk/gcc/gcc/doc/invoke.texi:29786: misplaced }

@{n} should be @var{n}.
I was too optimistic and sent the patch before the build finished (or
in this case failed).
Sorry for that.

I have sent a v2 that builds fine:
  https://gcc.gnu.org/pipermail/gcc-patches/2023-December/639142.html

>
>
> On Mon, Dec 4, 2023 at 10:43 AM Kito Cheng <kito.cheng@gmail.com> wrote:
> >
> > LGTM
> >
> > On Sun, Dec 3, 2023 at 5:16 AM Christoph Müllner <christoph.muellner@vrull.eu> wrote:
> >>
> >> This patch documents the optimization parameter
> >> riscv-strcmp-inline-limit, which can be used to tweak the behaviour
> >> of -minline-strcmp and -minline-strncmp.
> >>
> >> gcc/ChangeLog:
> >>
> >>         PR target/112650
> >>         * doc/invoke.texi: Document riscv-strcmp-inline-limit.
> >>
> >> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
> >> ---
> >>  gcc/doc/invoke.texi | 8 ++++++++
> >>  1 file changed, 8 insertions(+)
> >>
> >> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> >> index 2fab4c5d71f..ba2d843b484 100644
> >> --- a/gcc/doc/invoke.texi
> >> +++ b/gcc/doc/invoke.texi
> >> @@ -29846,6 +29846,10 @@ Inlining will only be done if the strings are properly aligned
> >>  and instructions for accelerated processing are available.
> >>  The default is to not inline strcmp calls.
> >>
> >> +The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
> >> +the maximum number of bytes compared by the inlined code.
> >> +The default value is 64.
> >> +
> >>  @opindex minline-strncmp
> >>  @item -minline-strncmp
> >>  @itemx -mno-inline-strncmp
> >> @@ -29854,6 +29858,10 @@ Inlining will only be done if the strings are properly aligned
> >>  and instructions for accelerated processing are available.
> >>  The default is to not inline strncmp calls.
> >>
> >> +The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
> >> +the maximum number of bytes compared by the inlined code.
> >> +The default value is 64.
> >> +
> >>  @opindex mshorten-memrefs
> >>  @item -mshorten-memrefs
> >>  @itemx -mno-shorten-memrefs
> >> --
> >> 2.41.0
> >>
  

Patch

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 2fab4c5d71f..ba2d843b484 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -29846,6 +29846,10 @@  Inlining will only be done if the strings are properly aligned
 and instructions for accelerated processing are available.
 The default is to not inline strcmp calls.
 
+The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
+the maximum number of bytes compared by the inlined code.
+The default value is 64.
+
 @opindex minline-strncmp
 @item -minline-strncmp
 @itemx -mno-inline-strncmp
@@ -29854,6 +29858,10 @@  Inlining will only be done if the strings are properly aligned
 and instructions for accelerated processing are available.
 The default is to not inline strncmp calls.
 
+The @option{--param riscv-strcmp-inline-limit=@{n}} parameter controls
+the maximum number of bytes compared by the inlined code.
+The default value is 64.
+
 @opindex mshorten-memrefs
 @item -mshorten-memrefs
 @itemx -mno-shorten-memrefs