Find a file
Ian Romanick daa38c1972 nir/opt_if: Merge if-statements with inverted conditions
Cases like

    if (x) {
        ...
    } else {
        ...
    }
    if (!x) {
        ...
    } else {
        ...
    }

should be merged.

I don't know why Ice Lake is affected differetly by this commit.

v2: Add implementation of srcs_equal_or_logical_inverse after bad
rebase. That's what I get for rushing out an MR right before lunch.
Noticed by Georg.

shader-db:

Lunar Lake
No changes.

All other Iris platforms had simlar results. (Meteor Lake shown)
total cycles in shared programs: 882310108 -> 882311504 (<.01%)
cycles in affected programs: 74306 -> 75702 (1.88%)
helped: 4
HURT: 2
helped stats (abs) min: 2.0 max: 38.0 x̄: 11.00 x̃: 2
helped stats (rel) min: 0.02% max: 0.29% x̄: 0.09% x̃: 0.02%
HURT stats (abs)   min: 720.0 max: 720.0 x̄: 720.00 x̃: 720
HURT stats (rel)   min: 5.27% max: 5.27% x̄: 5.27% x̃: 5.27%
95% mean confidence interval for cycles value: -163.75 629.08
95% mean confidence interval for cycles %-change: -1.21% 4.61%
Inconclusive result (value mean confidence interval includes 0).

fossil-db:

All Intel platforms except Ice Lake had similar results. (Lunar Lake shown)
Totals:
Instrs: 914554534 -> 914546744 (-0.00%); split: -0.00%, +0.00%
CodeSize: 12887129264 -> 12886823808 (-0.00%); split: -0.00%, +0.00%
Send messages: 40220826 -> 40219429 (-0.00%); split: -0.00%, +0.00%
Cycle count: 100101810976 -> 100101804762 (-0.00%); split: -0.00%, +0.00%
Spill count: 3459811 -> 3459786 (-0.00%); split: -0.00%, +0.00%
Fill count: 4909877 -> 4909835 (-0.00%); split: -0.00%, +0.00%
Max live registers: 191837229 -> 191838000 (+0.00%); split: -0.00%, +0.00%
Max dispatch width: 48514400 -> 48514336 (-0.00%)
Non SSA regs after NIR: 136346777 -> 136343948 (-0.00%); split: -0.00%, +0.00%

Totals from 1937 (0.10% of 2003486) affected shaders:
Instrs: 3013550 -> 3005760 (-0.26%); split: -0.39%, +0.13%
CodeSize: 43169072 -> 42863616 (-0.71%); split: -0.81%, +0.10%
Send messages: 183171 -> 181774 (-0.76%); split: -0.82%, +0.06%
Cycle count: 126864798 -> 126858584 (-0.00%); split: -0.67%, +0.67%
Spill count: 7354 -> 7329 (-0.34%); split: -0.45%, +0.11%
Fill count: 5547 -> 5505 (-0.76%); split: -0.88%, +0.13%
Max live registers: 296895 -> 297666 (+0.26%); split: -0.04%, +0.30%
Max dispatch width: 41856 -> 41792 (-0.15%)
Non SSA regs after NIR: 545672 -> 542843 (-0.52%); split: -1.15%, +0.63%

Ice Lake
Totals:
Instrs: 996341606 -> 996312120 (-0.00%); split: -0.00%, +0.00%
CodeSize: 12563695936 -> 12563195200 (-0.00%); split: -0.00%, +0.00%
Send messages: 45911343 -> 45909063 (-0.00%); split: -0.00%, +0.00%
Cycle count: 82819362995 -> 82818778468 (-0.00%); split: -0.00%, +0.00%
Spill count: 2935451 -> 2935452 (+0.00%); split: -0.00%, +0.00%
Fill count: 5034267 -> 5034281 (+0.00%); split: -0.00%, +0.00%
Max live registers: 124672355 -> 124672961 (+0.00%); split: -0.00%, +0.00%
Max dispatch width: 41330808 -> 41330672 (-0.00%)
Non SSA regs after NIR: 160790466 -> 160785863 (-0.00%); split: -0.01%, +0.00%

Totals from 2163 (0.09% of 2327905) affected shaders:
Instrs: 4164788 -> 4135302 (-0.71%); split: -0.80%, +0.09%
CodeSize: 53351344 -> 52850608 (-0.94%); split: -0.95%, +0.01%
Send messages: 271164 -> 268884 (-0.84%); split: -0.84%, +0.00%
Cycle count: 145818114 -> 145233587 (-0.40%); split: -0.66%, +0.26%
Spill count: 7819 -> 7820 (+0.01%); split: -0.32%, +0.33%
Fill count: 7191 -> 7205 (+0.19%); split: -0.57%, +0.76%
Max live registers: 192403 -> 193009 (+0.31%); split: -0.08%, +0.40%
Max dispatch width: 34728 -> 34592 (-0.39%)
Non SSA regs after NIR: 570874 -> 566271 (-0.81%); split: -1.49%, +0.68%

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41871>
2026-06-02 17:44:14 +00:00
.ci-farms Revert "ci: vmware farm is offline, stop using it" 2026-05-18 22:24:39 +00:00
.ci-farms-disabled Revert "ci: vmware farm is offline, stop using it" 2026-05-18 22:24:39 +00:00
.github/workflows meson: remove unused osmesa option 2025-06-23 06:42:50 +00:00
.gitlab radv: introduce RADV_EXPERIMENTAL envvar for experimental features 2026-03-30 07:27:01 +00:00
.gitlab-ci Uprev ANGLE to 196d1b79eadbd8fdbf0590092266bb2d87264988 2026-06-02 00:06:49 +00:00
.marge/hooks marge/pipeline_message: print details for any pipeline that hasn't succeeded 2026-02-13 14:44:30 +00:00
android android: fix building rules for i915, r300 2025-10-08 23:43:33 +02:00
bin bin/gen_release_notes: add paragraph on OpenCL support 2026-05-13 15:21:40 +00:00
build-support meson: move tsan-blacklist.txt to build-support with the other build support files 2024-05-01 07:05:12 +00:00
docs radv: advertise VK_KHR_device_fault 2026-06-02 15:18:34 +02:00
include ethosu: Add performance counter debug output 2026-06-02 17:07:08 +00:00
licenses licenses: add missing licenses 2025-01-08 20:37:51 +00:00
src nir/opt_if: Merge if-statements with inverted conditions 2026-06-02 17:44:14 +00:00
subprojects meson: update libdrm wrap 2026-05-12 13:02:24 +00:00
.clang-format meson: Restore .clang-format for ninja clang-format target 2026-02-02 13:30:55 +00:00
.clang-format-ignore ethosu: Switch to the weight encoder from Regor 2026-03-23 07:45:55 +00:00
.clang-format-include kk: Enable code formatting enforcement 2026-05-25 15:30:32 +00:00
.dir-locals.el
.editorconfig editorconfig: Set for glsl files 2025-11-14 19:31:17 +00:00
.git-blame-ignore-revs radv: Add re-format commit to .git-blame-ignore-revs 2025-11-12 07:55:36 +00:00
.gitattributes
.gitignore Revert "add VK CTS validation report for a0 interpolation fix" 2026-02-10 18:07:18 +00:00
.gitlab-ci.yml ci: changing .gitlab-ci.yml itself also means the container jobs must exist 2026-03-18 14:19:02 +00:00
.graphqlrc.yml
.mailmap mailmap: Update my email 2026-03-12 23:36:00 +00:00
.mr-label-maker.yml mr-label-maker: Add rule for new trace replay config files 2026-05-11 08:02:05 +00:00
.shellcheckrc ci: move shellcheck options to .shellcheckrc 2024-10-24 22:43:03 +00:00
clippy.toml meson: Bump the minimum rust version to 1.85.0 2026-05-30 01:20:10 +00:00
CODEOWNERS CODEOWNERS: add Jay 2026-05-27 20:03:10 +00:00
meson.build meson: Make with_gfx_compute depend on video encode support (mediafoundation) 2026-06-01 16:32:02 +00:00
meson.options amd: make ac_ib_parser an amd tool build option 2026-04-17 09:40:13 +00:00
README.rst docs: Match README installation guide with meson.rst 2024-07-27 11:53:53 +00:00
rustfmt.toml mesa: Add rustfmt.toml 2024-11-18 22:29:14 +00:00
VERSION VERSION: bump to 26.2 2026-04-15 13:15:35 +00:00

`Mesa <https://mesa3d.org>`_ - The 3D Graphics Library
======================================================


Source
------

This repository lives at https://gitlab.freedesktop.org/mesa/mesa.
Other repositories are likely forks, and code found there is not supported.


Build & install
---------------

You can find more information in our documentation (`docs/install.rst
<https://docs.mesa3d.org/install.html>`_), but the recommended way is to use
Meson (`docs/meson.rst <https://docs.mesa3d.org/meson.html>`_):

.. code-block:: sh

  $ meson setup build
  $ ninja -C build/
  $ sudo ninja -C build/ install

Support
-------

Many Mesa devs hang on IRC; if you're not sure which channel is
appropriate, you should ask your question on `OFTC's #dri-devel
<irc://irc.oftc.net/dri-devel>`_, someone will redirect you if
necessary.
Remember that not everyone is in the same timezone as you, so it might
take a while before someone qualified sees your question.
To figure out who you're talking to, or which nick to ping for your
question, check out `Who's Who on IRC
<https://dri.freedesktop.org/wiki/WhosWho/>`_.

The next best option is to ask your question in an email to the
mailing lists: `mesa-dev\@lists.freedesktop.org
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>`_


Bug reports
-----------

If you think something isn't working properly, please file a bug report
(`docs/bugs.rst <https://docs.mesa3d.org/bugs.html>`_).


Contributing
------------

Contributions are welcome, and step-by-step instructions can be found in our
documentation (`docs/submittingpatches.rst
<https://docs.mesa3d.org/submittingpatches.html>`_).

Note that Mesa uses gitlab for patches submission, review and discussions.