[PATCH] D15352: [EarlyCSE] DSE of atomic unordered stores

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 17:31:59 PST 2015


reames added a comment.

@JF - How does the new version look?


================
Comment at: test/Transforms/EarlyCSE/atomics.ll:189
@@ +188,3 @@
+  store atomic i32 3, i32* %P1 unordered, align 4
+  store i32 0, i32* %P1, align 4
+  ret void
----------------
done as @test29

================
Comment at: test/Transforms/EarlyCSE/atomics.ll:228
@@ +227,3 @@
+; but current don't due to implementation limits
+define void @test27(i1 %B, i32* %P1, i32* %P2) {
+; CHECK-LABEL: @test27
----------------
This turned out to be amusing.  We hadn't actually implemented the optimization this was testing and the weaker check was spuriously passing.  Thanks for pushing me on this.

The problem is that we have a release store marked as potentially reading memory which trips up:
if (Inst->mayReadFromMemory() &&
        !(MemInst.isValid() && !MemInst.mayReadFromMemory()))
      LastStore = nullptr;

I'm going to mark these as missed opts for the moment, and will likely revisit this at some future point.


http://reviews.llvm.org/D15352





More information about the llvm-commits mailing list