[llvm] [SeparateConstOffsetFromGEP] Reorder trivial GEP chains to separate constants (PR #73056)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 10:05:59 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 8ea7f1d20ad8ab8c381800eefda948d85c6860cc d7feea7d2b5e9e41c48ada4a01b801f61ec3d0db -- llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
index 5e5d48b968..b5b171c7dc 100644
--- a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
+++ b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
@@ -973,7 +973,8 @@ bool SeparateConstOffsetFromGEP::reorderGEP(GetElementPtrInst *GEP,
TargetTransformInfo &TTI) {
Type *GEPType = GEP->getResultElementType();
// TODO: support reordering for non-trivial GEP chains
- if (GEPType->isAggregateType() || GEP->getNumIndices() != 1 || GEP->isInBounds())
+ if (GEPType->isAggregateType() || GEP->getNumIndices() != 1 ||
+ GEP->isInBounds())
return false;
auto PtrGEP = dyn_cast<GetElementPtrInst>(GEP->getPointerOperand());
``````````
</details>
https://github.com/llvm/llvm-project/pull/73056
More information about the llvm-commits
mailing list