Repository navigation
Check that flattened insertvalues reach the SPIR-V back end - #1075
Merged
Merged
Conversation
The comment on `flatten_nested_insertvalue!` said it has to run after optimization because InstCombine folds the flattened sequences back together. InstCombine also runs after `finish_ir!`, in `prepare_execution!`, so that would undo the Intel workaround. It doesn't: InstCombine never merges single-index `insertvalue`s into multi-index ones, and it is SROA, during optimization, that introduces those. Correct the comment, and test the SPIR-V instead of only the `finish_ir!` output, so that a pass added later between the two can't undo the workaround unnoticed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1075 +/- ##
==========================================
- Coverage 92.48% 90.95% -1.53%
==========================================
Files 31 31
Lines 7334 7333 -1
==========================================
- Hits 6783 6670 -113
- Misses 551 663 +112 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
flatten_nested_insertvalue!(the workaround for intel/intel-graphics-compiler#378, from #953) runs infinish_ir!, and its comment said it has to run after optimization because InstCombine folds the flattened sequences back together.prepare_execution!runs InstCombine again afterfinish_ir!(since #878), so if that were true the workaround would be undone before the IR reaches the back end.It isn't undone. InstCombine only shortens or copies the index lists of existing multi-index
insertvalues, it never merges single-index ones into one; the multi-index ones come from SROA splitting aggregate loads. The IR afterprepare_execution!keeps the flattened form (so doesdefault<O3>run on it), and on an Iris Xe (NEO 26.35, IGC 2.41) with oneAPI.jl 2.10 and GPUCompiler main, the reproducer from JuliaGPU/OpenCL.jl#502 and a findmin-style reduction over(Bool, value)tuples are correct, and wrong with the pass disabled.This corrects the comment and adds a test on the SPIR-V output, since the existing one only checks
code_llvm, which is taken beforeprepare_execution!. With the pass disabled, it fails on the Khronos translator.