LLVM 22.0.0git
PackReuse.h
Go to the documentation of this file.
1//===- PackReuse.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 pack de-duplication pass.
10//
11
12#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PACKREUSE_H
13#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PACKREUSE_H
14
15#include "llvm/ADT/StringRef.h"
16#include "llvm/SandboxIR/Pass.h"
18
19namespace llvm::sandboxir {
20
21/// This pass aims at de-duplicating packs, i.e., try to reuse already existing
22/// pack patterns instead of keeping both.
23/// This is useful because even though the duplicates will most probably be
24/// optimized away by future passes, their added cost can make vectorization
25/// more conservative than it should be.
26class PackReuse final : public RegionPass {
27 bool Change = false;
28
29public:
30 PackReuse() : RegionPass("pack-reuse") {}
31 bool runOnRegion(Region &Rgn, const Analyses &A) final;
32};
33
34} // namespace llvm::sandboxir
35
36#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PACKREUSE_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This pass aims at de-duplicating packs, i.e., try to reuse already existing pack patterns instead of ...
Definition: PackReuse.h:26
bool runOnRegion(Region &Rgn, const Analyses &A) final
\Returns true if it modifies R.
Definition: PackReuse.cpp:14
A pass that runs on a sandbox::Region.
Definition: Pass.h:84
The main job of the Region is to point to new instructions generated by vectorization passes.
Definition: Region.h:96