[PATCH] D29587: [DAGCombiner] mulhi + 1 never overflow.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 15:13:02 PST 2017


efriedma added inline comments.


================
Comment at: test/CodeGen/X86/overflow.ll:38
 ; X64:       # BB#0:
-; X64-NEXT:    movq %rdx, %rcx
-; X64-NEXT:    movq %rdi, %rax
-; X64-NEXT:    mulq %rsi
-; X64-NEXT:    andl $1, %ecx
-; X64-NEXT:    addq %rdx, %rcx
-; X64-NEXT:    setb %al
+; X64-NEXT:    xorl %eax, %eax
 ; X64-NEXT:    retq
----------------
deadalnix wrote:
> efriedma wrote:
> > Maybe change this test to return %7 rather than just one bit of the high half of %7, so the code isn't completely dead?  Not really important.
> The code is dead either way, we shift right to get the carry.
I mean make the function return i128, and make the last instruction "ret i128 %7", so we return the 64-bit sum in RAX, and zero in RDX.


https://reviews.llvm.org/D29587





More information about the llvm-commits mailing list