[clang] [llvm] [HLSL][Matrix] Support row-major `transpose` and `mul` by inserting matrix memory layout transformations (PR #186898)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 20 13:03:10 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 132554 tests passed
* 3024 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CodeGenHLSL/builtins/mul.hlsl</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -finclude-default-header -O1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -emit-llvm -fmatrix-memory-layout=column-major -o - C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\builtins\mul.hlsl | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\builtins\mul.hlsl --check-prefixes=CHECK,COLMAJOR,DXIL
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -finclude-default-header -O1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -emit-llvm -fmatrix-memory-layout=column-major -o - 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\builtins\mul.hlsl'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\builtins\mul.hlsl' --check-prefixes=CHECK,COLMAJOR,DXIL
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\builtins\mul.hlsl:71:11: error: CHECK: expected string not found in input
# | // CHECK: %hlsl.fmad.i = {{.*}}call {{.*}} double @llvm.fmuladd.f64(double %{{.*}}, double %{{.*}}, double %[[FMUL]])
# |           ^
# | <stdin>:71:68: note: scanning from here
# |  %foldExtExtBinop = fmul reassoc nnan ninf nsz arcp afn <3 x double> %b, %a
# |                                                                    ^
# | <stdin>:71:68: note: with "FMUL" equal to "foldExtExtBinop"
# |  %foldExtExtBinop = fmul reassoc nnan ninf nsz arcp afn <3 x double> %b, %a
# |                                                                    ^
# | <stdin>:75:40: note: possible intended match here
# |  %hlsl.fmad.i = tail call reassoc nnan ninf nsz arcp afn double @llvm.fmuladd.f64(double %vecext2.i, double %vecext3.i, double %mul.i)
# |                                        ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\CodeGenHLSL\builtins\mul.hlsl
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            66: } 
# |            67:  
# |            68: ; Function Attrs: alwaysinline mustprogress nofree norecurse nosync nounwind willreturn memory(none) 
# |            69: define noundef nofpclass(nan inf) double @_Z17test_vec_vec_muldDv3_dS_(<3 x double> noundef nofpclass(nan inf) %a, <3 x double> noundef nofpclass(nan inf) %b) local_unnamed_addr #0 { 
# |            70: entry: 
# |            71:  %foldExtExtBinop = fmul reassoc nnan ninf nsz arcp afn <3 x double> %b, %a 
# | check:71'0                                                                        X~~~~~~~~ error: no match found
# | check:71'1                                                                                  with "FMUL" equal to "foldExtExtBinop"
# |            72:  %mul.i = extractelement <3 x double> %foldExtExtBinop, i64 0 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            73:  %vecext2.i = extractelement <3 x double> %a, i64 1 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            74:  %vecext3.i = extractelement <3 x double> %b, i64 1 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            75:  %hlsl.fmad.i = tail call reassoc nnan ninf nsz arcp afn double @llvm.fmuladd.f64(double %vecext2.i, double %vecext3.i, double %mul.i) 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:71'2                                            ?                                                                                                possible intended match
# |            76:  %vecext2.i.1 = extractelement <3 x double> %a, i64 2 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            77:  %vecext3.i.1 = extractelement <3 x double> %b, i64 2 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            78:  %hlsl.fmad.i.1 = tail call reassoc nnan ninf nsz arcp afn double @llvm.fmuladd.f64(double %vecext2.i.1, double %vecext3.i.1, double %hlsl.fmad.i) 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            79:  ret double %hlsl.fmad.i.1 
# | check:71'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            80: } 
# | check:71'0     ~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/186898


More information about the llvm-commits mailing list