Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributor: Do not treat pointer vectors as valid for unsupported attributes #121149

Merged

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Dec 26, 2024

The memory attributes, noalias, and dereferenceable do not support
vectors of pointers according to the IR verifier, so don't report
them as valid.

Copy link
Contributor Author

arsenm commented Dec 26, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm arsenm requested review from jdoerfert and shiltian December 26, 2024 13:18
@arsenm arsenm marked this pull request as ready for review December 26, 2024 13:18
@arsenm arsenm changed the title Attributor: Do not treat pointer vectors of valid for unsupported attributes Attributor: Do not treat pointer vectors as valid for unsupported attributes Dec 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 26, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Matt Arsenault (arsenm)

Changes

The memory attributes, noalias, and dereferenceable do not support
vectors of pointers according to the IR verifier, so don't report
them as valid.


Full diff: https://github.com/llvm/llvm-project/pull/121149.diff

1 Files Affected:

  • (modified) llvm/include/llvm/Transforms/IPO/Attributor.h (+4-4)
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 8915969f75466c..01082786e22258 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -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);
   }
@@ -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);
   }
@@ -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);
   }
@@ -4636,7 +4636,7 @@ struct AAMemoryBehavior
   /// See AbstractAttribute::isValidIRPositionForInit
   static bool isValidIRPositionForInit(Attributor &A, const IRPosition &IRP) {
     if (!IRP.isFunctionScope() &&
-        !IRP.getAssociatedType()->isPtrOrPtrVectorTy())
+        !IRP.getAssociatedType()->isPointerTy())
       return false;
     return IRAttribute::isValidIRPositionForInit(A, IRP);
   }

Copy link

github-actions bot commented Dec 26, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

…ributes

The memory attributes, noalias, and dereferenceable do not support
vectors of pointers according to the IR verifier, so don't report
them as valid.
@arsenm arsenm force-pushed the users/arsenm/attributor-remove-checks-for-ptr-vector-attributes branch from ce58312 to 019394c Compare December 26, 2024 13:23
@arsenm arsenm merged commit ac8bb73 into main Dec 27, 2024
8 checks passed
@arsenm arsenm deleted the users/arsenm/attributor-remove-checks-for-ptr-vector-attributes branch December 27, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants