Skip to content

Commit

Permalink
Attributor: Do not treat pointer vectors as valid for unsupported att…
Browse files Browse the repository at this point in the history
…ributes (#121149)

The memory attributes, noalias, and dereferenceable do not support
vectors of pointers according to the IR verifier, so don't report
them as valid.
  • Loading branch information
arsenm authored Dec 27, 2024
1 parent 1ead155 commit ac8bb73
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions llvm/include/llvm/Transforms/IPO/Attributor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3853,7 +3853,7 @@ struct AANoAlias

/// See AbstractAttribute::isValidIRPositionForInit
static bool isValidIRPositionForInit(Attributor &A, const IRPosition &IRP) {
if (!IRP.getAssociatedType()->isPtrOrPtrVectorTy())
if (!IRP.getAssociatedType()->isPointerTy())
return false;
return IRAttribute::isValidIRPositionForInit(A, IRP);
}
Expand Down Expand Up @@ -4220,7 +4220,7 @@ struct AADereferenceable

/// See AbstractAttribute::isValidIRPositionForInit
static bool isValidIRPositionForInit(Attributor &A, const IRPosition &IRP) {
if (!IRP.getAssociatedType()->isPtrOrPtrVectorTy())
if (!IRP.getAssociatedType()->isPointerTy())
return false;
return IRAttribute::isValidIRPositionForInit(A, IRP);
}
Expand Down Expand Up @@ -4364,7 +4364,7 @@ struct AANoCapture

/// See AbstractAttribute::isValidIRPositionForInit
static bool isValidIRPositionForInit(Attributor &A, const IRPosition &IRP) {
if (!IRP.getAssociatedType()->isPtrOrPtrVectorTy())
if (!IRP.getAssociatedType()->isPointerTy())
return false;
return IRAttribute::isValidIRPositionForInit(A, IRP);
}
Expand Down Expand Up @@ -4635,8 +4635,7 @@ struct AAMemoryBehavior

/// See AbstractAttribute::isValidIRPositionForInit
static bool isValidIRPositionForInit(Attributor &A, const IRPosition &IRP) {
if (!IRP.isFunctionScope() &&
!IRP.getAssociatedType()->isPtrOrPtrVectorTy())
if (!IRP.isFunctionScope() && !IRP.getAssociatedType()->isPointerTy())
return false;
return IRAttribute::isValidIRPositionForInit(A, IRP);
}
Expand Down

0 comments on commit ac8bb73

Please sign in to comment.