Commit 8d6a1de
authored
[SelectionDAGISel] Don't merge input chains if it would put a token factor in the way of a glue. (#167805)
In the new test, we're trying to fold a load and a X86ISD::CALL. The
call has a CopyToReg glued to it. The load and the call have different
input chains so they need to be merged. This results in a TokenFactor
that gets put between the CopyToReg and the final CALLm instruction. The
DAG scheduler can't handle that.
The load here was created by legalization of the extract_element using a
stack temporary store and load. A normal IR load would be chained into
call sequence by SelectionDAGBuilder. This would usually have the load
chained in before the CopyToReg. The store/load created by legalization
don't get chained into the rest of the DAG.
Fixes #637901 parent 9216e17 commit 8d6a1de
File tree
2 files changed
+38
-4
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/X86
2 files changed
+38
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2783 | 2783 | | |
2784 | 2784 | | |
2785 | 2785 | | |
2786 | | - | |
| 2786 | + | |
2787 | 2787 | | |
2788 | 2788 | | |
2789 | 2789 | | |
| |||
2826 | 2826 | | |
2827 | 2827 | | |
2828 | 2828 | | |
2829 | | - | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
2830 | 2837 | | |
| 2838 | + | |
2831 | 2839 | | |
2832 | 2840 | | |
2833 | 2841 | | |
| |||
3989 | 3997 | | |
3990 | 3998 | | |
3991 | 3999 | | |
3992 | | - | |
| 4000 | + | |
3993 | 4001 | | |
3994 | 4002 | | |
3995 | 4003 | | |
| |||
4033 | 4041 | | |
4034 | 4042 | | |
4035 | 4043 | | |
4036 | | - | |
| 4044 | + | |
4037 | 4045 | | |
4038 | 4046 | | |
4039 | 4047 | | |
| |||
| 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 | + | |
0 commit comments