[llvm] r337043 - [X86] Try fixing r336768

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 13 13:54:24 PDT 2018


Author: maskray
Date: Fri Jul 13 13:54:24 2018
New Revision: 337043

URL: http://llvm.org/viewvc/llvm-project?rev=337043&view=rev
Log:
[X86] Try fixing r336768

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/test/CodeGen/X86/dagcombine-select.ll

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=337043&r1=337042&r2=337043&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jul 13 13:54:24 2018
@@ -33462,7 +33462,7 @@ static SDValue combineCMov(SDNode *N, Se
       if (AddOp1 && (AddOp2.getOpcode() == ISD::CTTZ_ZERO_UNDEF ||
                      AddOp2.getOpcode() == ISD::CTTZ)) {
         APInt Diff = Cnst->getAPIntValue() - AddOp1->getAPIntValue();
-        if (CC == X86::COND_NE) {
+        if (CC == X86::COND_E) {
           Add = DAG.getNode(X86ISD::CMOV, DL, Add.getValueType(), AddOp2,
                             DAG.getConstant(Diff, DL, Add.getValueType()),
                             DAG.getConstant(CC, DL, MVT::i8), Cond);

Modified: llvm/trunk/test/CodeGen/X86/dagcombine-select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dagcombine-select.ll?rev=337043&r1=337042&r2=337043&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/dagcombine-select.ll (original)
+++ llvm/trunk/test/CodeGen/X86/dagcombine-select.ll Fri Jul 13 13:54:24 2018
@@ -287,7 +287,7 @@ define i64 @cttz_64_eq_select(i64 %v) no
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    bsfq %rdi, %rcx
 ; CHECK-NEXT:    movq $-1, %rax
-; CHECK-NEXT:    cmoveq %rcx, %rax
+; CHECK-NEXT:    cmovneq %rcx, %rax
 ; CHECK-NEXT:    addq $6, %rax
 ; CHECK-NEXT:    retq
 
@@ -295,7 +295,7 @@ define i64 @cttz_64_eq_select(i64 %v) no
 ; BMI:       # %bb.0:
 ; BMI-NEXT:    tzcntq %rdi, %rcx
 ; BMI-NEXT:    movq $-1, %rax
-; BMI-NEXT:    cmovbq %rcx, %rax
+; BMI-NEXT:    cmovaeq %rcx, %rax
 ; BMI-NEXT:    addq $6, %rax
 ; BMI-NEXT:    retq
   %cnt = tail call i64 @llvm.cttz.i64(i64 %v, i1 true)
@@ -310,7 +310,7 @@ define i64 @cttz_64_ne_select(i64 %v) no
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    bsfq %rdi, %rcx
 ; CHECK-NEXT:    movq $-1, %rax
-; CHECK-NEXT:    cmoveq %rcx, %rax
+; CHECK-NEXT:    cmovneq %rcx, %rax
 ; CHECK-NEXT:    addq $6, %rax
 ; CHECK-NEXT:    retq
 
@@ -318,7 +318,7 @@ define i64 @cttz_64_ne_select(i64 %v) no
 ; BMI:       # %bb.0:
 ; BMI-NEXT:    tzcntq %rdi, %rcx
 ; BMI-NEXT:    movq $-1, %rax
-; BMI-NEXT:    cmovbq %rcx, %rax
+; BMI-NEXT:    cmovaeq %rcx, %rax
 ; BMI-NEXT:    addq $6, %rax
 ; BMI-NEXT:    retq
   %cnt = tail call i64 @llvm.cttz.i64(i64 %v, i1 true)
@@ -334,7 +334,7 @@ define i32 @cttz_32_eq_select(i32 %v) no
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    bsfl %edi, %ecx
 ; CHECK-NEXT:    movl $-1, %eax
-; CHECK-NEXT:    cmovel %ecx, %eax
+; CHECK-NEXT:    cmovnel %ecx, %eax
 ; CHECK-NEXT:    addl $6, %eax
 ; CHECK-NEXT:    retq
 
@@ -342,7 +342,7 @@ define i32 @cttz_32_eq_select(i32 %v) no
 ; BMI:       # %bb.0:
 ; BMI-NEXT:    tzcntl %edi, %ecx
 ; BMI-NEXT:    movl $-1, %eax
-; BMI-NEXT:    cmovbl %ecx, %eax
+; BMI-NEXT:    cmovael %ecx, %eax
 ; BMI-NEXT:    addl $6, %eax
 ; BMI-NEXT:    retq
   %cnt = tail call i32 @llvm.cttz.i32(i32 %v, i1 true)
@@ -357,7 +357,7 @@ define i32 @cttz_32_ne_select(i32 %v) no
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    bsfl %edi, %ecx
 ; CHECK-NEXT:    movl $-1, %eax
-; CHECK-NEXT:    cmovel %ecx, %eax
+; CHECK-NEXT:    cmovnel %ecx, %eax
 ; CHECK-NEXT:    addl $6, %eax
 ; CHECK-NEXT:    retq
 
@@ -365,7 +365,7 @@ define i32 @cttz_32_ne_select(i32 %v) no
 ; BMI:       # %bb.0:
 ; BMI-NEXT:    tzcntl %edi, %ecx
 ; BMI-NEXT:    movl $-1, %eax
-; BMI-NEXT:    cmovbl %ecx, %eax
+; BMI-NEXT:    cmovael %ecx, %eax
 ; BMI-NEXT:    addl $6, %eax
 ; BMI-NEXT:    retq
   %cnt = tail call i32 @llvm.cttz.i32(i32 %v, i1 true)




More information about the llvm-commits mailing list