Skip to content
  • Chris Lattner's avatar
    Teach X86ISelLowering that the second result of X86ISD::UMUL is a flags · 68861717
    Chris Lattner authored
    result.  This allows us to compile:
    
    void *test12(long count) {
          return new int[count];
    }
    
    into:
    
    test12:
    	movl	$4, %ecx
    	movq	%rdi, %rax
    	mulq	%rcx
    	movq	$-1, %rdi
    	cmovnoq	%rax, %rdi
    	jmp	__Znam                  ## TAILCALL
    
    instead of:
    
    test12:
    	movl	$4, %ecx
    	movq	%rdi, %rax
    	mulq	%rcx
    	seto	%cl
    	testb	%cl, %cl
    	movq	$-1, %rdi
    	cmoveq	%rax, %rdi
    	jmp	__Znam
    
    Of course it would be even better if the regalloc inverted the cmov to 'cmovoq',
    which would eliminate the need for the 'movq %rdi, %rax'.
    
    llvm-svn: 120936
    68861717
Loading