This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Use __make_integer_seq builtin when available
ClosedPublic

Authored by K-ballo on Nov 19 2015, 3:54 AM.

Details

Summary

Use the __make_integer_seq builtin, introduced by r252036, when available. This allows for an incredibly fast std::make_integer_sequence implementation.

Diff Detail

Event Timeline

K-ballo updated this revision to Diff 40624.Nov 19 2015, 3:54 AM
K-ballo retitled this revision from to [libcxx] Use __make_integer_seq builtin when available.
K-ballo updated this object.
K-ballo added a subscriber: cfe-commits.
majnemer edited edge metadata.Dec 6 2015, 2:02 PM

This LGTM but @mclow.lists or @EricWF should give the final say-so.

EricWF edited edge metadata.Dec 9 2015, 10:56 AM

@majnemer Will the compiler emit diagnostics comparable to the static asserts in the other implementation?

EricWF accepted this revision.Dec 9 2015, 12:30 PM
EricWF edited edge metadata.

The only issue I have with this is that we should still test both code patchs with clang so we can ensure the fallback implementation remains correct. I would change

#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)

Then add a test called test/std/utilities/intseq/intseq.make/make_integer_seq_fallback.pass.cpp that contains:

#define _LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE
#include "make_integer_seq.pass.cpp"

After that these changes LGTM. @K-ballo I'm happy to make the changes as I commit this if your OK with that?

This revision is now accepted and ready to land.Dec 9 2015, 12:30 PM

After that these changes LGTM. @K-ballo I'm happy to make the changes as I commit this if your OK with that?

@EricWF Go ahead, thank you!

EricWF closed this revision.Dec 9 2015, 2:06 PM

Committted in r255162. Thanks.