[llvm] [SandboxVectorizer] Define SeedBundle: a set of instructions to be vectorized (PR #110696)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 10:06:01 PDT 2024
================
@@ -0,0 +1,136 @@
+//===- SeedCollector.h ------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+// This file contains the mechanism for collecting the seed instructions that
+// are used as starting points for forming the vectorization graph.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_SEEDCOLLECTOR_H
+#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_SEEDCOLLECTOR_H
+
+#include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/iterator_range.h"
+#include "llvm/Analysis/ScalarEvolution.h"
+#include "llvm/SandboxIR/Instruction.h"
+#include "llvm/SandboxIR/Utils.h"
+#include "llvm/SandboxIR/Value.h"
+#include <iterator>
+#include <memory>
+
+namespace llvm::sandboxir {
+class Instruction;
+class StoreInst;
+class BasicBlock;
+
+/// An ordered set of Instructions that can be vectorized.
+class SeedBundle {
+public:
+ using SeedList = SmallVector<sandboxir::Instruction *>;
+ /// Initialize a bundle with \p I.
+ explicit SeedBundle(sandboxir::Instruction *I, const DataLayout &DL) {
+ insertAt(begin(), I, DL);
+ }
+ explicit SeedBundle(SeedList &&L, const DataLayout &DL)
+ : Seeds(std::move(L)) {
+ for (auto &S : Seeds) {
----------------
tschuett wrote:
More '{' s than necessary.
https://github.com/llvm/llvm-project/pull/110696
More information about the llvm-commits
mailing list