[X86][MCU] Minor bug fix for r293469 + test case
llvm-svn: 293478
This commit is contained in:
parent
e81adb52b1
commit
e11d2d73bf
|
|
@ -17395,7 +17395,7 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
|
|||
DAG.getNode(ISD::ANY_EXTEND, DL, VT, CmpOp0.getOperand(0)),
|
||||
DAG.getConstant(1, DL, VT));
|
||||
else
|
||||
Neg = Cmp;
|
||||
Neg = CmpOp0;
|
||||
SDValue Mask = DAG.getNode(ISD::SUB, DL, VT, DAG.getConstant(0, DL, VT),
|
||||
Neg); // -(and (x, 0x1))
|
||||
SDValue And = DAG.getNode(ISD::AND, DL, VT, Mask, Src1); // Mask & z
|
||||
|
|
|
|||
|
|
@ -678,3 +678,17 @@ entry:
|
|||
%1 = select i1 %cmp10, i32 %A, i32 %0
|
||||
ret i32 %1
|
||||
}
|
||||
|
||||
define i32 @select_or_1(i32 %A, i32 %B, i32 %cond) {
|
||||
; CHECK-LABEL: select_or_1:
|
||||
; MCU: andl $1, %ecx
|
||||
; MCU-NEXT: negl %ecx
|
||||
; MCU-NEXT: andl %edx, %ecx
|
||||
; MCU-NEXT: orl %ecx, %eax
|
||||
entry:
|
||||
%and = and i32 %cond, 1
|
||||
%cmp10 = icmp eq i32 %and, 0
|
||||
%0 = or i32 %B, %A
|
||||
%1 = select i1 %cmp10, i32 %A, i32 %0
|
||||
ret i32 %1
|
||||
}
|
||||
Loading…
Reference in New Issue