mirror of https://github.com/llvm/torch-mlir
NFC: Move CPA typing analysis down a directory.
parent
6a50efd046
commit
051d088161
|
@ -13,7 +13,7 @@
|
|||
#include "mlir/IR/Dialect.h"
|
||||
#include "mlir/IR/Types.h"
|
||||
#include "npcomp/Dialect/Common.h"
|
||||
#include "npcomp/Typing/CPA/Interfaces.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Interfaces.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace NPCOMP {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "mlir/IR/Dialect.h"
|
||||
#include "npcomp/Dialect/Common.h"
|
||||
#include "npcomp/Typing/CPA/Interfaces.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Interfaces.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace NPCOMP {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "mlir/IR/StandardTypes.h"
|
||||
#include "mlir/IR/SymbolTable.h"
|
||||
#include "mlir/Interfaces/SideEffectInterfaces.h"
|
||||
#include "npcomp/Typing/CPA/Interfaces.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Interfaces.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace NPCOMP {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#define NPCOMP_DIALECT_NUMPY_IR_NUMPY_OPS
|
||||
|
||||
include "NumpyDialect.td"
|
||||
include "npcomp/Typing/CPA/Interfaces.td"
|
||||
include "npcomp/Typing/Analysis/CPA/Interfaces.td"
|
||||
include "mlir/Interfaces/SideEffectInterfaces.td"
|
||||
include "mlir/IR/SymbolInterfaces.td"
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
add_subdirectory(CPA)
|
|
@ -13,10 +13,10 @@
|
|||
// http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.129.2756
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_TYPING_CPA_ALGORITHM_H
|
||||
#define NPCOMP_TYPING_CPA_ALGORITHM_H
|
||||
#ifndef NPCOMP_TYPING_ANALYSIS_CPA_ALGORITHM_H
|
||||
#define NPCOMP_TYPING_ANALYSIS_CPA_ALGORITHM_H
|
||||
|
||||
#include "npcomp/Typing/CPA/Support.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Support.h"
|
||||
#include "llvm/ADT/DenseSet.h"
|
||||
|
||||
namespace mlir {
|
||||
|
@ -51,4 +51,4 @@ private:
|
|||
} // namespace NPCOMP
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_TYPING_CPA_ALGORITHM_H
|
||||
#endif // NPCOMP_TYPING_ANALYSIS_CPA_ALGORITHM_H
|
|
@ -6,19 +6,19 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_TYPING_CPA_INTERFACES_H
|
||||
#define NPCOMP_TYPING_CPA_INTERFACES_H
|
||||
#ifndef NPCOMP_TYPING_ANALYSIS_CPA_INTERFACES_H
|
||||
#define NPCOMP_TYPING_ANALYSIS_CPA_INTERFACES_H
|
||||
|
||||
#include "mlir/IR/OpDefinition.h"
|
||||
#include "mlir/IR/Types.h"
|
||||
|
||||
#include "npcomp/Typing/CPA/Support.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Support.h"
|
||||
|
||||
namespace mlir {
|
||||
|
||||
#include "npcomp/Typing/CPA/OpInterfaces.h.inc"
|
||||
#include "npcomp/Typing/CPA/TypeInterfaces.h.inc"
|
||||
#include "npcomp/Typing/Analysis/CPA/OpInterfaces.h.inc"
|
||||
#include "npcomp/Typing/Analysis/CPA/TypeInterfaces.h.inc"
|
||||
|
||||
} // namespace mlir
|
||||
|
||||
#endif // NPCOMP_TYPING_CPA_INTERFACES_H
|
||||
#endif // NPCOMP_TYPING_ANALYSIS_CPA_INTERFACES_H
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef NPCOMP_TYPING_CPA_CPA_INTERFACES
|
||||
#define NPCOMP_TYPING_CPA_CPA_INTERFACES
|
||||
#ifndef NPCOMP_TYPING_ANALYSIS_CPA_CPA_INTERFACES
|
||||
#define NPCOMP_TYPING_ANALYSIS_CPA_CPA_INTERFACES
|
||||
|
||||
include "mlir/IR/OpBase.td"
|
||||
|
||||
|
@ -35,4 +35,4 @@ def NPCOMP_CPATypeInferenceOpInterface : OpInterface<
|
|||
];
|
||||
}
|
||||
|
||||
#endif // NPCOMP_TYPING_CPA_CPA_INTERFACES
|
||||
#endif // NPCOMP_TYPING_ANALYSIS_CPA_CPA_INTERFACES
|
|
@ -22,8 +22,8 @@
|
|||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
#ifndef NPCOMP_TYPING_CPA_SUPPORT_H
|
||||
#define NPCOMP_TYPING_CPA_SUPPORT_H
|
||||
#ifndef NPCOMP_TYPING_ANALYSIS_CPA_SUPPORT_H
|
||||
#define NPCOMP_TYPING_ANALYSIS_CPA_SUPPORT_H
|
||||
|
||||
namespace mlir {
|
||||
namespace NPCOMP {
|
|
@ -1 +1 @@
|
|||
add_subdirectory(CPA)
|
||||
add_subdirectory(Analysis)
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
#include "npcomp/Dialect/Basicpy/IR/BasicpyDialect.h"
|
||||
#include "npcomp/Dialect/Basicpy/IR/BasicpyOps.h"
|
||||
#include "npcomp/Dialect/Basicpy/Transforms/Passes.h"
|
||||
#include "npcomp/Typing/CPA/Algorithm.h"
|
||||
#include "npcomp/Typing/CPA/Interfaces.h"
|
||||
#include "npcomp/Typing/CPA/Support.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Algorithm.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Interfaces.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Support.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
|
||||
#define DEBUG_TYPE "basicpy-type-inference"
|
||||
|
@ -220,6 +220,14 @@ public:
|
|||
llvm::errs() << "------------------\n";
|
||||
prop.propagateTransitivity();
|
||||
} while (prop.commit());
|
||||
|
||||
llvm::errs() << "CONSTRAINTS:\n";
|
||||
llvm::errs() << "------------\n";
|
||||
env.getConstraints().print(cpaContext, llvm::errs());
|
||||
|
||||
llvm::errs() << "\nTYPEVARS:\n";
|
||||
llvm::errs() << "---------\n";
|
||||
env.getTypeVars().print(cpaContext, llvm::errs());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
add_subdirectory(CPA)
|
|
@ -6,7 +6,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "npcomp/Typing/CPA/Algorithm.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Algorithm.h"
|
||||
|
||||
using namespace mlir::NPCOMP::Typing::CPA;
|
||||
|
|
@ -6,9 +6,9 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "npcomp/Typing/CPA/Interfaces.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Interfaces.h"
|
||||
|
||||
using namespace mlir;
|
||||
|
||||
#include "npcomp/Typing/CPA/OpInterfaces.cpp.inc"
|
||||
#include "npcomp/Typing/CPA/TypeInterfaces.cpp.inc"
|
||||
#include "npcomp/Typing/Analysis/CPA/OpInterfaces.cpp.inc"
|
||||
#include "npcomp/Typing/Analysis/CPA/TypeInterfaces.cpp.inc"
|
|
@ -6,8 +6,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "npcomp/Typing/CPA/Support.h"
|
||||
#include "npcomp/Typing/CPA/Interfaces.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Support.h"
|
||||
#include "npcomp/Typing/Analysis/CPA/Interfaces.h"
|
||||
|
||||
#include "mlir/IR/Operation.h"
|
||||
|
||||
|
@ -233,9 +233,9 @@ void ObjectValueType::print(Context &context, raw_ostream &os, bool brief) {
|
|||
}
|
||||
|
||||
void Constraint::print(Context &context, raw_ostream &os, bool brief) {
|
||||
from->print(context, os, brief);
|
||||
from->print(context, os, true);
|
||||
os << " <: ";
|
||||
to->print(context, os, brief);
|
||||
to->print(context, os, true);
|
||||
if (!brief && contextOp) {
|
||||
os << "\n " << *contextOp;
|
||||
}
|
|
@ -1 +1 @@
|
|||
add_subdirectory(CPA)
|
||||
add_subdirectory(Analysis)
|
||||
|
|
Loading…
Reference in New Issue