[llvm] [NVPTX] Add NVPTX intrinsics for TMA copies (PR #95289)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 12 11:46:20 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 3254f31a66263ea9647c9547f1531c3123444fcd 48328b66827d33454f3a40e78adaaa16a8654612 -- llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
index 06eb2ba848..d34b417d79 100644
--- a/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
@@ -154,17 +154,27 @@ INITIALIZE_PASS_END(NVPTXLowerArgs, "nvptx-lower-args",
static std::optional<int> tmaDescriptorOperandIndex(Instruction *I) {
if (auto *II = dyn_cast<IntrinsicInst>(I)) {
switch (II->getIntrinsicID()) {
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_1d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_2d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_3d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_4d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_5d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_1d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_2d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_3d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_4d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_5d_shared_cluster_global_tile_mbarrier_complete_tx_bytes:
return 1;
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_1d_global_shared_cta_tile_bulk_group:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_2d_global_shared_cta_tile_bulk_group:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_3d_global_shared_cta_tile_bulk_group:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_4d_global_shared_cta_tile_bulk_group:
- case llvm::Intrinsic::nvvm_cp_async_bulk_tensor_5d_global_shared_cta_tile_bulk_group:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_1d_global_shared_cta_tile_bulk_group:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_2d_global_shared_cta_tile_bulk_group:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_3d_global_shared_cta_tile_bulk_group:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_4d_global_shared_cta_tile_bulk_group:
+ case llvm::Intrinsic::
+ nvvm_cp_async_bulk_tensor_5d_global_shared_cta_tile_bulk_group:
return 0;
default:
return std::nullopt;
@@ -376,8 +386,8 @@ void NVPTXLowerArgs::handleByValParam(const NVPTXTargetMachine &TM,
assert(StructType && "Missing byval type");
auto IsALoadChain = [&](Value *Start) {
- SmallVector<Use*, 16> UsesToCheck;
- for (Use& u : Start->uses())
+ SmallVector<Use *, 16> UsesToCheck;
+ for (Use &u : Start->uses())
UsesToCheck.push_back(&u);
auto IsSupportedUse = [](Use *U) -> bool {
Value *V = U->get();
@@ -397,7 +407,7 @@ void NVPTXLowerArgs::handleByValParam(const NVPTXTargetMachine &TM,
};
while (!UsesToCheck.empty()) {
- Use* U = UsesToCheck.pop_back_val();
+ Use *U = UsesToCheck.pop_back_val();
if (!IsSupportedUse(U)) {
LLVM_DEBUG(dbgs() << "Need a copy of " << *Arg << " because of " << U
<< "\n");
@@ -405,7 +415,7 @@ void NVPTXLowerArgs::handleByValParam(const NVPTXTargetMachine &TM,
return false;
}
if (!isa<LoadInst>(U)) {
- for (Use& u : U->getUser()->uses())
+ for (Use &u : U->getUser()->uses())
UsesToCheck.push_back(&u);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/95289
More information about the llvm-commits
mailing list