-
Notifications
You must be signed in to change notification settings - Fork 156
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
Support boolean literals for VectorRepeatValue #4997
Comments
During #4622 lots of attention was given to Vector usage in binary ops since the literals that could be vectorized tended to show up there. Since boolean literals were not on the list, I somehow neglected to look at the logical operators (which depend on booleans to be used). This diff adds the necessary branching to cover the vec repeat case, looking forward to the time where boolean literals _can be vectorized_. It also adds skipped/commented out tests with reference to #4997 which should aim to enable these code paths by finally allowing bool literals to become vectorized.
Bool literals were not included in the vec repeat test since they are still not eligible for vectorization. Ref: #4997
Bool literals were not included in the vec repeat test since they are still not eligible for vectorization. Ref: #4997
Bool literals were not included in the vec repeat test since they are still not eligible for vectorization. Ref: #4997
For the "undefined identifier" problem, it seems like the fix is to define the builtin local to the test, as was done here for float: For booleans, this will mean adding the following to your test source:
|
There is also flux/libflux/flux-core/src/semantic/tests.rs Lines 4205 to 4208 in 2be9804
env flux/libflux/flux-core/src/semantic/tests.rs Lines 4257 to 4260 in 2be9804
|
Bool literals were not included in the vec repeat test since they are still not eligible for vectorization. Ref: #4997
Bool literals were not included in the vec repeat test since they are still not eligible for vectorization. Ref: #4997
* feat: rewrite calls to float as _vectorizedFloat For functions matching our point of entry pattern, `(r) => A` rewrite calls to `float()`, even those in the stdlib. This rewrite is naive in that it just plops a new identifier in place of the old. Unsure if there's a way to do a proper lookup for the real Symbol or not. * test: confirm calls to float can vectorize from Go * test: acceptance test for _vectorizedFloat Bool literals were not included in the vec repeat test since they are still not eligible for vectorization. Ref: #4997 * feat: add feature flag for `vectorizedFloat` * chore: remove fixed fixme * chore: define builtin float in test instead of loading stdlib * chore: move float builtin def to analyzer Environment Feels more official this way. * chore: make generate
During #4622 lots of attention was given to Vector usage in binary ops since the literals that could be vectorized tended to show up there. Since boolean literals were not on the list, I somehow neglected to look at the logical operators (which depend on booleans to be used). This diff adds the necessary branching to cover the vec repeat case, looking forward to the time where boolean literals _can be vectorized_. It also adds skipped/commented out tests with reference to #4997 which should aim to enable these code paths by finally allowing bool literals to become vectorized.
During #4622 lots of attention was given to Vector usage in binary ops since the literals that could be vectorized tended to show up there. Since boolean literals were not on the list, I somehow neglected to look at the logical operators (which depend on booleans to be used). This diff adds the necessary branching to cover the vec repeat case, looking forward to the time where boolean literals _can be vectorized_. It also adds skipped/commented out tests with reference to #4997 which should aim to enable these code paths by finally allowing bool literals to become vectorized.
* refactor: add vec repeat support for logical ops During #4622 lots of attention was given to Vector usage in binary ops since the literals that could be vectorized tended to show up there. Since boolean literals were not on the list, I somehow neglected to look at the logical operators (which depend on booleans to be used). This diff adds the necessary branching to cover the vec repeat case, looking forward to the time where boolean literals _can be vectorized_. It also adds skipped/commented out tests with reference to #4997 which should aim to enable these code paths by finally allowing bool literals to become vectorized. * feat: support vectorized bool literals * test: verify bool literals can be vectorized in Go/Rust * fix: add early return for const folding branches in vectorAnd/vectorOr * test: flux acceptance tests for bool literals/vec repeat * fix: only rewrite `boolean.true` and `boolean.false` identifiers Also updates supporting test code to emulate package membership and prelude. * fix: only rewrite calls to `universe.float` Previously we rewrote any call to a function named `float`. This could cause issues if the regular float had been shadowed. * chore: combine tests * chore: make generate
The initial work towards wrapping constants/literals for vectorization only covered a subset of literals (int, float, string time).
boolean
was intended to be included but I (@onelson) was unable to figure out how to get them working on the rust side.Rust complained about "undefined identifier" for
true
andfalse
in tests and the bool literal match arm invectorize()
never seemed to match.Possibly all that's missing is some configuration of the
Analyzer
but I wasn't sure how to make it work.DOD:
~~vecRepeat~~()
callsVectorRepeatValue
instances on the Go sideThe text was updated successfully, but these errors were encountered: