Index: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp @@ -3369,6 +3369,10 @@ case X86::BSR32rr: case X86::BSR64rr: return X86::COND_E; + case X86::BLSI32rr: + case X86::BLSI64rr: + return X86::COND_AE; + // TODO: BLSR, BLSMSK, and TBM instructions. } } Index: llvm/trunk/test/CodeGen/X86/bmi.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/bmi.ll +++ llvm/trunk/test/CodeGen/X86/bmi.ll @@ -1240,8 +1240,7 @@ ; X64-LABEL: blsi_cflag_32: ; X64: # %bb.0: ; X64-NEXT: blsil %edi, %eax -; X64-NEXT: testl %edi, %edi -; X64-NEXT: cmovel %esi, %eax +; X64-NEXT: cmovael %esi, %eax ; X64-NEXT: retq %tobool = icmp eq i32 %x, 0 %sub = sub nsw i32 0, %x @@ -1279,8 +1278,7 @@ ; X64-LABEL: blsi_cflag_64: ; X64: # %bb.0: ; X64-NEXT: blsiq %rdi, %rax -; X64-NEXT: testq %rdi, %rdi -; X64-NEXT: cmoveq %rsi, %rax +; X64-NEXT: cmovaeq %rsi, %rax ; X64-NEXT: retq %tobool = icmp eq i64 %x, 0 %sub = sub nsw i64 0, %x