================
@@ -0,0 +1,65 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-pixel -x hlsl -emit-llvm
-disable-llvm-passes -finclude-default-header -o - %s | llvm-cxxfilt |
FileCheck %s --check-prefixes=CHECK,DXIL
+
+Texture2D<float4> t;
+
+// CHECK: define internal {{.*}} <4 x float> @test_mips(float vector[2])(<2 x
float> {{.*}} %loc) #1 {
+// CHECK: entry:
+// CHECK: %[[LOC_ADDR:.*]] = alloca <2 x float>
+// CHECK: %[[REF_TMP:.*]] = alloca %"struct.hlsl::Texture2D<>::mips_slice_type"
+// CHECK: store <2 x float> %loc, ptr %[[LOC_ADDR]]
+// CHECK: call void @hlsl::Texture2D<float
vector[4]>::mips_type::operator[](int) const(ptr {{.*}} %[[REF_TMP]], ptr
{{.*}} getelementptr {{.*}} (i8, ptr @t, i32 4), i32 noundef 0)
+// CHECK: %[[V0:.*]] = load <2 x float>, ptr %[[LOC_ADDR]]
+// CHECK: %[[CONV:.*]] = fptosi <2 x float> %[[V0]] to <2 x i32>
+// CHECK: %[[CALL:.*]] = call {{.*}} <4 x float> @hlsl::Texture2D<float
vector[4]>::mips_slice_type::operator[](int vector[2]) const(ptr {{.*}}
%[[REF_TMP]], <2 x i32> {{.*}} %[[CONV]])
+// CHECK: ret <4 x float> %[[CALL]]
+
+[shader("pixel")]
+float4 test_mips(float2 loc : LOC) : SV_Target {
+ return t.mips[0][int2(loc)];
+}
+
+// TODO: Some of the checks use %{{.*}}. We should be trying to match the ids
correctly to make sure we have the right connections.
----------------
Keenuts wrote:
this is to be addressed for this PR?
https://github.com/llvm/llvm-project/pull/186143
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits