[llvm] [AArch64] Fix hasNearbyPairedStore to handle non-inbounds GEPs (PR #199137)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 21 22:54:19 PDT 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 -- llvm/lib/Target/AArch64/AArch64ISelLowering.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/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 97efc3a14..084ba27d1 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -18780,7 +18780,7 @@ bool hasNearbyPairedStore(Iter It, Iter End, Value *Ptr, const DataLayout &DL) {
APInt OffsetA(IdxWidth, 0), OffsetB(IdxWidth, 0);
const Value *PtrA1 =
Ptr->stripAndAccumulateConstantOffsets(DL, OffsetA,
- /*AllowNonInbounds=*/ true);
+ /*AllowNonInbounds=*/true);
while (++It != End) {
if (It->isDebugOrPseudoInst())
@@ -18790,7 +18790,7 @@ bool hasNearbyPairedStore(Iter It, Iter End, Value *Ptr, const DataLayout &DL) {
if (const auto *SI = dyn_cast<StoreInst>(&*It)) {
const Value *PtrB1 =
SI->getPointerOperand()->stripAndAccumulateConstantOffsets(
- DL, OffsetB, /*AllowNonInbounds=*/ true);
+ DL, OffsetB, /*AllowNonInbounds=*/true);
if (PtrA1 == PtrB1 &&
(OffsetA.sextOrTrunc(IdxWidth) - OffsetB.sextOrTrunc(IdxWidth))
.abs() == 16)
``````````
</details>
https://github.com/llvm/llvm-project/pull/199137
More information about the llvm-commits
mailing list