<div dir="ltr"><div><div style="color:rgb(0,0,0);background-color:rgb(255,255,254)"><div>Hi All, </div><div><br>With the "<a href="https://gcc.godbolt.org/z/yBYTrd">https://gcc.godbolt.org/z/yBYTrd</a>"  case .<br><br>the atomic is converted to non atomic ops  for x86 like<br><br>from <br>      xchg dword ptr [100], eax<br>to <br>       mov dword ptr [100], 1<br><br>the pass is responsible for this tranformation was instCombine i.e InstCombiner::visitAtomicRMWInst<br><br>which converts the IR like <br> %0 = atomicrmw xchg i32* inttoptr (i64 100 to i32*), i32 1 monotonic<br>to <br> store atomic i32 1, i32* inttoptr (i64 100 to i32*) monotonic, align 4<br><br>which is valid for relax(monotonic) and release ordering as per the code out there.<br><br>we think that,its the inst lowering issue, where the atomic store was lowered to non-atomic store here.<br><br>to work around we changed our case to strong ordering .<br><br>and we are debugging the case with x86 and the same goes with an arm too.<br><br>Any suggestions or thoughts on the transformation? , will be helpful to proceed further.<br><br>FYI, the problem persists with LLVM-9, not with the LLVM-8.<br><br>Thank you <br>~Umesh <br></div><div><span style="color:rgb(9,136,90)"><br></span></div><div><span style="color:rgb(9,136,90)"><br></span></div><div><br></div></div></div></div>