x86 FP atomic codegen: don't drop globals, stack
authorJF Bastien <jfb@google.com>
Thu, 15 Oct 2015 16:46:29 +0000 (16:46 +0000)
committerJF Bastien <jfb@google.com>
Thu, 15 Oct 2015 16:46:29 +0000 (16:46 +0000)
commitb72c6bad3c6d50fd5d0f24b704c05c8ab997d675
tree4363a69a5b3e05073ab69c1e46939f10f7efb54a
parent634f5c1b9b89f460935d6583ea5037174a9a9126
x86 FP atomic codegen: don't drop globals, stack

Summary:
x86 codegen is clever about generating good code for relaxed
floating-point operations, but it was being silly when globals and
immediates were involved, forgetting where the global was and
loading/storing from/to the wrong place. The same applied to hard-coded
address immediates.

Don't let it forget about the displacement.

This fixes https://llvm.org/bugs/show_bug.cgi?id=25171

A very similar bug when doing floating-points atomics to the stack is
also fixed by this patch.

This fixes https://llvm.org/bugs/show_bug.cgi?id=25144

Reviewers: pete

Subscribers: llvm-commits, majnemer, rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250429 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/atomic_mi.ll