-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Better vector interleaves #8925
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
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
9e89b7c
Specialized x86 implementation of interleave_vectors
abadams 188bee0
Update test to be more exhaustive
abadams 2ba8dde
Fix comment.
abadams d102f7b
Comment fix
abadams 46d41dd
clang-tidy fixes
abadams 27f1220
Make variable names more consistent
abadams 5576f46
Simplify code with helper lambda
abadams 107aaa5
Comment tweaks
abadams 0bc1b9f
Don't do half-width unpcks
abadams cdc1de2
Use optimization fences in the base class too
abadams 23b79ba
Merge branch 'main' into abadams/fix_x86_transpose
mcourteaux 3eef5db
Use Catanzaro's algorithm for non-power-of-two interleaves
abadams 678a353
Support more interleave and deinterleave patterns
abadams a0b7d66
Merge remote-tracking branch 'origin/main' into abadams/fix_x86_trans…
abadams 4c1adf7
clang-tidy fix
abadams 1c940e8
Handle multiple let injections at same site
abadams c39b1a0
better simplification and better handling of composite factors
abadams 794df0b
Fix innermost_containing_node
abadams 486addd
Fix some simd op check failures
abadams a1ecca9
Fix infinite recursion issue and missed case in interleave codegen
abadams f66d5ea
Adjust expectations in stage_strided_loads test
abadams c25142f
Allow reversed suffix or not in sve test
abadams bae3e02
Don't use optimization fences on hexagon
abadams b7defbd
Fix infinite simplifier loop
abadams 23944a0
Don't hoist transposes on hexagon
abadams 0d110d2
Make distinct strided load nodes in the IR distinct in memory too
abadams 53ae7e4
Merge remote-tracking branch 'origin/main' into abadams/fix_x86_trans…
abadams 84f10b1
arm-32 has no vst2 for 64-bit elements
abadams 8d93c3c
Windows bad filename fix in simd op check
abadams 36565ce
Temporary dumping of cpu info to debug github actions issue
abadams 3f45c47
dump cpuinfo in makefile testing workflow
abadams 223dd7f
Merge remote-tracking branch 'origin/main' into abadams/fix_x86_trans…
abadams 2695151
Address review comments
abadams 31f180a
Merge remote-tracking branch 'origin/main' into abadams/fix_x86_trans…
abadams 2962ea1
Remove duplicate function body
abadams fa2fcb7
Use slice of predicate
abadams dcdfb90
clang-format
abadams 70afc58
SVE fixes
abadams cd04fb2
Merge branch 'main' into abadams/fix_x86_transpose
alexreinking 5d2b524
Move optimization_fence back
alexreinking bccf4b7
Merge remote-tracking branch 'origin/main' into abadams/fix_x86_trans…
abadams 60cd341
Try to thread the needle with webassembly nonsense
abadams 9d7b904
Fix msvc warning
abadams 9dd04eb
Skip simd_op_check_sve2 on old llvms
abadams 11126e7
Merge remote-tracking branch 'origin/main' into abadams/fix_x86_trans…
abadams e5e6b66
Skip test on sve2 with llvm 21
abadams 2470267
Skip block transpose performance test for sve2 on llvm 21
abadams 479afa8
Skip sub-test that triggers llvm bug
abadams b46cb04
Test should hopefully now work with llvm main
abadams 289d3c6
Back out dump of cpuinfo
abadams f3aa758
Merge remote-tracking branch 'origin/main' into abadams/fix_x86_trans…
abadams 6659fe5
Fix bad merge
abadams 6149ea4
Use structured bindings in transpose_idioms.cpp
alexreinking 1686a9e
Merge branch 'main' into abadams/fix_x86_transpose
alexreinking 9f204fc
Avoid bad simplify rule
abadams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,10 +239,39 @@ class CSEEveryExprInStmt : public IRMutator { | |
| } | ||
| const Call *bundle = Call::as_intrinsic(dummy, {Call::bundle}); | ||
| internal_assert(bundle && bundle->args.size() == 2); | ||
| Stmt s = Store::make(op->name, bundle->args[0], bundle->args[1], | ||
|
|
||
| Expr value = bundle->args[0], index = bundle->args[1]; | ||
|
|
||
| // Figure out which ones are actually needed by the index | ||
|
|
||
| auto add_all_vars_to_set = [&](const Expr &e, std::set<std::string> &s) { | ||
| visit_with(e, [&](auto *, const Variable *var) { | ||
| s.insert(var->name); | ||
| }); | ||
| }; | ||
|
|
||
| std::set<string> index_lets; | ||
| add_all_vars_to_set(index, index_lets); | ||
| for (const auto &[var, val] : reverse_view(lets)) { | ||
| if (index_lets.count(var)) { | ||
| add_all_vars_to_set(val, index_lets); | ||
| } | ||
| } | ||
|
|
||
| vector<pair<string, Expr>> deferred; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment why some are Let and some are deferred into a LetStmt? |
||
| for (const auto &[var, val] : reverse_view(lets)) { | ||
| if (index_lets.count(var)) { | ||
| deferred.emplace_back(var, val); | ||
| } else { | ||
| value = Let::make(var, val, value); | ||
| } | ||
| } | ||
|
|
||
| Stmt s = Store::make(op->name, value, index, | ||
| op->param, mutate(op->predicate), op->alignment); | ||
| for (const auto &[var, value] : reverse_view(lets)) { | ||
| s = LetStmt::make(var, value, s); | ||
|
|
||
| for (const auto &[var, val] : deferred) { | ||
| s = LetStmt::make(var, val, s); | ||
| } | ||
| return s; | ||
| } | ||
|
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have a dead code elimination pass?
Also, in what kind of case would there be more than what we need?
We're looking at a
buffer[index] = let x in let y in let z in ...;type of expression.