[llvm] VectorWiden pass to widen aleady vectorized instrctions (PR #67029)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 8 12:21:43 PDT 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 876334321f842edadcc0cd4241c76b59bb888b9e 1191edc18daf0ad3827f5893c73f6ac23991bbe6 -- llvm/include/llvm/Transforms/Vectorize/VectorWiden.h llvm/lib/Transforms/Vectorize/VectorWiden.cpp llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/Analysis/TargetTransformInfoImpl.h llvm/lib/Analysis/TargetTransformInfo.cpp llvm/lib/Passes/PassBuilder.cpp llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index bbce3189c..2acd0117d 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -1673,8 +1673,7 @@ public:
unsigned getMaxNumArgs() const;
/// \returns Whether vector operations are a good candidate for vector widen.
- bool considerToWiden(LLVMContext &Context,
- ArrayRef<Instruction *> IL) const;
+ bool considerToWiden(LLVMContext &Context, ArrayRef<Instruction *> IL) const;
/// @}
@@ -2046,7 +2045,7 @@ public:
virtual bool hasArmWideBranch(bool Thumb) const = 0;
virtual unsigned getMaxNumArgs() const = 0;
virtual bool considerToWiden(LLVMContext &Context,
- ArrayRef<Instruction *> IL) const = 0;
+ ArrayRef<Instruction *> IL) const = 0;
};
template <typename T>
@@ -2765,7 +2764,7 @@ public:
}
bool considerToWiden(LLVMContext &Context,
- ArrayRef<Instruction *> IL) const override {
+ ArrayRef<Instruction *> IL) const override {
return Impl.considerToWiden(Context, IL);
}
};
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index 6caa3fa6f..5278c9d4d 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -895,8 +895,7 @@ public:
unsigned getMaxNumArgs() const { return UINT_MAX; }
- bool considerToWiden(LLVMContext &Context,
- ArrayRef<Instruction *> IL) const {
+ bool considerToWiden(LLVMContext &Context, ArrayRef<Instruction *> IL) const {
return false;
}
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 93302427e..d01ed739a 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -1248,8 +1248,8 @@ bool TargetTransformInfo::hasActiveVectorLength(unsigned Opcode, Type *DataType,
return TTIImpl->hasActiveVectorLength(Opcode, DataType, Alignment);
}
-bool TargetTransformInfo::considerToWiden(
- LLVMContext &Context, ArrayRef<Instruction *> IL) const {
+bool TargetTransformInfo::considerToWiden(LLVMContext &Context,
+ ArrayRef<Instruction *> IL) const {
return TTIImpl->considerToWiden(Context, IL);
}
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 45c2529f9..8ef983e5d 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -233,8 +233,8 @@
#include "llvm/Transforms/Utils/CanonicalizeAliases.h"
#include "llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h"
#include "llvm/Transforms/Utils/CountVisits.h"
-#include "llvm/Transforms/Utils/Debugify.h"
#include "llvm/Transforms/Utils/DXILUpgrade.h"
+#include "llvm/Transforms/Utils/Debugify.h"
#include "llvm/Transforms/Utils/EntryExitInstrumenter.h"
#include "llvm/Transforms/Utils/FixIrreducible.h"
#include "llvm/Transforms/Utils/HelloWorld.h"
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
index 1da184b48..cecf02ee2 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -2427,12 +2427,11 @@ InstructionCost AArch64TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
}
static const TypeConversionCostTblEntry SME2Tbl[] = {
- { ISD::FP_ROUND, MVT::nxv8f16, MVT::nxv8f32, 1 }
- };
+ {ISD::FP_ROUND, MVT::nxv8f16, MVT::nxv8f32, 1}};
if (ST->hasSME2())
if (const auto *Entry = ConvertCostTableLookup(
- SME2Tbl, ISD, DstTy.getSimpleVT(), SrcTy.getSimpleVT()))
+ SME2Tbl, ISD, DstTy.getSimpleVT(), SrcTy.getSimpleVT()))
return AdjustCost(Entry->Cost);
if (const auto *Entry = ConvertCostTableLookup(ConversionTbl, ISD,
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
index 140dd5014..9afba1ec1 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
@@ -413,8 +413,7 @@ public:
return BaseT::getStoreMinimumVF(VF, ScalarMemTy, ScalarValTy);
}
- bool considerToWiden(LLVMContext &Context,
- ArrayRef<Instruction *> IL) const {
+ bool considerToWiden(LLVMContext &Context, ArrayRef<Instruction *> IL) const {
unsigned Opcode = IL[0]->getOpcode();
Type *Ty = IL[0]->getType();
if (!ST->hasSME2())
diff --git a/llvm/lib/Transforms/Vectorize/VectorWiden.cpp b/llvm/lib/Transforms/Vectorize/VectorWiden.cpp
index 5e20e5793..e8b595656 100644
--- a/llvm/lib/Transforms/Vectorize/VectorWiden.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorWiden.cpp
@@ -14,6 +14,7 @@
//
//==------------------------------------------------------------------------==//
+#include "llvm/Transforms/Vectorize/VectorWiden.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallSet.h"
@@ -35,7 +36,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Utils/CodeMoverUtils.h"
#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/Transforms/Vectorize/VectorWiden.h"
using namespace llvm;
``````````
</details>
https://github.com/llvm/llvm-project/pull/67029
More information about the llvm-commits
mailing list