This is an archive of the discontinued LLVM Phabricator instance.

Some fixes for open breaks on MacOS and UBSan
ClosedPublic

Authored by __simt__ on Feb 25 2020, 10:03 PM.

Details

Reviewers
ldionne
Summary

In this patch:

  1. Reduced the net of dependencies when platform semaphores are disabled.
  2. Respect the signed range of ptrdiff_t in tests.
  3. Construct the aligned member for the barrier algorithm properly.

Testing on this code is pretty light at this stage.

Diff Detail

Repository
rCXX libc++

Event Timeline

__simt__ created this revision.Feb 25 2020, 10:03 PM
ldionne added a subscriber: EricWF.Feb 26 2020, 3:51 PM
ldionne added inline comments.
libcxx/src/barrier.cpp
40

Couldn't we use the aligned versions of operator new and delete here? I believe we could then get rid of the __state_t* __state pointer?

I was going to suggest some complicated solution that does explicit calls to operator new[](size_t, align_val_t), however after thinking about it harder I think simply compiling as C++17 would solve the problem, since the array would then be aligned properly.

@EricWF WDYT about building with C++17 enabled?

ldionne accepted this revision.Feb 26 2020, 4:24 PM

But regardless, please ship this for now to unbreak the builders, this should be our top priority.

This revision is now accepted and ready to land.Feb 26 2020, 4:24 PM