[llvm] [DAG][RISCV] Use vp.<binop> when widening illegal types for binops which can trap (PR #105214)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 11:28:16 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff aaba552f51e1a96f829afa8b422ca8d7ace55781 073c512cd4c52c866423de01ffed2088685f781c --extensions h,cpp -- llvm/include/llvm/CodeGen/ISDOpcodes.h llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp llvm/lib/CodeGen/SelectionDAG/MatchContext.h llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 39d9e550b9..6c47f47376 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -4857,9 +4857,11 @@ SDValue DAGTypeLegalizer::WidenVecRes_BinaryCanTrap(SDNode *N) {
SDValue InOp1 = GetWidenedVector(N->getOperand(0));
SDValue InOp2 = GetWidenedVector(N->getOperand(1));
SDValue Mask = DAG.getAllOnesConstant(dl, WideMaskVT);
- SDValue EVL = DAG.getElementCount(dl, TLI.getVPExplicitVectorLengthTy(),
- N->getValueType(0).getVectorElementCount());
- return DAG.getNode(*VPOpcode, dl, WidenVT, InOp1, InOp2, Mask, EVL, Flags);
+ SDValue EVL =
+ DAG.getElementCount(dl, TLI.getVPExplicitVectorLengthTy(),
+ N->getValueType(0).getVectorElementCount());
+ return DAG.getNode(*VPOpcode, dl, WidenVT, InOp1, InOp2, Mask, EVL,
+ Flags);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/105214
More information about the llvm-commits
mailing list