forked from OSchip/llvm-project
[x86] simplify cmov with same true/false operands
llvm-svn: 365998
This commit is contained in:
parent
327db23b66
commit
2097f75eab
|
@ -36783,6 +36783,10 @@ static SDValue combineCMov(SDNode *N, SelectionDAG &DAG,
|
|||
X86::CondCode CC = (X86::CondCode)N->getConstantOperandVal(2);
|
||||
SDValue Cond = N->getOperand(3);
|
||||
|
||||
// cmov X, X, ?, ? --> X
|
||||
if (TrueOp == FalseOp)
|
||||
return TrueOp;
|
||||
|
||||
// Try to simplify the EFLAGS and condition code operands.
|
||||
// We can't always do this as FCMOV only supports a subset of X86 cond.
|
||||
if (SDValue Flags = combineSetCCEFLAGS(Cond, CC, DAG, Subtarget)) {
|
||||
|
|
|
@ -291,9 +291,8 @@ define i32 @PR40483_sub5(i32*, i32) {
|
|||
;
|
||||
; X64-LABEL: PR40483_sub5:
|
||||
; X64: # %bb.0:
|
||||
; X64-NEXT: xorl %eax, %eax
|
||||
; X64-NEXT: subl %esi, (%rdi)
|
||||
; X64-NEXT: cmovael %eax, %eax
|
||||
; X64-NEXT: xorl %eax, %eax
|
||||
; X64-NEXT: retq
|
||||
%3 = load i32, i32* %0, align 8
|
||||
%4 = tail call { i8, i32 } @llvm.x86.subborrow.32(i8 0, i32 %3, i32 %1)
|
||||
|
|
Loading…
Reference in New Issue