[llvm] Attributor: Do not treat pointer vectors as valid for unsupported attributes (PR #121149)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 26 05:23:49 PST 2024
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/121149
>From 019394c9e310bf5bd5dd22f51ba8159711834323 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Thu, 26 Dec 2024 20:16:02 +0700
Subject: [PATCH] Attributor: Do not treat pointer vectors as valid for
unsupported attributes
The memory attributes, noalias, and dereferenceable do not support
vectors of pointers according to the IR verifier, so don't report
them as valid.
---
llvm/include/llvm/Transforms/IPO/Attributor.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
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