[llvm-commits] [PATCH] Fix sext(setcc()) => setcc()

James Benton jbenton at vmware.com
Fri Jul 6 07:01:41 PDT 2012


On 05/07/12 17:54, Anton Korobeynikov wrote:
>> http://bb.pgr.jp/builders/cmake-clang-i686-msvc10/builds/1063/steps/test_llvm/logs/LLVM%20%3A%3A%20CodeGen___X86___sext-setcc-self.ll
> I believe this is due to different vector calling convention on
> windows. Most probably test will need to test wrt explicit target
> triple.
>
When testing myself with -march=x86 on mingw it was generating the 
standard ebp/esp stack setup around the pcmp/xor which was breaking the 
CHECK-NEXT:

         pushl   %ebp
Ltmp17:
         .cfi_def_cfa_offset 8
Ltmp18:
         .cfi_offset %ebp, -8
         movl    %esp, %ebp
Ltmp19:
         .cfi_def_cfa_register %ebp
         xorps   %xmm0, %xmm0
         popl    %ebp
         ret

Simple trivial fix was to speciy x86-64 -march=x86-64, this caused llvm 
to no longer generate the ebp/esp stack and adheres with usage in 
similar tests such as test/CodeGen/X86/sse-minmax.ll. I also added 
-asm-verbose=false like sse-minmax.ll as we only really want to see the 
assembly, not the comments.

This resulted in the correct output:

         xorps   %xmm0, %xmm0
         ret

Was odd that llvm generated the ebp/esp thing when neither were utilised 
in the function, is that intended behaviour?

-------------- next part --------------
Index: test/CodeGen/X86/sext-setcc-self.ll
===================================================================
--- test/CodeGen/X86/sext-setcc-self.ll	(revision 159822)
+++ test/CodeGen/X86/sext-setcc-self.ll	(working copy)
@@ -1,9 +1,5 @@
-; RUN: llc -march=x86 -mcpu=nehalem < %s | FileCheck %s
+; RUN: llc -march=x86-64 -mcpu=nehalem -asm-verbose=false < %s | FileCheck %s
 
-; FIXME: The failure cannot be reproduced with, ... why?
-; llc -mtriple=i686-win32 -mcpu=nehalem
-; XFAIL: cygwin,mingw32,win32
-
 define <4 x i32> @test_ueq(<4 x float> %in) {
 entry:
   ; CHECK: pcmpeqd %xmm0, %xmm0


More information about the llvm-commits mailing list