Displaying 2 results from an estimated 2 matches for "1jwe5j".
2020 Nov 18
2
[AssumeBundles] ValueTracking cannot use alignment assumptions?
...me format) and clang-trunk (assume bundles):
#include <stdint.h>
int foo(int *p) {
__builtin_assume_aligned(p, 32);
return ((intptr_t) p) & 4;
}
clang-11 (https://godbolt.org/z/xGh1e4) computes the returned value statically:
ret i32 0
clang-trunk (https://godbolt.org/z/1jWe5j) fails to optimize the code:
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 4
ret i32 %5
As one can see, after switching to operand bundles, clang-trunk lost its ability to reason about low bits in aligned pointers.
So, I wonder if there are any plans to teach Val...
2020 Nov 18
0
[AssumeBundles] ValueTracking cannot use alignment assumptions?
...#include <stdint.h>
> int foo(int *p) {
> __builtin_assume_aligned(p, 32);
> return ((intptr_t) p) & 4;
> }
>
> clang-11 (https://godbolt.org/z/xGh1e4) computes the returned value statically:
>
> ret i32 0
>
> clang-trunk (https://godbolt.org/z/1jWe5j) fails to optimize the code:
>
> %3 = ptrtoint i32* %0 to i64
> %4 = trunc i64 %3 to i32
> %5 = and i32 %4, 4
> ret i32 %5
>
> As one can see, after switching to operand bundles, clang-trunk lost its ability to reason about low bits in aligned pointers.
>
> So, I...