[llvm] [CodeGen] Avoid aligning alloca size. (PR #132064)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 19 13:22:58 PDT 2025


================
@@ -114,7 +114,7 @@ define void @f5() {
 ; CHECK-NEXT:    lgr %r11, %r15
 ; CHECK-NEXT:    .cfi_def_cfa_register %r11
 ; CHECK-NEXT:    lgr %r1, %r15
-; CHECK-NEXT:    aghi %r1, -128
+; CHECK-NEXT:    aghi %r1, -124
 ; CHECK-NEXT:    la %r2, 280(%r1)
 ; CHECK-NEXT:    nill %r2, 65408
 ; CHECK-NEXT:    lgr %r15, %r1
----------------
uweigand wrote:

This looks clearly wrong.  The sequence `lgr %r1, %r15 ; aghi %r1, -124 ; lgr %r15, %r1` subtracts 124 from the stack pointer, with the result that the stack pointer is now no longer properly aligned as required by the ABI.

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


More information about the llvm-commits mailing list