-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[DAGCombiner] Remove hasOneUse check from sext+sext_inreg to sext_inreg combine #140207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-llvm-selectiondag Author: Pierre van Houtryve (Pierre-vh) ChangesThe hasOneUseCheck does not really add anything and makes the combine too Full diff: https://github.com/llvm/llvm-project/pull/140207.diff 1 Files Affected:
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index d6e288a59b2ee..79949bb6d37a0 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14101,7 +14101,7 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
}
// If the trunc wasn't legal, try to fold to (sext_inreg (anyext x))
- if ((!LegalTypes || TLI.isTypeLegal(VT)) && N0.hasOneUse()) {
+ if (!LegalTypes || TLI.isTypeLegal(VT)) {
SDValue ExtSrc = DAG.getAnyExtOrTrunc(N00, DL, VT);
return DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, VT, ExtSrc,
N0->getOperand(1));
|
@@ -14101,7 +14101,7 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) { | ||
} | ||
|
||
// If the trunc wasn't legal, try to fold to (sext_inreg (anyext x)) | ||
if ((!LegalTypes || TLI.isTypeLegal(VT)) && N0.hasOneUse()) { | ||
if (!LegalTypes || TLI.isTypeLegal(VT)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no test changes, but in the next PR some tests would regress without it, in particular s_test_smed3_i8_pat_0
would have a mix of s_sext_i32_i8
and s_bfe
+ s_sext_i32_i16
chained together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above truncate case also doesn't have the hasOneUse check
Merge activity
|
9ed6224
to
c0fbfb3
Compare
aa2e1c7
to
cd12b2c
Compare
…eg combine The hasOneUseCheck does not really add anything and makes the combine too restrictive. Upcoming patches benefit from removing the hasOneUse check.
cd12b2c
to
bb86037
Compare
The hasOneUseCheck does not really add anything and makes the combine too
restrictive. Upcoming patches benefit from removing the hasOneUse check.