Commit a40640b
[AMDGPU][SDAG] Add ISD::PTRADD DAG combines (llvm#142739)
This patch focuses on generic DAG combines, plus an AMDGPU-target-specific one
that is closely connected.
The generic DAG combine is based on a part of PR llvm#105669 by rgwott, which was
adapted from work by jrtc27, arichardson, davidchisnall in the CHERI/Morello
LLVM tree. I added some parts and removed several disjuncts from the
reassociation condition:
- `isNullConstant(X)`, since there are address spaces where 0 is a perfectly
normal value that shouldn't be treated specially,
- `(YIsConstant && ZOneUse)` and `(N0OneUse && ZOneUse && !ZIsConstant)`, since
they cause regressions in AMDGPU.
For SWDEV-516125.1 parent 48a592b commit a40640b
File tree
6 files changed
+286
-196
lines changed- llvm
- lib
- CodeGen/SelectionDAG
- Target/AMDGPU
- test/CodeGen
- AArch64
- AMDGPU
6 files changed
+286
-196
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
1140 | 1141 | | |
1141 | 1142 | | |
1142 | 1143 | | |
1143 | | - | |
| 1144 | + | |
1144 | 1145 | | |
1145 | 1146 | | |
1146 | 1147 | | |
| |||
1894 | 1895 | | |
1895 | 1896 | | |
1896 | 1897 | | |
| 1898 | + | |
1897 | 1899 | | |
1898 | 1900 | | |
1899 | 1901 | | |
| |||
2664 | 2666 | | |
2665 | 2667 | | |
2666 | 2668 | | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
2667 | 2749 | | |
2668 | 2750 | | |
2669 | 2751 | | |
| |||
15095 | 15177 | | |
15096 | 15178 | | |
15097 | 15179 | | |
| 15180 | + | |
15098 | 15181 | | |
15099 | 15182 | | |
15100 | 15183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
| 948 | + | |
948 | 949 | | |
949 | 950 | | |
950 | 951 | | |
| |||
15084 | 15085 | | |
15085 | 15086 | | |
15086 | 15087 | | |
| 15088 | + | |
| 15089 | + | |
| 15090 | + | |
| 15091 | + | |
| 15092 | + | |
| 15093 | + | |
| 15094 | + | |
| 15095 | + | |
| 15096 | + | |
| 15097 | + | |
| 15098 | + | |
| 15099 | + | |
| 15100 | + | |
| 15101 | + | |
| 15102 | + | |
| 15103 | + | |
| 15104 | + | |
| 15105 | + | |
| 15106 | + | |
| 15107 | + | |
| 15108 | + | |
| 15109 | + | |
| 15110 | + | |
| 15111 | + | |
| 15112 | + | |
| 15113 | + | |
| 15114 | + | |
| 15115 | + | |
| 15116 | + | |
| 15117 | + | |
| 15118 | + | |
| 15119 | + | |
| 15120 | + | |
| 15121 | + | |
| 15122 | + | |
| 15123 | + | |
| 15124 | + | |
| 15125 | + | |
| 15126 | + | |
| 15127 | + | |
| 15128 | + | |
| 15129 | + | |
| 15130 | + | |
15087 | 15131 | | |
15088 | 15132 | | |
15089 | 15133 | | |
| |||
15622 | 15666 | | |
15623 | 15667 | | |
15624 | 15668 | | |
| 15669 | + | |
| 15670 | + | |
15625 | 15671 | | |
15626 | 15672 | | |
15627 | 15673 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | 129 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 130 | | |
| 131 | + | |
| 132 | + | |
139 | 133 | | |
140 | 134 | | |
141 | 135 | | |
| |||
144 | 138 | | |
145 | 139 | | |
146 | 140 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
162 | 152 | | |
163 | 153 | | |
164 | 154 | | |
| |||
205 | 195 | | |
206 | 196 | | |
207 | 197 | | |
208 | | - | |
209 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
210 | 201 | | |
211 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
212 | 206 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 207 | | |
218 | 208 | | |
219 | 209 | | |
220 | 210 | | |
221 | 211 | | |
222 | 212 | | |
223 | 213 | | |
224 | | - | |
225 | | - | |
| 214 | + | |
226 | 215 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
231 | 221 | | |
232 | 222 | | |
233 | 223 | | |
| |||
264 | 254 | | |
265 | 255 | | |
266 | 256 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | 257 | | |
272 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
273 | 262 | | |
274 | | - | |
275 | 263 | | |
276 | 264 | | |
277 | 265 | | |
278 | 266 | | |
279 | 267 | | |
280 | 268 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
289 | 275 | | |
290 | 276 | | |
291 | 277 | | |
| |||
670 | 656 | | |
671 | 657 | | |
672 | 658 | | |
| 659 | + | |
673 | 660 | | |
674 | | - | |
| 661 | + | |
| 662 | + | |
675 | 663 | | |
676 | 664 | | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
| 665 | + | |
681 | 666 | | |
682 | 667 | | |
683 | 668 | | |
| |||
697 | 682 | | |
698 | 683 | | |
699 | 684 | | |
700 | | - | |
701 | 685 | | |
702 | 686 | | |
703 | 687 | | |
704 | | - | |
705 | | - | |
| 688 | + | |
706 | 689 | | |
| 690 | + | |
| 691 | + | |
707 | 692 | | |
708 | 693 | | |
709 | 694 | | |
| |||
0 commit comments