Author: Sirui Mu Date: 2026-09-16T20:38:05+08:00 New Revision: b8e720436725e1386985b7bdeabaca677ff498bb
URL: https://github.com/llvm/llvm-project/commit/b8e720436725e1386985b7bdeabaca677ff498bb DIFF: https://github.com/llvm/llvm-project/commit/b8e720436725e1386985b7bdeabaca677ff498bb.diff LOG: [CIR][NFC] Cleanup unhandled NYI in atomic libcall codegen (#223732) This patch cleans up the unhandled NYIs in the CIRGen path for atomic operation library calls. This patch should be NFC. Added: Modified: clang/lib/CIR/CodeGen/CIRGenAtomic.cpp Removed: ################################################################################ diff --git a/clang/lib/CIR/CodeGen/CIRGenAtomic.cpp b/clang/lib/CIR/CodeGen/CIRGenAtomic.cpp index 6a459edcc3c39..8bbcba6b576e6 100644 --- a/clang/lib/CIR/CodeGen/CIRGenAtomic.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenAtomic.cpp @@ -1262,8 +1262,10 @@ static RValue emitLibCallForAtomicExpr(CIRGenFunction &cgf, AtomicExpr *e, case AtomicExpr::AO__atomic_store: case AtomicExpr::AO__atomic_store_n: case AtomicExpr::AO__c11_atomic_store: + case AtomicExpr::AO__hip_atomic_store: + case AtomicExpr::AO__opencl_atomic_store: case AtomicExpr::AO__scoped_atomic_store: - case AtomicExpr::AO__scoped_atomic_store_n: { + case AtomicExpr::AO__scoped_atomic_store_n: calleeName = "__atomic_store"; retTy = cgf.getContext().VoidTy; hasRetTy = true; @@ -1271,41 +1273,17 @@ static RValue emitLibCallForAtomicExpr(CIRGenFunction &cgf, AtomicExpr *e, e->getVal1()->getType())), cgf.getContext().VoidPtrTy); break; - } - - case AtomicExpr::AO__hip_atomic_store: - case AtomicExpr::AO__opencl_atomic_store: - cgf.cgm.errorNYI(loc, - "emitLibCallForAtomicExpr: atomic store for hip/opencl"); - return RValue::get(nullptr); // void __atomic_load(size_t size, void *mem, void *return, int order) case AtomicExpr::AO__atomic_load: case AtomicExpr::AO__atomic_load_n: case AtomicExpr::AO__c11_atomic_load: + case AtomicExpr::AO__hip_atomic_load: + case AtomicExpr::AO__opencl_atomic_load: case AtomicExpr::AO__scoped_atomic_load: - case AtomicExpr::AO__scoped_atomic_load_n: { + case AtomicExpr::AO__scoped_atomic_load_n: calleeName = "__atomic_load"; break; - } - - case AtomicExpr::AO__hip_atomic_load: - case AtomicExpr::AO__opencl_atomic_load: - cgf.cgm.errorNYI(loc, - "emitLibCallForAtomicExpr: atomic load for hip/opencl"); - return RValue::get(nullptr); - - case AtomicExpr::AO__atomic_fetch_fmaximum: - case AtomicExpr::AO__atomic_fetch_fmaximum_num: - case AtomicExpr::AO__atomic_fetch_fminimum: - case AtomicExpr::AO__atomic_fetch_fminimum_num: - case AtomicExpr::AO__scoped_atomic_fetch_fmaximum: - case AtomicExpr::AO__scoped_atomic_fetch_fmaximum_num: - case AtomicExpr::AO__scoped_atomic_fetch_fminimum: - case AtomicExpr::AO__scoped_atomic_fetch_fminimum_num: - cgf.cgm.errorNYI( - loc, "emitLibCallForAtomicExpr: atomic fetch fmaximum/fminimum"); - return RValue::get(nullptr); case AtomicExpr::AO__atomic_add_fetch: case AtomicExpr::AO__scoped_atomic_add_fetch: @@ -1363,6 +1341,14 @@ static RValue emitLibCallForAtomicExpr(CIRGenFunction &cgf, AtomicExpr *e, case AtomicExpr::AO__scoped_atomic_max_fetch: case AtomicExpr::AO__scoped_atomic_fetch_uinc: case AtomicExpr::AO__scoped_atomic_fetch_udec: + case AtomicExpr::AO__atomic_fetch_fmaximum: + case AtomicExpr::AO__atomic_fetch_fmaximum_num: + case AtomicExpr::AO__atomic_fetch_fminimum: + case AtomicExpr::AO__atomic_fetch_fminimum_num: + case AtomicExpr::AO__scoped_atomic_fetch_fmaximum: + case AtomicExpr::AO__scoped_atomic_fetch_fmaximum_num: + case AtomicExpr::AO__scoped_atomic_fetch_fminimum: + case AtomicExpr::AO__scoped_atomic_fetch_fminimum_num: case AtomicExpr::AO__atomic_test_and_set: case AtomicExpr::AO__atomic_clear: case AtomicExpr::AO__atomic_fetch_uinc: _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
