This is an archive of the discontinued LLVM Phabricator instance.

Remove the unnecessary `is_nothrow_swappable` condition in `swap`.
ClosedPublic

Authored by mpark on Jul 6 2020, 7:10 PM.

Details

Summary

Thanks to @lewissbaker who pointed out the unnecessary condition in
https://reviews.llvm.org/D81954#inline-756872. Since this codepath does not
make use of swap anyway (that codepath is a different branch), we can safely
remove this condition and produce better codegen when all types are nothrow
movable but are potentially-throwing swappable.

See codegen in https://gcc.godbolt.org/z/uDFZjz

Diff Detail

Event Timeline

mpark created this revision.Jul 6 2020, 7:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2020, 7:10 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Jul 7 2020, 5:46 AM
This revision is now accepted and ready to land.Jul 7 2020, 5:46 AM
This revision was automatically updated to reflect the committed changes.