Tim Northover 8f2a85e099 IR: add "cmpxchg weak" variant to support permitted failure.
This commit adds a weak variant of the cmpxchg operation, as described
in C++11. A cmpxchg instruction with this modifier is permitted to
fail to store, even if the comparison indicated it should.

As a result, cmpxchg instructions must return a flag indicating
success in addition to their original iN value loaded. Thus, for
uniformity *all* cmpxchg instructions now return "{ iN, i1 }". The
second flag is 1 when the store succeeded.

At the DAG level, a new ATOMIC_CMP_SWAP_WITH_SUCCESS node has been
added as the natural representation for the new cmpxchg instructions.
It is a strong cmpxchg.

By default this gets Expanded to the existing ATOMIC_CMP_SWAP during
Legalization, so existing backends should see no change in behaviour.
If they wish to deal with the enhanced node instead, they can call
setOperationAction on it. Beware: as a node with 2 results, it cannot
be selected from TableGen.

Currently, no use is made of the extra information provided in this
patch. Test updates are almost entirely adapting the input IR to the
new scheme.

Summary for out of tree users:
------------------------------

+ Legacy Bitcode files are upgraded during read.
+ Legacy assembly IR files will be invalid.
+ Front-ends must adapt to different type for "cmpxchg".
+ Backends should be unaffected by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210903 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-13 14:24:07 +00:00
..
2014-06-09 08:36:53 +00:00
2014-01-23 18:49:33 +00:00
2014-06-10 19:18:24 +00:00
2014-06-10 19:18:28 +00:00
2014-06-10 19:00:20 +00:00
2014-06-10 19:00:20 +00:00
2014-02-04 07:12:38 +00:00
2013-12-10 21:11:55 +00:00
2014-06-06 01:20:28 +00:00
2014-05-02 15:41:47 +00:00
2014-02-04 17:18:37 +00:00
2014-05-02 15:41:47 +00:00
2013-12-20 05:11:55 +00:00
2013-12-14 00:38:04 +00:00
2014-06-05 00:15:55 +00:00
2014-05-09 16:42:19 +00:00
2014-06-09 16:36:31 +00:00
2013-11-06 17:36:04 +00:00
2014-01-11 21:06:00 +00:00
2013-10-13 17:56:28 +00:00
2014-06-09 16:36:31 +00:00

+==============================================================================+
| How to organize the lit tests                                                |
+==============================================================================+

- If you write a test for matching a single DAG opcode or intrinsic, it should
  go in a file called {opcode_name,intrinsic_name}.ll (e.g. fadd.ll)

- If you write a test that matches several DAG opcodes and checks for a single
  ISA instruction, then that test should go in a file called {ISA_name}.ll (e.g.
  bfi_int.ll

- For all other tests, use your best judgement for organizing tests and naming
  the files.

+==============================================================================+
| Naming conventions                                                           |
+==============================================================================+

- Use dash '-' and not underscore '_' to separate words in file names, unless
  the file is named after a DAG opcode or ISA instruction that has an
  underscore '_' in its name.