[clang] [OpenMP][CodeGen] Preserve libcalls for declare simd redecls (PR #193881)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 11 23:09:50 PDT 2026
wpcwzy wrote:
Hi all,
I've added a second commit on top of the original patch.
The new commit fixes a follow-on problem: even with the libcall preserved, under `-fmath-errno` the function declaration still has default may-read/write memory effects, so the loop vectorizer's dependence analysis still refuses to vectorize. Now, when a libm math function annotated with `#pragma omp declare simd` is called inside an OpenMP SIMD loop, the call site will be marked as memory(none). This only affects calls inside SIMD loops and ordinary scalar calls outside loops are untouched. Functions with output pointers (sincos, modf, etc.) are excluded.
To classify libm functions by name under `-fo-builtin`(the config glibc uses for its libmvec ABI tests, where getBuiltinID() returns 0), we added an interface called `isConstWithoutErrnoAndExceptions(StringRef)`.
Reviews and comments are greatly welcomed. :)
https://github.com/llvm/llvm-project/pull/193881
More information about the cfe-commits
mailing list