================
@@ -3565,6 +3565,31 @@ cir::EhTypeIdOp::verifySymbolUses(SymbolTableCollection 
&symbolTable) {
   return success();
 }
 
+//===----------------------------------------------------------------------===//
+// CpuIdOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult cir::CpuIdOp::verify() {
+  auto basePtrTy = mlir::dyn_cast<cir::PointerType>(getBasePtr().getType());
+  if (!basePtrTy)
+    return mlir::failure();
+
+  mlir::Type type = basePtrTy.getPointee();
+
+  // basePtr points to an array of size at least 4
+  auto arrayTy = mlir::dyn_cast<cir::ArrayType>(type);
+  if (arrayTy && (arrayTy.getSize() < 4))
+    return emitOpError()
+           << "base pointer must point to an array of size at least 4";
+
+  // Array decay: basePtr points to !s32i
----------------
rturrado wrote:

Indeed.

https://github.com/llvm/llvm-project/pull/173197
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to