Fix PR26585 by improving the promotion of DBG_VALUEs to DW_AT_locations.
When a variable is described by a single DBG_VALUE instruction we can
often use a more efficient inline DW_AT_location instead of using a
location list.

This commit makes the heuristic that decides when to apply this
optimization stricter by also verifying that the DBG_VALUE is live at the
entry of the function (instead of just checking that it is valid until
the end of the function).

<rdar://problem/24611008>

llvm-svn: 262247
diff --git a/llvm/test/DebugInfo/X86/parameters.ll b/llvm/test/DebugInfo/X86/parameters.ll
index 1d71efc..749d8ea 100644
--- a/llvm/test/DebugInfo/X86/parameters.ll
+++ b/llvm/test/DebugInfo/X86/parameters.ll
@@ -25,15 +25,19 @@
 ; CHECK: debug_info contents
 ; 0x74 is DW_OP_breg4, showing that the parameter is accessed indirectly
 ; (with a zero offset) from the register parameter
-; CHECK: DW_AT_location{{.*}}(<0x0{{.}}> 74 00
+; CHECK: DW_AT_location [DW_FORM_data4]	([[F_LOC:0x[0-9]*]])
 ; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_name{{.*}} = "f"
-
+;
 ; CHECK: DW_AT_location{{.*}}([[G_LOC:0x[0-9]*]])
 ; CHECK-NOT: DW_TAG
 ; CHECK: DW_AT_name{{.*}} = "g"
+;
 ; CHECK: debug_loc contents
-; CHECK-NEXT: [[G_LOC]]: Beginning
+; CHECK:         [[F_LOC]]: Beginning
+; CHECK-NEXT:               Ending
+; CHECK-NEXT: Location description: 74 00
+; CHECK:         [[G_LOC]]: Beginning
 ; CHECK-NEXT:               Ending
 ; CHECK-NEXT: Location description: 74 00