Peter Collingbourne
2010-Jun-22 20:12 UTC
[LLVMdev] [RFC/PATCH] IntrinsicLowering improvements
Hi, This is more of an RFC than for committing (hence the post to llvmdev) but I'd like to have some opinions on these improvements to IntrinsicLowering before I go ahead and implement the rest of the intrinsics. 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. The LowerIntrinsicCall method would need to be refactored into multiple methods I think, but I'm not sure about the granularity. Do we need more than standard and single-thread? Thanks, -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Support-for-lowering-atomic-intrinsics-in-single-thr.patch Type: text/x-diff Size: 4538 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100622/988cc188/attachment.patch> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Add-a-Silent-parameter-to-IntrinsicLowering-LowerInt.patch Type: text/x-diff Size: 2925 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100622/988cc188/attachment-0001.patch>
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? Finally, I guess even "single threaded" code may have a use for some atomic operations if it makes use of signal handlers. Ciao, Duncan.
Peter Collingbourne
2010-Jun-23 23:32 UTC
[LLVMdev] [RFC/PATCH] IntrinsicLowering improvements
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. Thanks, -- Peter -------------- 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>