HomePhabricator

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

Authored by mpark on Jul 8 2020, 10:46 AM.

Description

Remove the unnecessary is_nothrow_swappable condition in swap.

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

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D83274

Details

Committed
mparkJul 8 2020, 10:46 AM
Reviewer
Restricted Project
Differential Revision
D83274: Remove the unnecessary `is_nothrow_swappable` condition in `swap`.
Parents
rG82206e7fb49d: [X86] Enabled a bunch of 64-bit Interlocked* functions intrinsics on 32-bit…
Branches
Unknown
Tags
Unknown