[llvm] r289765 - Fix argument attribute queries with bundle operands
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 14 21:09:15 PST 2016
Author: hfinkel
Date: Wed Dec 14 23:09:15 2016
New Revision: 289765
URL: http://llvm.org/viewvc/llvm-project?rev=289765&view=rev
Log:
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...
Modified:
llvm/trunk/lib/Analysis/AliasAnalysis.cpp
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=289765&r1=289764&r2=289765&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Wed Dec 14 23:09:15 2016
@@ -460,7 +460,8 @@ ModRefInfo AAResults::callCapturesBefore
// 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
// 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;
}
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=289765&r1=289764&r2=289765&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Dec 14 23:09:15 2016
@@ -740,7 +740,8 @@ ModRefInfo BasicAAResult::getModRefInfo(
// pointer were passed to arguments that were neither of these, then it
// couldn't be no-capture.
if (!(*CI)->getType()->isPointerTy() ||
- (!CS.doesNotCapture(OperandNo) && !CS.isByValArgument(OperandNo)))
+ (!CS.doesNotCapture(OperandNo) &&
+ OperandNo < CS.getNumArgOperands() && !CS.isByValArgument(OperandNo)))
continue;
// If this is a no-capture pointer argument, see if we can tell that it
More information about the llvm-commits
mailing list