Skip to content

Commit 18679ac

Browse files
author
Kai Luo
committed
[PowerPC] Adjust MaxAtomicSizeInBitsSupported on PPC64
AtomicExpandPass uses this variable to determine emitting libcalls or not. The default value is 1024 and if we don't specify it for PPC64 explicitly, AtomicExpandPass won't emit `__atomic_*` libcalls for those target unable to inline atomic ops and finally the backend emits `__sync_*` libcalls. Thanks @efriedma for pointing it out. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D122868
1 parent c8e1c94 commit 18679ac

File tree

3 files changed

+167
-120
lines changed

3 files changed

+167
-120
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,6 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
13221322
}
13231323

13241324
if (shouldInlineQuadwordAtomics()) {
1325-
setMaxAtomicSizeInBitsSupported(128);
13261325
setOperationAction(ISD::ATOMIC_LOAD, MVT::i128, Custom);
13271326
setOperationAction(ISD::ATOMIC_STORE, MVT::i128, Custom);
13281327
setOperationAction(ISD::INTRINSIC_VOID, MVT::i128, Custom);
@@ -1347,6 +1346,10 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
13471346

13481347
if (!isPPC64)
13491348
setMaxAtomicSizeInBitsSupported(32);
1349+
else if (shouldInlineQuadwordAtomics())
1350+
setMaxAtomicSizeInBitsSupported(128);
1351+
else
1352+
setMaxAtomicSizeInBitsSupported(64);
13501353

13511354
setStackPointerRegisterToSaveRestore(isPPC64 ? PPC::X1 : PPC::R1);
13521355

0 commit comments

Comments
 (0)