Skip to content

Commit aa2e1c7

Browse files
committed
[DAGCombiner] Remove hasOneUse check from sext+sext_inreg to sext_inreg combine
The hasOneUseCheck does not really add anything and makes the combine too restrictive. Upcoming patches benefit from removing the hasOneUse check.
1 parent 4eec26b commit aa2e1c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14101,7 +14101,7 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
1410114101
}
1410214102

1410314103
// If the trunc wasn't legal, try to fold to (sext_inreg (anyext x))
14104-
if ((!LegalTypes || TLI.isTypeLegal(VT)) && N0.hasOneUse()) {
14104+
if (!LegalTypes || TLI.isTypeLegal(VT)) {
1410514105
SDValue ExtSrc = DAG.getAnyExtOrTrunc(N00, DL, VT);
1410614106
return DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, VT, ExtSrc,
1410714107
N0->getOperand(1));

0 commit comments

Comments
 (0)