Summary: | Merge similar if-statements | ||
---|---|---|---|
Product: | Mesa | Reporter: | Ian Romanick <idr> |
Component: | glsl-compiler | Assignee: | Ian Romanick <idr> |
Status: | RESOLVED MOVED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | enhancement | ||
Priority: | medium | ||
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Ian Romanick
2016-03-29 18:55:27 UTC
> Existing optimization passes should turn this into a pair of bcsel instructions.
Ian, is this already done or do you have patches for it?
(In reply to Eero Tamminen from comment #1) > > Existing optimization passes should turn this into a pair of bcsel instructions. > > Ian, is this already done or do you have patches for it? This is done however i965 doesn't make use of it. If you pass a non-zero limit to nir_opt_peephole_select() (i965 currently has a limit of zero, all other nir drivers seem to pass a value) these if-statments should get turned into bcsel. (In reply to Timothy Arceri from comment #2) > (In reply to Eero Tamminen from comment #1) > > > Existing optimization passes should turn this into a pair of bcsel instructions. > > > > Ian, is this already done or do you have patches for it? > > This is done however i965 doesn't make use of it. If you pass a non-zero > limit to nir_opt_peephole_select() (i965 currently has a limit of zero, all > other nir drivers seem to pass a value) these if-statments should get turned > into bcsel. nip_opt_peephole_select would help with this specific case, but I have seen other cases where the bodies of the then-blocks and the else-blocks are quite large. I noticed one or two cases of this recently, but I don't recall which shaders. I will probably work on this fairly soon (sometime this year) if someone doesn't beat me to it. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/809. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.