Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
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.
| test/CodeGen/ms-intrinsics.c | ||
|---|---|---|
| 297 | 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
} | |
Comment Actions
I can't seem to recall anything major. Our _ReadBarrier and _WriteBarrier simply map to _ReadWriteBarrier. Our __faststorefence is just a normal fence instead of an interlocked operation.
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 }