Skip to content

Commit c4a3f2f

Browse files
committed
Simplify check for low precision type
1 parent 48e35c5 commit c4a3f2f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/Target/DirectX/DXILShaderFlags.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,13 @@ void ModuleShaderFlags::updateFunctionFlags(ComputedShaderFlags &CSF,
9999
}
100100
}
101101

102-
auto IsLowPrecisionType = [](const Type *Ty) {
103-
return (Ty->isIntegerTy() && Ty->getScalarSizeInBits() == 16) ||
104-
Ty->isHalfTy();
105-
};
106-
107102
if (!CSF.LowPrecisionPresent)
108-
CSF.LowPrecisionPresent = IsLowPrecisionType(I.getType());
103+
CSF.LowPrecisionPresent =
104+
I.getType()->isIntegerTy(16) || I.getType()->isHalfTy();
109105

110106
if (!CSF.LowPrecisionPresent) {
111107
for (const Value *Op : I.operands()) {
112-
if (IsLowPrecisionType(Op->getType())) {
108+
if (Op->getType()->isIntegerTy(16) || Op->getType()->isHalfTy()) {
113109
CSF.LowPrecisionPresent = true;
114110
break;
115111
}

0 commit comments

Comments
 (0)