================ @@ -2142,85 +2178,58 @@ void NeonEmitter::genOverloadTypeCheckCode(raw_ostream &OS, OS << "#endif\n\n"; } -void NeonEmitter::genIntrinsicRangeCheckCode(raw_ostream &OS, - SmallVectorImpl<Intrinsic *> &Defs) { - OS << "#ifdef GET_NEON_IMMEDIATE_CHECK\n"; +inline bool +NeonEmitter::areRangeChecksCompatable(const ArrayRef<ImmCheck> ChecksA, + const ArrayRef<ImmCheck> ChecksB) { + // If multiple intrinsics map to the same builtin, we must ensure that the + // intended range checks performed in SemaArm.cpp do not contradict each + // other, as these are emitted once per-buitlin. + // + // The arguments to be checked and type of each check to be performed must be + // the same. The element types may differ as they will be resolved + // per-intrinsic as overloaded types by SemaArm.cpp, though the vector sizes + // are not and so must be the same. + bool compat = ---------------- momchil-velikov wrote:
A slightly better approach IMHO would be to define `ImmCheck::operator==` and then one ought to be able to just say `ChecksA == ChecksB`. 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