[all-commits] [llvm/llvm-project] ce3812: [RISCV] Avoid redundant branch-to-branch when expa...
Alex Bradbury via All-commits
all-commits at lists.llvm.org
Wed Aug 17 05:49:39 PDT 2022
Author: Alex Bradbury <asb at igalia.com>
Date: 2022-08-17 (Wed, 17 Aug 2022)
[RISCV] Avoid redundant branch-to-branch when expanding cmpxchg
If the success value of a cmpxchg is used in a branch, the expanded
cmpxchg sequence ends up with a redundant branch-to-branch (as the
backend atomics expansion happens as late as possible, passes to
optimise such cases have already run). This patch identifies this case
and avoid it when expanding the cmpxchg.
Note that a similar optimisation is possible for a BEQ on the cmpxchg
success value. As it's hard to imagine a case where real-world code may
do that, this patch doens't handle that case.
Differential Revision: https://reviews.llvm.org/D130192
More information about the All-commits