ispc
ispc copied to clipboard
Limit canonicalization and add lit test
Description
Add an LLVM patch to restrict the canonicalization of extractelement(cast) to cases where the index is constant or both instructions are in the same basic block. Add also a lit test to expose the issue.
There is also a opensource LLVM PR under the review: https://github.com/llvm/llvm-project/pull/166227
Related Issue
This is fix for Sub-par code generation when using extract issue
Checklist
- [x] Code has been formatted with
clang-format(e.g.,clang-format -i src/ispc.cpp) - [x] Git history has been squashed to meaningful commits (one commit per logical change)
- [x] Compiler changes are covered by lit tests
- [ ] Language/stdlib changes include new functional tests for runtime behavior
- [ ] Documentation updated if needed