This is a performance patch that hoists two conditions in DwarfDebug's validThroughout to avoid a linear-scan of all instructions in a block. We now exit early if validThrougout will never return true for the variable location. No test as this is a performance change, but:
- It halves the time in DWARF emission for several code samples I'm working on, which have large volumes of inlining to deal with,
- A clang-10 stage2 build produces an identical binary with/without this patch.
The first added clause filters for the two circumstances where validThroughout will return true. The second added clause should be identical to the one that's deleted from after the linear-scan.