From 12b0848d28163866e01b686156830d8daf0a8506 Mon Sep 17 00:00:00 2001 From: Zheng Zhong Date: Sun, 28 Apr 2024 02:34:58 -0400 Subject: [PATCH] use getElementCount().getKnownMinValue() for llvm17 --- lib/Target/CBackend/CBackend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 6c5af40..134194c 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -4570,8 +4570,8 @@ void CWriter::printIntrinsicDefinition(FunctionType *funT, unsigned Opcode, printTypeName(Out, retT); Out << " r;\n"; - if (isa(retT)) { - char vectorSize = dyn_cast(retT)->getNumElements(); + if (auto vRetT = dyn_cast(retT)) { + char vectorSize = vRetT->getElementCount().getKnownMinValue(); for (i = 0; i < vectorSize; i++) { Out << " r.vector[" << (int)i << "] = " << OpName << "_devec("; for (char j = 0; j < numParams; j++) {