================
@@ -1579,6 +1579,109 @@ OpFoldResult cir::VecExtractOp::fold(FoldAdaptor 
adaptor) {
   return elements[index];
 }
 
+//===----------------------------------------------------------------------===//
+// VecCmpOp
+//===----------------------------------------------------------------------===//
+
+OpFoldResult cir::VecCmpOp::fold(FoldAdaptor adaptor) {
+  mlir::Attribute lhs = adaptor.getLhs();
+  mlir::Attribute rhs = adaptor.getRhs();
+  if (!mlir::isa_and_nonnull<cir::ConstVectorAttr>(lhs) ||
+      !mlir::isa_and_nonnull<cir::ConstVectorAttr>(rhs))
+    return {};
+
+  auto lhsVecAttr = mlir::cast<cir::ConstVectorAttr>(lhs);
+  auto rhsVecAttr = mlir::cast<cir::ConstVectorAttr>(rhs);
+
+  auto inputElemTy =
+      mlir::cast<cir::VectorType>(lhsVecAttr.getType()).getElementType();
----------------
andykaylor wrote:

Don't use auto here. The cast gives the misleading impression that it isn't 
needed, but this is actually the result of getElementType(), right?

https://github.com/llvm/llvm-project/pull/143322
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to