1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
Go to file
Philip Reames 594dcaeec7 [X86/Atomics] (Semantically) revert G246098, switch back to the old atomic example
When writing an email for a follow up proposal, I realized one of the diffs in the committed change was incorrect.  Digging into it revealed that the fix is complicated enough to require some thought, so reverting in the meantime.

The problem is visible in this diff (from the revert):
 ; X64-SSE-LABEL: store_fp128:
 ; X64-SSE:       # %bb.0:
-; X64-SSE-NEXT:    movaps %xmm0, (%rdi)
+; X64-SSE-NEXT:    subq $24, %rsp
+; X64-SSE-NEXT:    .cfi_def_cfa_offset 32
+; X64-SSE-NEXT:    movaps %xmm0, (%rsp)
+; X64-SSE-NEXT:    movq (%rsp), %rsi
+; X64-SSE-NEXT:    movq {{[0-9]+}}(%rsp), %rdx
+; X64-SSE-NEXT:    callq __sync_lock_test_and_set_16
+; X64-SSE-NEXT:    addq $24, %rsp
+; X64-SSE-NEXT:    .cfi_def_cfa_offset 8
 ; X64-SSE-NEXT:    retq
   store atomic fp128 %v, fp128* %fptr unordered, align 16
   ret void

The problem here is three fold:
1) x86-64 doesn't guarantee atomicity of anything larger than 8 bytes.  Some platforms observably break this guarantee, others don't, but the codegen isn't considering this, so it's wrong on at least some platforms.
2) When I started to track down the problem, I discovered that DAGCombiner had stripped the atomicity off the store entirely.  This comes down to idiomatic usage of DAG.getStore passing all MMO components separately as opposed to just passing the MMO.
3) On x86 (not -64), there are cases where 8 byte atomiciy is supported, but only for floating point operations.  This would seem to imply that operation typing matters for correctness, and DAGCombine happily folds away bitcasts.  I'm not 100% sure there's a problem here, but I'm not entirely sure there isn't either.

I plan on returning to each issue in turn;  sorry for the churn here.
2019-11-05 11:24:27 -08:00
benchmarks Pull google/benchmark library to the LLVM tree 2018-08-28 09:42:41 +00:00
bindings Update version number in llvm python bindings 2019-10-25 17:14:11 -04:00
cmake Add more binutils tools to LLVM_INSTALL_TOOLCHAIN_ONLY target 2019-11-04 14:11:23 -08:00
docs [globalisel][docs] Add KnownBits Analysis documentation 2019-11-05 09:55:33 -08:00
examples Break out OrcError and RPC 2019-10-29 17:31:28 -07:00
include [llvm-objdump] Fix spurious "The end of the file was unexpectedly encountered" if a SHT_NOBITS sh_offset is larger than the file size 2019-11-05 11:14:12 -08:00
lib [X86/Atomics] (Semantically) revert G246098, switch back to the old atomic example 2019-11-05 11:24:27 -08:00
projects Add few docs and implementation of strcpy and strcat. 2019-10-04 17:30:54 +00:00
resources
runtimes Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds. 2019-09-24 22:38:18 +00:00
test [X86/Atomics] (Semantically) revert G246098, switch back to the old atomic example 2019-11-05 11:24:27 -08:00
tools [llvm-objcopy][ELF] Implement --only-keep-debug 2019-11-05 08:56:15 -08:00
unittests [LV] Apply sink-after & interleave-groups as VPlan transformations (NFC) 2019-11-05 17:29:13 +02:00
utils [lit] Fix not calling internal commands 2019-11-05 14:09:21 -05:00
.arcconfig [llvm] Set up .arcconfig to point to Diffusion L repository 2018-01-12 15:37:41 +00:00
.clang-format
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitattributes Fix the "git modified" issue on the preserve-comments-crlf.s. 2019-09-10 12:17:49 +00:00
.gitignore gitignore: Ignore Qt Creator project configuration files. NFC 2019-06-12 08:28:31 +00:00
CMakeLists.txt build: remove LLVM_CXX_STD extension point 2019-10-25 11:51:47 -07:00
CODE_OWNERS.TXT Update email address in CODE_OWNERS 2019-07-01 16:01:15 +00:00
configure
CREDITS.TXT Update email address. 2019-07-17 07:02:02 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
README.txt Test commit. 2019-10-03 14:57:49 +00:00
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.