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

Backport xtensa_codegen to main (v2) #7432

Open
wants to merge 632 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
632 commits
Select commit Hold shift + click to select a range
d0f0027
[xtensa] Add xtensa_io.cpp (#7233)
steven-johnson Dec 13, 2022
87569c0
[xtensa] DMA support improvements. (#7237)
vksnk Dec 14, 2022
8afb0b8
Skip the second loop var if it's loop body is more than another for loop
vksnk Dec 14, 2022
d0cf547
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 15, 2022
7bc3baa
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 16, 2022
470da09
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 28, 2022
fea1299
Fix #7255 for Xtensa, too (#7257)
steven-johnson Dec 28, 2022
598c104
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 28, 2022
c35aa11
Add missing `cache.clear()` call at end of functions (#7259)
steven-johnson Dec 29, 2022
d6f1e5d
Merge branch 'main' into xtensa-codegen
vksnk Jan 5, 2023
e87e1e8
Avoid global variables in xtensa_dma & better clean-up on failure
vksnk Jan 5, 2023
73a3f16
Pass _ucon to halide_error for DMA check (#7267)
steven-johnson Jan 9, 2023
104f3d1
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 10, 2023
8efaaed
[xtensa] Extend fp16 support for Xtensa (#7288)
vksnk Jan 18, 2023
511a04e
[xtensa] set is_tcm to False when working with buffer (#7277)
Aelphy Jan 18, 2023
2e9ae6a
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 18, 2023
4023640
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 20, 2023
562d045
Post changes from #7291 to Codegen_Xtensa (#7299)
steven-johnson Jan 20, 2023
23da552
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 23, 2023
4605ac6
[xtensa] Minor DMA improvements (#7304)
vksnk Jan 25, 2023
f52351f
[xtensa] added code for running tests and commented failing i48 tests…
Aelphy Jan 26, 2023
1589189
Merge branch 'main' into xtensa-codegen
vksnk Jan 31, 2023
e989a3a
Add store<native_vector_i16_2x> implementation
vksnk Jan 31, 2023
75de60a
Add widening quad add
vksnk Jan 31, 2023
63175ac
Improved halide_xtensa_sat_narrow_i16
vksnk Jan 31, 2023
f338197
Do not inline generic gather_load + specialization for gather of nati…
vksnk Jan 31, 2023
6c521e0
Add __attribute__((malloc)) to halide_tcm_malloc
vksnk Jan 31, 2023
fae28de
Patterns for quad widening add + minor clean-up
vksnk Jan 31, 2023
0a1b5a1
Replace widening_shift_left with signed widening_mul when possible
vksnk Jan 31, 2023
78dc6a0
Pattern for narrow_i48_with_rounding_shift_i16
vksnk Jan 31, 2023
234bf6e
Merge branch 'main' into xtensa-codegen
vksnk Jan 31, 2023
9ab7a4d
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 3, 2023
7e93e0a
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 8, 2023
8efaae9
[xtensa] A few minor Xtensa fixes (#7333)
steven-johnson Feb 10, 2023
76dc02a
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 10, 2023
a0ac990
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 10, 2023
31e557f
Add [SKIP] to correctness_simd_op_check_xtensa
steven-johnson Feb 10, 2023
3e6a2c6
Remove Xtensa::compile(LoweredFunc), add Xtensa::preprocess_function_…
steven-johnson Feb 10, 2023
858ee30
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 11, 2023
7ea67a6
Remove unnecessary overrides in Codegen_Xtensa (#7342)
steven-johnson Feb 11, 2023
b467f28
[xtensa] Generate PACKVRNR for i16(i32(i48x) >> wild_i32) (#7349)
vksnk Feb 14, 2023
ec1159e
[xtensa] Remove __restrict from print_assignment (#7351)
vksnk Feb 14, 2023
49e7d35
[Xtensa] 8-bit arithmetic improvements + some other smaller changes (…
Aelphy Feb 15, 2023
f6731b0
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 15, 2023
310f641
[xtensa] Improvements to CodeGen_Xtensa (#7328)
Aelphy Feb 15, 2023
038d325
Add missing convert<native_vector_u16_x2, native_vector_i24>
vksnk Feb 15, 2023
21d7637
Merge branch 'main' into xtensa-codegen
vksnk Feb 15, 2023
e69fa42
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 22, 2023
29f3f42
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 22, 2023
ad6c84a
[xtensa] Clean up HalideFreeHelper code (#7368)
steven-johnson Feb 22, 2023
38057b8
Merge branch 'main' into xtensa-codegen
vksnk Feb 27, 2023
0091fd9
[xtensa] Limit the number of allowed DMA channels + allocate a separa…
vksnk Feb 28, 2023
2fb3b62
Better handling of u1 to i16 cast & clean-up
vksnk Feb 28, 2023
c16b5e2
[xtensa] removed tests that are failing to compile (#7362)
Aelphy Feb 28, 2023
040d773
Merge branch 'main' into xtensa-codegen
vksnk Mar 1, 2023
b48f78c
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk Mar 1, 2023
c855273
Merge branch 'main' into xtensa-codegen
vksnk Mar 3, 2023
5e81e91
Remove incorrect halide_xtensa_sat_narrow_u16
vksnk Mar 3, 2023
3a0b891
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 6, 2023
08d3c37
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 13, 2023
613655d
Add is_stack_private_to_thread()
steven-johnson Mar 13, 2023
afda48d
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 15, 2023
d598e54
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 16, 2023
d7153e3
Revert all apps/ to current top-of-tree status
steven-johnson Mar 16, 2023
d31dcb7
Add halide_xtensa_extract_*_of_4_u16
vksnk Mar 16, 2023
37329e1
Limit halide_xtensa_extract_*_of_* to native vectors
vksnk Mar 16, 2023
5a025a7
Fix formatting
vksnk Mar 16, 2023
bf1133a
Make sure that count for load_variable is positive
vksnk Mar 16, 2023
658ceba
Move large Xtensa-codegen source into external template files (#7430)
steven-johnson Mar 16, 2023
ec6c234
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 17, 2023
8495be1
[xtensa] Returned old free_helper (#7441)
Aelphy Mar 22, 2023
83adfa3
[xtensa] Added uint32 vector mul and fixed i16 -> i32_x2 vector conve…
Aelphy Mar 23, 2023
39eced3
Merge branch 'main' into xtensa-codegen
vksnk Mar 23, 2023
c4bd23e
Remove commented code
vksnk Mar 23, 2023
9af1278
Report an error in the end of suffix_for_type
vksnk Mar 23, 2023
9d06135
Refactor is_native_vector_type and is_double_native_vector_type
vksnk Mar 23, 2023
32d1a29
Move common logic into visit_comparison_op
vksnk Mar 27, 2023
5cb1b30
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 28, 2023
8ebc04a
WIP
steven-johnson Mar 28, 2023
6881545
Update XtensaOptimize.cpp
steven-johnson Mar 28, 2023
7614953
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 28, 2023
4e2aaab
Remove dupe func
steven-johnson Mar 28, 2023
0f23f14
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 28, 2023
7524d06
Fix is_double_native_vector_type
vksnk Mar 28, 2023
c7fb421
Add missing store_predicated
vksnk Mar 28, 2023
e0a1e65
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 29, 2023
33dee7f
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 29, 2023
48903c4
[xtensa] fixed few correctness issues in codegen + added new correctn…
Aelphy Mar 30, 2023
9f58631
Minor improvements to Xtensa codegen (#7463)
steven-johnson Mar 31, 2023
10124d3
Improve intrinsic_suffix_for_type() to be switch-based
steven-johnson Apr 1, 2023
614669a
Remove XTensa override of print_assignment()
steven-johnson Apr 1, 2023
e02255f
Make op_name_to_intrinsic a member variable
steven-johnson Apr 1, 2023
e57c5cf
Move Xtensa from Feature to Arch (#7467)
steven-johnson Apr 3, 2023
4b3f443
Use a real hash function for HalideTypeSet (#7469)
steven-johnson Apr 3, 2023
17d15a6
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 3, 2023
d477fd2
Update simd_op_check_xtensa.cpp
steven-johnson Apr 3, 2023
3fe791d
Update CodeGen_Xtensa.cpp
steven-johnson Apr 3, 2023
e99d060
Update CodeGen_Xtensa.cpp
steven-johnson Apr 3, 2023
d5f5cec
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 3, 2023
97c7f74
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 5, 2023
686bc74
Fix technically-illegal in-class specialization
steven-johnson Apr 6, 2023
127872b
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 7, 2023
d83dba0
trigger buildbots
steven-johnson Apr 7, 2023
e5e6d9e
Minor code cleanup in Xtensa (#7492)
steven-johnson Apr 10, 2023
262f7d3
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 11, 2023
62ba85b
Update CodeGen_Xtensa.cpp
steven-johnson Apr 11, 2023
e43507b
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 18, 2023
d0a1be0
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 19, 2023
3d8ed21
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 20, 2023
eb6d786
[xtensa] Fixed a bug in interleave RGB for Q8 (#7526)
Aelphy Apr 22, 2023
8eafd5d
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 24, 2023
ab5b52a
[xtensa] fixed regression due to a new pattern for narrow_predicate (…
Aelphy Apr 25, 2023
a0050eb
Merge branch 'main' into xtensa-codegen
vksnk Apr 25, 2023
34f2943
[xtensa] supported new narrow rules in XtensaOptimize (#7535)
Aelphy Apr 26, 2023
831e686
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 28, 2023
792d4ae
Merge branch 'main' into xtensa-codegen
steven-johnson May 2, 2023
5e38a83
Merge branch 'main' of https://github.com/halide/Halide into xtensa-c…
vksnk May 4, 2023
fbdabb7
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk May 4, 2023
7c93c61
Adds a function to extract every 8th element of vector
vksnk May 4, 2023
8ed6d2e
Add corresponding type
vksnk May 4, 2023
c153cda
Merge branch 'main' into xtensa-codegen
steven-johnson May 5, 2023
be1d051
Merge branch 'main' into xtensa-codegen
steven-johnson May 8, 2023
2764a26
Merge branch 'main' into xtensa-codegen
steven-johnson May 9, 2023
34fe122
Merge branch 'main' into xtensa-codegen
steven-johnson May 12, 2023
74f6fa5
Merge branch 'main' into xtensa-codegen
steven-johnson May 16, 2023
1723399
Merge branch 'main' of https://github.com/halide/Halide into xtensa-c…
vksnk May 18, 2023
41abd8a
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk May 18, 2023
a8cce9d
Use IEEE compliant square root intrinsic
vksnk May 18, 2023
c747082
Merge branch 'main' into xtensa-codegen
steven-johnson May 18, 2023
47d1ba4
Merge branch 'main' into xtensa-codegen
vksnk May 24, 2023
3b849f9
Fixes halide_xtensa_sat_narrow_shift_i32 intrinsic
vksnk May 24, 2023
306715b
Tighten Target parsing for Xtensa (#7589)
steven-johnson May 24, 2023
86628a4
Pacify clang-tidy by removing unused constant (#7590)
steven-johnson May 24, 2023
7805085
Trim xtensa symbol names to get under 65-char limit (#7595)
steven-johnson May 30, 2023
d9f328f
Merge branch 'main' into xtensa-codegen
steven-johnson May 30, 2023
1eb0051
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2023
462cb76
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2023
6df58b0
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 8, 2023
1e22d04
Merge branch 'main' into xtensa-codegen
vksnk Jun 14, 2023
78e3692
Optimize f32(i16(wild_i32x)) pattern
vksnk Jun 14, 2023
ca576e0
Generates & (2^n)-1 for % 2^n
vksnk Jun 14, 2023
701df75
Relaxes check for interleave op generation
vksnk Jun 14, 2023
15c387d
Puts small, constant-sized allocations with MemoryType::Auto on Stack
vksnk Jun 14, 2023
2605161
Adds implementations with intrinsics of f32 load/stores
vksnk Jun 14, 2023
675b0f2
Adds gather_load<native_vector_i16_x2>
vksnk Jun 14, 2023
69b254c
Adds missing function implementation
vksnk Jun 14, 2023
1d2b16a
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 20, 2023
2d3d3b9
[xtensa] widen ops, convert, division + abs, gather_load improvements…
Aelphy Jun 23, 2023
4a8d62f
Merge branch 'main' into xtensa-codegen
vksnk Jul 12, 2023
288a231
Workaround for compiler bug
vksnk Jul 13, 2023
9f6b861
Merge branch 'main' into xtensa-codegen
steven-johnson Jul 24, 2023
c7c4b35
Merge branch 'main' into xtensa-codegen
steven-johnson Jul 24, 2023
3a2cecc
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 7, 2023
58798f6
[xtensa] Applied xtensa_dma patch from Cadence (#7750)
Aelphy Aug 8, 2023
a3d1e71
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 24, 2023
996482b
Codegen fixes so it can compile with cstubs
vksnk Sep 13, 2023
39e3a78
Merge branch 'main' into xtensa-codegen
vksnk Sep 13, 2023
92ff9bb
Improve handling of bool vectors
vksnk Sep 18, 2023
9f044b5
Build rules for Xtensa tests with cstub library (#7852)
vksnk Sep 19, 2023
26c036b
Merge branch 'main' into xtensa-codegen
vksnk Oct 19, 2023
057050a
[xtensa] improved conversion ops and covered them with tests (#7859)
Aelphy Oct 20, 2023
e1eb59f
Merge branch 'main' into xtensa-codegen
vksnk Oct 23, 2023
b8a4523
Fix a test and disable two
vksnk Oct 23, 2023
5439f01
Merge branch 'main' into xtensa-codegen
vksnk Oct 31, 2023
7486c0c
Merge branch 'main' into xtensa-codegen
vksnk Nov 6, 2023
dcfa415
Shuffles for fp16 and support all of the immediate shuffles
vksnk Nov 6, 2023
0f4a488
Format
vksnk Nov 6, 2023
01f3132
Pre-convert indices for gather
vksnk Nov 6, 2023
4fa8f86
Merge branch 'main' into xtensa-codegen
vksnk Nov 9, 2023
e9d0319
Add missing override
vksnk Nov 10, 2023
804f37b
[xtensa] Improved load_predicated for float (#7943)
Aelphy Nov 10, 2023
d6b0816
[xtensa] Clean up (#7953)
Aelphy Nov 20, 2023
46ef7ac
Merge branch 'main' into xtensa-codegen
vksnk Nov 21, 2023
71e2728
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 28, 2023
68a6652
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 28, 2023
80e8daa
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 28, 2023
fc4ff80
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 29, 2023
fadcbeb
[xtensa] Clean up (#7961)
Aelphy Nov 29, 2023
d95b65a
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 5, 2023
d84e3a6
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 8, 2023
2c48ba8
Fix boolean Or for q8 and add support of boolean Add and Not
vksnk Dec 8, 2023
b1dd8de
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 13, 2023
e1e4193
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 13, 2023
7d83daf
Merge branch 'main' into xtensa-codegen
vksnk Dec 15, 2023
a20dbef
Interleave functions for fp16
vksnk Dec 15, 2023
4306918
Merge branch 'main' into xtensa-codegen
vksnk Dec 19, 2023
5212015
Formatting fixes
vksnk Dec 19, 2023
aec7d7b
[xtensa] index cast to uint16 for gath_load is at least sometimes wrong
Aelphy Dec 21, 2023
43df465
[xtensa] undo disabling of ConvertGatherLoadIndex
Aelphy Dec 21, 2023
e2a58dd
Merge branch 'main' into xtensa-codegen
vksnk Jan 3, 2024
76d8e37
Swap loop_carry and align_loads
vksnk Jan 3, 2024
b12448e
Add runtime function to wait for specific dma transaction
vksnk Jan 3, 2024
846ac52
Schedule ahead DMA copy if ring_buffer is defined
vksnk Jan 3, 2024
a925471
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 17, 2024
e5d4a57
Fix clang-tidy errors in InjectDmaTransfer (#8033)
steven-johnson Jan 17, 2024
4a3378f
[xtensa] adjusted the tests to be launchable for Q8 (#8011)
Aelphy Jan 17, 2024
05d4412
Skip the double buffering for DMA if the allocation and compute is at…
vksnk Jan 19, 2024
958037a
[xtensa] Added efficient gather load to Q7 (#8026)
Aelphy Jan 23, 2024
9e17fc7
[xtensa] Added float16 interleaves (#8050)
Aelphy Jan 29, 2024
f32f95e
[xtensa] added vector load_predicated for f16 (#8057)
Aelphy Feb 1, 2024
35e97c6
Merge branch 'main' into xtensa-codegen
vksnk Feb 1, 2024
8c7d78c
Fix warning
vksnk Feb 1, 2024
feb0b93
[xtensa] Added int32 by int16 vector division + maintenance work (#8058)
Aelphy Feb 6, 2024
ea03af7
[xtensa] Added int32<->float vector reinterprets (#8070)
Aelphy Feb 7, 2024
3285236
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 7, 2024
77fc71b
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
steven-johnson Feb 7, 2024
a732568
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 14, 2024
6b2b35b
Fix simd_op_check_xtensa (#8095)
steven-johnson Feb 14, 2024
b8d576f
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 14, 2024
72603c2
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 18, 2024
0e69339
[xtensa] added vector extracts for floats + moved float16 and int48 (…
Aelphy Feb 19, 2024
15e80e9
[xtensa] Fixed halide_xtensa_interleave_f16 (#8109)
Aelphy Feb 19, 2024
91b3273
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 26, 2024
3e59768
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 26, 2024
85b6d7e
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 27, 2024
aa696b5
[Xtensa codegen] Specializations for load/store and fma support (#8126)
vksnk Feb 27, 2024
b248fa9
[xtensa] Added gather_load for float16 (#8128)
Aelphy Feb 28, 2024
c9bbd19
Merge branch 'main' into xtensa-codegen
vksnk Feb 28, 2024
b6449b3
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 5, 2024
aad94de
Disable halide_xtensa_mul_add_f32 temporarily
vksnk Mar 5, 2024
30f29fc
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 8, 2024
f60781f
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 15, 2024
cff71e1
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 29, 2024
f42a3d7
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 5, 2024
f247636
Merge branch 'main' into xtensa-codegen
vksnk Apr 12, 2024
3e712ba
Disable fused mul-add for f16 while investigating
vksnk Apr 12, 2024
3101277
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 29, 2024
d61390a
[xtensa] Fixed index conversion for gather_load with undefined ramp (…
Aelphy May 10, 2024
17d4351
Merge branch 'main' into xtensa-codegen
steven-johnson May 20, 2024
8a316d1
[xtensa] Added vector load for two vectors for f16 and f32 (#8226)
Aelphy May 23, 2024
3ea4747
[xtensa] added support for sqrt_f16 (#8247)
Aelphy May 30, 2024
1ef63f7
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 3, 2024
5b5b0c6
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2024
69bfd80
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2024
83476fb
[xtensa] Fixed broadcast for Q8 (#8271)
Aelphy Jun 7, 2024
eeda6e6
[xtensa] Added a new optimize rule (#8276)
Aelphy Jun 11, 2024
51c5bea
Merge branch 'main' into xtensa-codegen
vksnk Jun 13, 2024
6c9b492
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk Jun 13, 2024
1b5db56
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 26, 2024
7c7ca23
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 28, 2024
42db6c6
abs for f16 types
vksnk Jul 17, 2024
3cb0b00
Adds specializations for aligned loads and stores for f16 type
vksnk Jul 17, 2024
e208b47
Fix dumb mistake
vksnk Jul 18, 2024
0b18cf7
Merge branch 'main' into xtensa-codegen
steven-johnson Jul 24, 2024
92abb5f
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 1, 2024
80443bf
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 15, 2024
e1f962e
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 23, 2024
90f1acc
Merge branch 'main' into xtensa-codegen
steven-johnson Sep 17, 2024
1dbe8c5
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 6, 2024
75d3228
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 8, 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
115 changes: 112 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ SOURCE_FILES = \
CodeGen_WebAssembly.cpp \
CodeGen_WebGPU_Dev.cpp \
CodeGen_X86.cpp \
CodeGen_Xtensa.cpp \
CompilerLogger.cpp \
ConstantBounds.cpp \
ConstantInterval.cpp \
Expand Down Expand Up @@ -492,6 +493,7 @@ SOURCE_FILES = \
HexagonOptimize.cpp \
ImageParam.cpp \
InferArguments.cpp \
InjectDmaTransfer.cpp \
InjectHostDevBufferCopies.cpp \
Inline.cpp \
InlineReductions.cpp \
Expand Down Expand Up @@ -596,11 +598,14 @@ SOURCE_FILES = \
Var.cpp \
VectorizeLoops.cpp \
WasmExecutor.cpp \
WrapCalls.cpp
WrapCalls.cpp \
XtensaOptimize.cpp

C_TEMPLATE_FILES = \
CodeGen_C_prologue \
CodeGen_C_vectors
CodeGen_C_vectors \
CodeGen_Xtensa_prologue \
CodeGen_Xtensa_vectors

HTML_TEMPLATE_FILES = \
StmtToHTML_dependencies.html \
Expand Down Expand Up @@ -648,6 +653,7 @@ HEADER_FILES = \
CodeGen_PyTorch.h \
CodeGen_Targets.h \
CodeGen_WebGPU_Dev.h \
CodeGen_Xtensa.h \
CompilerLogger.h \
ConciseCasts.h \
CPlusPlusMangle.h \
Expand Down Expand Up @@ -692,6 +698,7 @@ HEADER_FILES = \
HexagonOptimize.h \
ImageParam.h \
InferArguments.h \
InjectDmaTransfer.h \
InjectHostDevBufferCopies.h \
Inline.h \
InlineReductions.h \
Expand Down Expand Up @@ -780,7 +787,8 @@ HEADER_FILES = \
Util.h \
Var.h \
VectorizeLoops.h \
WrapCalls.h
WrapCalls.h \
XtensaOptimize.h

OBJECTS = $(SOURCE_FILES:%.cpp=$(BUILD_DIR)/%.o)
HEADERS = $(HEADER_FILES:%.h=$(SRC_DIR)/%.h)
Expand Down Expand Up @@ -1241,6 +1249,10 @@ clean:
rm -rf $(DISTRIB_DIR)
rm -rf $(ROOT_DIR)/apps/*/bin

.PHONY: clean_xtensa
clean_xtensa:
rm -rf $(XTENSA_RUNTIME_OBJS) $(DISTRIB_DIR)/lib/libHalideRuntime-xtensa.a

CORRECTNESS_TESTS = $(shell ls $(ROOT_DIR)/test/correctness/*.cpp) $(shell ls $(ROOT_DIR)/test/correctness/*.c)
PERFORMANCE_TESTS = $(shell ls $(ROOT_DIR)/test/performance/*.cpp)
ERROR_TESTS = $(shell ls $(ROOT_DIR)/test/error/*.cpp)
Expand Down Expand Up @@ -1273,6 +1285,7 @@ test_correctness_multi_gpu: correctness_gpu_multi_device
# 3) Externally-written JIT-based tests
GENERATOR_AOT_TESTS = $(GENERATOR_EXTERNAL_TESTS:$(ROOT_DIR)/test/generator/%_aottest.cpp=generator_aot_%)
GENERATOR_AOTCPP_TESTS = $(GENERATOR_EXTERNAL_TESTS:$(ROOT_DIR)/test/generator/%_aottest.cpp=generator_aotcpp_%)
GENERATOR_AOTXTENSA_TESTS = $(GENERATOR_EXTERNAL_TESTS:$(ROOT_DIR)/test/generator/%_aottest.cpp=generator_aotcpp_xtensa_%)
GENERATOR_JIT_TESTS = $(GENERATOR_EXTERNAL_TESTS:$(ROOT_DIR)/test/generator/%_jittest.cpp=generator_jit_%)

# multitarget test doesn't make any sense for the CPP backend; just skip it.
Expand Down Expand Up @@ -1303,6 +1316,62 @@ GENERATOR_AOTCPP_TESTS := $(filter-out generator_aotcpp_gpu_multi_context_thread

test_aotcpp_generator: $(GENERATOR_AOTCPP_TESTS)

# Tests below probably don't make much sense for Xtensa.
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_alias,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_async_parallel,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_autograd,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_cxx_mangling,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_cxx_mangling_define_extern,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_metadata_tester,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_string_param,$(GENERATOR_AOTXTENSA_TESTS))

# Tests below work, but need to disable parallel in the schedule.
# TODO(vksnk): figure out what's wrong with parallel in this case.
# https://github.com/halide/Halide/issues/7856
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_example,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_mandelbrot,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_pyramid,$(GENERATOR_AOTXTENSA_TESTS))

# Xtensa doesn't have float64 vectors
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_templated,$(GENERATOR_AOTXTENSA_TESTS))

# Needs define_extent
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_tiled_blur,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_nested_externs,$(GENERATOR_AOTXTENSA_TESTS))

# Segmentation fault, tests provide custom runtime and user context.
# https://github.com/halide/Halide/issues/7857
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_user_context,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_user_context_insanity,$(GENERATOR_AOTXTENSA_TESTS))

# multitarget test doesn't make any sense for the Xtensa backend; just skip it.
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_multitarget,$(GENERATOR_AOTXTENSA_TESTS))

# Note that many of the AOT-CPP tests are broken right now;
# remove AOT-CPP tests that don't (yet) work for C++ backend
# (each tagged with the *known* blocking issue(s))

# sanitizercoverage relies on LLVM-specific hooks, so it will never work with the C backend
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_sanitizercoverage,$(GENERATOR_AOTXTENSA_TESTS))

# https://github.com/halide/Halide/issues/2084 (only if opencl enabled))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_cleanup_on_error,$(GENERATOR_AOTXTENSA_TESTS))

# https://github.com/halide/Halide/issues/7273
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_msan,$(GENERATOR_AOTXTENSA_TESTS))

# https://github.com/halide/Halide/issues/7272
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_memory_profiler_mandelbrot,$(GENERATOR_AOTXTENSA_TESTS))

# https://github.com/halide/Halide/issues/4916
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_stubtest,$(GENERATOR_AOTXTENSA_TESTS))
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_stubuser,$(GENERATOR_AOTXTENSA_TESTS))

# Build requirements are finicky, testing non-C++ backend is good enough here
GENERATOR_AOTXTENSA_TESTS := $(filter-out generator_aotcpp_xtensa_gpu_multi_context_threaded,$(GENERATOR_AOTXTENSA_TESTS))

test_aotcpp_xtensa_generator: $(GENERATOR_AOTXTENSA_TESTS)

# This is just a test to ensure than RunGen builds and links for a critical mass of Generators;
# not all will work directly (e.g. due to missing define_externs at link time), so we disable
# those known to be broken for plausible reasons.
Expand Down Expand Up @@ -1487,6 +1556,7 @@ $(BIN_DIR)/%.generator: $(BUILD_DIR)/GenGen.o $(TEST_DEPS) $(BUILD_DIR)/%_genera
NAME_MANGLING_TARGET=$(NON_EMPTY_TARGET)-c_plus_plus_name_mangling

GEN_AOT_OUTPUTS=-e static_library,c_header,c_source,registration
GEN_AOT_XTENSA_OUTPUTS=-e c_source

# By default, %.a/.h are produced by executing %.generator. Runtimes are not included in these.
# (We explicitly also generate .cpp output here as well, as additional test surface for the C++ backend.)
Expand Down Expand Up @@ -1518,6 +1588,14 @@ $(FILTERS_DIR)/cxx_mangling.a: $(BIN_DIR)/cxx_mangling.generator $(FILTERS_DIR)/
$(CURDIR)/$< -g cxx_mangling $(GEN_AOT_OUTPUTS),function_info_header -o $(CURDIR)/$(FILTERS_DIR) target=$(TARGET)-no_runtime-c_plus_plus_name_mangling -f "HalideTest::AnotherNamespace::cxx_mangling"
$(ROOT_DIR)/tools/makelib.sh $@ $@ $(FILTERS_DIR)/cxx_mangling_externs.o

$(FILTERS_DIR)/pyramid_xtensa.halide_generated.cpp: $(BIN_DIR)/pyramid.generator
@mkdir -p $(@D)
$(CURDIR)/$< -g pyramid $(GEN_AOT_XTENSA_OUTPUTS) -o $(CURDIR)/$(FILTERS_DIR) target=xtensa-32-noos-no_runtime -n pyramid_xtensa levels=10

$(FILTERS_DIR)/%_xtensa.halide_generated.cpp: $(BIN_DIR)/%.generator
@mkdir -p $(@D)
$(CURDIR)/$< -g $* $(GEN_AOT_XTENSA_OUTPUTS) -o $(CURDIR)/$(FILTERS_DIR) target=xtensa-32-noos-no_runtime -n $*_xtensa

ifneq ($(TEST_CUDA), )
# Also build with a gpu target to ensure that the GPU-Host generation
# code handles name mangling properly. (Note that we don't need to
Expand Down Expand Up @@ -1729,6 +1807,11 @@ $(BIN_DIR)/$(TARGET)/generator_aotcpp_%: $(ROOT_DIR)/test/generator/%_aottest.cp
@mkdir -p $(@D)
$(CXX) $(GEN_AOT_CXX_FLAGS) $(filter %.cpp %.o %.a,$^) $(OPTIMIZE) $(GEN_AOT_INCLUDES) $(GEN_AOT_LD_FLAGS) -o $@

# Also make AOT testing targets that depends on the .cpp output (rather than .a).
$(BIN_DIR)/$(TARGET)/generator_aotcpp_xtensa_%: $(ROOT_DIR)/test/generator/%_aottest.cpp $(FILTERS_DIR)/%_xtensa.halide_generated.cpp $(FILTERS_DIR)/%.h $(RUNTIME_EXPORTED_INCLUDES) $(BIN_DIR)/$(TARGET)/runtime.a
@mkdir -p $(@D)
clang++ $(GEN_AOT_CXX_FLAGS) $(filter %.cpp %.o %.a,$^) $(OPTIMIZE) $(GEN_AOT_INCLUDES) $(GEN_AOT_LD_FLAGS) -Wno-error -I$(CSTUB_INCLUDE_PATH) -L$(CSTUB_LIB_PATH) -lcstub -D XCHAL_VISION_TYPE=7 -D XCHAL_VISION_SIMD16=32 -D XCHAL_DATA_WIDTH=64 -o $@

# MSAN test doesn't use the standard runtime
$(BIN_DIR)/$(TARGET)/generator_aot_msan: $(ROOT_DIR)/test/generator/msan_aottest.cpp $(FILTERS_DIR)/msan.a $(FILTERS_DIR)/msan.h $(RUNTIME_EXPORTED_INCLUDES)
@mkdir -p $(@D)
Expand Down Expand Up @@ -2073,6 +2156,11 @@ generator_aotcpp_%: $(BIN_DIR)/$(TARGET)/generator_aotcpp_%
cd $(TMP_DIR) ; $(CURDIR)/$<
@-echo

generator_aotcpp_xtensa_%: $(BIN_DIR)/$(TARGET)/generator_aotcpp_xtensa_%
@-mkdir -p $(TMP_DIR)
cd $(TMP_DIR) ; $(CURDIR)/$<
@-echo

$(TMP_DIR)/images/%.png: $(ROOT_DIR)/tutorial/images/%.png
@-mkdir -p $(TMP_DIR)/images
cp $< $(TMP_DIR)/images/
Expand Down Expand Up @@ -2506,6 +2594,27 @@ $(DISTRIB_DIR)/bin/get_host_target
.PHONY: distrib
distrib: $(DISTRIB_DIR)/lib/libHalide.$(SHARED_EXT) autoschedulers

XTENSA_RUNTIME_SRC=$(ROOT_DIR)/src/runtime/alignment_128.cpp \
$(ROOT_DIR)/src/runtime/errors.cpp \
$(ROOT_DIR)/src/runtime/posix_error_handler.cpp \
$(ROOT_DIR)/src/runtime/msan_stubs.cpp \
$(ROOT_DIR)/src/runtime/to_string.cpp \
$(ROOT_DIR)/src/runtime/posix_print.cpp \
$(ROOT_DIR)/src/runtime/posix_io.cpp \
$(ROOT_DIR)/src/runtime/posix_aligned_alloc.cpp \
$(ROOT_DIR)/src/runtime/posix_allocator.cpp \
$(ROOT_DIR)/src/runtime/xtensa_dma.cpp \

XTENSA_RUNTIME_OBJS=$(patsubst $(ROOT_DIR)/src/runtime/%,$(BIN_DIR)/%,$(patsubst %.cpp,%.o,$(XTENSA_RUNTIME_SRC)))

$(XTENSA_RUNTIME_OBJS): $(BIN_DIR)/%.o: $(ROOT_DIR)/src/runtime/%.cpp
xt-clang++ -O2 -mlongcalls -c -std=c++17 -stdlib=libc++ -D COMPILING_HALIDE_RUNTIME -DBITS_32 -ffreestanding $< -o $@

$(DISTRIB_DIR)/lib/libHalideRuntime-xtensa.a: $(XTENSA_RUNTIME_OBJS)
xt-ar rcs $@ $^

xtensa-runtime: distrib $(DISTRIB_DIR)/lib/libHalideRuntime-xtensa.a

$(DISTRIB_DIR)/halide.tgz: distrib
ln -sf $(DISTRIB_DIR) halide
tar -czf $(BUILD_DIR)/halide.tgz \
Expand Down
17 changes: 17 additions & 0 deletions apps/simd_op_check/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
include ../support/Makefile.inc

CXX-hexagon-32-noos-hvx_128 ?= $(HL_HEXAGON_TOOLS)/bin/hexagon-clang++
CXX-xtensa ?= clang++

CXXFLAGS-hexagon-32-noos-hvx_128 ?= -mhvx -mhvx-length=128B -G0
CXXFLAGS-xtensa ?= -std=c++17 -I$(CSTUB_INCLUDE_PATH) -D XCHAL_VISION_TYPE=7 -D XCHAL_VISION_SIMD16=32 -D XCHAL_DATA_WIDTH=64

LDFLAGS-hexagon-32-noos-hvx_128 ?= -L../../src/runtime/hexagon_remote/bin/v60/ -lsim_qurt
LDFLAGS-xtensa ?= -lpthread -ldl

all: \
$(BIN)/driver-host \
Expand All @@ -18,6 +21,7 @@ arm_32: $(BIN)/driver-arm-32-android
arm_64: $(BIN)/driver-arm-64-android

host: $(BIN)/driver-host
xtensa: $(BIN)/driver-xtensa

$(BIN)/hexagon-32-noos-%/filters.h:
@mkdir -p $(@D)
Expand All @@ -28,6 +32,15 @@ $(BIN)/hexagon-32-noos-%/filters.h:
cd $(BIN)/hexagon-32-noos-$*; for f in test_*.h; do n=$${f/.h/}; echo '{"'$${n}'", &'$${n}'},'; done >> filters.h
echo '{NULL, NULL}};' >> $(BIN)/hexagon-32-noos-$*/filters.h

$(BIN)/xtensa/filters.h:
@mkdir -p $(@D)
make -C ../../ bin/correctness_simd_op_check_xtensa
cd $(BIN)/xtensa && HL_TARGET=xtensa-32-noos LD_LIBRARY_PATH=../../../../bin:$$LD_LIBRARY_PATH ../../../../bin/correctness_simd_op_check_xtensa
cat $(BIN)/xtensa/test_*.h > $(BIN)/xtensa/filter_headers.h
echo "filter filters[] = {" > $(BIN)/xtensa/filters.h
cd $(BIN)/xtensa; for f in test_*.h; do n=$${f/.h/}; echo '{"'$${n}'", &'$${n}'},'; done >> filters.h
echo '{NULL, NULL}};' >> $(BIN)/xtensa/filters.h

$(BIN)/%/filters.h:
@mkdir -p $(@D)
make -C ../../ bin/correctness_simd_op_check
Expand All @@ -41,5 +54,9 @@ $(BIN)/driver-%: driver.cpp $(BIN)/%/filters.h
@mkdir -p $(@D)
$(CXX-$*) $(CXXFLAGS-$*) -I ../../include $(OPTIMIZE) -I $(BIN)/$* driver.cpp $(BIN)/$*/test_*.o $(BIN)/$*/simd_op_check_runtime.o -o $@ $(LDFLAGS-$*) $(HALIDE_SYSTEM_LIBS)

$(BIN)/driver-xtensa: driver.cpp $(BIN)/xtensa/filters.h
@mkdir -p $(@D)
$(CXX-xtensa) $(CXXFLAGS-xtensa) -I ../../include $(OPTIMIZE) -I $(BIN)/xtensa driver.cpp $(BIN)/xtensa/test_*.cpp $(BIN)/xtensa/simd_op_check_runtime.o $(CSTUB_LIB_PATH)/libcstub.a -o $@ $(LDFLAGS-xtensa) $(HALIDE_SYSTEM_LIBS)

clean:
rm -rf $(BIN)
4 changes: 3 additions & 1 deletion python_bindings/src/halide/halide_/PyEnums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ void define_enums(py::module &m) {
.value("Hexagon", Target::Arch::Hexagon)
.value("POWERPC", Target::Arch::POWERPC)
.value("RISCV", Target::Arch::RISCV)
.value("WebAssembly", Target::Arch::WebAssembly);
.value("WebAssembly", Target::Arch::WebAssembly)
.value("Xtensa", Target::Arch::Xtensa);

// Please keep sorted.
py::enum_<Target::Processor>(m, "TargetProcessorTune")
Expand Down Expand Up @@ -177,6 +178,7 @@ void define_enums(py::module &m) {
.value("SVE2", Target::Feature::SVE2)
.value("ARMDotProd", Target::Feature::ARMDotProd)
.value("ARMFp16", Target::Feature::ARMFp16)
.value("XtensaQ8", Target::Feature::XtensaQ8)
.value("LLVMLargeCodeModel", Target::Feature::LLVMLargeCodeModel)
.value("RVV", Target::Feature::RVV)
.value("ARMv8a", Target::Feature::ARMv8a)
Expand Down
2 changes: 2 additions & 0 deletions python_bindings/src/halide/halide_/PyFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ void define_func(py::module &m) {

.def("infer_arguments", &Func::infer_arguments)

.def("dma", (Func & (Func::*)()) & Func::dma)

.def("__repr__", [](const Func &func) -> std::string {
std::ostringstream o;
o << "<halide.Func '" << func.name() << "'>";
Expand Down
18 changes: 12 additions & 6 deletions src/AssociativeOpsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ enum class ValType {
UInt64 = 4,
Int8 = 5,
Int16 = 6,
Int32 = 7,
Int64 = 8,
Float16 = 9,
Float32 = 10,
Float64 = 11,
All = 12, // General type (including all previous types)
Int24 = 7,
Int32 = 8,
Int48 = 9,
Int64 = 10,
Float16 = 11,
Float32 = 12,
Float64 = 13,
All = 14, // General type (including all previous types)
};

ValType convert_halide_type_to_val_type(const Type &halide_t) {
Expand All @@ -50,8 +52,12 @@ ValType convert_halide_type_to_val_type(const Type &halide_t) {
val_t = ValType::Int8;
} else if (halide_t.bits() == 16) {
val_t = ValType::Int16;
} else if (halide_t.bits() == 24) {
val_t = ValType::Int24;
} else if (halide_t.bits() == 32) {
val_t = ValType::Int32;
} else if (halide_t.bits() == 48) {
val_t = ValType::Int48;
} else {
internal_assert(halide_t.bits() == 64);
val_t = ValType::Int64;
Expand Down
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ target_sources(
CodeGen_Targets.h
CodeGen_Vulkan_Dev.h
CodeGen_WebGPU_Dev.h
CodeGen_Xtensa.h
CompilerLogger.h
ConciseCasts.h
CPlusPlusMangle.h
Expand Down Expand Up @@ -128,6 +129,7 @@ target_sources(
HexagonOptimize.h
ImageParam.h
InferArguments.h
InjectDmaTransfer.h
InjectHostDevBufferCopies.h
Inline.h
InlineReductions.h
Expand Down Expand Up @@ -217,6 +219,7 @@ target_sources(
VectorizeLoops.h
WasmExecutor.h
WrapCalls.h
XtensaOptimize.h
)

# The sources that go into libHalide. For the sake of IDE support, headers that
Expand Down Expand Up @@ -265,6 +268,7 @@ target_sources(
CodeGen_WebAssembly.cpp
CodeGen_WebGPU_Dev.cpp
CodeGen_X86.cpp
CodeGen_Xtensa.cpp
CompilerLogger.cpp
CPlusPlusMangle.cpp
ConstantBounds.cpp
Expand Down Expand Up @@ -303,6 +307,7 @@ target_sources(
HexagonOptimize.cpp
ImageParam.cpp
InferArguments.cpp
InjectDmaTransfer.cpp
InjectHostDevBufferCopies.cpp
Inline.cpp
InlineReductions.cpp
Expand Down Expand Up @@ -409,11 +414,14 @@ target_sources(
VectorizeLoops.cpp
WasmExecutor.cpp
WrapCalls.cpp
XtensaOptimize.cpp
)

set(C_TEMPLATE_FILES
CodeGen_C_prologue
CodeGen_C_vectors
CodeGen_Xtensa_prologue
CodeGen_Xtensa_vectors
)

set(HTML_TEMPLATE_FILES
Expand Down
4 changes: 2 additions & 2 deletions src/CodeGen_C.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class CodeGen_C : public IRPrinter {
std::string id;

/** The target being generated for. */
Target target;
const Target target;

/** Controls whether this instance is generating declarations or
* definitions and whether the interface us extern "C" or C++. */
Expand Down Expand Up @@ -300,7 +300,7 @@ class CodeGen_C : public IRPrinter {
void emit_constexpr_function_info(const std::string &function_name,
const std::vector<LoweredArgument> &args,
const MetadataNameMap &metadata_name_map);
void emit_halide_free_helper(const std::string &alloc_name, const std::string &free_function);
virtual void emit_halide_free_helper(const std::string &alloc_name, const std::string &free_function);
};

} // namespace Internal
Expand Down
Loading
Loading