From: weiyu Date: Wed, 30 Sep 2020 19:38:06 +0000 (-0700) Subject: Do not directly replace function call style atomics X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11llvm.git;a=commitdiff_plain;h=9b5b50179b617d9bfda0b5c5e787c32ad435f019 Do not directly replace function call style atomics --- diff --git a/CDSPass.cpp b/CDSPass.cpp index a33738a..0440c49 100644 --- a/CDSPass.cpp +++ b/CDSPass.cpp @@ -533,12 +533,12 @@ bool CDSPass::runOnFunction(Function &F) { chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores, DL); } - } else if (isAtomicCall(&Inst) ) { + } /*else if (isAtomicCall(&Inst) ) { AtomicAccesses.push_back(&Inst); HasAtomic = true; chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores, DL); - } else if (isa(Inst) || isa(Inst)) { + }*/ else if (isa(Inst) || isa(Inst)) { LoadInst *LI = dyn_cast(&Inst); StoreInst *SI = dyn_cast(&Inst); bool isVolatile = ( LI ? LI->isVolatile() : SI->isVolatile() ); @@ -722,12 +722,14 @@ bool CDSPass::instrumentMemIntrinsic(Instruction *I) { bool CDSPass::instrumentAtomic(Instruction * I, const DataLayout &DL) { IRBuilder<> IRB(I); + Value *position = getPosition(I, IRB); +/* if (auto *CI = dyn_cast(I)) { return instrumentAtomicCall(CI, DL); } +*/ - Value *position = getPosition(I, IRB); if (LoadInst *LI = dyn_cast(I)) { Value *Addr = LI->getPointerOperand(); int Idx=getMemoryAccessFuncIndex(Addr, DL);