Several updates for [DebugInfo] Add debug locations to constant SD nodes (r235989).
Includes:
- re-enabling the change (disabled recently);
- missing change for FP constants;
- resetting debug location of constant node if it's used more than at one place to prevent emission of wrong locations in case of coalesced constants;
- a couple of additional tests.
Now all look ups in CSEMap are wrapped by additional method. Not sure if it makes
sense in all cases, but at least this way we won't miss anything.
Possible question: why debug location isn't last parameter with default value in the
new method? Answer: because InsertPos is output parameter.
Comment in D9084 suggests that debug locations aren't useful for "target constants",
so there might be one more change related to this API (namely, dropping debug
locations for getTarget*Constant methods).
use llvm_unreachable rather than assert(false)
(alternatively, assert(N->getOpcode() != ISD::Constant && N->getOpcode() != ISD::ConstantFP && "..."))