Apply clang-tidy fixes for readability-simplify-boolean-expr in SPIRVToLLVM.cpp ...
authorMehdi Amini <joker.eph@gmail.com>
Mon, 29 Aug 2022 10:25:52 +0000 (10:25 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 1 Sep 2022 00:37:14 +0000 (00:37 +0000)
mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp

index 0a0e7b0..1d6ae56 100644 (file)
@@ -252,7 +252,7 @@ static Optional<Type> convertArrayType(spirv::ArrayType type,
   unsigned stride = type.getArrayStride();
   Type elementType = type.getElementType();
   auto sizeInBytes = elementType.cast<spirv::SPIRVType>().getSizeInBytes();
-  if (stride != 0 && !(sizeInBytes && *sizeInBytes == stride))
+  if (stride != 0 && (!sizeInBytes || *sizeInBytes != stride))
     return llvm::None;
 
   auto llvmElementType = converter.convertType(elementType);