Skip to content

Commit

Permalink
Bootstrap vast (#473)
Browse files Browse the repository at this point in the history
* Delete old files. Some need renaming and macOS is annoying with case insensitivity.

* Re-bootstrap VAST and MLIR APIs.

* Bump VAST
  • Loading branch information
Peter Goodman authored Nov 25, 2023
1 parent 745ad58 commit 9e67c1e
Show file tree
Hide file tree
Showing 908 changed files with 27,743 additions and 37,569 deletions.
669 changes: 543 additions & 126 deletions bin/Bootstrap/VAST.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/Examples/CountSourceIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <multiplier/Index.h>
#include <multiplier/Compilation.h>
#include <multiplier/IR/MLIR/Builtin/ModuleOp.h>
#include <multiplier/IR/MLIR/Builtin/Operation.h>

DECLARE_bool(help);
DECLARE_string(db);
Expand Down
21 changes: 12 additions & 9 deletions include/multiplier/IR/Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
// This source code is licensed in accordance with the terms specified in
// the LICENSE file found in the root directory of this source tree.

#pragma once

#include <memory>
#include <optional>
#include <string_view>

#include "AttributeKind.h"

namespace mlir {
namespace detail {
class AttributeStorage;
} // namespace detail
} // namespace mlir
namespace mx::ir {

Expand All @@ -20,22 +23,22 @@ class Argument;
class SourceIRImpl;
class Type;

enum AttributeKind : unsigned;

// The type of some operation / value.
class Attribute final {
class Attribute {
private:
friend class Operation;
friend class Block;
friend class Argument;
friend class Value;

protected:

std::shared_ptr<const SourceIRImpl> module_;
mlir::detail::AttributeStorage *attr_;
mlir::AttributeStorage *attr_;
AttributeKind kind_;

inline Attribute(std::shared_ptr<const SourceIRImpl> module,
mlir::detail::AttributeStorage *attr)
mlir::AttributeStorage *attr)
: module_(std::move(module)),
attr_(attr),
kind_(classify(attr)) {}
Expand All @@ -44,9 +47,9 @@ class Attribute final {
inline Attribute(std::shared_ptr<const SourceIRImpl> module,
void *attr)
: Attribute(std::move(module),
reinterpret_cast<mlir::detail::AttributeStorage *>(attr)) {}
reinterpret_cast<mlir::AttributeStorage *>(attr)) {}

static AttributeKind classify(mlir::detail::AttributeStorage *attr);
static AttributeKind classify(mlir::AttributeStorage *attr);

inline AttributeKind kind(void) const noexcept {
return kind_;
Expand Down
150 changes: 86 additions & 64 deletions include/multiplier/IR/AttributeKind.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,69 +12,91 @@ namespace mx {
namespace ir {
enum class AttributeKind : unsigned {
UNKNOWN,
CCONVATTR,
COMDATATTR,
ACCESSGROUPATTR,
ALIASSCOPEATTR,
ALIASSCOPEDOMAINATTR,
DIBASICTYPEATTR,
DICOMPILEUNITATTR,
DICOMPOSITETYPEATTR,
DIDERIVEDTYPEATTR,
DIFILEATTR,
DILABELATTR,
DILEXICALBLOCKATTR,
DILEXICALBLOCKFILEATTR,
DILOCALVARIABLEATTR,
DINAMESPACEATTR,
DINULLTYPEATTR,
DISUBPROGRAMATTR,
DISUBRANGEATTR,
DISUBROUTINETYPEATTR,
FASTMATHFLAGSATTR,
MEMORYEFFECTSATTR,
TBAAMEMBERATTR,
TBAAROOTATTR,
TBAATAGATTR,
TBAATYPEDESCRIPTORATTR,
LINKAGEATTR,
LOOPANNOTATIONATTR,
LOOPDISTRIBUTEATTR,
LOOPINTERLEAVEATTR,
LOOPLICMATTR,
LOOPPEELEDATTR,
LOOPPIPELINEATTR,
LOOPUNROLLANDJAMATTR,
LOOPUNROLLATTR,
LOOPUNSWITCHATTR,
LOOPVECTORIZEATTR,
ALLOCALIGNATTR,
ALLOCSIZEATTR,
ANNOTATIONATTR,
ASMLABELATTR,
BUILTINATTR,
CVQUALIFIERSATTR,
CVRQUALIFIERSATTR,
CONSTATTR,
FORMATATTR,
LOADERUNINITIALIZEDATTR,
MODEATTR,
NOINSTRUMENTFUNCTIONATTR,
NOTHROWATTR,
NONNULLATTR,
PACKEDATTR,
PUREATTR,
RESTRICTATTR,
SECTIONATTR,
UCVQUALIFIERSATTR,
WARNUNUSEDRESULTATTR,
BOOLEANATTR,
FLOATATTR,
INTEGERATTR,
SOURCELANGUAGEATTR,
STRINGLITERALATTR,
VOIDATTR,
IDENTIFIERATTR,
BUILTIN_TYPED,
BUILTIN_ELEMENTS,
BUILTIN_AFFINE_MAP,
BUILTIN_ARRAY,
BUILTIN_DENSE_ARRAY,
BUILTIN_DENSE_INT_OR_FP_ELEMENTS,
BUILTIN_DENSE_RESOURCE_ELEMENTS,
BUILTIN_DENSE_STRING_ELEMENTS,
BUILTIN_DICTIONARY,
BUILTIN_FLOAT,
BUILTIN_INTEGER,
BUILTIN_INTEGER_SET,
BUILTIN_OPAQUE,
BUILTIN_SPARSE_ELEMENTS,
BUILTIN_STRING,
BUILTIN_SYMBOL_REF,
BUILTIN_TYPE,
BUILTIN_UNIT,
BUILTIN_STRIDED_LAYOUT,
BUILTIN_BOOL,
BUILTIN_FLAT_SYMBOL_REF,
BUILTIN_DENSE_INT_ELEMENTS,
LLVM_C_CONV,
LLVM_COMDAT,
LLVM_ACCESS_GROUP,
LLVM_ALIAS_SCOPE,
LLVM_ALIAS_SCOPE_DOMAIN,
LLVM_DI_BASIC_TYPE,
LLVM_DI_COMPILE_UNIT,
LLVM_DI_COMPOSITE_TYPE,
LLVM_DI_DERIVED_TYPE,
LLVM_DI_FILE,
LLVM_DI_LABEL,
LLVM_DI_LEXICAL_BLOCK,
LLVM_DI_LEXICAL_BLOCK_FILE,
LLVM_DI_LOCAL_VARIABLE,
LLVM_DI_NAMESPACE,
LLVM_DI_NULL_TYPE,
LLVM_DI_SUBPROGRAM,
LLVM_DI_SUBRANGE,
LLVM_DI_SUBROUTINE_TYPE,
LLVM_FASTMATH_FLAGS,
LLVM_MEMORY_EFFECTS,
LLVM_TBAA_MEMBER,
LLVM_TBAA_ROOT,
LLVM_TBAA_TAG,
LLVM_TBAA_TYPE_DESCRIPTOR,
LLVM_LINKAGE,
LLVM_LOOP_ANNOTATION,
LLVM_LOOP_DISTRIBUTE,
LLVM_LOOP_INTERLEAVE,
LLVM_LOOP_LICM,
LLVM_LOOP_PEELED,
LLVM_LOOP_PIPELINE,
LLVM_LOOP_UNROLL_AND_JAM,
LLVM_LOOP_UNROLL,
LLVM_LOOP_UNSWITCH,
LLVM_LOOP_VECTORIZE,
HL_ALLOC_ALIGN,
HL_ALLOC_SIZE,
HL_ANNOTATION,
HL_ASM_LABEL,
HL_BUILTIN,
HL_CV_QUALIFIERS,
HL_CVR_QUALIFIERS,
HL_CONST,
HL_FORMAT,
HL_LOADER_UNINITIALIZED,
HL_MODE,
HL_NO_INSTRUMENT_FUNCTION,
HL_NO_THROW,
HL_NON_NULL,
HL_PACKED,
HL_PURE,
HL_RESTRICT,
HL_SECTION,
HL_UCV_QUALIFIERS,
HL_WARN_UNUSED_RESULT,
CORE_BOOLEAN,
CORE_FLOAT,
CORE_INTEGER,
CORE_SOURCE_LANGUAGE,
CORE_STRING_LITERAL,
CORE_VOID,
META_IDENTIFIER,
};

} // namespace ir
Expand All @@ -84,7 +106,7 @@ inline static const char *EnumerationName(ir::AttributeKind) {
}

inline static constexpr unsigned NumEnumerators(ir::AttributeKind) {
return 63;
return 85;
}

const char *EnumeratorName(ir::AttributeKind);
Expand Down
2 changes: 2 additions & 0 deletions include/multiplier/IR/Block.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// This source code is licensed in accordance with the terms specified in
// the LICENSE file found in the root directory of this source tree.

#pragma once

#include <gap/core/generator.hpp>
#include <memory>

Expand Down
Loading

0 comments on commit 9e67c1e

Please sign in to comment.