Re: [PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
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:

Re: Re: [PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread 钟居哲
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

Re: [PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread Richard Sandiford via Gcc-patches
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]

[PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
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