-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[SelectionDAG] Use ZERO_EXTEND_VECTOR_INREG for vectors #92048
Conversation
@llvm/pr-subscribers-llvm-selectiondag Author: AtariDreams (AtariDreams) ChangesFull diff: https://github.com/llvm/llvm-project/pull/92048.diff 1 Files Affected:
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 0aa36deda79dc..2a8794e46e988 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -1508,8 +1508,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_VPFunnelShift(SDNode *N) {
!TLI.isOperationLegalOrCustom(Opcode, VT)) {
SDValue HiShift = DAG.getConstant(OldBits, DL, VT);
Hi = DAG.getNode(ISD::VP_SHL, DL, VT, Hi, HiShift, Mask, EVL);
- // FIXME: Replace it by vp operations.
- Lo = DAG.getZeroExtendInReg(Lo, DL, OldVT);
+ Lo = DAG.getNode(ISD::ZERO_EXTEND_VECTOR_INREG, DL, VT, Lo);
SDValue Res = DAG.getNode(ISD::VP_OR, DL, VT, Hi, Lo, Mask, EVL);
Res = DAG.getNode(IsFSHR ? ISD::VP_LSHR : ISD::VP_SHL, DL, VT, Res, Amt,
Mask, EVL);
|
Needs test |
@@ -1508,8 +1508,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_VPFunnelShift(SDNode *N) { | |||
!TLI.isOperationLegalOrCustom(Opcode, VT)) { | |||
SDValue HiShift = DAG.getConstant(OldBits, DL, VT); | |||
Hi = DAG.getNode(ISD::VP_SHL, DL, VT, Hi, HiShift, Mask, EVL); | |||
// FIXME: Replace it by vp operations. | |||
Lo = DAG.getZeroExtendInReg(Lo, DL, OldVT); | |||
Lo = DAG.getNode(ISD::ZERO_EXTEND_VECTOR_INREG, DL, VT, Lo); |
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.
I don't think this can be correct - we've already extended Lo with GetPromotedInteger above, getZeroExtendInReg is just used to mask the lower bits.
@@ -1508,8 +1508,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_VPFunnelShift(SDNode *N) { | |||
!TLI.isOperationLegalOrCustom(Opcode, VT)) { | |||
SDValue HiShift = DAG.getConstant(OldBits, DL, VT); | |||
Hi = DAG.getNode(ISD::VP_SHL, DL, VT, Hi, HiShift, Mask, EVL); | |||
// FIXME: Replace it by vp operations. | |||
Lo = DAG.getZeroExtendInReg(Lo, DL, OldVT); | |||
Lo = DAG.getNode(ISD::ZERO_EXTEND_VECTOR_INREG, DL, VT, Lo); |
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.
It isn't correct and this isn't a VP instruction so wouldn't address the FIXME. The FIXME was saying we should use ISD::VP_AND instead of ISD::AND
I don't think this code path is exercised. I put an assert(0) in it and nothing failed. |
New test coverage e417e61532ac373e7b0708262dedefcdaf6ced9c |
No description provided.