[DebugInfo][NFC] Early-exit when analyzing for single-location variables
authorJeremy Morse <jeremy.morse@sony.com>
Wed, 8 Apr 2020 11:24:13 +0000 (12:24 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Wed, 8 Apr 2020 11:27:11 +0000 (12:27 +0100)
commitc77887e4d1beae537ebb43e75f119e9e3b4fbe9c
treee477b4c11e37a6ce21e29bacaa0190adb70d95ce
parent02cd80e68ecf59af98e74d1b06c23b3317555933
[DebugInfo][NFC] Early-exit when analyzing for single-location variables

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.

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.

Differential Revision: https://reviews.llvm.org/D77639
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp