[PATCH] D11434: Allow value forwarding past release fences in EarlyCSE

Dmitry Vyukov dvyukov at google.com
Thu Jul 23 06:30:37 PDT 2015


dvyukov added inline comments.

================
Comment at: test/Transforms/EarlyCSE/fence.ll:43
@@ +42,3 @@
+  fence acquire
+  %a2 = load i32, i32* %addr.i, align 4
+  %res = sub i32 %a, %a2
----------------
jfb wrote:
> You can't forward `%a` and eliminate `%a2`, but you could eliminate `%a`, and replace it by `%a2` if there are no intervening uses, no?
In this particular case we can do whatever we want with accesses to %addr.i. No other thread can access it without a race.

================
Comment at: test/Transforms/EarlyCSE/fence.ll:57
@@ +56,3 @@
+  fence release
+  store i32 5, i32* %addr.i, align 4
+  ret void
----------------
Is it a full test? Or is it something that we don't handle yet?
I am asking because in this particular case we can do whatever we want with accesses to %addr. Since we store to %addr both before and after the fence, we can conclude that this fence is not used to synchronize accesses to %addr, so we can eliminate/combine/etc accesses to %addr.



http://reviews.llvm.org/D11434







More information about the llvm-commits mailing list