[clang] [llvm] [AMDGPU] Add alignment attr & propagate alignment through make.buffer.rsrc inst (PR #145278)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 6 19:46:26 PDT 2025
================
@@ -5501,7 +5505,32 @@ struct AAAlignCallSiteReturned final
using Base = AACalleeToCallSite<AAAlign, AAAlignImpl>;
AAAlignCallSiteReturned(const IRPosition &IRP, Attributor &A)
: Base(IRP, A) {}
+ ChangeStatus updateImpl(Attributor &A) override {
+ SmallVector<AA::ValueAndContext> Values;
+ SmallVector<Attributor::AlignmentCallbackTy, 1> AligmentCBs =
+ A.getAlignmentCallback(getIRPosition());
+
+ for (Attributor::AlignmentCallbackTy CB : AligmentCBs)
+ CB(getIRPosition(), this, Values);
+
+ if (!Values.empty()) {
+ StateType T;
+ for (AA::ValueAndContext &VAC : Values) {
+ const AAAlign *AA = A.getAAFor<AAAlign>(
+ *this, IRPosition::value(*VAC.getValue()), DepClassTy::REQUIRED);
+ if (AA && this != AA) {
----------------
shiltian wrote:
Not sure if that's a good idea to compare AA directly instead of comparing the associated value.
https://github.com/llvm/llvm-project/pull/145278
More information about the llvm-commits
mailing list