diff --git a/lib/polygeist/Ops.cpp b/lib/polygeist/Ops.cpp index f93e10030f41..926891b40611 100644 --- a/lib/polygeist/Ops.cpp +++ b/lib/polygeist/Ops.cpp @@ -4984,7 +4984,7 @@ template struct BufferElimination : public OpRewritePattern { if (!opd) continue; auto val = dyn_cast( - ((Value)load.getMapOperands()[opd.getPosition()])); + ((Value)load.getMapOperands()[opd.getPosition()])); if (!val) continue; @@ -5034,7 +5034,7 @@ template struct BufferElimination : public OpRewritePattern { if (!opd) continue; auto val = dyn_cast( - ((Value)load.getMapOperands()[opd.getPosition()])); + ((Value)load.getMapOperands()[opd.getPosition()])); if (!val) continue; @@ -5302,7 +5302,9 @@ struct AffineBufferElimination : public OpRewritePattern { auto i = idxp.index(); if (!idx.isValue) { if (auto ald = dyn_cast(ld)) { - if (auto ac = ald.getAffineMap().getResult(i).dyn_cast()) { + if (auto ac = ald.getAffineMap() + .getResult(i) + .dyn_cast()) { if (idx == ac.getValue()) continue; } diff --git a/lib/polygeist/Passes/ConvertPolygeistToLLVM.cpp b/lib/polygeist/Passes/ConvertPolygeistToLLVM.cpp index a652c80e78f3..f1d6a6ffa3ac 100644 --- a/lib/polygeist/Passes/ConvertPolygeistToLLVM.cpp +++ b/lib/polygeist/Passes/ConvertPolygeistToLLVM.cpp @@ -985,8 +985,7 @@ struct CAllocaOpLowering : public AllocLikeOpLowering { ConversionPatternRewriter &rewriter) const override { Location loc = allocaOp.getLoc(); MemRefType originalType = allocaOp.getType(); - auto convertedType = - dyn_cast_or_null( + auto convertedType = dyn_cast_or_null( getTypeConverter()->convertType(originalType)); auto elTy = convertMemrefElementTypeForLLVMPointer( originalType, *this->getTypeConverter()); @@ -1015,8 +1014,7 @@ struct CAllocOpLowering : public AllocLikeOpLowering { auto module = allocOp->getParentOfType(); Location loc = allocOp.getLoc(); MemRefType originalType = allocOp.getType(); - auto convertedType = - dyn_cast_or_null( + auto convertedType = dyn_cast_or_null( getTypeConverter()->convertType(originalType)); if (!convertedType) @@ -1197,10 +1195,8 @@ struct CLoadStoreOpLowering : public ConvertOpToLLVMPattern { ConversionPatternRewriter &rewriter) const { Location loc = op.getLoc(); MemRefType originalType = op.getMemRefType(); - auto convertedType = - dyn_cast_or_null( - this->getTypeConverter() - ->convertType(originalType)); + auto convertedType = dyn_cast_or_null( + this->getTypeConverter()->convertType(originalType)); if (!convertedType) { (void)rewriter.notifyMatchFailure(loc, "unsupported memref type"); return nullptr; diff --git a/lib/polygeist/Passes/ConvertToOpaquePtr.cpp b/lib/polygeist/Passes/ConvertToOpaquePtr.cpp index 7ef97adb2079..12a2698f2334 100644 --- a/lib/polygeist/Passes/ConvertToOpaquePtr.cpp +++ b/lib/polygeist/Passes/ConvertToOpaquePtr.cpp @@ -190,10 +190,9 @@ struct GEPConversion : public OpConversionPattern { Operation *rewritten; TypeAttr elty = nullptr; if (!op->getAttr(kElemTypeAttrName)) - elty = TypeAttr::get( - getTypeConverter()->convertType( - dyn_cast( - op.getOperand(0).getType()).getElementType())); + elty = TypeAttr::get(getTypeConverter()->convertType( + dyn_cast(op.getOperand(0).getType()) + .getElementType())); if (convertPtrsToOpaque(op, rewritten, elty, adaptor.getOperands(), rewriter, getTypeConverter()) .failed()) diff --git a/tools/cgeist/Lib/ValueCategory.cc b/tools/cgeist/Lib/ValueCategory.cc index 5c9fd4c0323d..3817a64ee14f 100644 --- a/tools/cgeist/Lib/ValueCategory.cc +++ b/tools/cgeist/Lib/ValueCategory.cc @@ -87,9 +87,8 @@ void ValueCategory::store(mlir::Location loc, mlir::OpBuilder &builder, if (auto mt = dyn_cast(val.getType())) { assert(mt.getShape().size() == 1 && "must have size 1"); if (auto PT = dyn_cast(toStore.getType())) { - if (auto MT = dyn_cast(val.getType() - .cast() - .getElementType())) { + if (auto MT = dyn_cast( + val.getType().cast().getElementType())) { assert(MT.getShape().size() == 1); assert(MT.getShape()[0] == ShapedType::kDynamic); assert(MT.getElementType() == PT.getElementType()); diff --git a/tools/polymer/lib/Transforms/Reg2Mem.cc b/tools/polymer/lib/Transforms/Reg2Mem.cc index ba7a02cf243f..042bcd283bf1 100644 --- a/tools/polymer/lib/Transforms/Reg2Mem.cc +++ b/tools/polymer/lib/Transforms/Reg2Mem.cc @@ -209,8 +209,8 @@ static void demoteRegisterToMemory(mlir::func::FuncOp f, OpBuilder &b) { mlir::Value val = defUsesPair.first; // Create the alloca op for the scratchpad. - memref::AllocaOp allocaOp = createScratchpadAllocaOp( - dyn_cast(val), b, &entryBlock); + memref::AllocaOp allocaOp = + createScratchpadAllocaOp(dyn_cast(val), b, &entryBlock); // Create the store op that stores val into the scratchpad for future uses. createScratchpadStoreOp(val, allocaOp, b);