Displaying 2 results from an estimated 2 matches for "__atomic_compare_exchange_n".
Did you mean:
__atomic_compare_exchange
2014 Mar 31
2
[LLVMdev] LLVM is doing something a bit weird in this example (which messes up DSA)
Hi all,
I have yet another DSA-related question :), and I would appreciate
your help. Actually, the following example generates some interesting
potential issues in the LLVM IR too.
Here is the example in C:
#define CAS(x,y,z) __atomic_compare_exchange_n(x,&(y),z,true,0,0)
int main() {
int *x = 0;
int y = 0;
int *z = x;
CAS(&z,x,&y); // if (z == x) z = &y;
assert(*z == y);
return 0;
}
Now, when compiled into LLVM IR 3.4 (with -mem2reg), an interesting
thing happens in this LLVM IR excerpt:
%1 = bitcast i32** %z to i6...
2014 Apr 01
2
[LLVMdev] LLVM is doing something a bit weird in this example (which messes up DSA)
...>> Hi all,
>>
>> I have yet another DSA-related question :), and I would appreciate
>> your help. Actually, the following example generates some interesting
>> potential issues in the LLVM IR too.
>>
>> Here is the example in C:
>> #define CAS(x,y,z) __atomic_compare_exchange_n(x,&(y),z,true,0,0)
>>
>> int main() {
>> int *x = 0;
>> int y = 0;
>> int *z = x;
>> CAS(&z,x,&y); // if (z == x) z = &y;
>> assert(*z == y);
>> return 0;
>> }
>>
>> Now, when compiled into LLVM IR 3...