summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mlir/CMakeLists.txt17
-rw-r--r--mlir/lib/Transforms/LoopTiling.cpp3
-rw-r--r--mlir/tools/mlir-cpu-runner/CMakeLists.txt2
-rw-r--r--mlir/tools/mlir-opt/CMakeLists.txt2
-rw-r--r--mlir/tools/mlir-translate/CMakeLists.txt2
5 files changed, 17 insertions, 9 deletions
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index c0d10296e30..882c2492cca 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -20,11 +20,18 @@ endfunction()
# TODO: This is to handle the current static registration, but should be
# factored out a bit.
function(whole_archive_link target)
- set(link_flags "-Llib -Wl,--whole-archive,")
- FOREACH(LIB ${ARGN})
- string(CONCAT link_flags ${link_flags} "-l${LIB},")
- ENDFOREACH(LIB)
- string(CONCAT link_flags ${link_flags} "--no-whole-archive")
+ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+ set(link_flags "-Llib -Wl,-all_load ")
+ FOREACH(LIB ${ARGN})
+ string(CONCAT link_flags ${link_flags} "-l${LIB} ")
+ ENDFOREACH(LIB)
+ else()
+ set(link_flags "-Llib -Wl,--whole-archive,")
+ FOREACH(LIB ${ARGN})
+ string(CONCAT link_flags ${link_flags} "-l${LIB},")
+ ENDFOREACH(LIB)
+ string(CONCAT link_flags ${link_flags} "--no-whole-archive")
+ endif()
set_target_properties(${target} PROPERTIES LINK_FLAGS ${link_flags})
endfunction(whole_archive_link)
diff --git a/mlir/lib/Transforms/LoopTiling.cpp b/mlir/lib/Transforms/LoopTiling.cpp
index f7fef1a428c..d262a5d14aa 100644
--- a/mlir/lib/Transforms/LoopTiling.cpp
+++ b/mlir/lib/Transforms/LoopTiling.cpp
@@ -368,7 +368,8 @@ void LoopTiling::getTileSizes(ArrayRef<AffineForOp> band,
(*tileSizes)[i] = tSize;
else
// Set last tile size to cover the balance.
- (*tileSizes)[i] = std::max(1UL, excessFactor / cumulProductOfTileSizes);
+ (*tileSizes)[i] = std::max(
+ 1U, static_cast<unsigned>(excessFactor / cumulProductOfTileSizes));
cumulProductOfTileSizes *= (*tileSizes)[i];
}
if (avoidMaxMinBounds)
diff --git a/mlir/tools/mlir-cpu-runner/CMakeLists.txt b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
index af448d103fe..1c59ae51f4d 100644
--- a/mlir/tools/mlir-cpu-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
@@ -13,6 +13,6 @@ set(LIBS
add_executable(mlir-cpu-runner
mlir-cpu-runner.cpp
)
-
+llvm_update_compile_flags(mlir-cpu-runner)
whole_archive_link(mlir-cpu-runner MLIRLLVMIR MLIRStandardOps MLIRTargetLLVMIR MLIRTransforms MLIRTranslation)
target_link_libraries(mlir-cpu-runner MLIRIR ${LIBS})
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index 8cb8551acbc..def266dd884 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -13,6 +13,6 @@ set(LIBS
add_executable(mlir-opt
mlir-opt.cpp
)
-
+llvm_update_compile_flags(mlir-opt)
whole_archive_link(mlir-opt ${LIBS})
target_link_libraries(mlir-opt MLIRIR ${LIBS} LLVMSupport)
diff --git a/mlir/tools/mlir-translate/CMakeLists.txt b/mlir/tools/mlir-translate/CMakeLists.txt
index 74e18972348..330c9ad7a52 100644
--- a/mlir/tools/mlir-translate/CMakeLists.txt
+++ b/mlir/tools/mlir-translate/CMakeLists.txt
@@ -14,6 +14,6 @@ set(LIBS
add_executable(mlir-translate
mlir-translate.cpp
)
-
+llvm_update_compile_flags(mlir-translate)
whole_archive_link(mlir-translate ${LIBS})
target_link_libraries(mlir-translate MLIRIR ${LIBS} LLVMSupport)
OpenPOWER on IntegriCloud