Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lang] Migrate irpass::scalarize() after optimize_bit_struct_stores &…
… determine_ad_stack_size (#8097) Issue: # ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 5e824fd</samp> This pull request fixes several bugs and improves the performance and usability of the code generation and IR transformation modules. It affects the files `codegen_llvm.cpp`, `ir_builder.h`, `compile_to_offloads.cpp`, and `demote_operations.cpp`. It also adds a new header file for the demote_operations transform. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 5e824fd</samp> * Fix bugs in code generation for binary division and right shift operations in `codegen_llvm.cpp` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-3c663c78745adcd3f6a7ac81fe99e628decc3040f292ea1e20ecd4b85a7f4313L614-R614), [link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-3c663c78745adcd3f6a7ac81fe99e628decc3040f292ea1e20ecd4b85a7f4313L661-R661)) * Add missing header file for `ConstStmt` class in `ir_builder.h` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-1894085b261e833e3e66924fc5b1cf63b9dd8b8aa0b3e78ec64366396131470dR5)) * Modify return type of `get_constant` method in `IRBuilder` class to be more general in `ir_builder.h` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-1894085b261e833e3e66924fc5b1cf63b9dd8b8aa0b3e78ec64366396131470dL140-R141)) * Remove redundant call to `scalarize` pass in `compile_to_offloads` transform in `compile_to_offloads.cpp` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-8fde186587db97b3bbc8a856e59bc4467b30257335b0fad064b4eebd521a912bL234-L241)) * Add missing argument to `full_simplify` pass in `compile_to_offloads` transform in `compile_to_offloads.cpp` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-8fde186587db97b3bbc8a856e59bc4467b30257335b0fad064b4eebd521a912bR288-R296)) * Add new header file for `IRBuilder` class in `demote_operations.cpp` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bR19-R129)) * Add new logic to handle tensor types in binary operations in `demote_operations` transform in `demote_operations.cpp` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bR135-R146), [link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bR165), [link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bL67-R198), [link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bL99-R228), [link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bL159-R254), [link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bL191-R287)) * Remove redundant logic for tensor types in binary operations in `demote_operations` transform in `demote_operations.cpp` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bL109-L150)) * Add comment to explain motivation and strategy for demoting power operation in `demote_operations` transform in `demote_operations.cpp` ([link](https://github.com/taichi-dev/taichi/pull/8097/files?diff=unified&w=0#diff-d217f2b07d4578612dc805b0f01e5dc1883be9acb906b222a8762313cfd0596bL176-R265))
- Loading branch information