[LLVMdev] [RFC/PATCH] IntrinsicLowering improvements

Peter Collingbourne peter at pcc.me.uk
Wed Jun 23 16:32:42 PDT 2010

Hi Duncan,

On Wed, Jun 23, 2010 at 09:25:39AM +0200, Duncan Sands wrote:
> Hi Peter,
> > My main motivation for the single-thread lowering is to be able to run
> > code that uses these intrinsics in the KLEE symbolic execution engine
> > but I imagine it could have other uses such as a whole-program LTO
> > that lowers atomic operations to more efficient non-atomic operations
> > when it is known to be safe to do so.
> instead, how about writing an LLVM IR pass that turns atomic intrinsics into
> non-atomic equivalent LLVM IR?

Yes, that seems more sensible.  I refactored the lowering into a pass
and added the remaining intrinsics (see attached patch).  I'll commit
this if approved.

I wonder if IntrinsicLowering should also be made into a pass, for
consistency with the other lowering passes.

> Finally, I guess even "single threaded" code
> may have a use for some atomic operations if it makes use of signal handlers.

Yes, good point.  Perhaps "non-preemptible" is better terminology
which is what I used in the new patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lower-atomic.patch
Type: text/x-diff
Size: 9266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100624/72abf886/attachment.patch>

More information about the llvm-dev mailing list