https://llvm.org/bugs/show_bug.cgi?id=25554
Bug ID: 25554 Summary: [x86, SSE] rematerialized existing constants Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Backend: X86 Assignee: unassignedb...@nondot.org Reporter: spatel+l...@rotateright.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified $ cat bad_vmov.c #include <smmintrin.h> void foo(__m128i v0, __m128i v1, int *ret) { __m128i one0 = _mm_set_epi32(0,0,0,1); __m128i one1 = _mm_set_epi32(0,1,0,0); if ( _mm_testz_si128(v0, one0) ) ret[0] = 10; if ( _mm_testz_si128(v1, one1) ) ret[1] = 20; } Using: ./clang -v clang version 3.8.0 (trunk 253253) Target: x86_64-apple-darwin15.0.0 Thread model: posix $ ./clang -O2 -S -o - bad_vmov.c -fomit-frame-pointer -msse4.1 ... movl $1, %eax movd %rax, %xmm2 ptest %xmm2, %xmm0 jne LBB0_2 movl $10, (%rdi) LBB0_2: movl $1, %eax <--- $1 was already in %eax movd %rax, %xmm0 <--- and %xmm2 already has this value pslldq $8, %xmm0 ptest %xmm0, %xmm1 jne LBB0_4 movl $20, 4(%rdi) LBB0_4: retq -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs