[llvm] [RISC-V][GISEL] Select G_BITCAST for scalable vectors (PR #101486)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 13:53:33 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 81c3499531c3fe03827bd8bc890e3a16db9e4c3c 907dbb3d9c8dc28590abdf1ff9a808ea64789fae --extensions cpp -- llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp b/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
index 1b55d03947..dc152f372c 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
@@ -792,18 +792,21 @@ void RISCVInstructionSelector::preISelLower(MachineInstr &MI,
     Register DstReg = MI.getOperand(0).getReg();
     const LLT DstTy = MRI.getType(DstReg);
     if (!(DstTy.isVector() && DstTy.getElementType().isPointer()))
-        break;
+      break;
     const LLT sXLen = LLT::scalar(STI.getXLen());
-    MRI.setType(DstReg, LLT::scalable_vector(DstTy.getElementCount().getKnownMinValue(), sXLen));
+    MRI.setType(DstReg, LLT::scalable_vector(
+                            DstTy.getElementCount().getKnownMinValue(), sXLen));
     break;
   }
   case TargetOpcode::G_STORE: {
     MachineOperand &SrcOp = MI.getOperand(0);
     const LLT SrcTy = MRI.getType(SrcOp.getReg());
     if (!(SrcTy.isVector() && SrcTy.getElementType().isPointer()))
-        break;
+      break;
     const LLT sXLen = LLT::scalar(STI.getXLen());
-    auto Copy = MIB.buildCopy(LLT::scalable_vector(SrcTy.getElementCount().getKnownMinValue(), sXLen), SrcOp);
+    auto Copy = MIB.buildCopy(
+        LLT::scalable_vector(SrcTy.getElementCount().getKnownMinValue(), sXLen),
+        SrcOp);
     Register NewSrc = Copy.getReg(0);
     SrcOp.setReg(NewSrc);
   }

``````````

</details>


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


More information about the llvm-commits mailing list