diff options
author | Hal Finkel <hfinkel@anl.gov> | 2016-12-15 05:09:15 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2016-12-15 05:09:15 +0000 |
commit | 39fed399e1ef4c1baad5c411bcd22fb5873aea5d (patch) | |
tree | 24eb58fd1debc838567831480c4df8e4262dff14 /llvm/lib/Analysis/AliasAnalysis.cpp | |
parent | d7389d626109cc0d611056da8238fa502e12f57c (diff) | |
download | bcm5719-llvm-39fed399e1ef4c1baad5c411bcd22fb5873aea5d.tar.gz bcm5719-llvm-39fed399e1ef4c1baad5c411bcd22fb5873aea5d.zip |
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
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |