Skip to content

Conversation

@jiang1997
Copy link

Fix #1868

@jiang1997 jiang1997 force-pushed the fix-#1868 branch 2 times, most recently from 5b25f33 to af464b6 Compare October 26, 2025 19:20
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Almost good, some issues need addressing!

@@ -1,7 +1,5 @@
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -I%S/../Inputs -mconstructor-aliases -fclangir -fclangir-lifetime-check="history=all" -fclangir-skip-system-headers -clangir-verify-diagnostics -emit-cir %s -o %t.cir

// XFAIL: *
Copy link
Member

@bcardosolopes bcardosolopes Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's address this separately, because it's not failing in all platforms, I'll merge the PR regardless if the only thing failing is related to this test (no worries).

// RUN: %clang_cc1 -x c -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir %s

// CHECK-LABEL: @scoped_load_thread
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We also need to check for LLVM output. Please rename CHECK to CIR and add both a LLVM and a OGCG one (see clang/test/CIR/CodeGen/opaque.cpp for an exmple).
  • Change the ARM64 test for your change to check for the scope value.
  • There are changes to CIRGenAtomic.cpp so maybe it's worth taking a look and changing where appropriate existing tests in:
./CodeGen/atomic-xchg-field.c
./CodeGen/atomic-thread-fence.c
./CodeGen/c11atomic.c
./CodeGen/atomic.cpp
./CodeGen/atomic-runtime.cpp

cir::AtomicFetchKindAttr fetchAttr;
bool fetchFirst = true;
auto scopeAttr = cir::MemScopeKindAttr::get(builder.getContext(), Scope);
std::optional<cir::MemScopeKind> scopeOpt;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these 3 lines are not needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cir.load does not have scoped atomic support

2 participants