LLVM 23.0.0git
LoadStoreVec.h
Go to the documentation of this file.
1//===- LoadStoreVec.h -------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// A pass that vectorizes short store-load chains.
10// Unlike generic bottom-up vectorization, this pass can vectorize instructions
11// of different types.
12//
13
14#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_LOADSTOREVEC_H
15#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_LOADSTOREVEC_H
16
17#include "llvm/ADT/ArrayRef.h"
18#include "llvm/SandboxIR/Pass.h"
19
20namespace llvm {
21
22class DataLayout;
23
24namespace sandboxir {
25
26class Value;
27class Instruction;
28class Scheduler;
29class Type;
30
31class LoadStoreVec final : public RegionPass {
32 const DataLayout *DL = nullptr;
33 /// Checks legality of vectorization and \returns the vector type on success,
34 /// nullopt otherwise.
35 std::optional<Type *> canVectorize(ArrayRef<Instruction *> Bndl,
37
38 void tryEraseDeadInstrs(ArrayRef<Instruction *> Stores,
40
41public:
42 LoadStoreVec() : RegionPass("load-store-vec") {}
43 bool runOnRegion(Region &Rgn, const Analyses &A) final;
44};
45
46} // namespace sandboxir
47
48} // namespace llvm
49
50#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_STRUCTINITVEC_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:64
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
Definition Instruction.h:43
bool runOnRegion(Region &Rgn, const Analyses &A) final
\Returns true if it modifies R.
RegionPass(StringRef Name)
Name can't contain any spaces or start with '-'.
Definition Pass.h:87
The main job of the Region is to point to new instructions generated by vectorization passes.
Definition Region.h:96
The list scheduler.
Definition Scheduler.h:163
Just like llvm::Type these are immutable, unique, never get freed and can only be created via static ...
Definition Type.h:47
A SandboxIR Value has users. This is the base class.
Definition Value.h:68
This is an optimization pass for GlobalISel generic memory operations.