[PATCH] D39411: [X86] Make sure we don't create locked inc/dec instructions when the carry flag is being used.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 29 20:17:09 PDT 2017


craig.topper created this revision.

INC/DEC don't update the carry flag so we need to make sure we don't try to use it.

This patch introduces new X86ISD opcodes for locked INC/DEC. Teaches lowerAtomicArithWithLOCK to emit these nodes if INC/DEC is not slow or the function is being optimized for size. An additional flag is added that allows the INC/DEC to be disabled if the caller determines that the carry flag is being requested.

This should fully fix PR35068 finishing the fix started in r316860.


https://reviews.llvm.org/D39411

Files:
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86InstrInfo.td
  test/CodeGen/X86/atomic-eflags-reuse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39411.120765.patch
Type: text/x-patch
Size: 14864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171030/920afbc7/attachment.bin>


More information about the llvm-commits mailing list