irtranslator-call-implicit-args.ll 79.5 KB
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
; RUN: llc -global-isel -amdgpu-fixed-function-abi -stop-after=irtranslator -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -verify-machineinstrs -o - %s | FileCheck -enable-var-scope -check-prefix=GFX900 %s
; RUN: llc -global-isel -amdgpu-fixed-function-abi -stop-after=irtranslator -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx908 -verify-machineinstrs -o - %s | FileCheck -enable-var-scope -check-prefix=GFX908 %s

; Workitem IDs are passed to the kernel differently for gfx908

declare hidden void @external_void_func_void() #0
declare hidden void @external_void_func_i32(i32) #0
declare hidden void @external_void_func_v32i32(<32 x i32>) #0

define amdgpu_kernel void @test_call_external_void_func_i32([17 x i8]) #0 {
  ; GFX900-LABEL: name: test_call_external_void_func_i32
  ; GFX900: bb.1 (%ir-block.1):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX900:   [[INT:%[0-9]+]]:_(p4) = G_INTRINSIC intrinsic(@llvm.amdgcn.kernarg.segment.ptr)
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 20
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_call_external_void_func_i32
  ; GFX908: bb.1 (%ir-block.1):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX908:   [[INT:%[0-9]+]]:_(p4) = G_INTRINSIC intrinsic(@llvm.amdgcn.kernarg.segment.ptr)
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 20
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_i32(i32 42)
  ret void
}

define void @test_func_call_external_void_func_i32() #0 {
  ; GFX900-LABEL: name: test_func_call_external_void_func_i32
  ; GFX900: bb.1 (%ir-block.0):
  ; GFX900:   liveins: $sgpr12, $sgpr13, $sgpr14, $vgpr31, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11, $sgpr30_sgpr31
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr31
  ; GFX900:   [[COPY1:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY2:%[0-9]+]]:sgpr_32 = COPY $sgpr13
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr12
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_64 = COPY $sgpr8_sgpr9
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr30_sgpr31
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 99
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY6]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY5]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(s64) = COPY [[COPY4]]
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY2]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY1]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY17:%[0-9]+]]:_(<4 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY17]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY9]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY12]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY13]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY15]](s32)
  ; GFX900:   $vgpr31 = COPY [[COPY16]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   [[COPY18:%[0-9]+]]:ccr_sgpr_64 = COPY [[COPY8]]
  ; GFX900:   S_SETPC_B64_return [[COPY18]]
  ; GFX908-LABEL: name: test_func_call_external_void_func_i32
  ; GFX908: bb.1 (%ir-block.0):
  ; GFX908:   liveins: $sgpr12, $sgpr13, $sgpr14, $vgpr31, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11, $sgpr30_sgpr31
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr31
  ; GFX908:   [[COPY1:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY2:%[0-9]+]]:sgpr_32 = COPY $sgpr13
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr12
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_64 = COPY $sgpr8_sgpr9
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr30_sgpr31
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 99
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY6]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY5]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(s64) = COPY [[COPY4]]
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY2]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY1]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY17:%[0-9]+]]:_(<4 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY17]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY9]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY12]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY13]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY15]](s32)
  ; GFX908:   $vgpr31 = COPY [[COPY16]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   [[COPY18:%[0-9]+]]:ccr_sgpr_64 = COPY [[COPY8]]
  ; GFX908:   S_SETPC_B64_return [[COPY18]]
  call void @external_void_func_i32(i32 99)
  ret void
}

; Explicit argument is split between registers ad the stack due to v31
; being used for workitem IDs.
define amdgpu_kernel void @test_call_external_void_func_v32i32([17 x i8]) #0 {
  ; GFX900-LABEL: name: test_call_external_void_func_v32i32
  ; GFX900: bb.1 (%ir-block.1):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX900:   [[BUILD_VECTOR:%[0-9]+]]:_(<32 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
  ; GFX900:   [[INT:%[0-9]+]]:_(p4) = G_INTRINSIC intrinsic(@llvm.amdgcn.kernarg.segment.ptr)
  ; GFX900:   [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32), [[UV8:%[0-9]+]]:_(s32), [[UV9:%[0-9]+]]:_(s32), [[UV10:%[0-9]+]]:_(s32), [[UV11:%[0-9]+]]:_(s32), [[UV12:%[0-9]+]]:_(s32), [[UV13:%[0-9]+]]:_(s32), [[UV14:%[0-9]+]]:_(s32), [[UV15:%[0-9]+]]:_(s32), [[UV16:%[0-9]+]]:_(s32), [[UV17:%[0-9]+]]:_(s32), [[UV18:%[0-9]+]]:_(s32), [[UV19:%[0-9]+]]:_(s32), [[UV20:%[0-9]+]]:_(s32), [[UV21:%[0-9]+]]:_(s32), [[UV22:%[0-9]+]]:_(s32), [[UV23:%[0-9]+]]:_(s32), [[UV24:%[0-9]+]]:_(s32), [[UV25:%[0-9]+]]:_(s32), [[UV26:%[0-9]+]]:_(s32), [[UV27:%[0-9]+]]:_(s32), [[UV28:%[0-9]+]]:_(s32), [[UV29:%[0-9]+]]:_(s32), [[UV30:%[0-9]+]]:_(s32), [[UV31:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[BUILD_VECTOR]](<32 x s32>)
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_v32i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 20
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[UV]](s32)
  ; GFX900:   $vgpr1 = COPY [[UV1]](s32)
  ; GFX900:   $vgpr2 = COPY [[UV2]](s32)
  ; GFX900:   $vgpr3 = COPY [[UV3]](s32)
  ; GFX900:   $vgpr4 = COPY [[UV4]](s32)
  ; GFX900:   $vgpr5 = COPY [[UV5]](s32)
  ; GFX900:   $vgpr6 = COPY [[UV6]](s32)
  ; GFX900:   $vgpr7 = COPY [[UV7]](s32)
  ; GFX900:   $vgpr8 = COPY [[UV8]](s32)
  ; GFX900:   $vgpr9 = COPY [[UV9]](s32)
  ; GFX900:   $vgpr10 = COPY [[UV10]](s32)
  ; GFX900:   $vgpr11 = COPY [[UV11]](s32)
  ; GFX900:   $vgpr12 = COPY [[UV12]](s32)
  ; GFX900:   $vgpr13 = COPY [[UV13]](s32)
  ; GFX900:   $vgpr14 = COPY [[UV14]](s32)
  ; GFX900:   $vgpr15 = COPY [[UV15]](s32)
  ; GFX900:   $vgpr16 = COPY [[UV16]](s32)
  ; GFX900:   $vgpr17 = COPY [[UV17]](s32)
  ; GFX900:   $vgpr18 = COPY [[UV18]](s32)
  ; GFX900:   $vgpr19 = COPY [[UV19]](s32)
  ; GFX900:   $vgpr20 = COPY [[UV20]](s32)
  ; GFX900:   $vgpr21 = COPY [[UV21]](s32)
  ; GFX900:   $vgpr22 = COPY [[UV22]](s32)
  ; GFX900:   $vgpr23 = COPY [[UV23]](s32)
  ; GFX900:   $vgpr24 = COPY [[UV24]](s32)
  ; GFX900:   $vgpr25 = COPY [[UV25]](s32)
  ; GFX900:   $vgpr26 = COPY [[UV26]](s32)
  ; GFX900:   $vgpr27 = COPY [[UV27]](s32)
  ; GFX900:   $vgpr28 = COPY [[UV28]](s32)
  ; GFX900:   $vgpr29 = COPY [[UV29]](s32)
  ; GFX900:   $vgpr30 = COPY [[UV30]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(p5) = COPY $sp_reg
  ; GFX900:   [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX900:   [[PTR_ADD1:%[0-9]+]]:_(p5) = G_PTR_ADD [[COPY20]], [[C4]](s32)
  ; GFX900:   G_STORE [[UV31]](s32), [[PTR_ADD1]](p5) :: (store 4 into stack, align 16, addrspace 5)
  ; GFX900:   [[COPY21:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY21]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_v32i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $vgpr1, implicit $vgpr2, implicit $vgpr3, implicit $vgpr4, implicit $vgpr5, implicit $vgpr6, implicit $vgpr7, implicit $vgpr8, implicit $vgpr9, implicit $vgpr10, implicit $vgpr11, implicit $vgpr12, implicit $vgpr13, implicit $vgpr14, implicit $vgpr15, implicit $vgpr16, implicit $vgpr17, implicit $vgpr18, implicit $vgpr19, implicit $vgpr20, implicit $vgpr21, implicit $vgpr22, implicit $vgpr23, implicit $vgpr24, implicit $vgpr25, implicit $vgpr26, implicit $vgpr27, implicit $vgpr28, implicit $vgpr29, implicit $vgpr30, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 4, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_call_external_void_func_v32i32
  ; GFX908: bb.1 (%ir-block.1):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX908:   [[BUILD_VECTOR:%[0-9]+]]:_(<32 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
  ; GFX908:   [[INT:%[0-9]+]]:_(p4) = G_INTRINSIC intrinsic(@llvm.amdgcn.kernarg.segment.ptr)
  ; GFX908:   [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32), [[UV8:%[0-9]+]]:_(s32), [[UV9:%[0-9]+]]:_(s32), [[UV10:%[0-9]+]]:_(s32), [[UV11:%[0-9]+]]:_(s32), [[UV12:%[0-9]+]]:_(s32), [[UV13:%[0-9]+]]:_(s32), [[UV14:%[0-9]+]]:_(s32), [[UV15:%[0-9]+]]:_(s32), [[UV16:%[0-9]+]]:_(s32), [[UV17:%[0-9]+]]:_(s32), [[UV18:%[0-9]+]]:_(s32), [[UV19:%[0-9]+]]:_(s32), [[UV20:%[0-9]+]]:_(s32), [[UV21:%[0-9]+]]:_(s32), [[UV22:%[0-9]+]]:_(s32), [[UV23:%[0-9]+]]:_(s32), [[UV24:%[0-9]+]]:_(s32), [[UV25:%[0-9]+]]:_(s32), [[UV26:%[0-9]+]]:_(s32), [[UV27:%[0-9]+]]:_(s32), [[UV28:%[0-9]+]]:_(s32), [[UV29:%[0-9]+]]:_(s32), [[UV30:%[0-9]+]]:_(s32), [[UV31:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[BUILD_VECTOR]](<32 x s32>)
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_v32i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 20
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[UV]](s32)
  ; GFX908:   $vgpr1 = COPY [[UV1]](s32)
  ; GFX908:   $vgpr2 = COPY [[UV2]](s32)
  ; GFX908:   $vgpr3 = COPY [[UV3]](s32)
  ; GFX908:   $vgpr4 = COPY [[UV4]](s32)
  ; GFX908:   $vgpr5 = COPY [[UV5]](s32)
  ; GFX908:   $vgpr6 = COPY [[UV6]](s32)
  ; GFX908:   $vgpr7 = COPY [[UV7]](s32)
  ; GFX908:   $vgpr8 = COPY [[UV8]](s32)
  ; GFX908:   $vgpr9 = COPY [[UV9]](s32)
  ; GFX908:   $vgpr10 = COPY [[UV10]](s32)
  ; GFX908:   $vgpr11 = COPY [[UV11]](s32)
  ; GFX908:   $vgpr12 = COPY [[UV12]](s32)
  ; GFX908:   $vgpr13 = COPY [[UV13]](s32)
  ; GFX908:   $vgpr14 = COPY [[UV14]](s32)
  ; GFX908:   $vgpr15 = COPY [[UV15]](s32)
  ; GFX908:   $vgpr16 = COPY [[UV16]](s32)
  ; GFX908:   $vgpr17 = COPY [[UV17]](s32)
  ; GFX908:   $vgpr18 = COPY [[UV18]](s32)
  ; GFX908:   $vgpr19 = COPY [[UV19]](s32)
  ; GFX908:   $vgpr20 = COPY [[UV20]](s32)
  ; GFX908:   $vgpr21 = COPY [[UV21]](s32)
  ; GFX908:   $vgpr22 = COPY [[UV22]](s32)
  ; GFX908:   $vgpr23 = COPY [[UV23]](s32)
  ; GFX908:   $vgpr24 = COPY [[UV24]](s32)
  ; GFX908:   $vgpr25 = COPY [[UV25]](s32)
  ; GFX908:   $vgpr26 = COPY [[UV26]](s32)
  ; GFX908:   $vgpr27 = COPY [[UV27]](s32)
  ; GFX908:   $vgpr28 = COPY [[UV28]](s32)
  ; GFX908:   $vgpr29 = COPY [[UV29]](s32)
  ; GFX908:   $vgpr30 = COPY [[UV30]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(p5) = COPY $sp_reg
  ; GFX908:   [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX908:   [[PTR_ADD1:%[0-9]+]]:_(p5) = G_PTR_ADD [[COPY20]], [[C4]](s32)
  ; GFX908:   G_STORE [[UV31]](s32), [[PTR_ADD1]](p5) :: (store 4 into stack, align 16, addrspace 5)
  ; GFX908:   [[COPY21:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY21]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_v32i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $vgpr1, implicit $vgpr2, implicit $vgpr3, implicit $vgpr4, implicit $vgpr5, implicit $vgpr6, implicit $vgpr7, implicit $vgpr8, implicit $vgpr9, implicit $vgpr10, implicit $vgpr11, implicit $vgpr12, implicit $vgpr13, implicit $vgpr14, implicit $vgpr15, implicit $vgpr16, implicit $vgpr17, implicit $vgpr18, implicit $vgpr19, implicit $vgpr20, implicit $vgpr21, implicit $vgpr22, implicit $vgpr23, implicit $vgpr24, implicit $vgpr25, implicit $vgpr26, implicit $vgpr27, implicit $vgpr28, implicit $vgpr29, implicit $vgpr30, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 4, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_v32i32(<32 x i32> zeroinitializer)
  ret void
}

define void @test_func_call_external_void_func_v32i32([17 x i8]) #0 {
  ; GFX900-LABEL: name: test_func_call_external_void_func_v32i32
  ; GFX900: bb.1 (%ir-block.1):
  ; GFX900:   liveins: $sgpr12, $sgpr13, $sgpr14, $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr10, $vgpr11, $vgpr12, $vgpr13, $vgpr14, $vgpr15, $vgpr16, $vgpr31, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11, $sgpr30_sgpr31
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr31
  ; GFX900:   [[COPY1:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY2:%[0-9]+]]:sgpr_32 = COPY $sgpr13
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr12
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_64 = COPY $sgpr8_sgpr9
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY8:%[0-9]+]]:_(s32) = COPY $vgpr0
  ; GFX900:   [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY8]](s32)
  ; GFX900:   [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC]](s16)
  ; GFX900:   [[COPY9:%[0-9]+]]:_(s32) = COPY $vgpr1
  ; GFX900:   [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY9]](s32)
  ; GFX900:   [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC2]](s16)
  ; GFX900:   [[COPY10:%[0-9]+]]:_(s32) = COPY $vgpr2
  ; GFX900:   [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[COPY10]](s32)
  ; GFX900:   [[TRUNC5:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC4]](s16)
  ; GFX900:   [[COPY11:%[0-9]+]]:_(s32) = COPY $vgpr3
  ; GFX900:   [[TRUNC6:%[0-9]+]]:_(s16) = G_TRUNC [[COPY11]](s32)
  ; GFX900:   [[TRUNC7:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC6]](s16)
  ; GFX900:   [[COPY12:%[0-9]+]]:_(s32) = COPY $vgpr4
  ; GFX900:   [[TRUNC8:%[0-9]+]]:_(s16) = G_TRUNC [[COPY12]](s32)
  ; GFX900:   [[TRUNC9:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC8]](s16)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s32) = COPY $vgpr5
  ; GFX900:   [[TRUNC10:%[0-9]+]]:_(s16) = G_TRUNC [[COPY13]](s32)
  ; GFX900:   [[TRUNC11:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC10]](s16)
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY $vgpr6
  ; GFX900:   [[TRUNC12:%[0-9]+]]:_(s16) = G_TRUNC [[COPY14]](s32)
  ; GFX900:   [[TRUNC13:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC12]](s16)
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY $vgpr7
  ; GFX900:   [[TRUNC14:%[0-9]+]]:_(s16) = G_TRUNC [[COPY15]](s32)
  ; GFX900:   [[TRUNC15:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC14]](s16)
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY $vgpr8
  ; GFX900:   [[TRUNC16:%[0-9]+]]:_(s16) = G_TRUNC [[COPY16]](s32)
  ; GFX900:   [[TRUNC17:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC16]](s16)
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY $vgpr9
  ; GFX900:   [[TRUNC18:%[0-9]+]]:_(s16) = G_TRUNC [[COPY17]](s32)
  ; GFX900:   [[TRUNC19:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC18]](s16)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY $vgpr10
  ; GFX900:   [[TRUNC20:%[0-9]+]]:_(s16) = G_TRUNC [[COPY18]](s32)
  ; GFX900:   [[TRUNC21:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC20]](s16)
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY $vgpr11
  ; GFX900:   [[TRUNC22:%[0-9]+]]:_(s16) = G_TRUNC [[COPY19]](s32)
  ; GFX900:   [[TRUNC23:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC22]](s16)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(s32) = COPY $vgpr12
  ; GFX900:   [[TRUNC24:%[0-9]+]]:_(s16) = G_TRUNC [[COPY20]](s32)
  ; GFX900:   [[TRUNC25:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC24]](s16)
  ; GFX900:   [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr13
  ; GFX900:   [[TRUNC26:%[0-9]+]]:_(s16) = G_TRUNC [[COPY21]](s32)
  ; GFX900:   [[TRUNC27:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC26]](s16)
  ; GFX900:   [[COPY22:%[0-9]+]]:_(s32) = COPY $vgpr14
  ; GFX900:   [[TRUNC28:%[0-9]+]]:_(s16) = G_TRUNC [[COPY22]](s32)
  ; GFX900:   [[TRUNC29:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC28]](s16)
  ; GFX900:   [[COPY23:%[0-9]+]]:_(s32) = COPY $vgpr15
  ; GFX900:   [[TRUNC30:%[0-9]+]]:_(s16) = G_TRUNC [[COPY23]](s32)
  ; GFX900:   [[TRUNC31:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC30]](s16)
  ; GFX900:   [[COPY24:%[0-9]+]]:_(s32) = COPY $vgpr16
  ; GFX900:   [[TRUNC32:%[0-9]+]]:_(s16) = G_TRUNC [[COPY24]](s32)
  ; GFX900:   [[TRUNC33:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC32]](s16)
  ; GFX900:   [[COPY25:%[0-9]+]]:sgpr_64 = COPY $sgpr30_sgpr31
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX900:   [[BUILD_VECTOR:%[0-9]+]]:_(<32 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
  ; GFX900:   [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32), [[UV8:%[0-9]+]]:_(s32), [[UV9:%[0-9]+]]:_(s32), [[UV10:%[0-9]+]]:_(s32), [[UV11:%[0-9]+]]:_(s32), [[UV12:%[0-9]+]]:_(s32), [[UV13:%[0-9]+]]:_(s32), [[UV14:%[0-9]+]]:_(s32), [[UV15:%[0-9]+]]:_(s32), [[UV16:%[0-9]+]]:_(s32), [[UV17:%[0-9]+]]:_(s32), [[UV18:%[0-9]+]]:_(s32), [[UV19:%[0-9]+]]:_(s32), [[UV20:%[0-9]+]]:_(s32), [[UV21:%[0-9]+]]:_(s32), [[UV22:%[0-9]+]]:_(s32), [[UV23:%[0-9]+]]:_(s32), [[UV24:%[0-9]+]]:_(s32), [[UV25:%[0-9]+]]:_(s32), [[UV26:%[0-9]+]]:_(s32), [[UV27:%[0-9]+]]:_(s32), [[UV28:%[0-9]+]]:_(s32), [[UV29:%[0-9]+]]:_(s32), [[UV30:%[0-9]+]]:_(s32), [[UV31:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[BUILD_VECTOR]](<32 x s32>)
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_v32i32
  ; GFX900:   [[COPY26:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY27:%[0-9]+]]:_(p4) = COPY [[COPY6]]
  ; GFX900:   [[COPY28:%[0-9]+]]:_(p4) = COPY [[COPY5]]
  ; GFX900:   [[COPY29:%[0-9]+]]:_(s64) = COPY [[COPY4]]
  ; GFX900:   [[COPY30:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY31:%[0-9]+]]:_(s32) = COPY [[COPY2]]
  ; GFX900:   [[COPY32:%[0-9]+]]:_(s32) = COPY [[COPY1]]
  ; GFX900:   [[COPY33:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   $vgpr0 = COPY [[UV]](s32)
  ; GFX900:   $vgpr1 = COPY [[UV1]](s32)
  ; GFX900:   $vgpr2 = COPY [[UV2]](s32)
  ; GFX900:   $vgpr3 = COPY [[UV3]](s32)
  ; GFX900:   $vgpr4 = COPY [[UV4]](s32)
  ; GFX900:   $vgpr5 = COPY [[UV5]](s32)
  ; GFX900:   $vgpr6 = COPY [[UV6]](s32)
  ; GFX900:   $vgpr7 = COPY [[UV7]](s32)
  ; GFX900:   $vgpr8 = COPY [[UV8]](s32)
  ; GFX900:   $vgpr9 = COPY [[UV9]](s32)
  ; GFX900:   $vgpr10 = COPY [[UV10]](s32)
  ; GFX900:   $vgpr11 = COPY [[UV11]](s32)
  ; GFX900:   $vgpr12 = COPY [[UV12]](s32)
  ; GFX900:   $vgpr13 = COPY [[UV13]](s32)
  ; GFX900:   $vgpr14 = COPY [[UV14]](s32)
  ; GFX900:   $vgpr15 = COPY [[UV15]](s32)
  ; GFX900:   $vgpr16 = COPY [[UV16]](s32)
  ; GFX900:   $vgpr17 = COPY [[UV17]](s32)
  ; GFX900:   $vgpr18 = COPY [[UV18]](s32)
  ; GFX900:   $vgpr19 = COPY [[UV19]](s32)
  ; GFX900:   $vgpr20 = COPY [[UV20]](s32)
  ; GFX900:   $vgpr21 = COPY [[UV21]](s32)
  ; GFX900:   $vgpr22 = COPY [[UV22]](s32)
  ; GFX900:   $vgpr23 = COPY [[UV23]](s32)
  ; GFX900:   $vgpr24 = COPY [[UV24]](s32)
  ; GFX900:   $vgpr25 = COPY [[UV25]](s32)
  ; GFX900:   $vgpr26 = COPY [[UV26]](s32)
  ; GFX900:   $vgpr27 = COPY [[UV27]](s32)
  ; GFX900:   $vgpr28 = COPY [[UV28]](s32)
  ; GFX900:   $vgpr29 = COPY [[UV29]](s32)
  ; GFX900:   $vgpr30 = COPY [[UV30]](s32)
  ; GFX900:   [[COPY34:%[0-9]+]]:_(p5) = COPY $sgpr32
  ; GFX900:   [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p5) = G_PTR_ADD [[COPY34]], [[C1]](s32)
  ; GFX900:   G_STORE [[UV31]](s32), [[PTR_ADD]](p5) :: (store 4 into stack, align 16, addrspace 5)
  ; GFX900:   [[COPY35:%[0-9]+]]:_(<4 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY35]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY26]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY27]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[COPY28]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY29]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY30]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY31]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY32]](s32)
  ; GFX900:   $vgpr31 = COPY [[COPY33]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_v32i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $vgpr1, implicit $vgpr2, implicit $vgpr3, implicit $vgpr4, implicit $vgpr5, implicit $vgpr6, implicit $vgpr7, implicit $vgpr8, implicit $vgpr9, implicit $vgpr10, implicit $vgpr11, implicit $vgpr12, implicit $vgpr13, implicit $vgpr14, implicit $vgpr15, implicit $vgpr16, implicit $vgpr17, implicit $vgpr18, implicit $vgpr19, implicit $vgpr20, implicit $vgpr21, implicit $vgpr22, implicit $vgpr23, implicit $vgpr24, implicit $vgpr25, implicit $vgpr26, implicit $vgpr27, implicit $vgpr28, implicit $vgpr29, implicit $vgpr30, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 4, implicit-def $scc
  ; GFX900:   [[COPY36:%[0-9]+]]:ccr_sgpr_64 = COPY [[COPY25]]
  ; GFX900:   S_SETPC_B64_return [[COPY36]]
  ; GFX908-LABEL: name: test_func_call_external_void_func_v32i32
  ; GFX908: bb.1 (%ir-block.1):
  ; GFX908:   liveins: $sgpr12, $sgpr13, $sgpr14, $vgpr0, $vgpr1, $vgpr2, $vgpr3, $vgpr4, $vgpr5, $vgpr6, $vgpr7, $vgpr8, $vgpr9, $vgpr10, $vgpr11, $vgpr12, $vgpr13, $vgpr14, $vgpr15, $vgpr16, $vgpr31, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11, $sgpr30_sgpr31
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr31
  ; GFX908:   [[COPY1:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY2:%[0-9]+]]:sgpr_32 = COPY $sgpr13
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr12
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_64 = COPY $sgpr8_sgpr9
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY8:%[0-9]+]]:_(s32) = COPY $vgpr0
  ; GFX908:   [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY8]](s32)
  ; GFX908:   [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC]](s16)
  ; GFX908:   [[COPY9:%[0-9]+]]:_(s32) = COPY $vgpr1
  ; GFX908:   [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY9]](s32)
  ; GFX908:   [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC2]](s16)
  ; GFX908:   [[COPY10:%[0-9]+]]:_(s32) = COPY $vgpr2
  ; GFX908:   [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[COPY10]](s32)
  ; GFX908:   [[TRUNC5:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC4]](s16)
  ; GFX908:   [[COPY11:%[0-9]+]]:_(s32) = COPY $vgpr3
  ; GFX908:   [[TRUNC6:%[0-9]+]]:_(s16) = G_TRUNC [[COPY11]](s32)
  ; GFX908:   [[TRUNC7:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC6]](s16)
  ; GFX908:   [[COPY12:%[0-9]+]]:_(s32) = COPY $vgpr4
  ; GFX908:   [[TRUNC8:%[0-9]+]]:_(s16) = G_TRUNC [[COPY12]](s32)
  ; GFX908:   [[TRUNC9:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC8]](s16)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s32) = COPY $vgpr5
  ; GFX908:   [[TRUNC10:%[0-9]+]]:_(s16) = G_TRUNC [[COPY13]](s32)
  ; GFX908:   [[TRUNC11:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC10]](s16)
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY $vgpr6
  ; GFX908:   [[TRUNC12:%[0-9]+]]:_(s16) = G_TRUNC [[COPY14]](s32)
  ; GFX908:   [[TRUNC13:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC12]](s16)
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY $vgpr7
  ; GFX908:   [[TRUNC14:%[0-9]+]]:_(s16) = G_TRUNC [[COPY15]](s32)
  ; GFX908:   [[TRUNC15:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC14]](s16)
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY $vgpr8
  ; GFX908:   [[TRUNC16:%[0-9]+]]:_(s16) = G_TRUNC [[COPY16]](s32)
  ; GFX908:   [[TRUNC17:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC16]](s16)
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY $vgpr9
  ; GFX908:   [[TRUNC18:%[0-9]+]]:_(s16) = G_TRUNC [[COPY17]](s32)
  ; GFX908:   [[TRUNC19:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC18]](s16)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY $vgpr10
  ; GFX908:   [[TRUNC20:%[0-9]+]]:_(s16) = G_TRUNC [[COPY18]](s32)
  ; GFX908:   [[TRUNC21:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC20]](s16)
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY $vgpr11
  ; GFX908:   [[TRUNC22:%[0-9]+]]:_(s16) = G_TRUNC [[COPY19]](s32)
  ; GFX908:   [[TRUNC23:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC22]](s16)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(s32) = COPY $vgpr12
  ; GFX908:   [[TRUNC24:%[0-9]+]]:_(s16) = G_TRUNC [[COPY20]](s32)
  ; GFX908:   [[TRUNC25:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC24]](s16)
  ; GFX908:   [[COPY21:%[0-9]+]]:_(s32) = COPY $vgpr13
  ; GFX908:   [[TRUNC26:%[0-9]+]]:_(s16) = G_TRUNC [[COPY21]](s32)
  ; GFX908:   [[TRUNC27:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC26]](s16)
  ; GFX908:   [[COPY22:%[0-9]+]]:_(s32) = COPY $vgpr14
  ; GFX908:   [[TRUNC28:%[0-9]+]]:_(s16) = G_TRUNC [[COPY22]](s32)
  ; GFX908:   [[TRUNC29:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC28]](s16)
  ; GFX908:   [[COPY23:%[0-9]+]]:_(s32) = COPY $vgpr15
  ; GFX908:   [[TRUNC30:%[0-9]+]]:_(s16) = G_TRUNC [[COPY23]](s32)
  ; GFX908:   [[TRUNC31:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC30]](s16)
  ; GFX908:   [[COPY24:%[0-9]+]]:_(s32) = COPY $vgpr16
  ; GFX908:   [[TRUNC32:%[0-9]+]]:_(s16) = G_TRUNC [[COPY24]](s32)
  ; GFX908:   [[TRUNC33:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC32]](s16)
  ; GFX908:   [[COPY25:%[0-9]+]]:sgpr_64 = COPY $sgpr30_sgpr31
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX908:   [[BUILD_VECTOR:%[0-9]+]]:_(<32 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
  ; GFX908:   [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32), [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32), [[UV8:%[0-9]+]]:_(s32), [[UV9:%[0-9]+]]:_(s32), [[UV10:%[0-9]+]]:_(s32), [[UV11:%[0-9]+]]:_(s32), [[UV12:%[0-9]+]]:_(s32), [[UV13:%[0-9]+]]:_(s32), [[UV14:%[0-9]+]]:_(s32), [[UV15:%[0-9]+]]:_(s32), [[UV16:%[0-9]+]]:_(s32), [[UV17:%[0-9]+]]:_(s32), [[UV18:%[0-9]+]]:_(s32), [[UV19:%[0-9]+]]:_(s32), [[UV20:%[0-9]+]]:_(s32), [[UV21:%[0-9]+]]:_(s32), [[UV22:%[0-9]+]]:_(s32), [[UV23:%[0-9]+]]:_(s32), [[UV24:%[0-9]+]]:_(s32), [[UV25:%[0-9]+]]:_(s32), [[UV26:%[0-9]+]]:_(s32), [[UV27:%[0-9]+]]:_(s32), [[UV28:%[0-9]+]]:_(s32), [[UV29:%[0-9]+]]:_(s32), [[UV30:%[0-9]+]]:_(s32), [[UV31:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[BUILD_VECTOR]](<32 x s32>)
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_v32i32
  ; GFX908:   [[COPY26:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY27:%[0-9]+]]:_(p4) = COPY [[COPY6]]
  ; GFX908:   [[COPY28:%[0-9]+]]:_(p4) = COPY [[COPY5]]
  ; GFX908:   [[COPY29:%[0-9]+]]:_(s64) = COPY [[COPY4]]
  ; GFX908:   [[COPY30:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY31:%[0-9]+]]:_(s32) = COPY [[COPY2]]
  ; GFX908:   [[COPY32:%[0-9]+]]:_(s32) = COPY [[COPY1]]
  ; GFX908:   [[COPY33:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   $vgpr0 = COPY [[UV]](s32)
  ; GFX908:   $vgpr1 = COPY [[UV1]](s32)
  ; GFX908:   $vgpr2 = COPY [[UV2]](s32)
  ; GFX908:   $vgpr3 = COPY [[UV3]](s32)
  ; GFX908:   $vgpr4 = COPY [[UV4]](s32)
  ; GFX908:   $vgpr5 = COPY [[UV5]](s32)
  ; GFX908:   $vgpr6 = COPY [[UV6]](s32)
  ; GFX908:   $vgpr7 = COPY [[UV7]](s32)
  ; GFX908:   $vgpr8 = COPY [[UV8]](s32)
  ; GFX908:   $vgpr9 = COPY [[UV9]](s32)
  ; GFX908:   $vgpr10 = COPY [[UV10]](s32)
  ; GFX908:   $vgpr11 = COPY [[UV11]](s32)
  ; GFX908:   $vgpr12 = COPY [[UV12]](s32)
  ; GFX908:   $vgpr13 = COPY [[UV13]](s32)
  ; GFX908:   $vgpr14 = COPY [[UV14]](s32)
  ; GFX908:   $vgpr15 = COPY [[UV15]](s32)
  ; GFX908:   $vgpr16 = COPY [[UV16]](s32)
  ; GFX908:   $vgpr17 = COPY [[UV17]](s32)
  ; GFX908:   $vgpr18 = COPY [[UV18]](s32)
  ; GFX908:   $vgpr19 = COPY [[UV19]](s32)
  ; GFX908:   $vgpr20 = COPY [[UV20]](s32)
  ; GFX908:   $vgpr21 = COPY [[UV21]](s32)
  ; GFX908:   $vgpr22 = COPY [[UV22]](s32)
  ; GFX908:   $vgpr23 = COPY [[UV23]](s32)
  ; GFX908:   $vgpr24 = COPY [[UV24]](s32)
  ; GFX908:   $vgpr25 = COPY [[UV25]](s32)
  ; GFX908:   $vgpr26 = COPY [[UV26]](s32)
  ; GFX908:   $vgpr27 = COPY [[UV27]](s32)
  ; GFX908:   $vgpr28 = COPY [[UV28]](s32)
  ; GFX908:   $vgpr29 = COPY [[UV29]](s32)
  ; GFX908:   $vgpr30 = COPY [[UV30]](s32)
  ; GFX908:   [[COPY34:%[0-9]+]]:_(p5) = COPY $sgpr32
  ; GFX908:   [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p5) = G_PTR_ADD [[COPY34]], [[C1]](s32)
  ; GFX908:   G_STORE [[UV31]](s32), [[PTR_ADD]](p5) :: (store 4 into stack, align 16, addrspace 5)
  ; GFX908:   [[COPY35:%[0-9]+]]:_(<4 x s32>) = COPY $sgpr0_sgpr1_sgpr2_sgpr3
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY35]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY26]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY27]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[COPY28]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY29]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY30]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY31]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY32]](s32)
  ; GFX908:   $vgpr31 = COPY [[COPY33]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_v32i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $vgpr1, implicit $vgpr2, implicit $vgpr3, implicit $vgpr4, implicit $vgpr5, implicit $vgpr6, implicit $vgpr7, implicit $vgpr8, implicit $vgpr9, implicit $vgpr10, implicit $vgpr11, implicit $vgpr12, implicit $vgpr13, implicit $vgpr14, implicit $vgpr15, implicit $vgpr16, implicit $vgpr17, implicit $vgpr18, implicit $vgpr19, implicit $vgpr20, implicit $vgpr21, implicit $vgpr22, implicit $vgpr23, implicit $vgpr24, implicit $vgpr25, implicit $vgpr26, implicit $vgpr27, implicit $vgpr28, implicit $vgpr29, implicit $vgpr30, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 4, implicit-def $scc
  ; GFX908:   [[COPY36:%[0-9]+]]:ccr_sgpr_64 = COPY [[COPY25]]
  ; GFX908:   S_SETPC_B64_return [[COPY36]]
  call void @external_void_func_v32i32(<32 x i32> zeroinitializer)
  ret void
}

; FIXME: Should fold out parts with known 0 id.

define amdgpu_kernel void @test_only_workitem_id_x() #0 !reqd_work_group_size !0 {
  ; GFX900-LABEL: name: test_only_workitem_id_x
  ; GFX900: bb.1 (%ir-block.0):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_only_workitem_id_x
  ; GFX908: bb.1 (%ir-block.0):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_i32(i32 42)
  ret void
}

define amdgpu_kernel void @test_only_workitem_id_y() #0 !reqd_work_group_size !1 {
  ; GFX900-LABEL: name: test_only_workitem_id_y
  ; GFX900: bb.1 (%ir-block.0):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_only_workitem_id_y
  ; GFX908: bb.1 (%ir-block.0):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_i32(i32 42)
  ret void
}

define amdgpu_kernel void @test_only_workitem_id_z() #0 !reqd_work_group_size !2 {
  ; GFX900-LABEL: name: test_only_workitem_id_z
  ; GFX900: bb.1 (%ir-block.0):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_only_workitem_id_z
  ; GFX908: bb.1 (%ir-block.0):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_i32(i32 42)
  ret void
}

define amdgpu_kernel void @test_only_workitem_id_xy() #0 !reqd_work_group_size !3 {
  ; GFX900-LABEL: name: test_only_workitem_id_xy
  ; GFX900: bb.1 (%ir-block.0):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_only_workitem_id_xy
  ; GFX908: bb.1 (%ir-block.0):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_i32(i32 42)
  ret void
}

define amdgpu_kernel void @test_only_workitem_id_yz() #0 !reqd_work_group_size !4 {
  ; GFX900-LABEL: name: test_only_workitem_id_yz
  ; GFX900: bb.1 (%ir-block.0):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_only_workitem_id_yz
  ; GFX908: bb.1 (%ir-block.0):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_i32(i32 42)
  ret void
}

define amdgpu_kernel void @test_only_workitem_id_xz() #0 !reqd_work_group_size !5 {
  ; GFX900-LABEL: name: test_only_workitem_id_xz
  ; GFX900: bb.1 (%ir-block.0):
  ; GFX900:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX900:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX900:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX900:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX900:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX900:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX900:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX900:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX900:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX900:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX900:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX900:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX900:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX900:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX900:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX900:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX900:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX900:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX900:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX900:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX900:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX900:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX900:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX900:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX900:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX900:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX900:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX900:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX900:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX900:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX900:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX900:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX900:   $vgpr0 = COPY [[C]](s32)
  ; GFX900:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX900:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX900:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX900:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX900:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX900:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX900:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX900:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX900:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX900:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX900:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX900:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX900:   S_ENDPGM 0
  ; GFX908-LABEL: name: test_only_workitem_id_xz
  ; GFX908: bb.1 (%ir-block.0):
  ; GFX908:   liveins: $sgpr14, $sgpr15, $sgpr16, $vgpr0, $vgpr1, $vgpr2, $sgpr4_sgpr5, $sgpr6_sgpr7, $sgpr8_sgpr9, $sgpr10_sgpr11
  ; GFX908:   [[COPY:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr2
  ; GFX908:   [[COPY1:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr1
  ; GFX908:   [[COPY2:%[0-9]+]]:vgpr_32(s32) = COPY $vgpr0
  ; GFX908:   [[COPY3:%[0-9]+]]:sgpr_32 = COPY $sgpr16
  ; GFX908:   [[COPY4:%[0-9]+]]:sgpr_32 = COPY $sgpr15
  ; GFX908:   [[COPY5:%[0-9]+]]:sgpr_32 = COPY $sgpr14
  ; GFX908:   [[COPY6:%[0-9]+]]:sgpr_64 = COPY $sgpr10_sgpr11
  ; GFX908:   [[COPY7:%[0-9]+]]:sgpr_64 = COPY $sgpr6_sgpr7
  ; GFX908:   [[COPY8:%[0-9]+]]:sgpr_64 = COPY $sgpr4_sgpr5
  ; GFX908:   [[COPY9:%[0-9]+]]:_(p4) = COPY $sgpr8_sgpr9
  ; GFX908:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
  ; GFX908:   ADJCALLSTACKUP 0, 0, implicit-def $scc
  ; GFX908:   [[GV:%[0-9]+]]:sreg_64(p0) = G_GLOBAL_VALUE @external_void_func_i32
  ; GFX908:   [[COPY10:%[0-9]+]]:_(p4) = COPY [[COPY8]]
  ; GFX908:   [[COPY11:%[0-9]+]]:_(p4) = COPY [[COPY7]]
  ; GFX908:   [[COPY12:%[0-9]+]]:_(p4) = COPY [[COPY9]](p4)
  ; GFX908:   [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
  ; GFX908:   [[PTR_ADD:%[0-9]+]]:_(p4) = G_PTR_ADD [[COPY12]], [[C1]](s64)
  ; GFX908:   [[COPY13:%[0-9]+]]:_(s64) = COPY [[COPY6]]
  ; GFX908:   [[COPY14:%[0-9]+]]:_(s32) = COPY [[COPY5]]
  ; GFX908:   [[COPY15:%[0-9]+]]:_(s32) = COPY [[COPY4]]
  ; GFX908:   [[COPY16:%[0-9]+]]:_(s32) = COPY [[COPY3]]
  ; GFX908:   [[COPY17:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
  ; GFX908:   [[COPY18:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
  ; GFX908:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
  ; GFX908:   [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY18]], [[C2]](s32)
  ; GFX908:   [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY17]], [[SHL]]
  ; GFX908:   [[COPY19:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
  ; GFX908:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
  ; GFX908:   [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY19]], [[C3]](s32)
  ; GFX908:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]]
  ; GFX908:   $vgpr0 = COPY [[C]](s32)
  ; GFX908:   [[COPY20:%[0-9]+]]:_(<4 x s32>) = COPY $private_rsrc_reg
  ; GFX908:   $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY20]](<4 x s32>)
  ; GFX908:   $sgpr4_sgpr5 = COPY [[COPY10]](p4)
  ; GFX908:   $sgpr6_sgpr7 = COPY [[COPY11]](p4)
  ; GFX908:   $sgpr8_sgpr9 = COPY [[PTR_ADD]](p4)
  ; GFX908:   $sgpr10_sgpr11 = COPY [[COPY13]](s64)
  ; GFX908:   $sgpr12 = COPY [[COPY14]](s32)
  ; GFX908:   $sgpr13 = COPY [[COPY15]](s32)
  ; GFX908:   $sgpr14 = COPY [[COPY16]](s32)
  ; GFX908:   $vgpr31 = COPY [[OR1]](s32)
  ; GFX908:   $sgpr30_sgpr31 = SI_CALL [[GV]](p0), @external_void_func_i32, csr_amdgpu_highregs, implicit $vgpr0, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $vgpr31
  ; GFX908:   ADJCALLSTACKDOWN 0, 0, implicit-def $scc
  ; GFX908:   S_ENDPGM 0
  call void @external_void_func_i32(i32 42)
  ret void
}

declare i32 @llvm.amdgcn.workitem.id.x() #1
declare i32 @llvm.amdgcn.workitem.id.y() #1
declare i32 @llvm.amdgcn.workitem.id.z() #1

attributes #0 = { nounwind }
attributes #1 = { nounwind readnone speculatable willreturn }

!0 = !{i32 64, i32 1, i32 1}
!1 = !{i32 1, i32 64, i32 1}
!2 = !{i32 1, i32 1, i32 64}
!3 = !{i32 32, i32 2, i32 1}
!4 = !{i32 1, i32 32, i32 2}
!5 = !{i32 32, i32 1, i32 2}