rust/tests
bors 76ed7a1fa4 Auto merge of #130329 - khuey:reorder-constant-spills, r=davidtwco
Reorder stack spills so that constants come later.

Currently constants are "pulled forward" and have their stack spills emitted first. This confuses LLVM as to where to place breakpoints at function entry, and results in argument values being wrong in the debugger. It's straightforward to avoid emitting the stack spills for constants until arguments/etc have been introduced in debug_introduce_locals, so do that.

Example LLVM IR (irrelevant IR elided):
Before:
```
define internal void `@_ZN11rust_1289457binding17h2c78f956ba4bd2c3E(i64` %a, i64 %b, double %c) unnamed_addr #0 !dbg !178 { start:
  %c.dbg.spill = alloca [8 x i8], align 8
  %b.dbg.spill = alloca [8 x i8], align 8
  %a.dbg.spill = alloca [8 x i8], align 8
  %x.dbg.spill = alloca [4 x i8], align 4
  store i32 0, ptr %x.dbg.spill, align 4, !dbg !192            ; LLVM places breakpoint here.
    #dbg_declare(ptr %x.dbg.spill, !190, !DIExpression(), !192)
  store i64 %a, ptr %a.dbg.spill, align 8
    #dbg_declare(ptr %a.dbg.spill, !187, !DIExpression(), !193)
  store i64 %b, ptr %b.dbg.spill, align 8
    #dbg_declare(ptr %b.dbg.spill, !188, !DIExpression(), !194)
  store double %c, ptr %c.dbg.spill, align 8
    #dbg_declare(ptr %c.dbg.spill, !189, !DIExpression(), !195)
  ret void, !dbg !196
}
```
After:
```
define internal void `@_ZN11rust_1289457binding17h2c78f956ba4bd2c3E(i64` %a, i64 %b, double %c) unnamed_addr #0 !dbg !178 { start:
  %x.dbg.spill = alloca [4 x i8], align 4
  %c.dbg.spill = alloca [8 x i8], align 8
  %b.dbg.spill = alloca [8 x i8], align 8
  %a.dbg.spill = alloca [8 x i8], align 8
  store i64 %a, ptr %a.dbg.spill, align 8
    #dbg_declare(ptr %a.dbg.spill, !187, !DIExpression(), !192)
  store i64 %b, ptr %b.dbg.spill, align 8
    #dbg_declare(ptr %b.dbg.spill, !188, !DIExpression(), !193)
  store double %c, ptr %c.dbg.spill, align 8
    #dbg_declare(ptr %c.dbg.spill, !189, !DIExpression(), !194)
  store i32 0, ptr %x.dbg.spill, align 4, !dbg !195            ; LLVM places breakpoint here.
    #dbg_declare(ptr %x.dbg.spill, !190, !DIExpression(), !195)
  ret void, !dbg !196
}
```
Note in particular the position of the "LLVM places breakpoint here" comment relative to the stack spills for the function arguments. LLVM assumes that the first instruction with with a debug location is the end of the prologue. As LLVM does not currently offer front ends any direct control over the placement of the prologue end reordering the IR is the only mechanism available to fix argument values at function entry in the presence of MIR optimizations like SingleUseConsts. Fixes #128945

r? `@michaelwoerister`
2024-09-26 02:37:52 +00:00
..
assembly Rollup merge of #130549 - biabbas:riscv32_wrs_vxworks, r=nnethercote 2024-09-25 10:09:22 +02:00
auxiliary
codegen tests: Remove spuriously failing vec-tryinto-array codegen test 2024-09-22 16:46:10 -07:00
codegen-units
coverage
coverage-run-rustdoc
crashes Validate unsize coercion in MIR validation 2024-09-25 11:10:38 -04:00
debuginfo
incremental
mir-opt be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
pretty
run-make Update run-make tests to use cargo wrapper cmd 2024-09-24 19:04:51 +08:00
run-pass-valgrind Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
rustdoc rustdoc: inherit parent's stability where applicable 2024-09-24 20:18:36 +02:00
rustdoc-gui Rollup merge of #129545 - notriddle:notriddle/toolbar-v2, r=GuillaumeGomez 2024-09-23 23:49:11 -04:00
rustdoc-js
rustdoc-js-std Bless rustdoc-js-std test 2024-09-22 20:35:10 -04:00
rustdoc-json Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
rustdoc-ui Update rustdoc doctest non_local_defs impl test 2024-09-23 10:01:59 +02:00
ui Auto merge of #120752 - compiler-errors:more-relevant-bounds, r=lcnr 2024-09-25 21:12:07 +00:00
ui-fulldeps
COMPILER_TESTS.md