[llvm] ac8bb73 - Attributor: Do not treat pointer vectors as valid for unsupported attributes (#121149)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 27 00:57:24 PST 2024


Author: Matt Arsenault
Date: 2024-12-27T15:57:20+07:00
New Revision: ac8bb7353a7fe79cd99b3c041d5a153517c31abc

URL: https://github.com/llvm/llvm-project/commit/ac8bb7353a7fe79cd99b3c041d5a153517c31abc
DIFF: https://github.com/llvm/llvm-project/commit/ac8bb7353a7fe79cd99b3c041d5a153517c31abc.diff

LOG: Attributor: Do not treat pointer vectors as valid for unsupported attributes (#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.

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/IPO/Attributor.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 8915969f75466c..a8ee3cd531e490 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);
   }
@@ -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);
   }


        


More information about the llvm-commits mailing list