-
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
base: main
Are you sure you want to change the base?
Changes from all commits
9e89b7c
188bee0
2ba8dde
d102f7b
46d41dd
27f1220
5576f46
107aaa5
0bc1b9f
cdc1de2
23b79ba
3eef5db
678a353
a0b7d66
4c1adf7
1c940e8
c39b1a0
794df0b
486addd
a1ecca9
f66d5ea
c25142f
bae3e02
b7defbd
23944a0
0d110d2
53ae7e4
84f10b1
8d93c3c
36565ce
3f45c47
223dd7f
2695151
31f180a
2962ea1
fa2fcb7
dcdfb90
70afc58
cd04fb2
5d2b524
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,10 +237,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 | ||
|
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. Don't we have a dead code elimination pass? |
||
|
|
||
| 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; | ||
| } | ||
|
|
||
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.
If it's intentional, all good. Just checking, because cpuinfo is typically VERY long in output.
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.
IIUC This is here because something like 10% of GHA x86 runners are throwing illegal instruction exceptions, indicating a feature detection bug on certain platforms.
That said, this should probably be something like:
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.
I want to see everything (e.g. precise cpu model, number of cpus, etc), in case it helps narrow it down.
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.
We can probably back this out since #9017 was merged