Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:48:20

0001 //===------ DeLICM.h --------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Undo the effect of Loop Invariant Code Motion (LICM) and
0010 // GVN Partial Redundancy Elimination (PRE) on SCoP-level.
0011 //
0012 // Namely, remove register/scalar dependencies by mapping them back to array
0013 // elements.
0014 //
0015 //===----------------------------------------------------------------------===//
0016 
0017 #ifndef POLLY_DELICM_H
0018 #define POLLY_DELICM_H
0019 
0020 #include "polly/ScopPass.h"
0021 #include "isl/isl-noexceptions.h"
0022 
0023 namespace llvm {
0024 class PassRegistry;
0025 class Pass;
0026 class raw_ostream;
0027 } // namespace llvm
0028 
0029 namespace polly {
0030 /// Create a new DeLICM pass instance.
0031 llvm::Pass *createDeLICMWrapperPass();
0032 llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS);
0033 
0034 struct DeLICMPass final : llvm::PassInfoMixin<DeLICMPass> {
0035   DeLICMPass() {}
0036 
0037   llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
0038                               ScopStandardAnalysisResults &SAR, SPMUpdater &U);
0039 };
0040 
0041 struct DeLICMPrinterPass final : llvm::PassInfoMixin<DeLICMPrinterPass> {
0042   DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {}
0043 
0044   PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
0045                         ScopStandardAnalysisResults &SAR, SPMUpdater &);
0046 
0047 private:
0048   llvm::raw_ostream &OS;
0049 };
0050 
0051 /// Determine whether two lifetimes are conflicting.
0052 ///
0053 /// Used by unittesting.
0054 bool isConflicting(isl::union_set ExistingOccupied,
0055                    isl::union_set ExistingUnused, isl::union_map ExistingKnown,
0056                    isl::union_map ExistingWrites,
0057                    isl::union_set ProposedOccupied,
0058                    isl::union_set ProposedUnused, isl::union_map ProposedKnown,
0059                    isl::union_map ProposedWrites,
0060                    llvm::raw_ostream *OS = nullptr, unsigned Indent = 0);
0061 
0062 } // namespace polly
0063 
0064 namespace llvm {
0065 void initializeDeLICMWrapperPassPass(llvm::PassRegistry &);
0066 void initializeDeLICMPrinterLegacyPassPass(llvm::PassRegistry &);
0067 } // namespace llvm
0068 
0069 #endif /* POLLY_DELICM_H */