[llvm] [SVE] Don't require lookup when demangling vector function mappings (PR #72260)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 05:51:21 PST 2023


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 1256d1d17e8668582a923cb36b6bc9b31034d7f7 6336196759d99f5bab80b2be2584e81ec8b6dbd5 -- llvm/include/llvm/Analysis/VectorUtils.h llvm/lib/Analysis/VFABIDemangling.cpp llvm/lib/Analysis/VectorUtils.cpp llvm/lib/Transforms/Utils/ModuleUtils.cpp llvm/tools/vfabi-demangle-fuzzer/vfabi-demangler-fuzzer.cpp llvm/unittests/Analysis/VectorFunctionABITest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Analysis/VFABIDemangling.cpp b/llvm/lib/Analysis/VFABIDemangling.cpp
index 9d86d34113..a66c916b78 100644
--- a/llvm/lib/Analysis/VFABIDemangling.cpp
+++ b/llvm/lib/Analysis/VFABIDemangling.cpp
@@ -318,7 +318,7 @@ getScalableECFromSignature(const FunctionType *Signature, const VFISAKind ISA,
 
   // Start with a very wide EC and drop when we find smaller ECs based on type.
   ElementCount MinEC =
-        ElementCount::getScalable(std::numeric_limits<unsigned int>::max());
+      ElementCount::getScalable(std::numeric_limits<unsigned int>::max());
   for (auto &Param : Params) {
     // Only vector parameters are used when determining the VF; uniform or
     // linear are left as scalars, so do not affect VF.
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 926eca80ea..96f39ff7e4 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -1468,8 +1468,8 @@ void VFABI::getVectorVariantNames(
   for (const auto &S : SetVector<StringRef>(ListAttr.begin(), ListAttr.end())) {
     std::optional<VFInfo> Info = VFABI::tryDemangleForVFABI(S, CI);
     if (Info && CI.getModule()->getFunction(Info->VectorName)) {
-      LLVM_DEBUG(dbgs() << "VFABI: Adding mapping '" << S << "' for " <<
-                 CI << "\n");
+      LLVM_DEBUG(dbgs() << "VFABI: Adding mapping '" << S << "' for " << CI
+                        << "\n");
       VariantMappings.push_back(std::string(S));
     } else
       LLVM_DEBUG(dbgs() << "VFABI: Invalid mapping '" << S << "'\n");
diff --git a/llvm/unittests/Analysis/VectorFunctionABITest.cpp b/llvm/unittests/Analysis/VectorFunctionABITest.cpp
index e2cb7129c7..e496d87c06 100644
--- a/llvm/unittests/Analysis/VectorFunctionABITest.cpp
+++ b/llvm/unittests/Analysis/VectorFunctionABITest.cpp
@@ -537,7 +537,7 @@ TEST_F(VFABIParserTest, ParseScalableMaskingSVESincos) {
 // parameter type.
 TEST_F(VFABIParserTest, ParseWiderReturnTypeSVE) {
   EXPECT_TRUE(
-    invokeParser("_ZGVsMxvv_foo(vector_foo)", "foo", "i64(i32, i32)"));
+      invokeParser("_ZGVsMxvv_foo(vector_foo)", "foo", "i64(i32, i32)"));
   EXPECT_EQ(VF, ElementCount::getScalable(2));
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list