[llvm] Nvptx port LowerBITCAST to SelectionDAG (PR #120903)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 22 08:58:32 PST 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 d486b768238c84b3fea8cb35aaceab1ae5204f92 d7cb1339321d41b6f489450f16ea529eac194889 --extensions h,cpp -- llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp llvm/lib/Target/NVPTX/NVPTXISelLowering.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index b91530d6f0..8f42877bcb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -924,18 +924,19 @@ SDValue DAGTypeLegalizer::LowerBitcast(SDNode *Node) const {
                              Node->getOperand(0), DAG.getIntPtrConstant(0, DL));
   SDValue Vec1 = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, MVT::i8,
                              Node->getOperand(0), DAG.getIntPtrConstant(1, DL));
-  
+
   SDValue Extend0 = DAG.getNode(ISD::ZERO_EXTEND, DL, MVT::i16, Vec0);
   SDValue Extend1 = DAG.getNode(ISD::ZERO_EXTEND, DL, MVT::i16, Vec1);
-  
-  EVT ShiftAmtTy = TLI.getShiftAmountTy(Extend1.getValueType(), DAG.getDataLayout());
+
+  EVT ShiftAmtTy =
+      TLI.getShiftAmountTy(Extend1.getValueType(), DAG.getDataLayout());
   SDValue ShiftConst = DAG.getShiftAmountConstant(8, ShiftAmtTy, DL);
   SDValue AsInt = DAG.getNode(
       ISD::OR, DL, MVT::i16, Extend0,
       DAG.getNode(ISD::SHL, DL, Extend1.getValueType(), Extend1, ShiftConst));
   EVT ToVT = Node->getValueType(0);
-  
-  return DAG.getBitcast( ToVT, AsInt);
+
+  return DAG.getBitcast(ToVT, AsInt);
 }
 
 /// Replace the node's results with custom code provided by the target and

``````````

</details>


https://github.com/llvm/llvm-project/pull/120903


More information about the llvm-commits mailing list