[llvm-branch-commits] [llvm] [AMDGPU][Attributor] Skip update if an AA is at its initial state (PR #114726)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 11 03:05:21 PST 2024
================
@@ -1145,31 +1169,71 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
auto &InfoCache = static_cast<AMDGPUInformationCache &>(A.getInfoCache());
ChangeStatus Change = ChangeStatus::UNCHANGED;
+ Function *F = getAssociatedFunction();
+
+ const auto *AAFlatWorkGroupSize = A.getAAFor<AAAMDFlatWorkGroupSize>(
+ *this, IRPosition::function(*F), DepClassTy::REQUIRED);
+ if (!AAFlatWorkGroupSize || !AAFlatWorkGroupSize->isValidState()) {
+ LLVM_DEBUG(
+ dbgs() << '[' << getName()
+ << "] AAAMDFlatWorkGroupSize is unavailable or invalid.\n");
+ return ChangeStatus::UNCHANGED;
+ }
+
+ if (AAFlatWorkGroupSize->isAtInitialState()) {
+ LLVM_DEBUG(dbgs() << '[' << getName()
+ << "] AAAMDFlatWorkGroupSize is still at initial "
+ "state. Skip the update.\n");
+ return ChangeStatus::UNCHANGED;
+ }
----------------
arsenm wrote:
The isAtInitialState check is a superset of the above isValidState, just replace the isValidState call?
https://github.com/llvm/llvm-project/pull/114726
More information about the llvm-branch-commits
mailing list