From 9b5b50179b617d9bfda0b5c5e787c32ad435f019 Mon Sep 17 00:00:00 2001 From: weiyu Date: Wed, 30 Sep 2020 12:38:06 -0700 Subject: [PATCH] Do not directly replace function call style atomics --- CDSPass.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.34.1