clang's atomic operation trick

clang will generate libCall or LLVM atomic IR with built-in atomic operaion.

1. when data size of atomic operation is less than getTarget().getMaxAtomicInlineWidth()
&& alignent, it will generate LLVM atomic IR, otherwise generate libCall

2. in ARM target, give fail triple name also generates libCall

3. MaxAtomicInlineWidth is defined in lib/Basic/Targets.cpp

留言

這個網誌中的熱門文章

我們能利用machine learning去幫助compiler的optimization演算法變強嗎?

The Speed Game: Automated Trading Systems in C++

被討厭的勇氣 自我啟發之父阿德勒的教導