diff --git a/lib/MemoryModel/PAGBuilder.cpp b/lib/MemoryModel/PAGBuilder.cpp index 7f6af6cd5..a8329fa37 100644 --- a/lib/MemoryModel/PAGBuilder.cpp +++ b/lib/MemoryModel/PAGBuilder.cpp @@ -414,6 +414,27 @@ void PAGBuilder::visitStoreInst(StoreInst &inst) { NodeID src = getValueNode(inst.getValueOperand()); pag->addStoreEdge(src, dst); + } else { + // if this is a vector operand, process the individual operands. + if(isa(inst.getValueOperand()->getType()) && dyn_cast(inst.getValueOperand())) { + ConstantVector *CVExpr = dyn_cast(inst.getValueOperand()); + bool dstCreated = false; + NodeID vdst; + // iterate for each element in the vector + for(unsigned vindex = 0; vindex < CVExpr->getNumOperands(); ++vindex) { + if(CVExpr->getOperand(vindex)->getType()->isPointerTy()) { + NodeID vsrc = getValueNode(CVExpr->getOperand(vindex)); + // create dst node only if its required. i.e., if any of the element + // of the vector's value is a pointer type. + if(!dstCreated) { + vdst = getValueNode(inst.getPointerOperand()); + dstCreated = true; + } + pag->addStoreEdge(vsrc, vdst); + } + + } + } } }