Skip to content

Commit 1297f8c

Browse files
committed
address pr comments
2 parents 15eee3e + 0ff2c71 commit 1297f8c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4843,7 +4843,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
48434843
.get();
48444844
break;
48454845
case ICK_Floating_Integral:
4846-
if (ToType->isRealFloatingType() || ToType->hasFloatingRepresentation())
4846+
if (ToType->hasFloatingRepresentation())
48474847
From =
48484848
ImpCastExprToType(From, ToType, CK_IntegralToFloating, VK_PRValue,
48494849
/*BasePath=*/nullptr, CCK)

clang/test/SemaHLSL/VectorOverloadResolution.hlsl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.6-library -S -fnative-half-type -finclude-default-header -o - -ast-dump %s | FileCheck %s
2-
// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
3-
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
4-
// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s \
5-
// RUN: --check-prefixes=CHECKIR
2+
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefixes=CHECKIR
63
void Fn(double2 D);
74
void Fn(half2 H);
85

@@ -42,7 +39,8 @@ void Fn3( int64_t2 p0);
4239
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' <FloatingToIntegral>
4340
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'half2':'half __attribute__((ext_vector_type(2)))' <LValueToRValue>
4441
// CHECK-NEXT: DeclRefExpr {{.*}} 'half2':'half __attribute__((ext_vector_type(2)))' lvalue ParmVar {{.*}} 'p0' 'half2':'half __attribute__((ext_vector_type(2)))'
45-
// CHECKIR: %conv = fptosi <2 x half> %0 to <2 x i64>
42+
// CHECKIR-LABEL: Call3
43+
// CHECKIR: %conv = fptosi <2 x half> {{.*}} to <2 x i64>
4644
void Call3(half2 p0) {
4745
Fn3(p0);
4846
}
@@ -54,7 +52,8 @@ void Call3(half2 p0) {
5452
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' <FloatingToIntegral>
5553
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float2':'float __attribute__((ext_vector_type(2)))' <LValueToRValue>
5654
// CHECK-NEXT: DeclRefExpr {{.*}} 'float2':'float __attribute__((ext_vector_type(2)))' lvalue ParmVar {{.*}} 'p0' 'float2':'float __attribute__((ext_vector_type(2)))'
57-
// CHECKIR: %conv = fptosi <2 x float> %0 to <2 x i64>
55+
// CHECKIR-LABEL: Call4
56+
// CHECKIR: {{.*}} = fptosi <2 x float> {{.*}} to <2 x i64>
5857
void Call4(float2 p0) {
5958
Fn3(p0);
6059
}
@@ -68,7 +67,8 @@ void Fn4( float2 p0);
6867
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float2':'float __attribute__((ext_vector_type(2)))' <IntegralToFloating>
6968
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' <LValueToRValue>
7069
// CHECK-NEXT: DeclRefExpr {{.*}} 'int64_t2':'long __attribute__((ext_vector_type(2)))' lvalue ParmVar {{.*}} 'p0' 'int64_t2':'long __attribute__((ext_vector_type(2)))'
71-
// CHECKIR: %conv = sitofp <2 x i64> %0 to <2 x float>
70+
// CHECKIR-LABEL: Call5
71+
// CHECKIR: {{.*}} = sitofp <2 x i64> {{.*}} to <2 x float>
7272
void Call5(int64_t2 p0) {
7373
Fn4(p0);
7474
}

0 commit comments

Comments
 (0)