Skip to content

intel/fs: Bug fixes for copy instructions executed under divergent control flow in presence of force_writemask_all overwrites.

Both the global dataflow analysis performed by the copy propagation pass and the live interval checks performed by register coalesce appear to misoptimize the program when a copy instruction occurs under divergent control flow, and the source (and in the case of copy propagation, the destination) of that copy is overwritten by another instruction that doesn't have the same force_writemask_all behavior as the copy instruction.

The problem was introduced by a4b36cd3 ("intel/fs: Coalesce when the src live range is contained in the dst") in the case of register coalesce, and its fix seems easy enough to back-port to all affected releases. The similar copy propagation bug has probably been present since forever (or at least as long as global copy propagation and force_writemask_all have been a thing), but due to the complexity of the fix it isn't nominated for mesa-stable in this MR (XXX - Maybe nominate it for mesa-stable at a later point?).

Cc: @llandwerlin , @idr

Merge request reports