https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121762
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:e8a360e79a783250d6466636f6256c75dbb457b2 commit r16-4205-ge8a360e79a783250d6466636f6256c75dbb457b2 Author: Andrew Pinski <[email protected]> Date: Tue Sep 23 21:08:24 2025 -0700 fab/isel: Move atomic optimizations to isel from fab [PR121762] These atomic optimizations that are currently in fab are really an instruction selection like optimizations so let's move them to gimple-isel.cc. Note since this is the last manual optimization left in fab, I have simplified the code to only fold internal and normal builtins. The next patch will remove all of fab. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/121762 gcc/ChangeLog: * gimple-isel.cc (gimple_nop_atomic_bit_test_and_p): New decl. (gimple_nop_convert): Likewise. (convert_atomic_bit_not): Moved from tree-ssa-ccp.cc. (optimize_atomic_bit_test_and): Likewise. (optimize_atomic_op_fetch_cmp_0): Likewise. (gimple_isel_builtin_call): New function. (CASE_ATOMIC): Moved from tree-ssa-ccp.cc. (CASE_ATOMIC_CMP0): Likewise. (CASE_ATOMIC_BIT_TEST_AND): Likewise. (pass_gimple_isel::execute): For calls just call gimple_isel_builtin_call. * tree-ssa-ccp.cc (convert_atomic_bit_not): Move to gimple-isel.cc. (gimple_nop_atomic_bit_test_and_p): Likewise. (gimple_nop_convert): Likewise. (optimize_atomic_bit_test_and): Likewise. (optimize_atomic_op_fetch_cmp_0): Likewise. (pass_fold_builtins::execute): Just call fold_stmt for internal or normal bultin calls. (CASE_ATOMIC): Move to gimple-isel.cc. (CASE_ATOMIC_CMP0): Likewise. (CASE_ATOMIC_BIT_TEST_AND): Likewise. Signed-off-by: Andrew Pinski <[email protected]>
