[llvm] [IndVars] Preserve flags of narrow IV inc if replacing with wider inc. (PR #80446)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 2 07:39:13 PST 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 275729ae06d568e9589392c142a416fb8c2bb1a8 f0a1a50a31901f11b286cae3bfe5d3a39c7ad098 -- llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index 9cea161402..27449486a7 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -1978,7 +1978,8 @@ PHINode *WidenIV::createWideIV(SCEVExpander &Rewriter) {
// should not wrap either. Set the flags to be the union of both wide
// increment and original increment; this ensures we preserve flags SCEV
// could infer for the wider increment.
- const SCEV *TruncInc = SE->getTruncateOrNoop(WideIncExpr, OrigInc->getType());
+ const SCEV *TruncInc =
+ SE->getTruncateOrNoop(WideIncExpr, OrigInc->getType());
if (SE->getSCEV(OrigInc) == TruncInc &&
isa<OverflowingBinaryOperator>(OrigInc) &&
isa<OverflowingBinaryOperator>(WideInc)) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/80446
More information about the llvm-commits
mailing list