Merge branch 'master' of /home/git/cds-llvm
authorBrian Demsky <bdemsky@uci.edu>
Mon, 22 Jul 2019 23:18:21 +0000 (16:18 -0700)
committerBrian Demsky <bdemsky@uci.edu>
Mon, 22 Jul 2019 23:18:21 +0000 (16:18 -0700)
1  2 
CDSPass.cpp

diff --combined CDSPass.cpp
index 164de72030e29259f06ad382feac1234d2fa46ac,d550140dff5639f147009f15bf998738318bfbfc..50aca18a5114b23a81b934e3cbe9e18c3bab03f1
@@@ -89,6 -89,7 +89,6 @@@ Type * Int64PtrTy
  Type * VoidTy;
  
  static const size_t kNumberOfAccessSizes = 4;
 -static const int volatile_order = 6;
  
  int getAtomicOrderIndex(AtomicOrdering order){
        switch (order) {
@@@ -198,9 -199,9 +198,9 @@@ void CDSPass::initializeCallbacks(Modul
                CDSLoad[i]  = M.getOrInsertFunction(LoadName, VoidTy, PtrTy);
                CDSStore[i] = M.getOrInsertFunction(StoreName, VoidTy, PtrTy);
                CDSVolatileLoad[i]  = M.getOrInsertFunction(VolatileLoadName,
 -                                                                      Ty, PtrTy, OrdTy, Int8PtrTy);
 +                                                                      Ty, PtrTy, Int8PtrTy);
                CDSVolatileStore[i] = M.getOrInsertFunction(VolatileStoreName, 
 -                                                                      VoidTy, PtrTy, Ty, OrdTy, Int8PtrTy);
 +                                                                      VoidTy, PtrTy, Ty, Int8PtrTy);
                CDSAtomicInit[i] = M.getOrInsertFunction(AtomicInitName, 
                                                                VoidTy, PtrTy, Ty, Int8PtrTy);
                CDSAtomicLoad[i]  = M.getOrInsertFunction(AtomicLoadName, 
@@@ -384,8 -385,6 +384,6 @@@ bool CDSPass::runOnFunction(Function &F
  
                        Res = true;
                }
-               F.dump();
        }
  
        return false;
@@@ -507,7 -506,8 +505,7 @@@ bool CDSPass::instrumentVolatile(Instru
                if (Idx < 0)
                        return false;
  
 -              Value *order = ConstantInt::get(OrdTy, volatile_order);
 -              Value *args[] = {Addr, order, position};
 +              Value *args[] = {Addr, position};
                Instruction* funcInst=CallInst::Create(CDSVolatileLoad[Idx], args);
                ReplaceInstWithInst(LI, funcInst);
        } else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
                        return false;
  
                Value *val = SI->getValueOperand();
 -              Value *order = ConstantInt::get(OrdTy, volatile_order);
 -              Value *args[] = {Addr, val, order, position};
 +              Value *args[] = {Addr, val, position};
                Instruction* funcInst=CallInst::Create(CDSVolatileStore[Idx], args);
                ReplaceInstWithInst(SI, funcInst);
        } else {