Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
r374772 changed Offset to be an int64_t but left NewOffset as an int. Scale is unsigned, so in the calculation `Offset - NewOffset * Scale`, `NewOffset * Scale` was promoted to unsigned and was then zero-extended to 64 bits, leading to an incorrect computation which manifested as an out-of-memory when building the Swift standard library for Android aarch64. Promote NewOffset to int64_t to fix this, and promote EmittableOffset as well, since its one user passes it to a function which takes an int64_t anyway. Test case based on a suggestion by Sander de Smalen! Differential Revision: https://reviews.llvm.org/D69018 llvm-svn: 375043
- Loading branch information
Showing
3 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
llvm/test/CodeGen/AArch64/framelayout-offset-immediate-change.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass=prologepilog %s -o - | FileCheck %s | ||
--- | ||
name: framelayout_offset_immediate_change | ||
tracksRegLiveness: true | ||
fixedStack: | ||
- { id: 0, offset: 0, size: 1} | ||
body: | | ||
bb.0: | ||
$x0 = LDURXi %fixed-stack.0, -264 | ||
RET_ReallyLR | ||
... | ||
# CHECK: name: framelayout_offset_immediate_change | ||
# CHECK: body: | | ||
# CHECK-NEXT: bb.0: | ||
# CHECK-NEXT: $x8 = SUBXri $sp, 8, 0 | ||
# CHECK-NEXT: $x0 = LDURXi killed $x8, -256 | ||
# CHECK-NEXT: RET_ReallyLR |