[PATCH] D134596: AMDGPU: Handle new address pattern in LowerKernelAttributes introduced by opaque pointers

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 25 15:56:51 PDT 2022


cfang marked 2 inline comments as done.
cfang added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp:114
+        if (!Load)
+          BCI = dyn_cast<BitCastInst>(*U->user_begin());
+      }
----------------
arsenm wrote:
> Would be shorter to check for bitcast first 
Cannot see how it can be shorter. However, I have a new approach which seems more readable.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerKernelAttributes.cpp:121
+        continue;
+      Load = dyn_cast<LoadInst>(*BCI->user_begin()); // LOad from BCI?
+    }
----------------
arsenm wrote:
> Typo LOad
Done. Thanks.


================
Comment at: llvm/test/CodeGen/AMDGPU/implicit-arg-v5-opt-opaque-ptr.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -mtriple=amdgcn-amd-amdhsa --amdhsa-code-object-version=5 -S -O3 -opaque-pointers %s | FileCheck -enable-var-scope -check-prefix=GCN %s
+
----------------
arsenm wrote:
> Don’t need -O3 or the code object flag
Removed -O3. The code object version flag is still needed because v5 is not default, and the module flag approach is not ready yet.
Will update together with other 79 tests when ready.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134596/new/

https://reviews.llvm.org/D134596



More information about the llvm-commits mailing list