[llvm] [AArch64] Lower factor-of-2 interleaved stores to STNP (PR #177938)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 26 04:14:01 PST 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,h -- llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/Analysis/TargetTransformInfoImpl.h llvm/include/llvm/CodeGen/BasicTTIImpl.h llvm/include/llvm/CodeGen/TargetLowering.h llvm/lib/Analysis/TargetTransformInfo.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.cpp llvm/lib/Target/AArch64/AArch64ISelLowering.h llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h llvm/lib/Target/X86/X86ISelLowering.cpp llvm/lib/Target/X86/X86ISelLowering.h llvm/lib/Target/X86/X86TargetTransformInfo.cpp llvm/lib/Target/X86/X86TargetTransformInfo.h llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.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/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 11da0f11e..d3d657a8d 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -3004,7 +3004,8 @@ public:
   }
 
   /// Return true if the target supports nontemporal store.
-  virtual bool isLegalNTStore(Type *DataType, Align Alignment, const DataLayout &DL) const {
+  virtual bool isLegalNTStore(Type *DataType, Align Alignment,
+                              const DataLayout &DL) const {
     // By default, assume nontemporal memory stores are available for stores
     // that are aligned and have a size that is a power of 2.
     unsigned DataSize = DL.getTypeStoreSize(DataType);
@@ -3012,7 +3013,8 @@ public:
   }
 
   /// Return true if the target supports nontemporal load.
-  virtual bool isLegalNTLoad(Type *DataType, Align Alignment, const DataLayout &DL) const {
+  virtual bool isLegalNTLoad(Type *DataType, Align Alignment,
+                             const DataLayout &DL) const {
     // By default, assume nontemporal memory loads are available for loads that
     // are aligned and have a size that is a power of 2.
     unsigned DataSize = DL.getTypeStoreSize(DataType);
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 736910480..ef1a1b73f 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -491,12 +491,12 @@ bool TargetTransformInfo::isLegalMaskedLoad(Type *DataType, Align Alignment,
 }
 
 bool TargetTransformInfo::shouldVectorizeNTStore(Type *DataType,
-                                                       Align Alignment) const {
+                                                 Align Alignment) const {
   return TTIImpl->shouldVectorizeNTStore(DataType, Alignment);
 }
 
 bool TargetTransformInfo::shouldVectorizeNTLoad(Type *DataType,
-                                                      Align Alignment) const {
+                                                Align Alignment) const {
   return TTIImpl->shouldVectorizeNTLoad(DataType, Alignment);
 }
 
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index d9f2f510e..fa0425d79 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -36053,18 +36053,20 @@ bool X86TargetLowering::isLegalStoreImmediate(int64_t Imm) const {
   return isInt<32>(Imm);
 }
 
-bool X86TTIImpl::isLegalNTLoad(Type *DataType, Align Alignment, const DataLayout &DL) const {
+bool X86TTIImpl::isLegalNTLoad(Type *DataType, Align Alignment,
+                               const DataLayout &DL) const {
   unsigned DataSize = DL.getTypeStoreSize(DataType);
   // The only supported nontemporal loads are for aligned vectors of 16 or 32
   // bytes.  Note that 32-byte nontemporal vector loads are supported by AVX2
   // (the equivalent stores only require AVX).
   if (Alignment >= DataSize && (DataSize == 16 || DataSize == 32))
-    return DataSize == 16 ?  ST->hasSSE1() : ST->hasAVX2();
+    return DataSize == 16 ? ST->hasSSE1() : ST->hasAVX2();
 
   return false;
 }
 
-bool X86TTIImpl::isLegalNTStore(Type *DataType, Align Alignment, const DataLayout &DL) const {
+bool X86TTIImpl::isLegalNTStore(Type *DataType, Align Alignment,
+                                const DataLayout &DL) const {
   unsigned DataSize = DL.getTypeStoreSize(DataType);
 
   // SSE4A supports nontemporal stores of float and double at arbitrary
diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h
index ce77673e7..17c424add 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.h
+++ b/llvm/lib/Target/X86/X86ISelLowering.h
@@ -1456,8 +1456,10 @@ namespace llvm {
 
     bool isLegalStoreImmediate(int64_t Imm) const override;
 
-    bool isLegalNTLoad(Type *DataType, Align Alignment, const DataLayout &DL) const override;
-    bool isLegalNTStore(Type *DataType, Align Alignment, const DataLayout &DL) const override;
+    bool isLegalNTLoad(Type *DataType, Align Alignment,
+                       const DataLayout &DL) const override;
+    bool isLegalNTStore(Type *DataType, Align Alignment,
+                        const DataLayout &DL) const override;
 
     /// Add x86-specific opcodes to the default list.
     bool isBinOp(unsigned Opcode) const override;

``````````

</details>


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


More information about the llvm-commits mailing list