Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use le32/le64 #8344

Merged
merged 41 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ddd0189
Use wasm32/wasm64 instead of le32/le64
steven-johnson Jul 15, 2024
60b46ee
Update Makefile
steven-johnson Jul 15, 2024
3cce91f
Update CMakeLists.txt
steven-johnson Jul 15, 2024
24fd1b2
Update CMakeLists.txt
steven-johnson Jul 15, 2024
67d80ae
trigger buildbots
steven-johnson Jul 15, 2024
301c610
Try x86 instead of wasm
steven-johnson Jul 16, 2024
09fba5f
-Wno-sync-alignment
steven-johnson Jul 16, 2024
af4af91
Revert "-Wno-sync-alignment"
abadams Jul 16, 2024
8002729
Don't do 64-bit atomics in 32-bit runtimes.
abadams Jul 16, 2024
30a755c
Reapply "-Wno-sync-alignment"
steven-johnson Jul 17, 2024
2cfd588
Revert "Don't do 64-bit atomics in 32-bit runtimes."
steven-johnson Jul 17, 2024
9325a2b
try arm instead
steven-johnson Jul 17, 2024
a9b0b61
sync warning
steven-johnson Jul 17, 2024
4e5bd58
gnueabihf
steven-johnson Jul 17, 2024
bfbe718
gnueabihf
steven-johnson Jul 17, 2024
2e8a6e8
Comments
steven-johnson Jul 17, 2024
6401755
Update CMakeLists.txt
steven-johnson Jul 17, 2024
def7da0
Let's try x86 instead
steven-johnson Jul 17, 2024
0e766ae
-Wno-sync-alignment
steven-johnson Jul 17, 2024
3e99fb8
Back to wasm
steven-johnson Jul 18, 2024
678164f
Update LLVM_Runtime_Linker.cpp
steven-johnson Jul 18, 2024
0c050b2
Fix RUNTIME_TRIPLE_WIN_GENERIC_64
steven-johnson Jul 19, 2024
3ca975b
Reenable warning
steven-johnson Jul 19, 2024
622c9cd
Update LLVM_Runtime_Linker.cpp
steven-johnson Jul 23, 2024
9885b30
Update LLVM_Runtime_Linker.cpp
steven-johnson Jul 23, 2024
6b6a76e
Merge branch 'main' into srj/no-le64
steven-johnson Jul 23, 2024
5b0ccc0
Update LLVM_Runtime_Linker.cpp
steven-johnson Jul 23, 2024
c88ab38
Merge branch 'main' into srj/no-le64
steven-johnson Jul 24, 2024
fe54bfe
Fixes
steven-johnson Jul 24, 2024
b28acbc
warnings
steven-johnson Jul 24, 2024
97046ce
wasm64->x86_64
steven-johnson Jul 24, 2024
007186b
back to wasm64
steven-johnson Jul 24, 2024
38f9ab6
Use wasm32/wasm64 for webgpu
steven-johnson Jul 25, 2024
2d5033b
Update Makefile
steven-johnson Jul 25, 2024
39cd51d
trigger buildbots
steven-johnson Jul 25, 2024
55c3610
Revert "Update Makefile"
steven-johnson Jul 25, 2024
a2064e4
Revert "Use wasm32/wasm64 for webgpu"
steven-johnson Jul 25, 2024
09c86a2
Revert "back to wasm64"
steven-johnson Jul 25, 2024
abbc1cd
-fno-jump-tables
steven-johnson Jul 25, 2024
b9497bd
Reapply "Use wasm32/wasm64 for webgpu"
steven-johnson Jul 26, 2024
d6affab
tabs
steven-johnson Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,9 @@ $(BIN_DIR)/build_halide_h: $(ROOT_DIR)/tools/build_halide_h.cpp
.SECONDARY:

# Compile generic 32- or 64-bit code
# (The 'nacl' is a red herring. This is just a generic 32-bit little-endian target.)
RUNTIME_TRIPLE_32 = "le32-unknown-nacl-unknown"
RUNTIME_TRIPLE_64 = "le64-unknown-unknown-unknown"
# Don't be fooled: arm/aarch64 are just generic 32/64-bit targets for our purposes here
RUNTIME_TRIPLE_32 = "arm-unknown-unknown-gnueabihf"
RUNTIME_TRIPLE_64 = "aarch64-unknown-unknown-unknown"

# Windows requires special handling. The generic windows_* modules must have -fpic elided
# and (for 64 bit) must set wchar to be 2 bytes. The windows_*_x86 and windows_*_arm
Expand All @@ -1068,7 +1068,8 @@ RUNTIME_TRIPLE_WIN_X86_32 = "i386-unknown-windows-unknown"
RUNTIME_TRIPLE_WIN_X86_64 = "x86_64-unknown-windows-unknown"
RUNTIME_TRIPLE_WIN_ARM_32 = "arm-unknown-windows-unknown"
RUNTIME_TRIPLE_WIN_ARM_64 = "aarch64-unknown-windows-unknown"
RUNTIME_TRIPLE_WIN_GENERIC_64 = "le64-unknown-windows-unknown"
# TODO: was le64 here, not sure if this is correct or not
RUNTIME_TRIPLE_WIN_GENERIC_64 = "aarch64-unknown-windows-unknown"
Copy link
Member

Choose a reason for hiding this comment

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

This is inconsistent with the CMake build, which uses x86_64 instead of aarch64.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


# `-fno-threadsafe-statics` is very important here (note that it allows us to use a 'modern' C++
# standard but still skip threadsafe guards for static initialization in our runtime code)
Expand Down
26 changes: 20 additions & 6 deletions src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,31 @@ foreach (i IN LISTS RUNTIME_CPP)
# unfortunately, clang doesn't automatically set this flag even though the
# ABI is msvc on windows
set(fshort-wchar -fshort-wchar)
alexreinking marked this conversation as resolved.
Show resolved Hide resolved
set(TARGET "le64-unknown-windows-unknown")
if (LLVM_PACKAGE_VERSION VERSION_LESS 19.0)
set(TARGET "le64-unknown-windows-unknown")
else ()
# TODO: was le64 here, not sure if this is correct or not
set(TARGET "aarch64-unknown-windows-unknown")
endif ()
Copy link
Member

Choose a reason for hiding this comment

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

What prevents us from just using aarch64/arm on all LLVM versions? I'm a bit worried about bugs in Halide 19 that appear only with LLVM 19 and not LLVM 18.

Also, does this introduce a requirement that LLVM be built with ARM and AArch64 backends? We will need to check that, if so. #2282 will rear its head again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What prevents us from just using aarch64/arm on all LLVM versions?

Nothing AFAICT. I'll make the change.

Also, does this introduce a requirement that LLVM be built with ARM and AArch64 backends

Yes.

endif ()
endif()
# Everything else
else()
if (j EQUAL 32)
# (The 'nacl' is a red herring. This is just a generic 32-bit little-endian target.)
set(TARGET "le32-unknown-nacl-unknown")
if (LLVM_PACKAGE_VERSION VERSION_LESS 19.0)
if (j EQUAL 32)
# generic 32-bit code
set(TARGET "le32-unknown-nacl-unknown")
else ()
# generic 64-bit code
set(TARGET "le64-unknown-unknown-unknown")
endif ()
else ()
# generic 64-bit code
set(TARGET "le64-unknown-unknown-unknown")
# don't be fooled: arm/aarch64 are just generic 32/64-bit targets for our purposes here
if (j EQUAL 32)
set(TARGET "arm-unknown-unknown-gnueabihf")
else ()
set(TARGET "aarch64-unknown-unknown-unknown")
endif ()
endif ()
endif ()

Expand Down