Commit e18ad47
committed
[SelectionDAG]Salvage debuginfo when combining load and sext instrs.
SelectionDAG uses the DAGCombiner to fold a load followed by a sext to
a load and sext instruction. For example, in x86 we will see that
%1 = load i32, ptr @GloBaRR
#dbg_value(i32 %1, !43, !DIExpression(), !52)
%2 = sext i32 %1 to i64, !dbg !53
is converted to:
%0:gr64_nosp = MOVSX64rm32 $rip, 1, $noreg, @GloBaRR, $noreg,
debug-instr-number 1, debug-location !51
DBG_VALUE $noreg, $noreg, !"Idx", !DIExpression(), debug-location !52
The DBG_VALUE needs to be transferred correctly to the new combined
instruction, and it needs to be appended with a DIExpression which
contains a DW_OP_LLVM_fragment, describing that the lower bits of the
virtual register contain the value.
This patch fixes the above described problem.1 parent 23a22d0 commit e18ad47
File tree
2 files changed
+95
-1
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/DebugInfo/X86
2 files changed
+95
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
14444 | 14447 | | |
14445 | 14448 | | |
14446 | 14449 | | |
14447 | | - | |
| 14450 | + | |
| 14451 | + | |
| 14452 | + | |
14448 | 14453 | | |
| 14454 | + | |
| 14455 | + | |
| 14456 | + | |
| 14457 | + | |
| 14458 | + | |
| 14459 | + | |
| 14460 | + | |
| 14461 | + | |
| 14462 | + | |
| 14463 | + | |
| 14464 | + | |
| 14465 | + | |
| 14466 | + | |
| 14467 | + | |
| 14468 | + | |
| 14469 | + | |
| 14470 | + | |
| 14471 | + | |
| 14472 | + | |
| 14473 | + | |
| 14474 | + | |
| 14475 | + | |
| 14476 | + | |
14449 | 14477 | | |
| 14478 | + | |
| 14479 | + | |
| 14480 | + | |
| 14481 | + | |
| 14482 | + | |
| 14483 | + | |
14450 | 14484 | | |
14451 | 14485 | | |
14452 | 14486 | | |
14453 | 14487 | | |
14454 | 14488 | | |
| 14489 | + | |
| 14490 | + | |
| 14491 | + | |
| 14492 | + | |
| 14493 | + | |
| 14494 | + | |
14455 | 14495 | | |
14456 | 14496 | | |
14457 | 14497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
0 commit comments