-
Notifications
You must be signed in to change notification settings - Fork 15.2k
DAG: Use poison for some load/store offsets in legalizer #167756
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
Open
arsenm
wants to merge
4
commits into
main
Choose a base branch
from
users/arsenm/dag/legalizer-use-poison-load-store-offsets
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
DAG: Use poison for some load/store offsets in legalizer #167756
arsenm
wants to merge
4
commits into
main
from
users/arsenm/dag/legalizer-use-poison-load-store-offsets
+14
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Nov 12, 2025
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Member
|
@llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-backend-risc-v Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/167756.diff 1 Files Affected:
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 417122d467054..ff3511726ea07 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -3344,7 +3344,7 @@ void DAGTypeLegalizer::SplitVecRes_VP_REVERSE(SDNode *N, SDValue &Lo,
SDValue TrueMask = DAG.getBoolConstant(true, DL, Mask.getValueType(), VT);
SDValue Store = DAG.getStridedStoreVP(DAG.getEntryNode(), DL, Val, StorePtr,
- DAG.getUNDEF(PtrVT), Stride, TrueMask,
+ DAG.getPOISON(PtrVT), Stride, TrueMask,
EVL, MemVT, StoreMMO, ISD::UNINDEXED);
SDValue Load = DAG.getLoadVP(VT, DL, Store, StackPtr, Mask, EVL, LoadMMO);
@@ -3387,14 +3387,16 @@ void DAGTypeLegalizer::SplitVecRes_VP_SPLICE(SDNode *N, SDValue &Lo,
SDValue StackPtr2 = TLI.getVectorElementPointer(DAG, StackPtr, VT, EVL1);
+ SDValue PoisonPtr = DAG.getPOISON(PtrVT);
+
SDValue TrueMask = DAG.getBoolConstant(true, DL, Mask.getValueType(), VT);
- SDValue StoreV1 = DAG.getStoreVP(DAG.getEntryNode(), DL, V1, StackPtr,
- DAG.getUNDEF(PtrVT), TrueMask, EVL1,
- V1.getValueType(), StoreMMO, ISD::UNINDEXED);
+ SDValue StoreV1 =
+ DAG.getStoreVP(DAG.getEntryNode(), DL, V1, StackPtr, PoisonPtr, TrueMask,
+ EVL1, V1.getValueType(), StoreMMO, ISD::UNINDEXED);
SDValue StoreV2 =
- DAG.getStoreVP(StoreV1, DL, V2, StackPtr2, DAG.getUNDEF(PtrVT), TrueMask,
- EVL2, V2.getValueType(), StoreMMO, ISD::UNINDEXED);
+ DAG.getStoreVP(StoreV1, DL, V2, StackPtr2, PoisonPtr, TrueMask, EVL2,
+ V2.getValueType(), StoreMMO, ISD::UNINDEXED);
SDValue Load;
if (Imm >= 0) {
|
2a9f464 to
ca207de
Compare
ca207de to
894713d
Compare
RKSimon
approved these changes
Nov 14, 2025
Base automatically changed from
users/arsenm/dag/use-poison-split-vec-res-vp-load-ff
to
main
November 15, 2025 16:48
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

No description provided.