about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorWesley Wiser <wesleywiser@microsoft.com>2022-12-07 13:48:34 -0500
committerWesley Wiser <wesleywiser@microsoft.com>2022-12-08 20:38:23 -0500
commit7253057887b6de77e6847844311da517d2ada1eb (patch)
treef0fa2e56c5451afb1edcf4488162aefa1d5e7aa1 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentb33d1e26b220062e23bb202c6765663c157d971b (diff)
downloadrust-7253057887b6de77e6847844311da517d2ada1eb.tar.gz
rust-7253057887b6de77e6847844311da517d2ada1eb.zip
Don't generate pointer loads to spills unless necessary
In order for LLVM to correctly generate debuginfo for msvc, we sometimes
need to spill arguments to the stack and perform some direct & indirect
offsets into the value. Previously, this code always performed those
actions, even when not required as LLVM would clean it up during
optimization.

However, when MIR inlining is enabled, this can cause problems as the
operations occur prior to the spilled value being initialized. To solve
this, we first calculate the necessary offsets using just the type which
is side-effect free and does not alter the LLVM IR. Then, if we are in a
situation which requires us to generate the LLVM IR (and this situation
only occurs for arguments, not local variables) then we perform the same
calculation again, this time generating the appropriate LLVM IR as we
go.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions