Author: Farzon Lotfi
Date: 2025-12-18T14:48:13-05:00
New Revision: c7b86a625eda58eb7e14dc01d6514a616ab0ea33

URL: 
https://github.com/llvm/llvm-project/commit/c7b86a625eda58eb7e14dc01d6514a616ab0ea33
DIFF: 
https://github.com/llvm/llvm-project/commit/c7b86a625eda58eb7e14dc01d6514a616ab0ea33.diff

LOG: [Matrix][HLSL] Revert Constant Matrix single subscript handling (#172887)

This change creates an XFAIL that will be addressed by #172805

This part of the change was not intended to make it in. It was a way to
optimize for constant index setters\getters but had the unintended
consequence of doing swizzles without considering the encoded element
offsets.

We need to be calling `MakeExtVectorElt` in `EmitExtVectorElementExpr`
so that we can call `E->getEncodedElementAccess(Elts);` off of the
`ExtVectorElementExpr` Node.

Calling it in `EmitMatrixSingleSubscriptExpr` was wrong because we doing
have the vector encoded elementts yet. But also to get the right index
we need a way to pass on the matrix column and row lengths so
`MakeMatrixRow` needed to be expanded to store row and column sizes on
the LValue.

Added: 
    

Modified: 
    clang/lib/CodeGen/CGExpr.cpp
    clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptConstSwizzle.hlsl
    clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptSetter.hlsl

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 27145983a2e3f..27ee96cb6dc82 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -4962,24 +4962,6 @@ LValue CodeGenFunction::EmitMatrixSingleSubscriptExpr(
   LValue Base = EmitLValue(E->getBase());
   llvm::Value *RowIdx = EmitMatrixIndexExpr(E->getRowIdx());
 
-  if (auto *RowConst = llvm::dyn_cast<llvm::ConstantInt>(RowIdx)) {
-    // Extract matrix shape from the AST type
-    const auto *MatTy = E->getBase()->getType()->castAs<ConstantMatrixType>();
-    unsigned NumCols = MatTy->getNumColumns();
-    llvm::SmallVector<llvm::Constant *, 8> Indices;
-    Indices.reserve(NumCols);
-
-    unsigned Row = RowConst->getZExtValue();
-    unsigned Start = Row * NumCols;
-    for (unsigned C = 0; C < NumCols; ++C)
-      Indices.push_back(llvm::ConstantInt::get(Int32Ty, Start + C));
-
-    llvm::Constant *Elts = llvm::ConstantVector::get(Indices);
-    return LValue::MakeExtVectorElt(
-        MaybeConvertMatrixAddress(Base.getAddress(), *this), Elts,
-        E->getBase()->getType(), Base.getBaseInfo(), TBAAAccessInfo());
-  }
-
   return LValue::MakeMatrixRow(
       MaybeConvertMatrixAddress(Base.getAddress(), *this), RowIdx,
       E->getBase()->getType(), Base.getBaseInfo(), TBAAAccessInfo());

diff  --git 
a/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptConstSwizzle.hlsl 
b/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptConstSwizzle.hlsl
index 2e580e4495930..edf831e3833d5 100644
--- 
a/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptConstSwizzle.hlsl
+++ 
b/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptConstSwizzle.hlsl
@@ -1,6 +1,9 @@
 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 
UTC_ARGS: --version 6
 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.7-library -disable-llvm-passes 
-emit-llvm -finclude-default-header -o - %s | FileCheck %s
 
+// BUG: https://github.com/llvm/llvm-project/issues/172805
+// XFAIL: *
+
 // CHECK-LABEL: define hidden void 
@_Z10setMatrix1Ru11matrix_typeILm4ELm4EfEDv4_f(
 // CHECK-SAME: ptr noalias noundef nonnull align 4 dereferenceable(64) 
[[M:%.*]], <4 x float> noundef nofpclass(nan inf) [[V:%.*]]) #[[ATTR0:[0-9]+]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
@@ -14,13 +17,13 @@
 // CHECK-NEXT:    [[TMP3:%.*]] = getelementptr <16 x float>, ptr [[TMP1]], i32 
0, i32 15
 // CHECK-NEXT:    store float [[TMP2]], ptr [[TMP3]], align 4
 // CHECK-NEXT:    [[TMP4:%.*]] = extractelement <4 x float> [[TMP0]], i32 1
-// CHECK-NEXT:    [[TMP5:%.*]] = getelementptr <16 x float>, ptr [[TMP1]], i32 
0, i32 14
+// CHECK-NEXT:    [[TMP5:%.*]] = getelementptr <16 x float>, ptr [[TMP1]], i32 
0, i32 11
 // CHECK-NEXT:    store float [[TMP4]], ptr [[TMP5]], align 4
 // CHECK-NEXT:    [[TMP6:%.*]] = extractelement <4 x float> [[TMP0]], i32 2
-// CHECK-NEXT:    [[TMP7:%.*]] = getelementptr <16 x float>, ptr [[TMP1]], i32 
0, i32 13
+// CHECK-NEXT:    [[TMP7:%.*]] = getelementptr <16 x float>, ptr [[TMP1]], i32 
0, i32 7
 // CHECK-NEXT:    store float [[TMP6]], ptr [[TMP7]], align 4
 // CHECK-NEXT:    [[TMP8:%.*]] = extractelement <4 x float> [[TMP0]], i32 3
-// CHECK-NEXT:    [[TMP9:%.*]] = getelementptr <16 x float>, ptr [[TMP1]], i32 
0, i32 12
+// CHECK-NEXT:    [[TMP9:%.*]] = getelementptr <16 x float>, ptr [[TMP1]], i32 
0, i32 3
 // CHECK-NEXT:    store float [[TMP8]], ptr [[TMP9]], align 4
 // CHECK-NEXT:    ret void
 //
@@ -38,16 +41,16 @@ void setMatrix1(out float4x4 M, float4 V) {
 // CHECK-NEXT:    [[TMP0:%.*]] = load <4 x i32>, ptr [[V_ADDR]], align 16
 // CHECK-NEXT:    [[TMP1:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
 // CHECK-NEXT:    [[TMP2:%.*]] = extractelement <4 x i32> [[TMP0]], i32 0
-// CHECK-NEXT:    [[TMP3:%.*]] = getelementptr <16 x i32>, ptr [[TMP1]], i32 
0, i32 8
+// CHECK-NEXT:    [[TMP3:%.*]] = getelementptr <16 x i32>, ptr [[TMP1]], i32 
0, i32 2
 // CHECK-NEXT:    store i32 [[TMP2]], ptr [[TMP3]], align 4
 // CHECK-NEXT:    [[TMP4:%.*]] = extractelement <4 x i32> [[TMP0]], i32 1
-// CHECK-NEXT:    [[TMP5:%.*]] = getelementptr <16 x i32>, ptr [[TMP1]], i32 
0, i32 9
+// CHECK-NEXT:    [[TMP5:%.*]] = getelementptr <16 x i32>, ptr [[TMP1]], i32 
0, i32 6
 // CHECK-NEXT:    store i32 [[TMP4]], ptr [[TMP5]], align 4
 // CHECK-NEXT:    [[TMP6:%.*]] = extractelement <4 x i32> [[TMP0]], i32 2
 // CHECK-NEXT:    [[TMP7:%.*]] = getelementptr <16 x i32>, ptr [[TMP1]], i32 
0, i32 10
 // CHECK-NEXT:    store i32 [[TMP6]], ptr [[TMP7]], align 4
 // CHECK-NEXT:    [[TMP8:%.*]] = extractelement <4 x i32> [[TMP0]], i32 3
-// CHECK-NEXT:    [[TMP9:%.*]] = getelementptr <16 x i32>, ptr [[TMP1]], i32 
0, i32 11
+// CHECK-NEXT:    [[TMP9:%.*]] = getelementptr <16 x i32>, ptr [[TMP1]], i32 
0, i32 14
 // CHECK-NEXT:    store i32 [[TMP8]], ptr [[TMP9]], align 4
 // CHECK-NEXT:    ret void
 //

diff  --git 
a/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptSetter.hlsl 
b/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptSetter.hlsl
index fbbf5594cdaab..49746531ddccc 100644
--- a/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptSetter.hlsl
+++ b/clang/test/CodeGenHLSL/BasicFeatures/MatrixSingleSubscriptSetter.hlsl
@@ -75,43 +75,76 @@ void setMatrixScalar(out float2x1 M, int index, float S) {
 // CHECK-NEXT:    [[MATRIX_ELEM5:%.*]] = extractelement <16 x i32> [[TMP0]], 
i32 15
 // CHECK-NEXT:    [[MATRIX_ROW_INS6:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS4]], i32 [[MATRIX_ELEM5]], i32 3
 // CHECK-NEXT:    [[TMP1:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
-// CHECK-NEXT:    store <4 x i32> [[MATRIX_ROW_INS6]], ptr [[TMP1]], align 4
-// CHECK-NEXT:    [[TMP2:%.*]] = load <16 x i32>, ptr [[N_ADDR]], align 4
-// CHECK-NEXT:    [[MATRIX_ELEM7:%.*]] = extractelement <16 x i32> [[TMP2]], 
i32 2
+// CHECK-NEXT:    [[MATRIX_LOAD:%.*]] = load <16 x i32>, ptr [[TMP1]], align 4
+// CHECK-NEXT:    [[TMP2:%.*]] = extractelement <4 x i32> [[MATRIX_ROW_INS6]], 
i32 0
+// CHECK-NEXT:    [[TMP3:%.*]] = insertelement <16 x i32> [[MATRIX_LOAD]], i32 
[[TMP2]], i32 0
+// CHECK-NEXT:    [[TMP4:%.*]] = extractelement <4 x i32> [[MATRIX_ROW_INS6]], 
i32 1
+// CHECK-NEXT:    [[TMP5:%.*]] = insertelement <16 x i32> [[TMP3]], i32 
[[TMP4]], i32 4
+// CHECK-NEXT:    [[TMP6:%.*]] = extractelement <4 x i32> [[MATRIX_ROW_INS6]], 
i32 2
+// CHECK-NEXT:    [[TMP7:%.*]] = insertelement <16 x i32> [[TMP5]], i32 
[[TMP6]], i32 8
+// CHECK-NEXT:    [[TMP8:%.*]] = extractelement <4 x i32> [[MATRIX_ROW_INS6]], 
i32 3
+// CHECK-NEXT:    [[TMP9:%.*]] = insertelement <16 x i32> [[TMP7]], i32 
[[TMP8]], i32 12
+// CHECK-NEXT:    store <16 x i32> [[TMP9]], ptr [[TMP1]], align 4
+// CHECK-NEXT:    [[TMP10:%.*]] = load <16 x i32>, ptr [[N_ADDR]], align 4
+// CHECK-NEXT:    [[MATRIX_ELEM7:%.*]] = extractelement <16 x i32> [[TMP10]], 
i32 2
 // CHECK-NEXT:    [[MATRIX_ROW_INS8:%.*]] = insertelement <4 x i32> poison, 
i32 [[MATRIX_ELEM7]], i32 0
-// CHECK-NEXT:    [[MATRIX_ELEM9:%.*]] = extractelement <16 x i32> [[TMP2]], 
i32 6
+// CHECK-NEXT:    [[MATRIX_ELEM9:%.*]] = extractelement <16 x i32> [[TMP10]], 
i32 6
 // CHECK-NEXT:    [[MATRIX_ROW_INS10:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS8]], i32 [[MATRIX_ELEM9]], i32 1
-// CHECK-NEXT:    [[MATRIX_ELEM11:%.*]] = extractelement <16 x i32> [[TMP2]], 
i32 10
+// CHECK-NEXT:    [[MATRIX_ELEM11:%.*]] = extractelement <16 x i32> [[TMP10]], 
i32 10
 // CHECK-NEXT:    [[MATRIX_ROW_INS12:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS10]], i32 [[MATRIX_ELEM11]], i32 2
-// CHECK-NEXT:    [[MATRIX_ELEM13:%.*]] = extractelement <16 x i32> [[TMP2]], 
i32 14
+// CHECK-NEXT:    [[MATRIX_ELEM13:%.*]] = extractelement <16 x i32> [[TMP10]], 
i32 14
 // CHECK-NEXT:    [[MATRIX_ROW_INS14:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS12]], i32 [[MATRIX_ELEM13]], i32 3
-// CHECK-NEXT:    [[TMP3:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
-// CHECK-NEXT:    [[TMP4:%.*]] = getelementptr <16 x i32>, ptr [[TMP3]], i32 
0, i32 4
-// CHECK-NEXT:    store <4 x i32> [[MATRIX_ROW_INS14]], ptr [[TMP4]], align 4
-// CHECK-NEXT:    [[TMP5:%.*]] = load <16 x i32>, ptr [[N_ADDR]], align 4
-// CHECK-NEXT:    [[MATRIX_ELEM15:%.*]] = extractelement <16 x i32> [[TMP5]], 
i32 1
-// CHECK-NEXT:    [[MATRIX_ROW_INS16:%.*]] = insertelement <4 x i32> poison, 
i32 [[MATRIX_ELEM15]], i32 0
-// CHECK-NEXT:    [[MATRIX_ELEM17:%.*]] = extractelement <16 x i32> [[TMP5]], 
i32 5
-// CHECK-NEXT:    [[MATRIX_ROW_INS18:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS16]], i32 [[MATRIX_ELEM17]], i32 1
-// CHECK-NEXT:    [[MATRIX_ELEM19:%.*]] = extractelement <16 x i32> [[TMP5]], 
i32 9
-// CHECK-NEXT:    [[MATRIX_ROW_INS20:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS18]], i32 [[MATRIX_ELEM19]], i32 2
-// CHECK-NEXT:    [[MATRIX_ELEM21:%.*]] = extractelement <16 x i32> [[TMP5]], 
i32 13
-// CHECK-NEXT:    [[MATRIX_ROW_INS22:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS20]], i32 [[MATRIX_ELEM21]], i32 3
-// CHECK-NEXT:    [[TMP6:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
-// CHECK-NEXT:    [[TMP7:%.*]] = getelementptr <16 x i32>, ptr [[TMP6]], i32 
0, i32 8
-// CHECK-NEXT:    store <4 x i32> [[MATRIX_ROW_INS22]], ptr [[TMP7]], align 4
-// CHECK-NEXT:    [[TMP8:%.*]] = load <16 x i32>, ptr [[N_ADDR]], align 4
-// CHECK-NEXT:    [[MATRIX_ELEM23:%.*]] = extractelement <16 x i32> [[TMP8]], 
i32 0
-// CHECK-NEXT:    [[MATRIX_ROW_INS24:%.*]] = insertelement <4 x i32> poison, 
i32 [[MATRIX_ELEM23]], i32 0
-// CHECK-NEXT:    [[MATRIX_ELEM25:%.*]] = extractelement <16 x i32> [[TMP8]], 
i32 4
-// CHECK-NEXT:    [[MATRIX_ROW_INS26:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS24]], i32 [[MATRIX_ELEM25]], i32 1
-// CHECK-NEXT:    [[MATRIX_ELEM27:%.*]] = extractelement <16 x i32> [[TMP8]], 
i32 8
-// CHECK-NEXT:    [[MATRIX_ROW_INS28:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS26]], i32 [[MATRIX_ELEM27]], i32 2
-// CHECK-NEXT:    [[MATRIX_ELEM29:%.*]] = extractelement <16 x i32> [[TMP8]], 
i32 12
-// CHECK-NEXT:    [[MATRIX_ROW_INS30:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS28]], i32 [[MATRIX_ELEM29]], i32 3
-// CHECK-NEXT:    [[TMP9:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
-// CHECK-NEXT:    [[TMP10:%.*]] = getelementptr <16 x i32>, ptr [[TMP9]], i32 
0, i32 12
-// CHECK-NEXT:    store <4 x i32> [[MATRIX_ROW_INS30]], ptr [[TMP10]], align 4
+// CHECK-NEXT:    [[TMP11:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
+// CHECK-NEXT:    [[MATRIX_LOAD15:%.*]] = load <16 x i32>, ptr [[TMP11]], 
align 4
+// CHECK-NEXT:    [[TMP12:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS14]], i32 0
+// CHECK-NEXT:    [[TMP13:%.*]] = insertelement <16 x i32> [[MATRIX_LOAD15]], 
i32 [[TMP12]], i32 1
+// CHECK-NEXT:    [[TMP14:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS14]], i32 1
+// CHECK-NEXT:    [[TMP15:%.*]] = insertelement <16 x i32> [[TMP13]], i32 
[[TMP14]], i32 5
+// CHECK-NEXT:    [[TMP16:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS14]], i32 2
+// CHECK-NEXT:    [[TMP17:%.*]] = insertelement <16 x i32> [[TMP15]], i32 
[[TMP16]], i32 9
+// CHECK-NEXT:    [[TMP18:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS14]], i32 3
+// CHECK-NEXT:    [[TMP19:%.*]] = insertelement <16 x i32> [[TMP17]], i32 
[[TMP18]], i32 13
+// CHECK-NEXT:    store <16 x i32> [[TMP19]], ptr [[TMP11]], align 4
+// CHECK-NEXT:    [[TMP20:%.*]] = load <16 x i32>, ptr [[N_ADDR]], align 4
+// CHECK-NEXT:    [[MATRIX_ELEM16:%.*]] = extractelement <16 x i32> [[TMP20]], 
i32 1
+// CHECK-NEXT:    [[MATRIX_ROW_INS17:%.*]] = insertelement <4 x i32> poison, 
i32 [[MATRIX_ELEM16]], i32 0
+// CHECK-NEXT:    [[MATRIX_ELEM18:%.*]] = extractelement <16 x i32> [[TMP20]], 
i32 5
+// CHECK-NEXT:    [[MATRIX_ROW_INS19:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS17]], i32 [[MATRIX_ELEM18]], i32 1
+// CHECK-NEXT:    [[MATRIX_ELEM20:%.*]] = extractelement <16 x i32> [[TMP20]], 
i32 9
+// CHECK-NEXT:    [[MATRIX_ROW_INS21:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS19]], i32 [[MATRIX_ELEM20]], i32 2
+// CHECK-NEXT:    [[MATRIX_ELEM22:%.*]] = extractelement <16 x i32> [[TMP20]], 
i32 13
+// CHECK-NEXT:    [[MATRIX_ROW_INS23:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS21]], i32 [[MATRIX_ELEM22]], i32 3
+// CHECK-NEXT:    [[TMP21:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
+// CHECK-NEXT:    [[MATRIX_LOAD24:%.*]] = load <16 x i32>, ptr [[TMP21]], 
align 4
+// CHECK-NEXT:    [[TMP22:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS23]], i32 0
+// CHECK-NEXT:    [[TMP23:%.*]] = insertelement <16 x i32> [[MATRIX_LOAD24]], 
i32 [[TMP22]], i32 2
+// CHECK-NEXT:    [[TMP24:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS23]], i32 1
+// CHECK-NEXT:    [[TMP25:%.*]] = insertelement <16 x i32> [[TMP23]], i32 
[[TMP24]], i32 6
+// CHECK-NEXT:    [[TMP26:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS23]], i32 2
+// CHECK-NEXT:    [[TMP27:%.*]] = insertelement <16 x i32> [[TMP25]], i32 
[[TMP26]], i32 10
+// CHECK-NEXT:    [[TMP28:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS23]], i32 3
+// CHECK-NEXT:    [[TMP29:%.*]] = insertelement <16 x i32> [[TMP27]], i32 
[[TMP28]], i32 14
+// CHECK-NEXT:    store <16 x i32> [[TMP29]], ptr [[TMP21]], align 4
+// CHECK-NEXT:    [[TMP30:%.*]] = load <16 x i32>, ptr [[N_ADDR]], align 4
+// CHECK-NEXT:    [[MATRIX_ELEM25:%.*]] = extractelement <16 x i32> [[TMP30]], 
i32 0
+// CHECK-NEXT:    [[MATRIX_ROW_INS26:%.*]] = insertelement <4 x i32> poison, 
i32 [[MATRIX_ELEM25]], i32 0
+// CHECK-NEXT:    [[MATRIX_ELEM27:%.*]] = extractelement <16 x i32> [[TMP30]], 
i32 4
+// CHECK-NEXT:    [[MATRIX_ROW_INS28:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS26]], i32 [[MATRIX_ELEM27]], i32 1
+// CHECK-NEXT:    [[MATRIX_ELEM29:%.*]] = extractelement <16 x i32> [[TMP30]], 
i32 8
+// CHECK-NEXT:    [[MATRIX_ROW_INS30:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS28]], i32 [[MATRIX_ELEM29]], i32 2
+// CHECK-NEXT:    [[MATRIX_ELEM31:%.*]] = extractelement <16 x i32> [[TMP30]], 
i32 12
+// CHECK-NEXT:    [[MATRIX_ROW_INS32:%.*]] = insertelement <4 x i32> 
[[MATRIX_ROW_INS30]], i32 [[MATRIX_ELEM31]], i32 3
+// CHECK-NEXT:    [[TMP31:%.*]] = load ptr, ptr [[M_ADDR]], align 4, !nonnull 
[[META3]], !align [[META4]]
+// CHECK-NEXT:    [[MATRIX_LOAD33:%.*]] = load <16 x i32>, ptr [[TMP31]], 
align 4
+// CHECK-NEXT:    [[TMP32:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS32]], i32 0
+// CHECK-NEXT:    [[TMP33:%.*]] = insertelement <16 x i32> [[MATRIX_LOAD33]], 
i32 [[TMP32]], i32 3
+// CHECK-NEXT:    [[TMP34:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS32]], i32 1
+// CHECK-NEXT:    [[TMP35:%.*]] = insertelement <16 x i32> [[TMP33]], i32 
[[TMP34]], i32 7
+// CHECK-NEXT:    [[TMP36:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS32]], i32 2
+// CHECK-NEXT:    [[TMP37:%.*]] = insertelement <16 x i32> [[TMP35]], i32 
[[TMP36]], i32 11
+// CHECK-NEXT:    [[TMP38:%.*]] = extractelement <4 x i32> 
[[MATRIX_ROW_INS32]], i32 3
+// CHECK-NEXT:    [[TMP39:%.*]] = insertelement <16 x i32> [[TMP37]], i32 
[[TMP38]], i32 15
+// CHECK-NEXT:    store <16 x i32> [[TMP39]], ptr [[TMP31]], align 4
 // CHECK-NEXT:    ret void
 //
 void setMatrixConstIndex(out int4x4 M, int4x4 N ) {


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to