llvm.org GIT mirror llvm / 1504eb6
[x86] simplify cmov with same true/false operands git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365998 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 7 months ago
2 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
3678236782 X86::CondCode CC = (X86::CondCode)N->getConstantOperandVal(2);
3678336783 SDValue Cond = N->getOperand(3);
3678436784
36785 // cmov X, X, ?, ? --> X
36786 if (TrueOp == FalseOp)
36787 return TrueOp;
36788
3678536789 // Try to simplify the EFLAGS and condition code operands.
3678636790 // We can't always do this as FCMOV only supports a subset of X86 cond.
3678736791 if (SDValue Flags = combineSetCCEFLAGS(Cond, CC, DAG, Subtarget)) {
290290 ;
291291 ; X64-LABEL: PR40483_sub5:
292292 ; X64: # %bb.0:
293 ; X64-NEXT: subl %esi, (%rdi)
293294 ; X64-NEXT: xorl %eax, %eax
294 ; X64-NEXT: subl %esi, (%rdi)
295 ; X64-NEXT: cmovael %eax, %eax
296295 ; X64-NEXT: retq
297296 %3 = load i32, i32* %0, align 8
298297 %4 = tail call { i8, i32 } @llvm.x86.subborrow.32(i8 0, i32 %3, i32 %1)