llvm/test
Philip Reames 33ee99ac22 [LICM] Make store promotion work in the face of unordered atomics
Extend our store promotion code to deal with unordered atomic accesses. Ordered atomics continue to be unhandled.

Most of the change is straight-forward, the only complicated bit is in the reasoning around mixing of atomic and non-atomic memory access. Rather than trying to reason about the complex semantics in these cases, I simply disallowed promotion when both atomic and non-atomic accesses are present. This is conservatively correct.

It seems really tempting to just promote all access to atomics, but the original accesses might have been conditional. Since we can't lower an arbitrary atomic type, it might not be safe to promote all access to atomic. Consider a loop like the following:
while(b) {
  load i128 ...
  if (can lower i128 atomic)
    store atomic i128 ...
  else
    store i128
}

It could be there's no race on the location and thus the code is perfectly well defined even if we can't lower a i128 atomically. 

It's not clear we need to be this conservative - arguably the program above is brocken since it can't be lowered unless the branch is folded - but I didn't want to have to fix any fallout which might result.

Differential Revision: https://reviews.llvm.org/D15592



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14 01:38:31 +00:00
..
Analysis [ValueTracking] use nonnull argument attribute to eliminate null checks 2017-02-12 15:35:34 +00:00
Assembler Move inline asm diags tests to an ARM directory. 2017-02-08 16:48:35 +00:00
Bindings
Bitcode IR: Function summary extensions for whole-program devirtualization pass. 2017-02-10 22:29:38 +00:00
BugPoint
CodeGen [X86] Add MXCSR register 2017-02-13 23:38:52 +00:00
DebugInfo Revert r294532, it caused PR31935 2017-02-10 21:57:30 +00:00
Examples
ExecutionEngine RuntimeDyldELF/AArch64: Implement basic GOT support 2017-02-06 15:31:28 +00:00
Feature Add intrinsics for constrained floating point operations 2017-01-26 23:27:59 +00:00
FileCheck
Instrumentation [sancov] using comdat only when it is enabled 2017-02-08 23:12:46 +00:00
Integer
JitListener
LibDriver
Linker Linker: Move special casing for available_externally in IRMover to clients. NFCI. 2017-02-02 05:12:15 +00:00
LTO [LTO] Remove useless redirection from test. NFCI. 2017-02-12 05:43:25 +00:00
MC [mips] Fix failing test. 2017-02-13 16:42:35 +00:00
Object test: adjust the test for the BSD format 2017-02-09 20:06:30 +00:00
ObjectYAML Attempt to fix the testcase in r292824 2017-01-23 20:42:17 +00:00
Other [PM] Hook up the instrumented PGO machinery in the new PM. 2017-02-13 15:26:22 +00:00
SymbolRewriter
TableGen [GlobalISel] Print the matched patterns using an action. 2017-02-04 00:47:08 +00:00
ThinLTO/X86 [tests] Be explicit about the files we want to remove. 2017-02-10 22:55:37 +00:00
tools Yet another fix llvm-objdump so it picks a good CPU based for Mach-O files, 2017-02-10 19:27:10 +00:00
Transforms [LICM] Make store promotion work in the face of unordered atomics 2017-02-14 01:38:31 +00:00
Unit
Verifier Add intrinsics for constrained floating point operations 2017-01-26 23:27:59 +00:00
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
TestRunner.sh