[clang] [CIR][X86] Add support for `cpuid`/`cpuidex` (PR #173197)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 8 17:58:55 PST 2026
================
@@ -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))
----------------
andykaylor wrote:
Have you seen this call happening with a pointer to an array? It looks to me like the AST has an implicit cast to `int*` before calling the function.
https://github.com/llvm/llvm-project/pull/173197
More information about the cfe-commits
mailing list