LLVM 23.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 LLVM_ABI PackReuse final : public RegionPass {
27 bool Change = false;
28
29public:
30 PackReuse(StringRef AuxArg) : RegionPass("pack-reuse") {
31 assert(AuxArg.empty() && "This pass ignores aux arg!");
32 }
33 bool runOnRegion(Region &Rgn, const Analyses &A) final;
34};
35
36} // namespace llvm::sandboxir
37
38#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PACKREUSE_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_ABI
Definition Compiler.h:215
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
constexpr bool empty() const
Check if the string is empty.
Definition StringRef.h:141
PackReuse(StringRef AuxArg)
Definition PackReuse.h:30
RegionPass(StringRef Name)
Name can't contain any spaces or start with '-'.
Definition Pass.h:87