[llvm] [Attributor] Fix GEP offsets if multiple bins are present for an allocation. (PR #72029)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 11 18:44:35 PST 2023
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 1eaf926f2c61b4a5cd35cca551246c020a60ad78 29bf4011306c1afd25c6cc6cf215d7581366dffe -- llvm/include/llvm/Transforms/IPO/Attributor.h llvm/lib/Transforms/IPO/AttributorAttributes.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index c12492889..f62728836 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -12790,7 +12790,8 @@ struct AAAllocationInfoImpl : public AAAllocationInfo {
// For each bin, compute its new start Offset and store the results.
int64_t PrevBinEndOffset = 0;
bool ChangedOffsets = false;
- for (AAPointerInfo::OffsetBinsTy::const_iterator It = PI->begin(); It != PI->end(); It++) {
+ for (AAPointerInfo::OffsetBinsTy::const_iterator It = PI->begin();
+ It != PI->end(); It++) {
const AA::RangeTy &OldRange = It->getFirst();
int64_t NewStartOffset = PrevBinEndOffset;
int64_t NewEndOffset = NewStartOffset + OldRange.Size;
@@ -12800,7 +12801,8 @@ struct AAAllocationInfoImpl : public AAAllocationInfo {
setOffets(OldRange, OldRange.Offset, NewStartOffset, OldRange.Size);
}
- // Set the new size of the allocation, the new size of the Allocation should be the size of NewEndOffset * 8
+ // Set the new size of the allocation, the new size of the Allocation should
+ // be the size of NewEndOffset * 8
auto NewAllocationSize =
std::optional<TypeSize>(TypeSize(PrevBinEndOffset * 8, false));
``````````
</details>
https://github.com/llvm/llvm-project/pull/72029
More information about the llvm-commits
mailing list