llvm-6502/lib
Evan Cheng 37b7387da9 Optimize some common usage patterns of atomic built-ins __sync_add_and_fetch() and __sync_sub_and_fetch.
When the return value is not used (i.e. only care about the value in the memory), x86 does not have to use add to implement these. Instead, it can use add, sub, inc, dec instructions with the "lock" prefix.

This is currently implemented using a bit of instruction selection trick. The issue is the target independent pattern produces one output and a chain and we want to map it into one that just output a chain. The current trick is to select it into a merge_values with the first definition being an implicit_def. The proper solution is to add new ISD opcodes for the no-output variant. DAG combiner can then transform the node before it gets to target node selection.

Problem #2 is we are adding a whole bunch of x86 atomic instructions when in fact these instructions are identical to the non-lock versions. We need a way to add target specific information to target nodes and have this information carried over to machine instructions. Asm printer (or JIT) can use this information to add the "lock" prefix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 08:33:02 +00:00
..
Analysis Equal SCEVs of a subscript give rise to dependence. 2009-07-30 02:26:01 +00:00
Archive
AsmParser Move types back to the 2.5 API. 2009-07-29 22:17:13 +00:00
Bitcode Read and write NamedMDNode. 2009-07-29 22:34:41 +00:00
CodeGen Optimize some common usage patterns of atomic built-ins __sync_add_and_fetch() and __sync_sub_and_fetch. 2009-07-30 08:33:02 +00:00
CompilerDriver
Debugger
ExecutionEngine In TrimAllocationToSize, if a block is below the minimum allocation size, 2009-07-29 22:55:02 +00:00
Linker Move types back to the 2.5 API. 2009-07-29 22:17:13 +00:00
MC Expose Tokens to target specific assembly parsers. 2009-07-28 17:58:44 +00:00
Support Twine: Provide [u]int{32,64} conversions via implicit constructors instead of 2009-07-30 03:47:15 +00:00
System Remove another F_OK. 2009-07-29 00:02:58 +00:00
Target Optimize some common usage patterns of atomic built-ins __sync_add_and_fetch() and __sync_sub_and_fetch. 2009-07-30 08:33:02 +00:00
Transforms Switch obvious clients to Twine instead of utostr (when they were already using 2009-07-30 04:20:37 +00:00
VMCore Typo 2009-07-30 02:00:06 +00:00
Makefile