[PATCH] D126448: [NFC][LegalizeTypes][VP] Refactor code in SplitRes_Select
WangLian via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 26 00:01:38 PDT 2022
Jimerlife created this revision.
Jimerlife added reviewers: craig.topper, victor-eds, frasercrmck, benshi001.
Jimerlife added a project: LLVM.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
Jimerlife requested review of this revision.
Herald added subscribers: llvm-commits, jacquesguan.
Refactor code in SplitRes_Select
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D126448
Files:
llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
@@ -543,15 +543,15 @@
if (Opcode != ISD::VP_SELECT && Opcode != ISD::VP_MERGE) {
Lo = DAG.getNode(Opcode, dl, LL.getValueType(), CL, LL, RL);
Hi = DAG.getNode(Opcode, dl, LH.getValueType(), CH, LH, RH);
- return;
+ } else {
+ assert((Opcode == ISD::VP_SELECT || Opcode == ISD::VP_MERGE) &&
+ "Expected VP_SELECT Or VP_MERGE Opcode");
+ SDValue EVLLo, EVLHi;
+ std::tie(EVLLo, EVLHi) =
+ DAG.SplitEVL(N->getOperand(3), N->getValueType(0), dl);
+ Lo = DAG.getNode(Opcode, dl, LL.getValueType(), CL, LL, RL, EVLLo);
+ Hi = DAG.getNode(Opcode, dl, LH.getValueType(), CH, LH, RH, EVLHi);
}
-
- SDValue EVLLo, EVLHi;
- std::tie(EVLLo, EVLHi) =
- DAG.SplitEVL(N->getOperand(3), N->getValueType(0), dl);
-
- Lo = DAG.getNode(Opcode, dl, LL.getValueType(), CL, LL, RL, EVLLo);
- Hi = DAG.getNode(Opcode, dl, LH.getValueType(), CH, LH, RH, EVLHi);
}
void DAGTypeLegalizer::SplitRes_SELECT_CC(SDNode *N, SDValue &Lo,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126448.432203.patch
Type: text/x-patch
Size: 1219 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220526/1ceeecf4/attachment.bin>
More information about the llvm-commits
mailing list