[flang-commits] [flang] [llvm] [mlir] [OpenMPIRBuilder] Emit __atomic_load and __atomic_compare_exchange libcalls for complex types in atomic update (PR #92364)

via flang-commits flang-commits at lists.llvm.org
Sun May 19 20:10:58 PDT 2024


NimishMishra wrote:

Thanks @kiranchandramohan and @Meinersbur for the comments.

I did try making the IR emitted here closer to Clang, as the first option. From what I understand, there are differences in the way `__atomic_compare_exchange` is emitted by Clang or when it is expanded in AtomicExpandPass. One main difference is emission of `llvm.lifetime` calls. Then there are several `store` and `extract`.

I sent across this PR for review to request for suggestions on this only. Is it okay if Clang is also made dependent on the OpenMPIRBuilder for emitting `__atomic_compare_exchange`, when the two IRs are different? Moreover, even though I was able to emit these calls from the IRBuilder, I am not 100% sure why Clang and AtomicExpandPass choose to emit different IRs. Which one is the better one?

https://github.com/llvm/llvm-project/pull/92364


More information about the flang-commits mailing list