[llvm] [llubi] Vector manipulation intrinsics cleanup (PR #195004)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 22:22:22 PDT 2026


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 origin/main HEAD --extensions cpp -- llvm/tools/llubi/lib/Interpreter.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/tools/llubi/lib/Interpreter.cpp b/llvm/tools/llubi/lib/Interpreter.cpp
index e87ebfabc..453fc3a3d 100644
--- a/llvm/tools/llubi/lib/Interpreter.cpp
+++ b/llvm/tools/llubi/lib/Interpreter.cpp
@@ -746,8 +746,8 @@ public:
       const auto &Vec = Args[0].asAggregate();
       const auto &SubVec = Args[1].asAggregate();
       const auto &Idx = Args[2].asInteger();
-      auto EC = cast<VectorType>(CB.getArgOperand(1)->getType())
-                    ->getElementCount();
+      auto EC =
+          cast<VectorType>(CB.getArgOperand(1)->getType())->getElementCount();
       const uint64_t RawOffset = Idx.getZExtValue();
       if (RawOffset % EC.getKnownMinValue() != 0) {
         reportImmediateUB("llvm.vector.insert index is not a multiple of the "
@@ -758,8 +758,7 @@ public:
       if (EC.isScalable() && VScale != 0 &&
           RawOffset > std::numeric_limits<uint64_t>::max() / VScale)
         return AnyValue::poison();
-      const uint64_t Offset =
-          EC.isScalable() ? RawOffset * VScale : RawOffset;
+      const uint64_t Offset = EC.isScalable() ? RawOffset * VScale : RawOffset;
       if (Offset > Vec.size() || SubVec.size() > Vec.size() - Offset)
         return AnyValue::poison();
       std::vector<AnyValue> Res;
@@ -788,8 +787,7 @@ public:
       if (EC.isScalable() && VScale != 0 &&
           RawOffset > std::numeric_limits<uint64_t>::max() / VScale)
         return AnyValue::poison();
-      const uint64_t Offset =
-          EC.isScalable() ? RawOffset * VScale : RawOffset;
+      const uint64_t Offset = EC.isScalable() ? RawOffset * VScale : RawOffset;
       const uint64_t DstSize = Ctx.getEVL(EC);
       if (Offset > Vec.size() || DstSize > Vec.size() - Offset)
         return AnyValue::poison();

``````````

</details>


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


More information about the llvm-commits mailing list