This is an archive of the discontinued LLVM Phabricator instance.

x86: preserve flags when folding atomic operations
ClosedPublic

Authored by jfb on Oct 12 2015, 3:34 PM.

Details

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 fadd optimization a few
lines below is therefore correct. The same applies for surrounding
load/store optimizations.

Diff Detail

Event Timeline

jfb updated this revision to Diff 37190.Oct 12 2015, 3:34 PM
jfb retitled this revision from to x86: preserve flags when folding atomic operations.
jfb updated this object.
jfb added reviewers: rsmith, rtrieu.
jfb added subscribers: morisset, reames, llvm-commits.

The change LGTM; it's not clear what you mean by "the subsequent fadd optimization" in the description without some more context.

jfb updated this object.Oct 12 2015, 5:21 PM
This revision was automatically updated to reflect the committed changes.