Do not directly replace function call style atomics
authorweiyu <weiyuluo1232@gmail.com>
Wed, 30 Sep 2020 19:38:06 +0000 (12:38 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Wed, 30 Sep 2020 19:38:06 +0000 (12:38 -0700)
CDSPass.cpp

index a33738a96d26880395afc7beaf3b284e1bf1e705..0440c49c460816062b538d4ed39067a880fb622c 100644 (file)
@@ -533,12 +533,12 @@ bool CDSPass::runOnFunction(Function &F) {
                                        chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores,
                                                DL);
                                }
                                        chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores,
                                                DL);
                                }
-                       } else if (isAtomicCall(&Inst) ) {
+                       } /*else if (isAtomicCall(&Inst) ) {
                                AtomicAccesses.push_back(&Inst);
                                HasAtomic = true;
                                chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores,
                                        DL);
                                AtomicAccesses.push_back(&Inst);
                                HasAtomic = true;
                                chooseInstructionsToInstrument(LocalLoadsAndStores, AllLoadsAndStores,
                                        DL);
-                       } else if (isa<LoadInst>(Inst) || isa<StoreInst>(Inst)) {
+                       }*/ else if (isa<LoadInst>(Inst) || isa<StoreInst>(Inst)) {
                                LoadInst *LI = dyn_cast<LoadInst>(&Inst);
                                StoreInst *SI = dyn_cast<StoreInst>(&Inst);
                                bool isVolatile = ( LI ? LI->isVolatile() : SI->isVolatile() );
                                LoadInst *LI = dyn_cast<LoadInst>(&Inst);
                                StoreInst *SI = dyn_cast<StoreInst>(&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);
 
 bool CDSPass::instrumentAtomic(Instruction * I, const DataLayout &DL) {
        IRBuilder<> IRB(I);
+       Value *position = getPosition(I, IRB);
 
 
+/*
        if (auto *CI = dyn_cast<CallInst>(I)) {
                return instrumentAtomicCall(CI, DL);
        }
        if (auto *CI = dyn_cast<CallInst>(I)) {
                return instrumentAtomicCall(CI, DL);
        }
+*/
 
 
-       Value *position = getPosition(I, IRB);
        if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
                Value *Addr = LI->getPointerOperand();
                int Idx=getMemoryAccessFuncIndex(Addr, DL);
        if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
                Value *Addr = LI->getPointerOperand();
                int Idx=getMemoryAccessFuncIndex(Addr, DL);