[llvm] [Xtensa] Implement support for the BranchRelaxation. (PR #113450)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 23 05:41:48 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 9b88792291c6441aae7c66c046a9460984ddc7d2 77d3f45e0ac3bd42ac36c2ee4c0b536ed0c9c60a --extensions h,cpp -- llvm/lib/Target/Xtensa/XtensaMachineFunctionInfo.h llvm/lib/Target/Xtensa/XtensaAsmPrinter.cpp llvm/lib/Target/Xtensa/XtensaFrameLowering.cpp llvm/lib/Target/Xtensa/XtensaInstrInfo.cpp llvm/lib/Target/Xtensa/XtensaInstrInfo.h llvm/lib/Target/Xtensa/XtensaRegisterInfo.h llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp llvm/lib/Target/Xtensa/XtensaTargetMachine.h
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/Xtensa/XtensaFrameLowering.cpp b/llvm/lib/Target/Xtensa/XtensaFrameLowering.cpp
index ee94ffdb22..ccdda31fa6 100644
--- a/llvm/lib/Target/Xtensa/XtensaFrameLowering.cpp
+++ b/llvm/lib/Target/Xtensa/XtensaFrameLowering.cpp
@@ -290,7 +290,8 @@ void XtensaFrameLowering::processFunctionBeforeFrameFinalized(
     int FI = MFI.CreateStackObject(Size, Alignment, false);
     RS->addScavengingFrameIndex(FI);
 
-    if (IsLargeFunction && XtensaFI->getBranchRelaxationScratchFrameIndex() == -1)
+    if (IsLargeFunction &&
+        XtensaFI->getBranchRelaxationScratchFrameIndex() == -1)
       XtensaFI->setBranchRelaxationScratchFrameIndex(FI);
   }
 }
diff --git a/llvm/lib/Target/Xtensa/XtensaInstrInfo.cpp b/llvm/lib/Target/Xtensa/XtensaInstrInfo.cpp
index 568739f09c..545467c527 100644
--- a/llvm/lib/Target/Xtensa/XtensaInstrInfo.cpp
+++ b/llvm/lib/Target/Xtensa/XtensaInstrInfo.cpp
@@ -507,14 +507,14 @@ void XtensaInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB,
     storeRegToStackSlot(MBB, L32R, ScavRegister, /*IsKill=*/true, FrameIndex,
                         &Xtensa::ARRegClass, &RI, Register());
     RI.eliminateFrameIndex(std::prev(L32R.getIterator()),
-                             /*SpAdj=*/0, /*FIOperandNum=*/1);
+                           /*SpAdj=*/0, /*FIOperandNum=*/1);
 
     L32R.getOperand(1).setMBB(&RestoreBB);
 
     loadRegFromStackSlot(RestoreBB, RestoreBB.end(), ScavRegister, FrameIndex,
                          &Xtensa::ARRegClass, &RI, Register());
     RI.eliminateFrameIndex(RestoreBB.back(),
-                             /*SpAdj=*/0, /*FIOperandNum=*/1);
+                           /*SpAdj=*/0, /*FIOperandNum=*/1);
   }
 
   MRI.replaceRegWith(ScratchReg, ScavRegister);
diff --git a/llvm/lib/Target/Xtensa/XtensaMachineFunctionInfo.h b/llvm/lib/Target/Xtensa/XtensaMachineFunctionInfo.h
index 7c7034387a..c38c060b93 100644
--- a/llvm/lib/Target/Xtensa/XtensaMachineFunctionInfo.h
+++ b/llvm/lib/Target/Xtensa/XtensaMachineFunctionInfo.h
@@ -27,7 +27,7 @@ class XtensaMachineFunctionInfo : public MachineFunctionInfo {
 
 public:
   explicit XtensaMachineFunctionInfo(const Function &F,
-                              const TargetSubtargetInfo *STI) {}
+                                     const TargetSubtargetInfo *STI) {}
 
   int getBranchRelaxationScratchFrameIndex() const {
     return BranchRelaxationScratchFrameIndex;
diff --git a/llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp b/llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp
index 9d05489202..8bbb2156e2 100644
--- a/llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp
+++ b/llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp
@@ -12,9 +12,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "XtensaMachineFunctionInfo.h"
 #include "XtensaTargetMachine.h"
 #include "TargetInfo/XtensaTargetInfo.h"
+#include "XtensaMachineFunctionInfo.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
 #include "llvm/CodeGen/TargetPassConfig.h"

``````````

</details>


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


More information about the llvm-commits mailing list