Skip to content

Commit 90ef640

Browse files
Spell out types; use dyn_cast on non-nullable
1 parent 4bfc45c commit 90ef640

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

mlir/lib/Conversion/MathToLLVM/MathToLLVM.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ struct SincosOpLowering : public ConvertOpToLLVMPattern<math::SincosOp> {
128128
LogicalResult
129129
matchAndRewrite(math::SincosOp op, OpAdaptor adaptor,
130130
ConversionPatternRewriter &rewriter) const override {
131-
const auto &typeConverter = *this->getTypeConverter();
132-
auto loc = op.getLoc();
133-
auto operandType = adaptor.getOperand().getType();
134-
auto llvmOperandType = typeConverter.convertType(operandType);
135-
auto sinType = typeConverter.convertType(op.getSin().getType());
136-
auto cosType = typeConverter.convertType(op.getCos().getType());
131+
const LLVMTypeConverter &typeConverter = *this->getTypeConverter();
132+
mlir::Location loc = op.getLoc();
133+
mlir::Type operandType = adaptor.getOperand().getType();
134+
mlir::Type llvmOperandType = typeConverter.convertType(operandType);
135+
mlir::Type sinType = typeConverter.convertType(op.getSin().getType());
136+
mlir::Type cosType = typeConverter.convertType(op.getCos().getType());
137137
if (!llvmOperandType || !sinType || !cosType)
138138
return failure();
139139

mlir/lib/Dialect/Math/IR/MathOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ OpFoldResult math::SinhOp::fold(FoldAdaptor adaptor) {
289289
//===----------------------------------------------------------------------===//
290290

291291
std::optional<SmallVector<int64_t, 4>> math::SincosOp::getShapeForUnroll() {
292-
if (auto vt = mlir::dyn_cast_or_null<VectorType>(getOperand().getType()))
292+
if (auto vt = mlir::dyn_cast<VectorType>(getOperand().getType()))
293293
return llvm::to_vector<4>(vt.getShape());
294294
return std::nullopt;
295295
}

0 commit comments

Comments
 (0)