[cfe-dev] LLVM error with SSE4.1 intrinsics and LTO

Christopher Kulla ckulla at gmail.com
Thu Jul 10 10:35:05 PDT 2014


Passing the right mcpu flag to the linker solves my problem on linux,
which is enough to get me unstuck for now.

Thanks for the pointer!





On Wed, Jul 9, 2014 at 10:21 AM, Christopher Kulla <ckulla at gmail.com> wrote:
> Hi all,
>
> I posted this to llvm-dev but didn't get any response, I'm re-trying
> here in case it is related to the clang driver somehow.
>
> The following program does not link correctly when using LTO:
>
> "clang -flto -msse4.1 test.c"
>
> #include <smmintrin.h>
>
> int main() {
>     __m128i a = _mm_set1_epi32(2);
>     __m128i b = _mm_set1_epi32(1);
>     __m128i c = _mm_min_epi32(a, b); // or _mm_max_epi32
>     return c[0] == 0; // just so c doesn't opt away
> }
>
> It works fine without "-flto".
>
> I've reproduced this using 3.4.2 as well as 3.5 (from trunk) on both
> Linux and OS X.
>
> Am I missing some flags to tell the linker to enable sse4.1? Or is
> there a bug here?
>
> Any pointers are appreciated! Thank you!
>
> -Chris



More information about the cfe-dev mailing list