[RegAllocFast] insert additional spills along indirect edges of INLINEASM_BR
authorNick Desaulniers <ndesaulniers@google.com>
Wed, 1 Mar 2023 23:20:55 +0000 (15:20 -0800)
committerNick Desaulniers <ndesaulniers@google.com>
Wed, 1 Mar 2023 23:21:11 +0000 (15:21 -0800)
commit9cec2b246e719533723562950e56c292fe5dd5ad
tree501c67bbb8cf45cde7976eb3035c580f128c55fd
parentb8f9ec6db77353fbcb2384fa60e4ca9a6d4e3245
[RegAllocFast] insert additional spills along indirect edges of INLINEASM_BR

When generating spills (stores) for values produced by INLINEASM_BR
instructions, make sure to insert one spill per indirect target.
Otherwise the reload generated may load from a stack slot that has not
yet been stored to (resulting in a load of an uninitialized stack slot).

Link: https://github.com/llvm/llvm-project/issues/53562
Fixes: https://github.com/llvm/llvm-project/issues/60855

Reviewed By: MatzeB

Differential Revision: https://reviews.llvm.org/D144907
llvm/lib/CodeGen/RegAllocFast.cpp
llvm/test/CodeGen/X86/callbr-asm-outputs-regallocfast.mir