Issue 133373
Summary 64bit loop variable on 32bit may be optimized
Labels new issue
Assignees
Reporter wzssyqa
    The Code like this
```
int x[128000];

void in(int k, int n) {
        for(unsigned long long i=0; i<128000; i++)
 x[i] = k;
}
```

If we build it for a 32bit system such as
```
./bin/clang --target=riscv32-linux-gnu -O3 -S n.c -emit-llvm
```
the 64bit one will be used, while in fact we can transform it to 32bit one, as it is less than 128000 always.

In fact gcc does this transform.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to