Extracted regions can have both inputs and outputs. In addition, the CodeExtractor removes inputs that are only used in llvm.assumes, and sunken allocas (values are used entirely in the extracted region as denoted by lifetime intrinsics). We also cannot combine sections that have different constants in the same structural location, and these constants will have to elevated to argument. This patch deduplicates extracted functions that only have inputs and non of the special cases.
There's quite a few dead variables added in this patch. Do they belong in later patches in the series?
non-rhetorical question: should it be marked noduplicate too?
elsewhere you have usually called them IRSC
I think this needs to be folded into the assertion to avoid -Wundef in Release builds.
both of these variables are dead
Unless you need to filter them for some reason?
variable is dead
I'd sink this to where it's used.
Why is the first one skipped, and can this be a range-for?
A lot of the dead variables belong to future patches, I'll make sure to weed them out in the next diff.
I'm not entirely sure, it seems like it might be a good idea for safety.
The first extracted function is used to construct the overall outlined function, so it is handled slightly differently.