================ @@ -403,6 +408,38 @@ class Intrinsic { (Type.isScalar() && Type.isHalf())) UseMacro = true; } + + int ArgIdx, Kind, TypeArgIdx; + std::vector<Record *> ImmCheckList = R->getValueAsListOfDefs("ImmChecks"); + for (const auto *I : ImmCheckList) { + unsigned EltSizeInBits = 0, VecSizeInBits = 0; + + ArgIdx = I->getValueAsInt("ImmArgIdx"); + TypeArgIdx = I->getValueAsInt("TypeContextArgIdx"); + Kind = I->getValueAsDef("Kind")->getValueAsInt("Value"); + + assert((ArgIdx >= 0 && Kind >= 0) && + "ImmArgIdx and Kind must be nonnegative"); + + if (TypeArgIdx >= 0) { + Type ContextType = getParamType(TypeArgIdx); + + // Element size cannot be set for intrinscs that map to polymorphic + // builtins. + if (CK != ClassB) + EltSizeInBits = ContextType.getElementSizeInBits(); + + VecSizeInBits = ContextType.getSizeInBits(); + } + + ImmChecks.emplace_back( ---------------- SpencerAbson wrote:
Done. https://github.com/llvm/llvm-project/pull/100278 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits