[RegisterScavenger][RISCV] Don't search for FrameSetup instrs if we were searching...
authorluxufan <luxufan@iscas.ac.cn>
Fri, 18 Nov 2022 06:56:36 +0000 (14:56 +0800)
committerluxufan <luxufan@iscas.ac.cn>
Fri, 18 Nov 2022 07:13:52 +0000 (15:13 +0800)
commit18c5f3c35d18ca069f02b78e62468d7494ed6c7c
treed6dae352ebaab865e4fe224a627542021c8b12ab
parentf034c98af000f9b1d260bee036ecf653062e1e90
[RegisterScavenger][RISCV] Don't search for FrameSetup instrs if we were searching from Non-FrameSetup instrs

Otherwise, the spill position may point to position where before
FrameSetup instructions. In which case, the spill instruction may store
to caller's frame since the stack pointer has not been adjustted.

Fixes https://github.com/llvm/llvm-project/issues/58286

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D135693
llvm/lib/CodeGen/RegisterScavenging.cpp
llvm/test/CodeGen/RISCV/out-of-reach-emergency-slot.mir
llvm/test/CodeGen/RISCV/pr58286.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/large-rvv-stack-size.mir