[PATCH] Allow __sync_fetch_and_min (etc) libcalls

Tim Northover t.p.northover at gmail.com
Thu Oct 24 08:29:50 PDT 2013


On processors with no atomic operations (e.g. ARM cortex-m0), all atomic operations are a platform issue and go via libcalls. Currently LLVM can't expand the min/max versions.

I'm a little concerned here that runtimes might not support these min/max functions. The alternative would be to expand them in terms of cmpxchg (as x86 with its limited primitives does).

However, given the tiny RAM/ROM involved on these CPUs, a libcall is probably preferable from my perspective. There should be no regressions since I'm converting an assertion failure into a libcall.

OK to commit, or is this a bigger ABI change than I anticipated?

http://llvm-reviews.chandlerc.com/D2017

Files:
  include/llvm/CodeGen/RuntimeLibcalls.h
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/TargetLoweringBase.cpp
  test/CodeGen/ARM/atomic-op.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2017.1.patch
Type: text/x-patch
Size: 9663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131024/2403aac9/attachment.bin>


More information about the llvm-commits mailing list