================
@@ -0,0 +1,345 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 6
+
+// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
+
+// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float
@_Z18StoreScalarAtMat00Ru11matrix_typeILm4ELm4EfEf(
+// CHECK-SAME: ptr noalias noundef nonnull align 4 dereferenceable(64)
[[A:%.*]], float noundef nofpclass(nan inf) [[F:%.*]]) #[[ATTR0:[0-9]+]] {
+// CHECK-NEXT: [[ENTRY:.*:]]
+// CHECK-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
+// CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
+// CHECK-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
+// CHECK-NEXT: store float [[F]], ptr [[F_ADDR]], align 4
+// CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F_ADDR]], align 4
+// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <1 x float>
poison, float [[TMP0]], i64 0
+// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <1 x float>
[[SPLAT_SPLATINSERT]], <1 x float> poison, <1 x i32> zeroinitializer
+// CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4, !nonnull
[[META4:![0-9]+]], !align [[META5:![0-9]+]]
+// CHECK-NEXT: [[TMP2:%.*]] = extractelement <1 x float> [[SPLAT_SPLAT]],
i32 0
+// CHECK-NEXT: store float [[TMP2]], ptr [[TMP1]], align 4
+// CHECK-NEXT: [[CAST_VTRUNC:%.*]] = extractelement <1 x float>
[[SPLAT_SPLAT]], i32 0
+// CHECK-NEXT: ret float [[CAST_VTRUNC]]
+//
+float StoreScalarAtMat00(out float4x4 A, float F) {
+ return A._m00 = F;
+}
----------------
hekota wrote:
Same as above. It would be better to focus just on the store operation.
```suggestion
voidStoreScalarAtMat00(out float4x4 A, float F) {
A._m00 = F;
}
```
https://github.com/llvm/llvm-project/pull/171225
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits