Skip to content

Commit b748be2

Browse files
committed
Address code review comments
1 parent e45e40f commit b748be2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,10 +1593,9 @@ OpFoldResult cir::VecCmpOp::fold(FoldAdaptor adaptor) {
15931593
auto lhsVecAttr = mlir::cast<cir::ConstVectorAttr>(lhs);
15941594
auto rhsVecAttr = mlir::cast<cir::ConstVectorAttr>(rhs);
15951595

1596-
auto inputElemTy =
1596+
mlir::Type inputElemTy =
15971597
mlir::cast<cir::VectorType>(lhsVecAttr.getType()).getElementType();
1598-
if (!mlir::isa<cir::IntType>(inputElemTy) &&
1599-
!mlir::isa<cir::CIRFPTypeInterface>(inputElemTy))
1598+
if (!isAnyIntegerOrFloatingPointType(inputElemTy))
16001599
return {};
16011600

16021601
cir::CmpOpKind opKind = adaptor.getKind();

clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ void CIRCanonicalizePass::runOnOperation() {
141141

142142
// Many operations are here to perform a manual `fold` in
143143
// applyOpPatternsGreedily.
144-
if (isa<BrOp, BrCondOp, CastOp, ScopeOp, SwitchOp, SelectOp, UnaryOp,
145-
VecExtractOp, VecShuffleDynamicOp, VecTernaryOp, VecCmpOp>(op))
144+
if (isa<BrCondOp, BrOp, CastOp, ScopeOp, SelectOp, SwitchOp, UnaryOp,
145+
VecCmpOp, VecExtractOp, VecShuffleDynamicOp, VecTernaryOp>(op))
146146
ops.push_back(op);
147147
});
148148

0 commit comments

Comments
 (0)