[llvm] [clang] [clang-tools-extra] Dont alter cold function alignment unless using Os (PR #72387)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 05:49:25 PST 2023


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 2060bfcdc7eb704647c64bf925cdceb94c1f535f effbfe02b71638fe49dfc09423663f9077c4cc41 -- clang/test/CodeGen/cold-align.cpp clang/lib/CodeGen/CodeGenModule.cpp llvm/lib/CodeGen/MachineFunction.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index ab5392a05f..9303ca787e 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -215,7 +215,7 @@ void MachineFunction::init() {
   // FIXME: Shouldn't use pref alignment if explicit alignment is set on F.
   // FIXME: Use Function::hasOptSize().
   if ((!F.hasFnAttribute(Attribute::OptimizeForSize)) ||
-     (F.getFnAttribute("keepalign").getValueAsBool()))
+      (F.getFnAttribute("keepalign").getValueAsBool()))
     Alignment = std::max(Alignment,
                          STI->getTargetLowering()->getPrefFunctionAlignment());
 

``````````

</details>


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


More information about the cfe-commits mailing list