Expand most atomic nodes into their respective libcalls.
Missing is the cmpxchg operation which produces ATOMIC_CMP_SWAP_WITH_SUCCESS.
A number of optimizations can still be done with these nodes.
Well, I've been fixing crashes with the GCC torture suite, and these are some of them, so that's why i've place this change.
When you say "drop", is there a way to tell isel to use the regular instructions for all of the atomics? Because, yeah, that would be better. Also, how do I do that?
There are no multiple threads, etc. on msp430
Threads are a property of the software, not the hardware; atomic operations can still be relevant on a single-processor systems. clang has an option -mthread-model if the user explicitly doesn't want to support multi-threaded execution; I'm not sure it's a good idea to force "-mthread-model single" on all users of msp430. (Granted, maybe msp430 has too little memory for anyone to try multi-threaded programming...)
But MSP430 has interrupts and they are similar to threads in some ways. For example if I need to increment some shared counter, I would like it to be done in a single instruction. That way if some interrupt triggers at the same time it would not corrupt the value, because a single instruction can not be split. I had to use inline assembly to make such kind of counter, because volatile doesn't optimize to a single instruction in debug builds, only in release.
My point is that just forcing mthread-model single may lead to bugs in peoples code if someone would actually use atomics to implement a counter for example.