rnk added a comment.

Looks good to me. David, do you remember any subtleties here? I seem to recall 
there were some bugs in our intrin.h implementations, or inconsistencies 
between us and MSVC.


================
Comment at: test/CodeGen/ms-intrinsics.c:297
@@ +296,3 @@
+// CHECK: define{{.*}}i16 @test_InterlockedIncrement16(i16*{{[a-z_ 
]*}}%Addend){{.*}}{
+// CHECK: [[TMP:%[0-9]+]] = atomicrmw volatile add i16* %Addend, i16 1 seq_cst
+// CHECK: [[RESULT:%[0-9]+]] = add i16 [[TMP]], 1
----------------
I think we should make these increments and decrements non-volatile. I'd like 
us to be able to optimize this kind of code to return 2:
  int f() {
    int x = 0;
    _InterlockedIncrement(&x);
    _InterlockedIncrement(&x);
   return x; // always 2
  }


https://reviews.llvm.org/D24153



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to