Skip to content

Split LLVM targets into subfolders to support CMake filtering. - #2960

Merged
ScottTodd merged 1 commit into
iree-org:mainfrom
ScottTodd:llvm-target-conditional
Aug 27, 2020
Merged

ScottTodd merged 1 commit into
iree-org:mainfrom
ScottTodd:llvm-target-conditional

Conversation

@ScottTodd

Copy link
Copy Markdown
Member

Follow-up to #2759.

Splitting iree/compiler/Dialect/HAL/Target/LLVM into

  • iree/compiler/Dialect/HAL/Target/LLVM (common code)
  • iree/compiler/Dialect/HAL/Target/LLVM/AOT
  • iree/compiler/Dialect/HAL/Target/LLVM/IR

So we can filter from builds using logic like

if(NOT ${IREE_TARGET_BACKEND_LLVM-IR})
  return()
endif()

with both targets in the same directory we'd need to use if/else wrapping, which is messier to handle (but not terribly so) in bazel_to_cmake.

@ScottTodd ScottTodd added compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) cmake labels Aug 20, 2020
@ScottTodd
ScottTodd requested a review from asaadaldien August 20, 2020 18:52
@google-cla google-cla Bot added the cla: yes label Aug 20, 2020
"//iree/compiler/Dialect/HAL/Target/LLVM:LLVMAOT",
"//iree/compiler/Dialect/HAL/Target/LLVM:LLVMIR",
"//iree/compiler/Dialect/HAL/Target/LLVM/AOT:LLVMAOT",
"//iree/compiler/Dialect/HAL/Target/LLVM/IR:LLVMIR",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets have LLVM/LLVMIR && LLVM\LLVMAOT dirs instead \IRpeople will expect something different here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think AOT and IR are fine here, as it's already nested under HAL/Target, and the file names are also prefixed
(so we'd have HAL/TargetTarget/LLVM/LLVMAOT/LLVMAOTTargetLinker.h, which seems excessive :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to avoid confusion, but the file paths are getting pretty long.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah looks repetitive =), how about /Bitcode & /Dylib?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that involve renaming the targets (file names, class names, references in code/docs) to match?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, just directories to match target executable format.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried /Bitcode and /Dylib:

[build] [8/209   3% :: 0.148] Building CXX object iree\compiler\Dialect\HAL\Target\LLVM\Dylib\internal\CMakeFiles\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.dir\LLVMAOTTargetLinker.cpp.obj
[build] FAILED: iree/compiler/Dialect/HAL/Target/LLVM/Dylib/internal/CMakeFiles/iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.dir/LLVMAOTTargetLinker.cpp.obj 
[build] C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\cl.exe  /nologo /TP -D__CLANG_SUPPORT_DYN_ANNOTATION__ -ID:\dev\projects\iree -I. -ID:\dev\projects\iree\third_party\llvm-project\llvm\include -Ithird_party\llvm-project\llvm\include -ID:\dev\projects\iree\third_party\llvm-project\mlir\include -Ithird_party\llvm-project\llvm\tools\mlir\include -ID:\dev\projects\iree\third_party\tensorflow -ID:\dev\projects\iree\third_party\tensorflow\tensorflow\compiler\mlir\hlo\include -Ibuild_tools\third_party\tensorflow -Ibuild_tools\third_party\tensorflow\tensorflow\compiler\mlir\hlo\include -Ibuild_tools\third_party\tensorflow\tensorflow\compiler\mlir\hlo\lib\Dialect\mhlo\IR -Ibuild_tools\third_party\tensorflow\tensorflow\compiler\mlir\hlo\lib\Dialect\mhlo\transforms -ID:\dev\projects\iree\third_party\abseil-cpp /DWIN32_LEAN_AND_MEAN /wd4624 /wd4141 /wd4005 /EHsc /bigobj /MDd /Zi /Ob0 /Od /RTC1   /DWIN32_LEAN_AND_MEAN /wd4624 /wd4141 /wd4005 /EHsc /bigobj -std:c++14 /showIncludes /Foiree\compiler\Dialect\HAL\Target\LLVM\Dylib\internal\CMakeFiles\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.dir\LLVMAOTTargetLinker.cpp.obj /Fdiree\compiler\Dialect\HAL\Target\LLVM\Dylib\internal\CMakeFiles\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.dir\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.pdb /FS -c D:\dev\projects\iree\iree\compiler\Dialect\HAL\Target\LLVM\Dylib\internal\LLVMAOTTargetLinker.cpp
[build] D:\dev\projects\iree\iree\compiler\Dialect\HAL\Target\LLVM\Dylib\internal\LLVMAOTTargetLinker.cpp: fatal error C1041: cannot open program database 'iree\compiler\Dialect\HAL\Target\LLVM\Dylib\internal\CMakeFiles\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.dir\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS
[build] [8/209   3% :: 3.611] Building CXX object iree\compiler\Dialect\HAL\Target\LLVM\Dylib\CMakeFiles\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_LLVMAOT.dir\LLVMAOTTarget.cpp.obj
[build] ninja: build stopped: subcommand failed.

yeah, that file path (iree\compiler\Dialect\HAL\Target\LLVM\Dylib\internal\CMakeFiles\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.dir\iree_compiler_Dialect_HAL_Target_LLVM_Dylib_internal_LLVMAOTTargetLinker_internal.pdb) is getting too long for Windows >_>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah windows |path| <= 260 ! NP lets keep IR,AOT thanks for trying =)

@ScottTodd

Copy link
Copy Markdown
Member Author

Need to fix some CMake builds.

@ScottTodd
ScottTodd force-pushed the llvm-target-conditional branch from 76bbd1f to 353d0ad Compare August 27, 2020 17:19
@ScottTodd

Copy link
Copy Markdown
Member Author

Need to fix some CMake builds.

Rebased and fixed.

@ScottTodd
ScottTodd requested a review from asaadaldien August 27, 2020 17:19
@ScottTodd
ScottTodd merged commit 8524cb9 into iree-org:main Aug 27, 2020
@ScottTodd
ScottTodd deleted the llvm-target-conditional branch August 27, 2020 18:30
This was referenced Aug 27, 2020
copybara-service Bot pushed a commit that referenced this pull request Aug 27, 2020
* 0c97a1c Merge pull request #3022 from rsuderman/google-to-main
* bf264f4 Merge branch 'main' into google-to-main
* 8524cb9 Split LLVM targets into subfolders to support CMake filtering. (#2960)
* 6e78211 Fixed Emulator Timeline Semaphore parameter name (#3019)
* aa8d1c0 Enable simple.mlir test for iree-benchmark-module on vulkan (#3016)
* 6db4e7b [vulkan] Release timepoint fences more aggressively when possible (#2800)
* a1365d3 [vulkan] Do not request timeline semaphore if not available (#2904)
* a38c890 Add more type support to model builder matmul benchmark. (#2977)
* a293ca7 Fix hyperlink to getting started docs on python page. (#3015)
* b022e70 Release inputs before closing the session. (#3004)
* f1678df Dynamicly register benchmark for entry_function with name BM_{entry_function} ..
* 6282700 Expand the tf_module_to_compiler_module API (#3009)
* f7e561a Merge pull request #3006 from rsuderman/google-to-main
* 8341d71 Explicitly insert dialects in conversion passes (#3002)
* b7c2b60 Fix format by changing to LLVM style (#3008)
* 4286f17 Merge branch 'main' into google-to-main
* f0a07f6 Allow iree.placeholder as an op between splittable ops. (#2999)
* 6bd3b1d Use hidden visibility for all symbols by default (#2997)
* d650082 VMLA Dynamic Iota support with Shape dialect work. (#2965)
* c724ee4 Add function to hide SavedModel roundtrip (#2995)
* 2fedce6 Merge pull request #2996
* c5f7030 Merge branch 'main' into google-to-main
* cf3211d [vulkan] Reset TimePointFence status when releasing back to pool (#2905)
* ebc6a83 Add lint action to check for tabs (#2984)
* 932339c Merge pull request #2964 from silvasean/add-dynamic-dot-example
* df727ae Integrate MLIR-EmitC at iml130/mlir-emitc@560cd8c (#2990)
* e824d36 Refactor for explicit dialect registration (#2978)
* 38b7d2c Allow ModelRunner to receive an array of extra symbols available during JITing..
* 264a97d Fuse linalg.tensor_reshape operations with hal.interface* operations. (#2973)
* 0e3c737 Fold flow.tensor.update when all operands are constant (#2982)
* c7a21c2 Merge pull request #2983 from rsuderman/google-to-main
* fd55a86 Add a dynamically shaped mhlo.dot lowering example

COPYBARA_INTEGRATE_REVIEW=#3025 from rsuderman:main-to-google 0c97a1c
PiperOrigin-RevId: 328804964
@GMNGeoffrey GMNGeoffrey added the infrastructure Relating to build systems, CI, or testing label May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) infrastructure Relating to build systems, CI, or testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants