Skip to content

Conversation

@makslevental
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Feb 26, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 147d9d6915cd64d9f4b8c752a6f149a7ffb29e3b 3009be0e0ed1de74b84712949d40b282f48659bd --extensions cpp,h -- llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp llvm/lib/CodeGen/GlobalISel/Utils.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h
View the diff from clang-format here.
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
index c88bf44c9b..b81e958ac2 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
@@ -1382,9 +1382,9 @@ public:
   }
 
   MachineInstrBuilder buildInsertVectorElementConstant(const DstOp &Res,
-                                                        const SrcOp &Val,
-                                                        const SrcOp &Elt,
-                                                        const int Idx) {
+                                                       const SrcOp &Val,
+                                                       const SrcOp &Elt,
+                                                       const int Idx) {
     auto TLI = getMF().getSubtarget().getTargetLowering();
     unsigned VecIdxWidth = TLI->getVectorIdxTy(getDataLayout()).getSizeInBits();
     return buildInsertVectorElement(
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index cc67d38308..21f8012ef7 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -126,7 +126,7 @@ LegalizerHelper::legalizeInstrStep(MachineInstr &MI,
     return LI.legalizeIntrinsic(*this, MI) ? Legalized : UnableToLegalize;
   if (isa<GInsertSubvector>(MI))
     return LI.legalizeCustom(*this, MI, LocObserver) ? Legalized
-                                                 : UnableToLegalize;
+                                                     : UnableToLegalize;
   auto Step = LI.getAction(MI, MRI);
   switch (Step.Action) {
   case Legal:
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index 49fb73363a..b5760fcdd3 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -2882,7 +2882,8 @@ bool AMDGPULegalizerInfo::legalizeInsertSubVector(MachineInstr &MI,
       } else {
         Elt = B.buildExtractVectorElementConstant(S32, InsB, I);
       }
-      VecB = B.buildInsertVectorElementConstant(NewVecVT, VecB, Elt, IdxVal / 2 + I);
+      VecB = B.buildInsertVectorElementConstant(NewVecVT, VecB, Elt,
+                                                IdxVal / 2 + I);
     }
     auto R = B.buildBitcast(VecVT, VecB);
     MI.eraseFromParent();
@@ -2891,7 +2892,8 @@ bool AMDGPULegalizerInfo::legalizeInsertSubVector(MachineInstr &MI,
 
   for (unsigned I = 0; I != InsNumElts; ++I) {
     auto Elt = B.buildExtractVectorElementConstant(EltVT, Ins, I);
-    Vec = B.buildInsertVectorElementConstant(VecVT, Vec, Elt, IdxVal + I).getReg(0);
+    Vec = B.buildInsertVectorElementConstant(VecVT, Vec, Elt, IdxVal + I)
+              .getReg(0);
   }
 
   MI.eraseFromParent();

@makslevental makslevental force-pushed the makslevental/g_insert_subvector branch from 91cd376 to 3009be0 Compare February 26, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant