File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -9923,16 +9923,23 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
99239923 // However when after the source operand of SRL is optimized into AND, the SRL
99249924 // itself may not be optimized further. Look for it and add the BRCOND into
99259925 // the worklist.
9926+ //
9927+ // The also tends to happen for binary operations when SimplifyDemandedBits
9928+ // is involved.
9929+ //
9930+ // FIXME: This is unecessary if we process the DAG in topological order,
9931+ // which we plan to do. This workaround can be removed once the DAG is
9932+ // processed in topological order.
99269933 if (N->hasOneUse()) {
99279934 SDNode *Use = *N->use_begin();
9928- if (Use->getOpcode() == ISD::BRCOND)
9929- AddToWorklist(Use);
9930- else if (Use->getOpcode() == ISD::TRUNCATE && Use->hasOneUse()) {
9931- // Also look pass the truncate.
9935+
9936+ // Look pass the truncate.
9937+ if (Use->getOpcode() == ISD::TRUNCATE && Use->hasOneUse())
99329938 Use = *Use->use_begin();
9933- if (Use->getOpcode() == ISD::BRCOND)
9934- AddToWorklist(Use);
9935- }
9939+
9940+ if (Use->getOpcode() == ISD::BRCOND || Use->getOpcode() == ISD::AND ||
9941+ Use->getOpcode() == ISD::OR || Use->getOpcode() == ISD::XOR)
9942+ AddToWorklist(Use);
99369943 }
99379944
99389945 // Try to transform this shift into a multiply-high if
Original file line number Diff line number Diff line change @@ -262,10 +262,9 @@ define i8 @low_bit_select_constants_bigger_true_narrower_result(i16 %x) {
262262define i1 @opaque_constant (i48 %x , i48 %y ) {
263263; X64-LABEL: opaque_constant:
264264; X64: # %bb.0:
265- ; X64-NEXT: movq %rsi , %rax
266- ; X64-NEXT: shrq $32 , %rdi
265+ ; X64-NEXT: movq %rdi , %rax
266+ ; X64-NEXT: xorq %rsi , %rax
267267; X64-NEXT: shrq $32, %rax
268- ; X64-NEXT: xorl %edi, %eax
269268; X64-NEXT: andl $1, %eax
270269; X64-NEXT: # kill: def $al killed $al killed $rax
271270; X64-NEXT: retq
You can’t perform that action at this time.
0 commit comments