Skip to content

Commit 1b105a1

Browse files
author
iclsrc
committed
Merge from 'main' to 'sycl-web' (12 commits)
CONFLICT (content): Merge conflict in llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
2 parents 7f77c7b + 2681497 commit 1b105a1

File tree

34 files changed

+1470
-438
lines changed

34 files changed

+1470
-438
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ def AVRSignal : InheritableAttr, TargetSpecificAttr<TargetAVR> {
11101110
}
11111111

11121112
def AsmLabel : InheritableAttr {
1113-
let Spellings = [CustomKeyword<"asm">, CustomKeyword<"__asm__">];
1113+
let Spellings = [CustomKeyword<"asm">, CustomKeyword<"__asm">, CustomKeyword<"__asm__">];
11141114
let Args = [
11151115
// Label specifies the mangled name for the decl.
11161116
StringArgument<"Label">, ];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5940,17 +5940,17 @@ used by other languages. (This prefix is also added to the standard Itanium
59405940
C++ ABI prefix on "mangled" symbol names, so that e.g. on such targets the true
59415941
symbol name for a C++ variable declared as ``int cppvar;`` would be
59425942
``__Z6cppvar``; note the two underscores.) This prefix is *not* added to the
5943-
symbol names specified by the ``asm`` attribute; programmers wishing to match a
5944-
C symbol name must compensate for this.
5943+
symbol names specified by the ``__asm`` attribute; programmers wishing to match
5944+
a C symbol name must compensate for this.
59455945

59465946
For example, consider the following C code:
59475947

59485948
.. code-block:: c
59495949

5950-
int var1 asm("altvar") = 1; // "altvar" in symbol table.
5950+
int var1 __asm("altvar") = 1; // "altvar" in symbol table.
59515951
int var2 = 1; // "_var2" in symbol table.
59525952

5953-
void func1(void) asm("altfunc");
5953+
void func1(void) __asm("altfunc");
59545954
void func1(void) {} // "altfunc" in symbol table.
59555955
void func2(void) {} // "_func2" in symbol table.
59565956

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,22 +2000,29 @@ void CGOpenMPRuntime::emitCriticalRegion(CodeGenFunction &CGF,
20002000
// Prepare arguments and build a call to __kmpc_critical
20012001
if (!CGF.HaveInsertPoint())
20022002
return;
2003+
llvm::FunctionCallee RuntimeFcn = OMPBuilder.getOrCreateRuntimeFunction(
2004+
CGM.getModule(),
2005+
Hint ? OMPRTL___kmpc_critical_with_hint : OMPRTL___kmpc_critical);
2006+
llvm::Value *LockVar = getCriticalRegionLock(CriticalName);
2007+
unsigned LockVarArgIdx = 2;
2008+
if (cast<llvm::GlobalVariable>(LockVar)->getAddressSpace() !=
2009+
RuntimeFcn.getFunctionType()
2010+
->getParamType(LockVarArgIdx)
2011+
->getPointerAddressSpace())
2012+
LockVar = CGF.Builder.CreateAddrSpaceCast(
2013+
LockVar, RuntimeFcn.getFunctionType()->getParamType(LockVarArgIdx));
20032014
llvm::Value *Args[] = {emitUpdateLocation(CGF, Loc), getThreadID(CGF, Loc),
2004-
getCriticalRegionLock(CriticalName)};
2015+
LockVar};
20052016
llvm::SmallVector<llvm::Value *, 4> EnterArgs(std::begin(Args),
20062017
std::end(Args));
20072018
if (Hint) {
20082019
EnterArgs.push_back(CGF.Builder.CreateIntCast(
20092020
CGF.EmitScalarExpr(Hint), CGM.Int32Ty, /*isSigned=*/false));
20102021
}
2011-
CommonActionTy Action(
2012-
OMPBuilder.getOrCreateRuntimeFunction(
2013-
CGM.getModule(),
2014-
Hint ? OMPRTL___kmpc_critical_with_hint : OMPRTL___kmpc_critical),
2015-
EnterArgs,
2016-
OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(),
2017-
OMPRTL___kmpc_end_critical),
2018-
Args);
2022+
CommonActionTy Action(RuntimeFcn, EnterArgs,
2023+
OMPBuilder.getOrCreateRuntimeFunction(
2024+
CGM.getModule(), OMPRTL___kmpc_end_critical),
2025+
Args);
20192026
CriticalOpGen.setAction(Action);
20202027
emitInlinedDirective(CGF, OMPD_critical, CriticalOpGen);
20212028
}

0 commit comments

Comments
 (0)