[llvm] [EarlyCSE] Rematerialize alignment assumption. (PR #109131)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 19 11:49:46 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 8242bd116d547cbebe0102cda1c4421ee4865407 b4f54c4b9451fb54a1a3037b754009d414ef2501 --extensions cpp -- llvm/lib/Transforms/Scalar/EarlyCSE.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
index da66ed49eb..743b333987 100644
--- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
+++ b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
@@ -1590,7 +1590,9 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
if (auto *I = dyn_cast<Instruction>(Op))
combineMetadataForCSE(I, &Inst, false);
- // If the load has align metadata, preserve it via an alignment assumption. Note that this doesn't use salavageKnowledge, as we need to create the assumption for the value we replaced the load with.
+ // If the load has align metadata, preserve it via an alignment
+ // assumption. Note that this doesn't use salavageKnowledge, as we need
+ // to create the assumption for the value we replaced the load with.
if (auto *AlignMD = Inst.getMetadata(LLVMContext::MD_align)) {
auto *A = mdconst::extract<ConstantInt>(AlignMD->getOperand(0));
if (Op->getPointerAlignment(SQ.DL).value() % A->getZExtValue() != 0) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/109131
More information about the llvm-commits
mailing list