Apply clang-tidy fixes for readability-simplify-boolean-expr in SPIRVOps.cpp (NFC)

This commit is contained in:
Mehdi Amini 2022-06-12 17:56:43 +00:00
parent 261d003350
commit b254d55711
1 changed files with 6 additions and 6 deletions

View File

@ -2546,7 +2546,7 @@ LogicalResult spirv::GroupBroadcastOp::verify() {
return emitOpError("execution scope must be 'Workgroup' or 'Subgroup'");
if (auto localIdTy = localid().getType().dyn_cast<VectorType>())
if (!(localIdTy.getNumElements() == 2 || localIdTy.getNumElements() == 3))
if (localIdTy.getNumElements() != 2 && localIdTy.getNumElements() != 3)
return emitOpError("localid is a vector and can be with only "
" 2 or 3 components, actual number is ")
<< localIdTy.getNumElements();
@ -4201,10 +4201,10 @@ LogicalResult spirv::GLSLFrexpStructOp::verify() {
if (exponentVecTy) {
IntegerType componentIntTy =
exponentVecTy.getElementType().dyn_cast<IntegerType>();
if (!(componentIntTy && componentIntTy.getWidth() == 32))
if (!componentIntTy || componentIntTy.getWidth() != 32)
return emitError("member one of the resulting struct type must"
"be a scalar or vector of 32 bit integer type");
} else if (!(exponentIntTy && exponentIntTy.getWidth() == 32)) {
} else if (!exponentIntTy || exponentIntTy.getWidth() != 32) {
return emitError("member one of the resulting struct type "
"must be a scalar or vector of 32 bit integer type");
}
@ -4322,9 +4322,9 @@ LogicalResult spirv::ImageQuerySizeOp::verify() {
case spirv::Dim::Dim2D:
case spirv::Dim::Dim3D:
case spirv::Dim::Cube:
if (!(samplingInfo == spirv::ImageSamplingInfo::MultiSampled ||
samplerInfo == spirv::ImageSamplerUseInfo::SamplerUnknown ||
samplerInfo == spirv::ImageSamplerUseInfo::NoSampler))
if (samplingInfo != spirv::ImageSamplingInfo::MultiSampled &&
samplerInfo != spirv::ImageSamplerUseInfo::SamplerUnknown &&
samplerInfo != spirv::ImageSamplerUseInfo::NoSampler)
return emitError(
"if Dim is 1D, 2D, 3D, or Cube, "
"it must also have either an MS of 1 or a Sampled of 0 or 2");