Skip to Content.
Sympa Menu

svadev - [svadev] DSA: How to identify interprocedural memory dependencies?

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

[svadev] DSA: How to identify interprocedural memory dependencies?


Chronological Thread 
  • From: Andreas Wilhelm <andreas.wilhelm AT gmx.com>
  • To: svadev AT cs.uiuc.edu
  • Subject: [svadev] DSA: How to identify interprocedural memory dependencies?
  • Date: Mon, 11 Mar 2013 17:22:26 +0100
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev/>
  • List-id: <svadev.cs.uiuc.edu>

Hello,

I'm working on a thread-safety-analyzer (based on LLVM 3.1/klee/Cloud9). Therefore I need a way to identify store instructions in function X, that modify memory locations which are read by a set of other functions Y,Z... At the moment I'm doing the following:

  EQTDDataStructures &DS = getAnalysis<EQTDDataStructures>();

  for (inst_iterator iIt = inst_begin(*funcA); iIt != inst_end(*funcA); ++iIt) {
    if (isa<StoreInst>( *iIt )) {
      StoreInst &inst = cast<StoreInst>( *iIt );

      bool ref = false;
      for (fSetIterator fItB = set.begin(); fItB != set.end() && !ref; ++fItB) {
        if (fItB->second == funcA)
          continue;

        DSGraph *graph = DS.getDSGraph( *fItB->second );
        if (graph->hasNodeForValue( inst.getValueOperand() )) {
          DSNodeHandle &node = graph->getNodeForValue( inst.getValueOperand() );
          ref =  node.getNode()->isReadNode() ||
                 node.getNode()->isIncompleteNode();
        }
      }

      if (ref) {
        instrumentInstruction( &inst );
      }
    } ...

I already know that a DS-Graph contains only nodes of used values within a function. So what I need is a way to traverse through the call tree and sum all DSNodes so that hasNodeForValue will be true if a Value is read by functionB or one of its successors.

What would be the best / easiest way to solve my problem?

Kind regards,
Andreas



Archive powered by MHonArc 2.6.16.

Top of Page