023-09-08 16:56
*To:* Lehua Ding <mailto:lehua.d...@rivai.ai>
*CC:* gcc-patches <mailto:gcc-patches@gcc.gnu.org>; juzhe.zhong
<mailto:juzhe.zh...@rivai.ai>
*Subject:* Re: [PATCH V3] Support folding min(poly,poly) to const
Lehua Ding writes:
> V3 change:
Thanks Richard.
LGTM again from RISC-V side :).
juzhe.zh...@rivai.ai
From: Richard Sandiford
Date: 2023-09-08 16:56
To: Lehua Ding
CC: gcc-patches; juzhe.zhong
Subject: Re: [PATCH V3] Support folding min(poly,poly) to const
Lehua Ding writes:
> V3 change: Address Richard's comments
Lehua Ding writes:
> V3 change: Address Richard's comments.
>
> Hi,
>
> This patch adds support that tries to fold `MIN (poly, poly)` to
> a constant. Consider the following C Code:
>
> ```
> void foo2 (int* restrict a, int* restrict b, int n)
> {
> for (int i = 0; i < 3; i += 1)
> a[i]
V3 change: Address Richard's comments.
Hi,
This patch adds support that tries to fold `MIN (poly, poly)` to
a constant. Consider the following C Code:
```
void foo2 (int* restrict a, int* restrict b, int n)
{
for (int i = 0; i < 3; i += 1)
a[i] += b[i];
}
```
Before this patch:
```
v