mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 16:07:09 +00:00

This make is obivious that a class was not intended to be derived from. NPM analysis pass can unfortunately not marked as final because they are derived from a llvm::Checker<T> template internally by the NPM. Also normalize the use of classes/structs * NPM passes are structs * Legacy passes are classes * structs that have methods and are not a visitor pattern are classes * structs have public inheritance by default, remove "public" keyword * Use typedef'ed type instead of inline forward declaration
70 lines
2.2 KiB
C++
70 lines
2.2 KiB
C++
//===------ DeLICM.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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Undo the effect of Loop Invariant Code Motion (LICM) and
|
|
// GVN Partial Redundancy Elimination (PRE) on SCoP-level.
|
|
//
|
|
// Namely, remove register/scalar dependencies by mapping them back to array
|
|
// elements.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef POLLY_DELICM_H
|
|
#define POLLY_DELICM_H
|
|
|
|
#include "polly/ScopPass.h"
|
|
#include "isl/isl-noexceptions.h"
|
|
|
|
namespace llvm {
|
|
class PassRegistry;
|
|
class Pass;
|
|
class raw_ostream;
|
|
} // namespace llvm
|
|
|
|
namespace polly {
|
|
/// Create a new DeLICM pass instance.
|
|
llvm::Pass *createDeLICMWrapperPass();
|
|
llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS);
|
|
|
|
struct DeLICMPass final : llvm::PassInfoMixin<DeLICMPass> {
|
|
DeLICMPass() {}
|
|
|
|
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
|
|
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
|
|
};
|
|
|
|
struct DeLICMPrinterPass final : llvm::PassInfoMixin<DeLICMPrinterPass> {
|
|
DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {}
|
|
|
|
PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
|
|
ScopStandardAnalysisResults &SAR, SPMUpdater &);
|
|
|
|
private:
|
|
llvm::raw_ostream &OS;
|
|
};
|
|
|
|
/// Determine whether two lifetimes are conflicting.
|
|
///
|
|
/// Used by unittesting.
|
|
bool isConflicting(isl::union_set ExistingOccupied,
|
|
isl::union_set ExistingUnused, isl::union_map ExistingKnown,
|
|
isl::union_map ExistingWrites,
|
|
isl::union_set ProposedOccupied,
|
|
isl::union_set ProposedUnused, isl::union_map ProposedKnown,
|
|
isl::union_map ProposedWrites,
|
|
llvm::raw_ostream *OS = nullptr, unsigned Indent = 0);
|
|
|
|
} // namespace polly
|
|
|
|
namespace llvm {
|
|
void initializeDeLICMWrapperPassPass(llvm::PassRegistry &);
|
|
void initializeDeLICMPrinterLegacyPassPass(llvm::PassRegistry &);
|
|
} // namespace llvm
|
|
|
|
#endif /* POLLY_DELICM_H */
|