summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryLocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/MemoryLocation.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryLocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/MemoryLocation.cpp b/llvm/lib/Analysis/MemoryLocation.cpp
index 55924db284e..43cebcd7a30 100644
--- a/llvm/lib/Analysis/MemoryLocation.cpp
+++ b/llvm/lib/Analysis/MemoryLocation.cpp
@@ -137,6 +137,10 @@ MemoryLocation MemoryLocation::getForArgument(ImmutableCallSite CS,
Arg, cast<ConstantInt>(II->getArgOperand(0))->getZExtValue(), AATags);
case Intrinsic::invariant_end:
+ // The first argument to an invariant.end is a "descriptor" type (e.g. a
+ // pointer to a empty struct) which is never actually dereferenced.
+ if (ArgIdx == 0)
+ return MemoryLocation(Arg, 0, AATags);
assert(ArgIdx == 2 && "Invalid argument index");
return MemoryLocation(
Arg, cast<ConstantInt>(II->getArgOperand(1))->getZExtValue(), AATags);
OpenPOWER on IntegriCloud