[llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 20:28:55 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 7db4e6c1ec18785ad3f622556362d83c11d7efef 4f2591385a7665d70b72d5f7b8337996b79c3389 -- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp llvm/lib/Target/NVPTX/NVPTXUtilities.cpp llvm/lib/Target/NVPTX/NVPTXUtilities.h llvm/lib/Target/NVPTX/NVVMIntrRange.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp b/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp
index bf352470f2..4305bbc99c 100644
--- a/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp
@@ -261,7 +261,6 @@ std::string getSamplerName(const Value &val) {
   return std::string(val.getName());
 }
 
-
 std::optional<unsigned> getMaxNTIDx(const Function &F) {
   return findOneNVVMAnnotation(F, "maxntidx");
 }
diff --git a/llvm/lib/Target/NVPTX/NVVMIntrRange.cpp b/llvm/lib/Target/NVPTX/NVVMIntrRange.cpp
index c47b717729..a7ab350c40 100644
--- a/llvm/lib/Target/NVPTX/NVVMIntrRange.cpp
+++ b/llvm/lib/Target/NVPTX/NVVMIntrRange.cpp
@@ -34,18 +34,18 @@ static cl::opt<unsigned> NVVMIntrRangeSM("nvvm-intr-range-sm", cl::init(20),
 
 namespace {
 class NVVMIntrRange : public FunctionPass {
-   unsigned SmVersion;
+  unsigned SmVersion;
 
- public:
-   static char ID;
-   NVVMIntrRange() : NVVMIntrRange(NVVMIntrRangeSM) {}
-   NVVMIntrRange(unsigned int SmVersion)
-       : FunctionPass(ID), SmVersion(SmVersion) {
+public:
+  static char ID;
+  NVVMIntrRange() : NVVMIntrRange(NVVMIntrRangeSM) {}
+  NVVMIntrRange(unsigned int SmVersion)
+      : FunctionPass(ID), SmVersion(SmVersion) {
 
-     initializeNVVMIntrRangePass(*PassRegistry::getPassRegistry());
-   }
+    initializeNVVMIntrRangePass(*PassRegistry::getPassRegistry());
+  }
 
-   bool runOnFunction(Function &) override;
+  bool runOnFunction(Function &) override;
 };
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/94422


More information about the llvm-commits mailing list