Skip to content

[NFC][AMDGPU] Reformat code for creating AA #101591

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

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

shiltian
Copy link
Contributor

@shiltian shiltian commented Aug 2, 2024

No description provided.

@shiltian shiltian marked this pull request as ready for review August 2, 2024 00:25
@shiltian shiltian requested a review from arsenm August 2, 2024 00:25
Copy link
Contributor Author

shiltian commented Aug 2, 2024

@llvmbot
Copy link
Member

llvmbot commented Aug 2, 2024

@llvm/pr-subscribers-backend-amdgpu

Author: Shilei Tian (shiltian)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp (+12-11)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
index 9d3c9e1e2ef9f..de1f3421cce4e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
@@ -1051,17 +1051,18 @@ static bool runImpl(Module &M, AnalysisGetter &AG, TargetMachine &TM) {
   Attributor A(Functions, InfoCache, AC);
 
   for (Function &F : M) {
-    if (!F.isIntrinsic()) {
-      A.getOrCreateAAFor<AAAMDAttributes>(IRPosition::function(F));
-      A.getOrCreateAAFor<AAUniformWorkGroupSize>(IRPosition::function(F));
-      A.getOrCreateAAFor<AAAMDGPUNoAGPR>(IRPosition::function(F));
-      CallingConv::ID CC = F.getCallingConv();
-      if (!AMDGPU::isEntryFunctionCC(CC)) {
-        A.getOrCreateAAFor<AAAMDFlatWorkGroupSize>(IRPosition::function(F));
-        A.getOrCreateAAFor<AAAMDWavesPerEU>(IRPosition::function(F));
-      } else if (CC == CallingConv::AMDGPU_KERNEL) {
-        addPreloadKernArgHint(F, TM);
-      }
+    if (F.isIntrinsic())
+      continue;
+
+    A.getOrCreateAAFor<AAAMDAttributes>(IRPosition::function(F));
+    A.getOrCreateAAFor<AAUniformWorkGroupSize>(IRPosition::function(F));
+    A.getOrCreateAAFor<AAAMDGPUNoAGPR>(IRPosition::function(F));
+    CallingConv::ID CC = F.getCallingConv();
+    if (!AMDGPU::isEntryFunctionCC(CC)) {
+      A.getOrCreateAAFor<AAAMDFlatWorkGroupSize>(IRPosition::function(F));
+      A.getOrCreateAAFor<AAAMDWavesPerEU>(IRPosition::function(F));
+    } else if (CC == CallingConv::AMDGPU_KERNEL) {
+      addPreloadKernArgHint(F, TM);
     }
   }
 

Base automatically changed from users/shiltian/optimistic-at-beginning to main August 2, 2024 02:55
@shiltian shiltian force-pushed the users/shiltian/reformat-create-aa branch from 806563c to 255a049 Compare August 2, 2024 02:58
@shiltian shiltian merged commit 423aec6 into main Aug 2, 2024
7 checks passed
@shiltian shiltian deleted the users/shiltian/reformat-create-aa branch August 2, 2024 12:58
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