[PATCH] Lower idempotent RMWs to fence+load
Robin Morisset
morisset at google.com
Fri Sep 19 16:51:39 PDT 2014
Hi jfb,
I originally tried doing this specifically for X86 in the backend in D5091,
but it was rather brittle and generally running to late to be general.
Furthermore, other targets may want to implement similar optimizations.
So I reimplemented it at the IR-level, fitting it into AtomicExpandPass
as it interacts with that pass (which could not be cleanly done before
at the backend level).
This optimization relies on a new target hook, which is only used by X86
for now, as the correctness of the optimization on other targets remains
an open question. If it is found correct on other targets, it should be
trivial to enable for them.
Details of the optimization are discussed in D5091.
http://reviews.llvm.org/D5422
Files:
include/llvm/Target/TargetLowering.h
lib/CodeGen/AtomicExpandPass.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/X86/atomic_idempotent.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5422.13899.patch
Type: text/x-patch
Size: 9243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140919/92b9a897/attachment.bin>
More information about the llvm-commits
mailing list