[llvm] [InferAddressSpaces] Handle unconverted ptrmask (PR #140802)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 12:05:35 PDT 2025


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,h -- llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/include/llvm/Analysis/TargetTransformInfoImpl.h llvm/lib/Analysis/TargetTransformInfo.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
``````````

: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/Transforms/Scalar/InferAddressSpaces.cpp b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
index 0380ea379..225973ba8 100644
--- a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+++ b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
@@ -687,7 +687,8 @@ Value *InferAddressSpacesImpl::clonePtrMaskWithNewAddressSpace(
   // Note: checking if the mask clears high bits is not sufficient as those
   // might have already been 0 in the old ptr.
   if (NewPtrBits && OldPtrBits->getBitWidth() > NewPtrBits->getBitWidth()) {
-    KnownBits MaskBits = computeKnownBits(MaskOp, *DL, /*AssumptionCache=*/nullptr, I);
+    KnownBits MaskBits =
+        computeKnownBits(MaskOp, *DL, /*AssumptionCache=*/nullptr, I);
     // Set all unknown bits of the old ptr to 1, so that we are conservative in
     // checking which bits are cleared by the mask.
     OldPtrBits->One |= ~OldPtrBits->Zero;

``````````

</details>


https://github.com/llvm/llvm-project/pull/140802


More information about the llvm-commits mailing list