Re: [PATCH] RISC-V: Improve code generation for select of consecutive constants

2024-09-18 Thread Jeff Law
On 9/17/24 5:25 AM, Jovan Vukic wrote: The patch optimizes code generated for comparisons of the form x > y ? 2 : 3 (x <= y ? 3 : 2) and x < y ? 2 : 3 (x >= y ? 3 : 2). For the following C code: long f1(long x, long y) { return (x > y) ? 2 : 3; } long f2(long x, long y) { return (

[PATCH] RISC-V: Improve code generation for select of consecutive constants

2024-09-17 Thread Jovan Vukic
The patch optimizes code generated for comparisons of the form x > y ? 2 : 3 (x <= y ? 3 : 2) and x < y ? 2 : 3 (x >= y ? 3 : 2). For the following C code: long f1(long x, long y) { return (x > y) ? 2 : 3; } long f2(long x, long y) { return (x < y) ? 2 : 3; } Before the patch, the gene