[llvm] [SLP]Improve minbitwidth analysis for shifts. (PR #84356)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 14 16:52:02 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 e4b772444c8176abe30d364e4a946ee6c8ae8de4 f2a13aebba673d1e6e255b3f2c0d9330466380f5 -- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 672fc19499..1da3619555 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -14050,30 +14050,30 @@ bool BoUpSLP::collectValuesToDemote(
}
return true;
};
- auto AttemptCheckBitwidth = [&](function_ref<bool(unsigned, unsigned)> Checker,
- bool &NeedToExit) {
- // Try all bitwidth < OrigBitWidth.
- NeedToExit = false;
- uint32_t OrigBitWidth = DL->getTypeSizeInBits(I->getType());
- unsigned BestFailBitwidth = 0;
- for (; BitWidth < OrigBitWidth; BitWidth *= 2) {
- if (Checker(BitWidth, OrigBitWidth))
- return true;
- if (BestFailBitwidth == 0 && FinalAnalysis())
- BestFailBitwidth = BitWidth;
- }
- if (BitWidth >= OrigBitWidth) {
- if (BestFailBitwidth == 0) {
- BitWidth = OrigBitWidth;
+ auto AttemptCheckBitwidth =
+ [&](function_ref<bool(unsigned, unsigned)> Checker, bool &NeedToExit) {
+ // Try all bitwidth < OrigBitWidth.
+ NeedToExit = false;
+ uint32_t OrigBitWidth = DL->getTypeSizeInBits(I->getType());
+ unsigned BestFailBitwidth = 0;
+ for (; BitWidth < OrigBitWidth; BitWidth *= 2) {
+ if (Checker(BitWidth, OrigBitWidth))
+ return true;
+ if (BestFailBitwidth == 0 && FinalAnalysis())
+ BestFailBitwidth = BitWidth;
+ }
+ if (BitWidth >= OrigBitWidth) {
+ if (BestFailBitwidth == 0) {
+ BitWidth = OrigBitWidth;
+ return false;
+ }
+ MaxDepthLevel = 1;
+ BitWidth = BestFailBitwidth;
+ NeedToExit = true;
+ return true;
+ }
return false;
- }
- MaxDepthLevel = 1;
- BitWidth = BestFailBitwidth;
- NeedToExit = true;
- return true;
- }
- return false;
- };
+ };
bool NeedToExit = false;
switch (I->getOpcode()) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/84356
More information about the llvm-commits
mailing list