On Mon, Oct 23, 2023 at 2:56 PM Hanke Zhang wrote:
>
> Richard Biener 于2023年10月23日周一 20:32写道:
> >
> > On Mon, Oct 23, 2023 at 12:50 PM Hanke Zhang wrote:
> > >
> > > Hi Richard:
> > >
> > > Thanks for your advice. But when I try a simpler example like the one
> > > below before looking at the co
Richard Biener 于2023年10月23日周一 20:32写道:
>
> On Mon, Oct 23, 2023 at 12:50 PM Hanke Zhang wrote:
> >
> > Hi Richard:
> >
> > Thanks for your advice. But when I try a simpler example like the one
> > below before looking at the code, GCC still does nothing.
> >
> > int main() {
> > int width;
>
On Mon, Oct 23, 2023 at 12:50 PM Hanke Zhang wrote:
>
> Hi Richard:
>
> Thanks for your advice. But when I try a simpler example like the one
> below before looking at the code, GCC still does nothing.
>
> int main() {
> int width;
> scanf("%d", &width);
> int sum = 0;
> for (int i
Hi Richard:
Thanks for your advice. But when I try a simpler example like the one
below before looking at the code, GCC still does nothing.
int main() {
int width;
scanf("%d", &width);
int sum = 0;
for (int i = 0; i < width; i++) sum += i;
printf("%d\n", sum);
}
I tried O3 an
On Tue, Oct 17, 2023 at 2:39 PM Hanke Zhang wrote:
>
> Hi Richard
> I get it, thank you again.
>
> And I got another problem, so I'd like ask it by the way. Can the left
> shift of the induction variable in a loop be optimized as a constant?
> Like the code below:
>
> int ans = 0;
> int width = ra
Hi Richard
I get it, thank you again.
And I got another problem, so I'd like ask it by the way. Can the left
shift of the induction variable in a loop be optimized as a constant?
Like the code below:
int ans = 0;
int width = rand() % 16;
for (int j = 0; j < width; j++)
ans += 1 << (j + width)
Richard Biener 于2023年10月17日周二 17:26写道:
>
> On Thu, Oct 12, 2023 at 2:18 PM Hanke Zhang via Gcc wrote:
> >
> > Hi, I'm recently working on vectorization of GCC. I'm stuck in a small
> > problem and would like to ask for advice.
> >
> > For example, for the following code:
> >
> > int main() {
> >
On Tue, Oct 17, 2023 at 1:54 PM Hanke Zhang wrote:
>
> Richard Biener 于2023年10月17日周二 17:26写道:
> >
> > On Thu, Oct 12, 2023 at 2:18 PM Hanke Zhang via Gcc wrote:
> > >
> > > Hi, I'm recently working on vectorization of GCC. I'm stuck in a small
> > > problem and would like to ask for advice.
> >
On Thu, Oct 12, 2023 at 2:18 PM Hanke Zhang via Gcc wrote:
>
> Hi, I'm recently working on vectorization of GCC. I'm stuck in a small
> problem and would like to ask for advice.
>
> For example, for the following code:
>
> int main() {
> int size = 1000;
> int *foo = malloc(sizeof(int) * size)