Page MenuHomePhabricator
Feed Advanced Search

Thu, Nov 24

eaeltsin added a comment to D137213: [clang][modules] NFCI: Pragma diagnostic mappings: write/read FileID instead of SourceLocation.

Looks like our tests fail because ReadFileID doesn't translate file ID as ReadSourceLocation/TranslateSourceLocation do. Please see the prototype fix inline.

Thu, Nov 24, 12:27 AM · Restricted Project, Restricted Project

Nov 1 2022

eaeltsin added a comment to D135137: [AggressiveInstCombine] Load merge the reverse load pattern of consecutive loads..

Here is the reproducer - https://godbolt.org/z/7bcjzfYK4

Nov 1 2022, 12:06 PM · Restricted Project, Restricted Project

Oct 21 2022

eaeltsin added a comment to D131858: [clang] Track the templated entity in type substitution..

Heads-up - I'm seeing the compilation failure that reduces to this commit. I didn't get a reproducer of the reasonable size yet :(

Oct 21 2022, 11:19 PM · Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project

Sep 1 2022

eaeltsin added a comment to rG482777123427: [InstCombine] fold test of equality to 0.0 with bitcast operand.

This commit crashes compilation of the following test t.cc:

using float32 = float;
struct Simd;
using float32x1 = Simd;
template <typename, typename In> void BitCast(In);
struct TypeInfo {
  using VectorType = float32 __attribute__((ext_vector_type(1)));
};
struct Simd {
  using MaskType = int;
  using VectorType = TypeInfo::VectorType;
  VectorType v;
  Simd(int) : v() {}
  friend MaskType operator==(Simd x, Simd y) { BitCast<MaskType>(x.v == y.v); }
  Simd operator++(int);
};
template <typename T> void TestSimdType() { T k0(T(0)++ == k0); }
void TypesTest_Typefloat32x1_TestTestBody() { TestSimdType<float32x1>(); }
Sep 1 2022, 5:16 AM · Restricted Project, Restricted Project

Aug 6 2022

eaeltsin added a comment to D128146: [libc++] Use uninitialized algorithms for vector.

@vitalybuka This isn't unexpected. -fno-inline disables inlining, which is essential for a lot of other optimizations. Using -fno-inline pretty much defeats the optimizer: https://godbolt.org/z/zrE5o1WK1.

I am more concerned about sanitizers

https://godbolt.org/z/1x9qjGG19 Near LBB11_5 we have now __asan_memcpy per every "P", before it was for entire vector.
I assume some additional improvement in instrumentation are possible, maybe replacing fixed short asan_memcpy with check/load/store. Or even optimizing asan_memcpy itself.

But still maybe some ideas if it's solvable on libc++ level so we rely less on optimizations?

I suspect this might go away if we manually lowered std::uninitialized_foo to memcpy like we do for std::copy and std::move.

(Just in case, I had a patch to do that a while ago: https://reviews.llvm.org/D118329)

Aug 6 2022, 12:22 AM · Restricted Project, Restricted Project

Aug 4 2022

eaeltsin added a comment to D128146: [libc++] Use uninitialized algorithms for vector.

The code is from libzim - https://github.com/openzim/libzim/blob/966f7b217e9bc36dc30be6d9e46d51a2bfb7091c/src/zim_types.h#L36 . It doesn't look nice to me, and there definitely are multiple ways to make it work.

Aug 4 2022, 5:29 AM · Restricted Project, Restricted Project

Aug 2 2022

eaeltsin added a comment to D128146: [libc++] Use uninitialized algorithms for vector.

Here is a sample that was compiling Ok before the change and is now broken: https://godbolt.org/z/djPG94f69

Aug 2 2022, 10:35 AM · Restricted Project, Restricted Project

Jul 23 2022

eaeltsin added a comment to D128146: [libc++] Use uninitialized algorithms for vector.

Thanks a lot, @huixie90!

Jul 23 2022, 10:25 PM · Restricted Project, Restricted Project

Jul 22 2022

eaeltsin added a comment to D128146: [libc++] Use uninitialized algorithms for vector.

Hi folks,

We have some code which compiles fine with the version previous to this patch and fails after.
The code compiles fine with godbolt: https://gcc.godbolt.org/z/ToPGG5cMb

But fails when built with clang containing this revision.
Repro compilation command:

clang -stdlib=libc++ -std=gnu++17 \
  -c /tmp/test.cc \
  -o /tmp/test.o

Compiler output:

/tmp/test.cc:5:17: error: assigning to 'float' from incompatible type 'Vx<float, 2>'
  data[Index] = std::forward<LastArg>(last_arg);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/test.cc:22:5: note: in instantiation of function template specialization 'SetData<0, 2, float, Vx<float, 2> &>' requested here
    SetData<0, Length, Element>(data_, std::forward<Args>(args)...);
    ^
[redacted]/include/c++/v1/__memory/allocator.h:165:28: note: in instantiation of function template specialization 'Vx<float, 2>::Vx<Vx<float, 2> &>' requested here
        ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
                           ^
[redacted]/include/c++/v1/__memory/allocator_traits.h:290:13: note: in instantiation of function template specialization 'std::allocator<Vx<float, 2>>::construct<Vx<float, 2>, Vx<float, 2> &>' requested here
        __a.construct(__p, _VSTD::forward<_Args>(__args)...);
            ^
[redacted]/include/c++/v1/__memory/uninitialized_algorithms.h:536:31: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<Vx<float, 2>>>::construct<Vx<float, 2>, Vx<float, 2> &, void>' requested here
    allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), *__first1);
                              ^
[redacted]/include/c++/v1/vector:1012:22: note: in instantiation of function template specialization 'std::__uninitialized_allocator_copy<std::allocator<Vx<float, 2>>, Vx<float, 2> *, Vx<float, 2> *, Vx<float, 2> *>' requested here
  __tx.__pos_ = std::__uninitialized_allocator_copy(__alloc(), __first, __last, __tx.__pos_);
                     ^
[redacted]/include/c++/v1/vector:1162:9: note: in instantiation of function template specialization 'std::vector<Vx<float, 2>>::__construct_at_end<Vx<float, 2> *>' requested here
        __construct_at_end(__x.__begin_, __x.__end_, __n);
        ^
/tmp/test.cc:35:16: note: in instantiation of member function 'std::vector<Vx<float, 2>>::vector' requested here
  do_something(vertices);
               ^
1 error generated.

I think this is a bug in your code. https://godbolt.org/z/sv8YehKhY fails the same way, but without std::vector. BTW the simplest fix would be to add Vx(Vx& v) : Vx(std::as_const(v)) {}.

Jul 22 2022, 10:49 PM · Restricted Project, Restricted Project

Jul 20 2022

eaeltsin added a comment to D129823: [libc++][ranges] Make range algorithms support proxy iterators.

Thanks Konstantin, now it works!

Jul 20 2022, 10:12 PM · Restricted Project, Restricted Project
eaeltsin added a comment to D129823: [libc++][ranges] Make range algorithms support proxy iterators.

Unfortunately not, this doesn't fix the issue I'm seeing.

Jul 20 2022, 2:36 PM · Restricted Project, Restricted Project

Jul 19 2022

eaeltsin added a comment to D128591: Transforms: refactor pow(x, n) expansion where n is a constant integer value.

Thanks Sanjay, this fixes the issues we are seeing so far.

Jul 19 2022, 10:11 AM · Restricted Project, Restricted Project
eaeltsin added a comment to D128591: Transforms: refactor pow(x, n) expansion where n is a constant integer value.

BTW, this is not about -Ofast - the problem reproduces with -O1 - https://gcc.godbolt.org/z/6barovn81

Jul 19 2022, 8:18 AM · Restricted Project, Restricted Project
eaeltsin updated eaeltsin.
Jul 19 2022, 6:40 AM
eaeltsin updated eaeltsin.
Jul 19 2022, 6:39 AM
eaeltsin added a comment to D128591: Transforms: refactor pow(x, n) expansion where n is a constant integer value.

Hi David,

Jul 19 2022, 6:08 AM · Restricted Project, Restricted Project
eaeltsin added a comment to D128591: Transforms: refactor pow(x, n) expansion where n is a constant integer value.

This patch introduces the difference between new inlined and library versions of std::pow, at least on x86_64. For large exponents, the difference is large. Also, when the difference accumulates, it makes a lot of existing tests that compare against golden values to go far beyond the meaningful margin.

Jul 19 2022, 4:53 AM · Restricted Project, Restricted Project
eaeltsin updated eaeltsin.
Jul 19 2022, 4:33 AM