[polly] ec2029f - [Polly] Do not inline dumpIslObj methods. NFC.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 12 21:55:10 PDT 2021
Author: Michael Kruse
Date: 2021-10-12T23:52:36-05:00
New Revision: ec2029f986d8bb80963c1efd9e5024bfe7ac3d30
URL: https://github.com/llvm/llvm-project/commit/ec2029f986d8bb80963c1efd9e5024bfe7ac3d30
DIFF: https://github.com/llvm/llvm-project/commit/ec2029f986d8bb80963c1efd9e5024bfe7ac3d30.diff
LOG: [Polly] Do not inline dumpIslObj methods. NFC.
Instead of being inline and having a neverCalled() workaround to make it
work in the debugger, define it as a regular exported function.
Also add overloads for the C API types isl_* so it works with managed as
well as unmanaged ISL objects.
Added:
Modified:
polly/include/polly/Support/GICHelper.h
polly/lib/Support/GICHelper.cpp
Removed:
################################################################################
diff --git a/polly/include/polly/Support/GICHelper.h b/polly/include/polly/Support/GICHelper.h
index 5a106d7ae0d87..67be60cbb3a84 100644
--- a/polly/include/polly/Support/GICHelper.h
+++ b/polly/include/polly/Support/GICHelper.h
@@ -186,10 +186,13 @@ ISL_OBJECT_TO_STRING(union_pw_aff)
ISL_OBJECT_TO_STRING(union_pw_multi_aff)
//@}
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
/// C++ wrapper for isl_*_dump() functions.
//@{
+
#define ISL_DUMP_OBJECT(name) \
- inline void dumpIslObj(const isl::name &Obj) { isl_##name##_dump(Obj.get()); }
+ void dumpIslObj(const isl::name &Obj); \
+ void dumpIslObj(isl_##name *Obj);
ISL_DUMP_OBJECT(aff)
ISL_DUMP_OBJECT(aff_list)
@@ -236,6 +239,7 @@ ISL_DUMP_OBJECT(val_list)
void dumpIslObj(const isl::schedule_node &Node, llvm::raw_ostream &OS);
void dumpIslObj(__isl_keep isl_schedule_node *node, llvm::raw_ostream &OS);
/// @}
+#endif
inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
__isl_keep isl_union_map *Map) {
diff --git a/polly/lib/Support/GICHelper.cpp b/polly/lib/Support/GICHelper.cpp
index 359b170502310..638289c86becf 100644
--- a/polly/lib/Support/GICHelper.cpp
+++ b/polly/lib/Support/GICHelper.cpp
@@ -191,53 +191,50 @@ std::string polly::getIslCompatibleName(const std::string &Prefix,
}
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-/// To call a inline dump() method in a debugger, at it must have been
-/// instantiated in at least one translation unit. Because isl's dump() method
-/// are meant to be called from a debugger only, but not from code, no such
-/// instantiation would exist. We use this method to force an instantiation in
-/// this translation unit. Because it has non-static linking, the compiler does
-/// not know that it is never called, and therefore must ensure the existence of
-/// the dump functions.
-void neverCalled() {
- polly::dumpIslObj(isl::aff());
- polly::dumpIslObj(isl::aff_list());
- polly::dumpIslObj(isl::ast_expr());
- polly::dumpIslObj(isl::ast_node());
- polly::dumpIslObj(isl::ast_node_list());
- polly::dumpIslObj(isl::basic_map());
- polly::dumpIslObj(isl::basic_map_list());
- polly::dumpIslObj(isl::basic_set());
- polly::dumpIslObj(isl::basic_set_list());
- polly::dumpIslObj(isl::constraint());
- polly::dumpIslObj(isl::id());
- polly::dumpIslObj(isl::id_list());
- polly::dumpIslObj(isl::id_to_ast_expr());
- polly::dumpIslObj(isl::local_space());
- polly::dumpIslObj(isl::map());
- polly::dumpIslObj(isl::map_list());
- polly::dumpIslObj(isl::multi_aff());
- polly::dumpIslObj(isl::multi_pw_aff());
- polly::dumpIslObj(isl::multi_union_pw_aff());
- polly::dumpIslObj(isl::multi_val());
- polly::dumpIslObj(isl::point());
- polly::dumpIslObj(isl::pw_aff());
- polly::dumpIslObj(isl::pw_aff_list());
- polly::dumpIslObj(isl::pw_multi_aff());
- polly::dumpIslObj(isl::schedule());
- polly::dumpIslObj(isl::schedule_constraints());
- polly::dumpIslObj(isl::schedule_node());
- polly::dumpIslObj(isl::set());
- polly::dumpIslObj(isl::set_list());
- polly::dumpIslObj(isl::space());
- polly::dumpIslObj(isl::union_map());
- polly::dumpIslObj(isl::union_pw_aff());
- polly::dumpIslObj(isl::union_pw_aff_list());
- polly::dumpIslObj(isl::union_pw_multi_aff());
- polly::dumpIslObj(isl::union_set());
- polly::dumpIslObj(isl::union_set_list());
- polly::dumpIslObj(isl::val());
- polly::dumpIslObj(isl::val_list());
-}
+#define ISL_DUMP_OBJECT_IMPL(NAME) \
+ void polly::dumpIslObj(const isl::NAME &Obj) { \
+ isl_##NAME##_dump(Obj.get()); \
+ } \
+ void polly::dumpIslObj(isl_##NAME *Obj) { isl_##NAME##_dump(Obj); }
+
+ISL_DUMP_OBJECT_IMPL(aff)
+ISL_DUMP_OBJECT_IMPL(aff_list)
+ISL_DUMP_OBJECT_IMPL(ast_expr)
+ISL_DUMP_OBJECT_IMPL(ast_node)
+ISL_DUMP_OBJECT_IMPL(ast_node_list)
+ISL_DUMP_OBJECT_IMPL(basic_map)
+ISL_DUMP_OBJECT_IMPL(basic_map_list)
+ISL_DUMP_OBJECT_IMPL(basic_set)
+ISL_DUMP_OBJECT_IMPL(basic_set_list)
+ISL_DUMP_OBJECT_IMPL(constraint)
+ISL_DUMP_OBJECT_IMPL(id)
+ISL_DUMP_OBJECT_IMPL(id_list)
+ISL_DUMP_OBJECT_IMPL(id_to_ast_expr)
+ISL_DUMP_OBJECT_IMPL(local_space)
+ISL_DUMP_OBJECT_IMPL(map)
+ISL_DUMP_OBJECT_IMPL(map_list)
+ISL_DUMP_OBJECT_IMPL(multi_aff)
+ISL_DUMP_OBJECT_IMPL(multi_pw_aff)
+ISL_DUMP_OBJECT_IMPL(multi_union_pw_aff)
+ISL_DUMP_OBJECT_IMPL(multi_val)
+ISL_DUMP_OBJECT_IMPL(point)
+ISL_DUMP_OBJECT_IMPL(pw_aff)
+ISL_DUMP_OBJECT_IMPL(pw_aff_list)
+ISL_DUMP_OBJECT_IMPL(pw_multi_aff)
+ISL_DUMP_OBJECT_IMPL(schedule)
+ISL_DUMP_OBJECT_IMPL(schedule_constraints)
+ISL_DUMP_OBJECT_IMPL(schedule_node)
+ISL_DUMP_OBJECT_IMPL(set)
+ISL_DUMP_OBJECT_IMPL(set_list)
+ISL_DUMP_OBJECT_IMPL(space)
+ISL_DUMP_OBJECT_IMPL(union_map)
+ISL_DUMP_OBJECT_IMPL(union_pw_aff)
+ISL_DUMP_OBJECT_IMPL(union_pw_aff_list)
+ISL_DUMP_OBJECT_IMPL(union_pw_multi_aff)
+ISL_DUMP_OBJECT_IMPL(union_set)
+ISL_DUMP_OBJECT_IMPL(union_set_list)
+ISL_DUMP_OBJECT_IMPL(val)
+ISL_DUMP_OBJECT_IMPL(val_list)
void polly::dumpIslObj(__isl_keep isl_schedule_node *node, raw_ostream &OS) {
if (!node)
More information about the llvm-commits
mailing list