llvm-reduce: Fix incorrect cloning of MachineMemOperands
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 19 Apr 2022 17:51:20 +0000 (13:51 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 27 Apr 2022 22:51:38 +0000 (18:51 -0400)
commit717209763e17c10aaddce9db3faac4ecbf1afd29
treeb40d88fb62b216aa06acf2eb67d3cd6cba59b7ac
parent6ff91d17d66da46572e97f9a0b042182762cbe9e
llvm-reduce: Fix incorrect cloning of MachineMemOperands

There were two problems with directly copying the MMOs from the old
function. The MMOs are owned by the function's Allocator, so need to
be reallocated anyways (surprisingly I didn't notice breakage on
this). Second, the PseudoSourceValues are also allocated per function
and need to be reallocated.
llvm/test/tools/llvm-reduce/mir/preserve-mem-operands.mir [new file with mode: 0644]
llvm/tools/llvm-reduce/ReducerWorkItem.cpp