Skip to content

[DAG] canCreateUndefOrPoison - remove isGuaranteedNotToBeUndefOrPoison check for shift nodes #146502

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

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

RKSimon
Copy link
Collaborator

@RKSimon RKSimon commented Jul 1, 2025

No longer necessary now that #146490 has landed - we still have the test coverage from #94145 that covers this.

…n check for shift nodes

No longer necessary now that llvm#146490 has landed - we still have the test coverage from llvm#94145 that covers this.
@RKSimon RKSimon requested a review from nikic July 1, 2025 10:30
@llvmbot llvmbot added the llvm:SelectionDAG SelectionDAGISel as well label Jul 1, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 1, 2025

@llvm/pr-subscribers-llvm-selectiondag

Author: Simon Pilgrim (RKSimon)

Changes

No longer necessary now that #146490 has landed - we still have the test coverage from #94145 that covers this.


Full diff: https://github.com/llvm/llvm-project/pull/146502.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (+1-3)
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index ad941a1964683..4ec6be534e278 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5616,9 +5616,7 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
   case ISD::SRA:
     // If the max shift amount isn't in range, then the shift can
     // create poison.
-    return !isGuaranteedNotToBeUndefOrPoison(Op.getOperand(1), DemandedElts,
-                                             PoisonOnly, Depth + 1) ||
-           !getValidMaximumShiftAmount(Op, DemandedElts, Depth + 1);
+    return !getValidMaximumShiftAmount(Op, DemandedElts, Depth + 1);
 
   case ISD::SCALAR_TO_VECTOR:
     // Check if we demand any upper (undef) elements.

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RKSimon RKSimon merged commit 89fe429 into llvm:main Jul 1, 2025
9 checks passed
@RKSimon RKSimon deleted the dag-nopoison-shift-amount branch July 1, 2025 14:18
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
…n check for shift nodes (llvm#146502)

No longer necessary now that llvm#146490 has landed - we still have the test coverage from llvm#94145 that covers this.
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
…n check for shift nodes (llvm#146502)

No longer necessary now that llvm#146490 has landed - we still have the test coverage from llvm#94145 that covers this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants