|
73 | 73 |
|
74 | 74 | using namespace llvm;
|
75 | 75 |
|
76 |
| -static std::atomic<unsigned> GlobalUniqueCallSite; |
77 |
| - |
78 | 76 | static cl::opt<bool> sched4reg(
|
79 | 77 | "nvptx-sched4reg",
|
80 | 78 | cl::desc("NVPTX Specific: schedule for register pressue"), cl::init(false));
|
@@ -500,7 +498,7 @@ static SDValue MaybeBitcast(SelectionDAG &DAG, SDLoc DL, EVT VT,
|
500 | 498 | // NVPTXTargetLowering Constructor.
|
501 | 499 | NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
|
502 | 500 | const NVPTXSubtarget &STI)
|
503 |
| - : TargetLowering(TM), nvTM(&TM), STI(STI) { |
| 501 | + : TargetLowering(TM), nvTM(&TM), STI(STI), GlobalUniqueCallSite(0) { |
504 | 502 | // always lower memset, memcpy, and memmove intrinsics to load/store
|
505 | 503 | // instructions, rather
|
506 | 504 | // then generating calls to memset, mempcy or memmove.
|
@@ -1474,7 +1472,7 @@ SDValue NVPTXTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
1474 | 1472 | unsigned FirstVAArg = CLI.NumFixedArgs; // position of the first variadic
|
1475 | 1473 | unsigned VAOffset = 0; // current offset in the param array
|
1476 | 1474 |
|
1477 |
| - unsigned UniqueCallSite = GlobalUniqueCallSite.fetch_add(1); |
| 1475 | + const unsigned UniqueCallSite = GlobalUniqueCallSite++; |
1478 | 1476 | SDValue TempChain = Chain;
|
1479 | 1477 | Chain = DAG.getCALLSEQ_START(Chain, UniqueCallSite, 0, dl);
|
1480 | 1478 | SDValue InGlue = Chain.getValue(1);
|
|
0 commit comments