[llvm] r265450 - [X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC.

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 09:50:55 PDT 2016


This caused the ASan tests to hang (see PR27245). I've reverted it in r265559.

On Tue, Apr 5, 2016 at 1:02 PM, Ahmed Bougacha via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: ab
> Date: Tue Apr  5 15:02:57 2016
> New Revision: 265450
>
> URL: http://llvm.org/viewvc/llvm-project?rev=265450&view=rev
> Log:
> [X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC.
>
> We only generate LOCKed versions of add/sub when the result is unused.
> It often happens that the result is used, but only by a comparison. We
> can optimize those out by reusing EFLAGS, which lets us use the proper
> instructions, instead of having to fallback to LXADD.
>
> Instead of doing this as an MI peephole (as we do for the other
> non-LOCKed (really, non-MR) forms), do it in ISel. It becomes quite
> tricky later.
>
> This also makes it eventually possible to stop expanding and/or/xor
> if the only user is an icmp (also see D18141).
>
> This uses the LOCK ISD opcodes added by r262244.
>
> Differential Revision: http://reviews.llvm.org/D17633
>
> Modified:
>     llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>     llvm/trunk/test/CodeGen/X86/atomic-eflags-reuse.ll


More information about the llvm-commits mailing list