Skip to content
  • Ahmed Bougacha's avatar
    [ARM] Emit clrex in the expanded cmpxchg fail block. · 81616a72
    Ahmed Bougacha authored
    ARM counterpart to r248291:
    
    In the comparison failure block of a cmpxchg expansion, the initial
    ldrex/ldxr will not be followed by a matching strex/stxr.
    On ARM/AArch64, this unnecessarily ties up the execution monitor,
    which might have a negative performance impact on some uarchs.
    
    Instead, release the monitor in the failure block.
    The clrex instruction was designed for this: use it.
    
    Also see ARMARM v8-A B2.10.2:
    "Exclusive access instructions and Shareable memory locations".
    
    Differential Revision: http://reviews.llvm.org/D13033
    
    llvm-svn: 248294
    81616a72
Loading