Commit 121baba
[SelectionDAG] Don't remove unused negated constant immediately
This reverts partial of a2fb544 (actually, 2508ef0) about removing
negated FP constant immediately if it has no uses. However, as discussed
in bug 47517, there're cases when NegX is folded into constant from
other places while NegY is removed by that line of code and NegX is
equal to NegY. In these cases, NegX is deleted before used and crash
happens. So revert the code and add necessary test case.
(cherry picked from commit b326d4f)1 parent f80e6d6 commit 121baba
File tree
2 files changed
+14
-3
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/X86
2 files changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5751 | 5751 | | |
5752 | 5752 | | |
5753 | 5753 | | |
5754 | | - | |
5755 | | - | |
| 5754 | + | |
5756 | 5755 | | |
5757 | | - | |
5758 | 5756 | | |
5759 | 5757 | | |
5760 | 5758 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments