summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 2fe012d3865..090755960c8 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -154,6 +154,12 @@ static ModRefInfo GetLocation(const Instruction *Inst, MemoryLocation &Loc,
return ModRefInfo::Mod;
}
+ if (const MemSetInst *MI = dyn_cast<MemSetInst>(Inst)) {
+ Loc = MemoryLocation::getForDest(MI);
+ // Conversatively assume ModRef for volatile memset.
+ return MI->isVolatile() ? ModRefInfo::ModRef : ModRefInfo::Mod;
+ }
+
if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst)) {
switch (II->getIntrinsicID()) {
case Intrinsic::lifetime_start:
OpenPOWER on IntegriCloud