OSDN Git Service

x86: preserve flags when folding atomic operations
authorJF Bastien <jfb@google.com>
Tue, 13 Oct 2015 00:28:47 +0000 (00:28 +0000)
committerJF Bastien <jfb@google.com>
Tue, 13 Oct 2015 00:28:47 +0000 (00:28 +0000)
commita4b41272897aebd7360d431179703403c832c8d3
treedaab9f62e1da32dd7cc111261471a890d154ffa6
parent41438be88af1a2ea003378a866447b4842990c69
x86: preserve flags when folding atomic operations

Summary:
D4796 taught LLVM to fold some atomic integer operations into a single
instruction. The pattern was unaware that the instructions clobbered
flags.

This patch adds the missing EFLAGS definition.

Floating point operations don't set flags, the subsequent fadd
optimization is therefore correct. The same applies for surrounding
load/store optimizations.

Reviewers: rsmith, rtrieu

Subscribers: llvm-commits, reames, morisset

Differential Revision: http://reviews.llvm.org/D13680

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250135 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrCompiler.td
test/CodeGen/X86/atomic-flags.ll [new file with mode: 0644]