================ @@ -2613,6 +2614,24 @@ void CGBuilderInserter::InsertHelper( // called function. void CodeGenFunction::checkTargetFeatures(const CallExpr *E, const FunctionDecl *TargetDecl) { + // SemaCheking cannot handle below x86 builtins because they have different + // parameter ranges with different TargetAttribute of caller. ---------------- FreddyLeaf wrote:
Semachecking doesn't have the information of the caller of the intrinsic. While here we require to know if caller has "avx" or not when the condition code is [8, 31]. Considering such case: ``` #include <immintrin.h> __attribute__((target("sse2"))) __m128 test1(__m128 a, __m128 b) { return _mm_cmp_ps(a, b, 14); // shouldn't report error. } __attribute__((target("avx"))) __m128 test2(__m128 a, __m128 b) { return _mm_cmp_ps(a, b, 14); // should report error. } https://github.com/llvm/llvm-project/pull/84136 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits