From 39fed399e1ef4c1baad5c411bcd22fb5873aea5d Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Thu, 15 Dec 2016 05:09:15 +0000 Subject: Fix argument attribute queries with bundle operands When iterating over data operands in AA, don't make argument-attribute-specific queries on bundle operands. Trying to fix self hosting... llvm-svn: 289765 --- llvm/lib/Analysis/AliasAnalysis.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp') diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index b6a65e10a89..10b3ed91659 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -460,7 +460,8 @@ ModRefInfo AAResults::callCapturesBefore(const Instruction *I, // pointer were passed to arguments that were neither of these, then it // couldn't be no-capture. if (!(*CI)->getType()->isPointerTy() || - (!CS.doesNotCapture(ArgNo) && !CS.isByValArgument(ArgNo))) + (!CS.doesNotCapture(ArgNo) && + ArgNo < CS.getNumArgOperands() && !CS.isByValArgument(ArgNo))) continue; // If this is a no-capture pointer argument, see if we can tell that it @@ -469,9 +470,9 @@ ModRefInfo AAResults::callCapturesBefore(const Instruction *I, // escape. if (isNoAlias(MemoryLocation(*CI), MemoryLocation(Object))) continue; - if (CS.doesNotAccessMemory(ArgNo)) + if (ArgNo < CS.getNumArgOperands() && CS.doesNotAccessMemory(ArgNo)) continue; - if (CS.onlyReadsMemory(ArgNo)) { + if (ArgNo < CS.getNumArgOperands() && CS.onlyReadsMemory(ArgNo)) { R = MRI_Ref; continue; } -- cgit v1.2.3