Skip to content

Commit 250c692

Browse files
committed
review comments: fix formatting
1 parent 880f50c commit 250c692

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -671,12 +671,10 @@ spirv::LogicalEqualOp::fold(spirv::LogicalEqualOp::FoldAdaptor adaptor) {
671671
// x == x -> true
672672
if (getOperand1() == getOperand2()) {
673673
auto trueAttr = BoolAttr::get(getContext(), true);
674-
if (isa<IntegerType>(getType())) {
674+
if (isa<IntegerType>(getType()))
675675
return trueAttr;
676-
}
677-
if (auto vecTy = dyn_cast<VectorType>(getType())) {
676+
if (auto vecTy = dyn_cast<VectorType>(getType()))
678677
return SplatElementsAttr::get(vecTy, trueAttr);
679-
}
680678
}
681679

682680
return constFoldBinaryOp<IntegerAttr>(
@@ -700,12 +698,10 @@ OpFoldResult spirv::LogicalNotEqualOp::fold(FoldAdaptor adaptor) {
700698
// x == x -> false
701699
if (getOperand1() == getOperand2()) {
702700
auto falseAttr = BoolAttr::get(getContext(), false);
703-
if (isa<IntegerType>(getType())) {
701+
if (isa<IntegerType>(getType()))
704702
return falseAttr;
705-
}
706-
if (auto vecTy = dyn_cast<VectorType>(getType())) {
703+
if (auto vecTy = dyn_cast<VectorType>(getType()))
707704
return SplatElementsAttr::get(vecTy, falseAttr);
708-
}
709705
}
710706

711707
return constFoldBinaryOp<IntegerAttr>(
@@ -754,12 +750,10 @@ OpFoldResult spirv::IEqualOp::fold(spirv::IEqualOp::FoldAdaptor adaptor) {
754750
// x == x -> true
755751
if (getOperand1() == getOperand2()) {
756752
auto trueAttr = BoolAttr::get(getContext(), true);
757-
if (isa<IntegerType>(getType())) {
753+
if (isa<IntegerType>(getType()))
758754
return trueAttr;
759-
}
760-
if (auto vecTy = dyn_cast<VectorType>(getType())) {
755+
if (auto vecTy = dyn_cast<VectorType>(getType()))
761756
return SplatElementsAttr::get(vecTy, trueAttr);
762-
}
763757
}
764758

765759
return constFoldBinaryOp<IntegerAttr>(
@@ -776,12 +770,10 @@ OpFoldResult spirv::INotEqualOp::fold(spirv::INotEqualOp::FoldAdaptor adaptor) {
776770
// x == x -> false
777771
if (getOperand1() == getOperand2()) {
778772
auto falseAttr = BoolAttr::get(getContext(), false);
779-
if (isa<IntegerType>(getType())) {
773+
if (isa<IntegerType>(getType()))
780774
return falseAttr;
781-
}
782-
if (auto vecTy = dyn_cast<VectorType>(getType())) {
775+
if (auto vecTy = dyn_cast<VectorType>(getType()))
783776
return SplatElementsAttr::get(vecTy, falseAttr);
784-
}
785777
}
786778

787779
return constFoldBinaryOp<IntegerAttr>(

0 commit comments

Comments
 (0)