Find a file
Ian Romanick dcfc90a8fc nir/algebraic: Convert bcsel of addition to addition of b2i or b2f
Recent changes to continue handling in loops results in many cases of

    loop {
        ...
	if (...) {
	    do_continue = true; // was continue;
	}

	i = do_continue ? i : i + 1;
    }

I noticed this while investigating mesa#15154. Unfortunately, this
doesn't fix the performance regressions noted in that issue.

One fragment shader in XCOM: Enemy Unknown doesn't like this change. :(

v2: Drop _nsz from a couple bcsel patterns where it is not needed.
Suggested by Georg.

v3: Drop ~ from the last two fadd patterns. Suggested by Georg. Update
expected checksum for plot3d-v2.trace on many platforms.

shader-db:

All Iris platforms had similar results. (Lunar Lake shown)
total instructions in shared programs: 17089936 -> 17086837 (-0.02%)
instructions in affected programs: 864928 -> 861829 (-0.36%)
helped: 696 / HURT: 110

total cycles in shared programs: 864096306 -> 863913752 (-0.02%)
cycles in affected programs: 345726340 -> 345543786 (-0.05%)
helped: 620 / HURT: 196

total spills in shared programs: 3318 -> 3319 (0.03%)
spills in affected programs: 14 -> 15 (7.14%)
helped: 0 / HURT: 1

total fills in shared programs: 1604 -> 1606 (0.12%)
fills in affected programs: 28 -> 30 (7.14%)
helped: 0 / HURT: 1

total sends in shared programs: 876852 -> 876850 (<.01%)
sends in affected programs: 6 -> 4 (-33.33%)
helped: 2 / HURT: 0

fossil-db:

Lunar Lake
Totals:
Instrs: 914468779 -> 914215874 (-0.03%); split: -0.03%, +0.00%
CodeSize: 12885732160 -> 12881939568 (-0.03%); split: -0.04%, +0.01%
Cycle count: 100100279922 -> 100096866800 (-0.00%); split: -0.05%, +0.04%
Spill count: 3459786 -> 3459693 (-0.00%); split: -0.01%, +0.01%
Fill count: 4909835 -> 4909177 (-0.01%); split: -0.04%, +0.03%
Max live registers: 191819298 -> 191822052 (+0.00%); split: -0.00%, +0.00%
Max dispatch width: 48511264 -> 48510608 (-0.00%); split: +0.00%, -0.00%
Non SSA regs after NIR: 136334891 -> 136301926 (-0.02%); split: -0.03%, +0.00%

Totals from 37416 (1.87% of 2003390) affected shaders:
Instrs: 53346249 -> 53093344 (-0.47%); split: -0.48%, +0.01%
CodeSize: 775396384 -> 771603792 (-0.49%); split: -0.60%, +0.11%
Cycle count: 32275003526 -> 32271590404 (-0.01%); split: -0.14%, +0.13%
Spill count: 569304 -> 569211 (-0.02%); split: -0.05%, +0.03%
Fill count: 620240 -> 619582 (-0.11%); split: -0.31%, +0.21%
Max live registers: 6712048 -> 6714802 (+0.04%); split: -0.01%, +0.05%
Max dispatch width: 893344 -> 892688 (-0.07%); split: +0.10%, -0.17%
Non SSA regs after NIR: 7191473 -> 7158508 (-0.46%); split: -0.49%, +0.03%

Meteor Lake and DG2 had similar results. (Meteor Lake shown)
Totals:
Instrs: 985625036 -> 985366432 (-0.03%); split: -0.03%, +0.00%
CodeSize: 16446268768 -> 16442606864 (-0.02%); split: -0.03%, +0.01%
Cycle count: 91278956920 -> 91272371300 (-0.01%); split: -0.07%, +0.06%
Spill count: 3713935 -> 3714003 (+0.00%); split: -0.00%, +0.00%
Fill count: 5001514 -> 5001259 (-0.01%); split: -0.03%, +0.02%
Max live registers: 120736970 -> 120738919 (+0.00%); split: -0.00%, +0.00%
Max dispatch width: 37827808 -> 37829472 (+0.00%); split: +0.01%, -0.00%
Non SSA regs after NIR: 160606595 -> 160573270 (-0.02%); split: -0.02%, +0.00%

Totals from 38664 (1.71% of 2265137) affected shaders:
Instrs: 53621392 -> 53362788 (-0.48%); split: -0.49%, +0.01%
CodeSize: 932994544 -> 929332640 (-0.39%); split: -0.52%, +0.13%
Cycle count: 24442489628 -> 24435904008 (-0.03%); split: -0.25%, +0.22%
Spill count: 550952 -> 551020 (+0.01%); split: -0.02%, +0.03%
Fill count: 525010 -> 524755 (-0.05%); split: -0.27%, +0.23%
Max live registers: 3594805 -> 3596754 (+0.05%); split: -0.01%, +0.07%
Max dispatch width: 510928 -> 512592 (+0.33%); split: +0.47%, -0.14%
Non SSA regs after NIR: 7652247 -> 7618922 (-0.44%); split: -0.46%, +0.03%

Tiger Lake, Ice Lake, and Skylake had similar results. (Tiger Lake shown)
Totals:
Instrs: 997905938 -> 997771670 (-0.01%); split: -0.01%, +0.00%
CodeSize: 13990460928 -> 13988346016 (-0.02%); split: -0.02%, +0.00%
Cycle count: 83465002175 -> 83456829524 (-0.01%); split: -0.02%, +0.01%
Spill count: 3815020 -> 3814879 (-0.00%); split: -0.01%, +0.00%
Fill count: 6561078 -> 6560768 (-0.00%); split: -0.01%, +0.00%
Max live registers: 121468149 -> 121468160 (+0.00%); split: -0.00%, +0.00%
Max dispatch width: 37914400 -> 37914624 (+0.00%); split: +0.00%, -0.00%
Non SSA regs after NIR: 155941530 -> 155944033 (+0.00%); split: -0.00%, +0.00%

Totals from 27771 (1.22% of 2273117) affected shaders:
Instrs: 31224666 -> 31090398 (-0.43%); split: -0.44%, +0.01%
CodeSize: 450250800 -> 448135888 (-0.47%); split: -0.57%, +0.10%
Cycle count: 15045135658 -> 15036963007 (-0.05%); split: -0.13%, +0.08%
Spill count: 406812 -> 406671 (-0.03%); split: -0.05%, +0.01%
Fill count: 391210 -> 390900 (-0.08%); split: -0.10%, +0.02%
Max live registers: 2592759 -> 2592770 (+0.00%); split: -0.02%, +0.02%
Max dispatch width: 383888 -> 384112 (+0.06%); split: +0.23%, -0.17%
Non SSA regs after NIR: 4221402 -> 4223905 (+0.06%); split: -0.01%, +0.07%

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/algebraic: Convert bcsel of addition to addition of b2i or b2f 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 gitlab: Highlight .cl as C 2023-11-02 11:37:46 +00:00
.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.