[clang] [llvm] [OpenMP][CodeGen] Preserve libcalls for declare simd redecls (PR #193881)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 09:51:46 PST 2026
wpcwzy wrote:
Hi Alexey,
All four are fixed, thanks.
- CurCodeDecl -> CurGD: the getFunctionFeatureMap(GlobalDecl) here takes the map as an out parameter, so it is getFunctionFeatureMap(Features, CGF.CurGD). CurGD is empty for global initializers, so there I fall back to the TU features instead of dereferencing it.
- The complex and vararg cases bail out before building a type, and Vector params whose element type cannot be a vector type are skipped. I could reproduce the FixedVectorType assertion with a _Complex cexpf declaration before the change. printf used to get a _ZGV*_printf mapping, now it gets none.
- getNamedValue instead of the getOrInsertFunction cast, so a symbol that already exists with another type is skipped. Same for a call whose type does not match the callee.
- SimplifyLibCalls: the mapping check moved into optimizeDoubleFP, so acosh and the other shrinks are covered too (the redundant sin/cos shrink check is gone), and optimizeSymmetricCall copies the mapping attribute.
Tests: declare_simd_math_unsupported.c for the complex/vararg/symbol-collision/mismatched-call cases, declare_simd_math_global_init.cpp for the empty CurGD path, target_clones/cpu_specific in declare_simd_math_target.c, and the shrink/symmetric rewrites in vfabi-mapping.ll.
check-all and llvm-test-suite pass.
https://github.com/llvm/llvm-project/pull/193881
More information about the cfe-commits
mailing list