NFC: Move CPA typing analysis down a directory.

pull/1/head
Stella Laurenzo 2020-07-04 16:40:02 -07:00
parent 6a50efd046
commit 051d088161
18 changed files with 42 additions and 32 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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"

View File

@ -0,0 +1 @@
add_subdirectory(CPA)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -1 +1 @@
add_subdirectory(CPA)
add_subdirectory(Analysis)

View File

@ -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());
}
};

View File

@ -0,0 +1 @@
add_subdirectory(CPA)

View File

@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
#include "npcomp/Typing/CPA/Algorithm.h"
#include "npcomp/Typing/Analysis/CPA/Algorithm.h"
using namespace mlir::NPCOMP::Typing::CPA;

View File

@ -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"

View File

@ -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;
}

View File

@ -1 +1 @@
add_subdirectory(CPA)
add_subdirectory(Analysis)