Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mlir-rvsdg
Browse files Browse the repository at this point in the history
  • Loading branch information
sjalander committed Jan 14, 2024
2 parents 63cdc34 + a442652 commit 5002525
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 126 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ include Makefile.macros
include jlm/rvsdg/Makefile.sub
include jlm/util/Makefile.sub
include jlm/llvm/Makefile.sub
include jlm/hls/Makefile.sub
include jlm/tooling/Makefile.sub
include tests/Makefile.sub
include tools/Makefile.sub

ifdef CIRCT_PATH
include jlm/hls/Makefile.sub
include tools/jhls/Makefile.sub
include tools/jlm-hls/Makefile.sub
endif

include Makefile.rules
5 changes: 3 additions & 2 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ else
fi

if [ "${CIRCT_ENABLED}" == "yes" ] ; then
CPPFLAGS_CIRCT="-DCIRCT=1 -I${CIRCT_PATH}/include"
CPPFLAGS_CIRCT="-I${CIRCT_PATH}/include"
CXXFLAGS_CIRCT="-Wno-error=comment"
fi

CLANG_BIN=$(${LLVM_CONFIG_BIN} --bindir)
Expand All @@ -101,7 +102,7 @@ rm -rf build ; ln -sf build-"${TARGET}" build

(
cat <<EOF
CXXFLAGS=${CXXFLAGS} ${CXXFLAGS_COMMON} ${CXXFLAGS_TARGET}
CXXFLAGS=${CXXFLAGS} ${CXXFLAGS_COMMON} ${CXXFLAGS_TARGET} ${CXXFLAGS_CIRCT}
CPPFLAGS=${CPPFLAGS} ${CPPFLAGS_COMMON} ${CPPFLAGS_TARGET} ${CPPFLAGS_LLVM} ${CPPFLAGS_CIRCT}
CIRCT_PATH=${CIRCT_PATH}
LLVMCONFIG=${LLVM_CONFIG_BIN}
Expand Down
4 changes: 0 additions & 4 deletions jlm/hls/backend/rhls2firrtl/mlirgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "jlm/hls/backend/rhls2firrtl/mlirgen.hpp"

#ifdef CIRCT

namespace jlm::hls
{

Expand Down Expand Up @@ -2571,5 +2569,3 @@ MLIRGenImpl::toString(const circt::firrtl::CircuitOp circuit)
}

}

#endif // CIRCT
4 changes: 0 additions & 4 deletions jlm/hls/backend/rhls2firrtl/mlirgen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#include <jlm/rvsdg/bitstring/type.hpp>
#include <jlm/rvsdg/traverser.hpp>

#ifdef CIRCT

#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
Expand Down Expand Up @@ -281,6 +279,4 @@ class MLIRGen : public BaseHLS

} // namespace jlm

#endif // CIRCT

#endif // JLM_HLS_BACKEND_RHLS2FIRRTL_MLIRGEN_HPP
14 changes: 13 additions & 1 deletion jlm/llvm/ir/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ class MemoryStateType final : public jlm::rvsdg::statetype
};

template<class ELEMENTYPE>
static inline bool
inline bool
IsOrContains(const jlm::rvsdg::type & type)
{
if (jlm::rvsdg::is<ELEMENTYPE>(type))
Expand All @@ -626,6 +626,18 @@ IsOrContains(const jlm::rvsdg::type & type)
return false;
}

/**
* Given a type, determines if it is one of LLVM's aggregate types.
* Vectors are not considered to be aggregate types, despite being based on a subtype.
* @param type the type to check
* @return true if the type is an aggreate type, false otherwise
*/
inline bool
IsAggregateType(const jlm::rvsdg::type & type)
{
return jlm::rvsdg::is<arraytype>(type) || jlm::rvsdg::is<StructType>(type);
}

}

#endif
Loading

0 comments on commit 5002525

Please sign in to comment.