ctetreau added inline comments.
================ Comment at: mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:81 static llvm::Type *getInnermostElementType(llvm::Type *type) { - while (isa<llvm::SequentialType>(type)) - type = type->getSequentialElementType(); - return type; + do { + if (auto *arrayTy = dyn_cast<llvm::ArrayType>(type)) { ---------------- Readability: This works, but is a little strange. I'd rewrite: ``` static llvm::Type *getInnermostElementType(llvm::Type *type) { while (isa<llvm::ArrayType>(type) || isa<llvm::VectorType>(type)) { if (auto *arrayTy = dyn_cast<llvm::ArrayType>(type)) type = arrayTy->getElementType(); else type = cast<llvm::VectorType>(type)->getElementType(); } return type; } ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75661/new/ https://reviews.llvm.org/D75661 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits