[llvm] [DAGCombiner] `visitSIGN_EXTEND_INREG` - fold `(sext_inreg (freeze (extload x)))` -> `(freeze (sextload x))` (PR #226208)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 02:04:44 PDT 2026


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 origin/main HEAD --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 94b41c293..a6a805079 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -17543,7 +17543,8 @@ SDValue DAGCombiner::visitSIGN_EXTEND_INREG(SDNode *N) {
   }
 
   // fold (sext_inreg (masked_load x)) -> (sext_masked_load x)
-  if (auto *Ld = dyn_cast<MaskedLoadSDNode>(Frozen && N0.hasOneUse() ? N0.getOperand(0) : N0)) {
+  if (auto *Ld = dyn_cast<MaskedLoadSDNode>(
+          Frozen && N0.hasOneUse() ? N0.getOperand(0) : N0)) {
     if (ExtVT == Ld->getMemoryVT() && Ld->hasNUsesOfValue(1, 0) &&
         Ld->getExtensionType() != ISD::LoadExtType::NON_EXTLOAD &&
         TLI.isLoadLegal(VT, ExtVT, Ld->getAlign(), Ld->getAddressSpace(),

``````````

</details>


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


More information about the llvm-commits mailing list