Skip to content

Commit 2ac4ee4

Browse files
author
git apple-llvm automerger
committed
Merge commit '1b01f058f4d0' from llvm.org/main into next
2 parents f1dedb7 + 1b01f05 commit 2ac4ee4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373

7474
using namespace llvm;
7575

76-
static std::atomic<unsigned> GlobalUniqueCallSite;
77-
7876
static cl::opt<bool> sched4reg(
7977
"nvptx-sched4reg",
8078
cl::desc("NVPTX Specific: schedule for register pressue"), cl::init(false));
@@ -500,7 +498,7 @@ static SDValue MaybeBitcast(SelectionDAG &DAG, SDLoc DL, EVT VT,
500498
// NVPTXTargetLowering Constructor.
501499
NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
502500
const NVPTXSubtarget &STI)
503-
: TargetLowering(TM), nvTM(&TM), STI(STI) {
501+
: TargetLowering(TM), nvTM(&TM), STI(STI), GlobalUniqueCallSite(0) {
504502
// always lower memset, memcpy, and memmove intrinsics to load/store
505503
// instructions, rather
506504
// then generating calls to memset, mempcy or memmove.
@@ -1474,7 +1472,7 @@ SDValue NVPTXTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
14741472
unsigned FirstVAArg = CLI.NumFixedArgs; // position of the first variadic
14751473
unsigned VAOffset = 0; // current offset in the param array
14761474

1477-
unsigned UniqueCallSite = GlobalUniqueCallSite.fetch_add(1);
1475+
const unsigned UniqueCallSite = GlobalUniqueCallSite++;
14781476
SDValue TempChain = Chain;
14791477
Chain = DAG.getCALLSEQ_START(Chain, UniqueCallSite, 0, dl);
14801478
SDValue InGlue = Chain.getValue(1);

llvm/lib/Target/NVPTX/NVPTXISelLowering.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ class NVPTXTargetLowering : public TargetLowering {
273273

274274
private:
275275
const NVPTXSubtarget &STI; // cache the subtarget here
276+
mutable unsigned GlobalUniqueCallSite;
277+
276278
SDValue getParamSymbol(SelectionDAG &DAG, int idx, EVT) const;
277279

278280
SDValue LowerADDRSPACECAST(SDValue Op, SelectionDAG &DAG) const;

0 commit comments

Comments
 (0)