This patch is intended to answer a question raised in PR27435:
https://bugs.llvm.org/show_bug.cgi?id=27435
Is a programmer using __builtin_sqrt() invoking the compiler's intrinsic definition of sqrt or the mathlib definition of sqrt?
I know there are follow-up bugs that still need to be solved (D28335), but I think we should answer this first. Also if this patch is correct, it is enough to produce the hoped-for result in the PR27435 examples because we'll get this IR at -O2:
$ ./clang -O2 27435.c -S -o - -emit-llvm | grep llvm.sqrt
%2 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %1) %2 = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %1)