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...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289765 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hal Finkel 2016-12-15 05:09:15 +00:00
parent d0f6642fb6
commit 146bbc6051
2 changed files with 6 additions and 4 deletions

View File

@ -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;
}

View File

@ -740,7 +740,8 @@ ModRefInfo BasicAAResult::getModRefInfo(ImmutableCallSite CS,
// 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