forked from OSchip/llvm-project
[SelectionDAG] simplify select FP with undef condition
llvm-svn: 347212
This commit is contained in:
parent
7a51bdcf3b
commit
a1dca3553e
|
@ -6784,7 +6784,7 @@ SDValue SelectionDAG::simplifySelect(SDValue Cond, SDValue T, SDValue F) {
|
|||
// select, ?, undef, F --> F
|
||||
// select, ?, T, undef --> T
|
||||
if (Cond.isUndef())
|
||||
return isa<ConstantSDNode>(T) ? T : F;
|
||||
return isConstantValueOfAnyType(T) ? T : F;
|
||||
if (T.isUndef())
|
||||
return F;
|
||||
if (F.isUndef())
|
||||
|
|
|
@ -506,6 +506,7 @@ define i64 @opaque_constant(i1 %cond, i64 %x) {
|
|||
define float @select_undef_fp(float %x) {
|
||||
; CHECK-LABEL: select_undef_fp:
|
||||
; CHECK: # %bb.0:
|
||||
; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
|
||||
; CHECK-NEXT: retq
|
||||
%f = select i1 undef, float 4.0, float %x
|
||||
ret float %f
|
||||
|
|
Loading…
Reference in New Issue