brintos

brintos / llvm-project-archived public Read only

0
0
Text · 34.5 KiB · 9afaab5 Raw
962 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 32; RUN:  llc -amdgpu-scalarize-global-loads=false  -mtriple=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=GFX6 %s3; RUN:  llc -amdgpu-scalarize-global-loads=false  -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GFX8 %s4 5define amdgpu_ps <2 x i32> @s_or_v2i32(<2 x i32> inreg %num, <2 x i32> inreg %den) {6; GFX6-LABEL: s_or_v2i32:7; GFX6:       ; %bb.0:8; GFX6-NEXT:    s_or_b64 s[0:1], s[0:1], s[2:3]9; GFX6-NEXT:    ; return to shader part epilog10;11; GFX8-LABEL: s_or_v2i32:12; GFX8:       ; %bb.0:13; GFX8-NEXT:    s_or_b64 s[0:1], s[0:1], s[2:3]14; GFX8-NEXT:    ; return to shader part epilog15  %result = or <2 x i32> %num, %den16  ret <2 x i32> %result17}18 19define <2 x i32> @v_or_v2i32(<2 x i32> %num, <2 x i32> %den) {20; GFX6-LABEL: v_or_v2i32:21; GFX6:       ; %bb.0:22; GFX6-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)23; GFX6-NEXT:    v_or_b32_e32 v1, v1, v324; GFX6-NEXT:    v_or_b32_e32 v0, v0, v225; GFX6-NEXT:    s_setpc_b64 s[30:31]26;27; GFX8-LABEL: v_or_v2i32:28; GFX8:       ; %bb.0:29; GFX8-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)30; GFX8-NEXT:    v_or_b32_e32 v1, v1, v331; GFX8-NEXT:    v_or_b32_e32 v0, v0, v232; GFX8-NEXT:    s_setpc_b64 s[30:31]33  %result = or <2 x i32> %num, %den34  ret <2 x i32> %result35}36 37define amdgpu_kernel void @or_v2i32(ptr addrspace(1) %out, ptr addrspace(1) %in) {38; GFX6-LABEL: or_v2i32:39; GFX6:       ; %bb.0:40; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x941; GFX6-NEXT:    s_mov_b32 s7, 0xf00042; GFX6-NEXT:    s_mov_b32 s6, -143; GFX6-NEXT:    s_mov_b32 s10, s644; GFX6-NEXT:    s_mov_b32 s11, s745; GFX6-NEXT:    s_waitcnt lgkmcnt(0)46; GFX6-NEXT:    s_mov_b32 s8, s247; GFX6-NEXT:    s_mov_b32 s9, s348; GFX6-NEXT:    buffer_load_dwordx4 v[0:3], off, s[8:11], 049; GFX6-NEXT:    s_mov_b32 s4, s050; GFX6-NEXT:    s_mov_b32 s5, s151; GFX6-NEXT:    s_waitcnt vmcnt(0)52; GFX6-NEXT:    v_or_b32_e32 v0, v0, v253; GFX6-NEXT:    v_or_b32_e32 v1, v1, v354; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 055; GFX6-NEXT:    s_endpgm56;57; GFX8-LABEL: or_v2i32:58; GFX8:       ; %bb.0:59; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x2460; GFX8-NEXT:    s_mov_b32 s7, 0xf00061; GFX8-NEXT:    s_mov_b32 s6, -162; GFX8-NEXT:    s_mov_b32 s10, s663; GFX8-NEXT:    s_mov_b32 s11, s764; GFX8-NEXT:    s_waitcnt lgkmcnt(0)65; GFX8-NEXT:    s_mov_b32 s8, s266; GFX8-NEXT:    s_mov_b32 s9, s367; GFX8-NEXT:    buffer_load_dwordx4 v[0:3], off, s[8:11], 068; GFX8-NEXT:    s_mov_b32 s4, s069; GFX8-NEXT:    s_mov_b32 s5, s170; GFX8-NEXT:    s_waitcnt vmcnt(0)71; GFX8-NEXT:    v_or_b32_e32 v0, v0, v272; GFX8-NEXT:    v_or_b32_e32 v1, v1, v373; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 074; GFX8-NEXT:    s_endpgm75  %b_ptr = getelementptr <2 x i32>, ptr addrspace(1) %in, i32 176  %a = load <2 x i32>, ptr addrspace(1) %in77  %b = load <2 x i32>, ptr addrspace(1) %b_ptr78  %result = or <2 x i32> %a, %b79  store <2 x i32> %result, ptr addrspace(1) %out80  ret void81}82 83define amdgpu_kernel void @or_v4i32(ptr addrspace(1) %out, ptr addrspace(1) %in) {84; GFX6-LABEL: or_v4i32:85; GFX6:       ; %bb.0:86; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x987; GFX6-NEXT:    s_mov_b32 s7, 0xf00088; GFX6-NEXT:    s_mov_b32 s6, -189; GFX6-NEXT:    s_mov_b32 s10, s690; GFX6-NEXT:    s_mov_b32 s11, s791; GFX6-NEXT:    s_waitcnt lgkmcnt(0)92; GFX6-NEXT:    s_mov_b32 s8, s293; GFX6-NEXT:    s_mov_b32 s9, s394; GFX6-NEXT:    buffer_load_dwordx4 v[0:3], off, s[8:11], 095; GFX6-NEXT:    buffer_load_dwordx4 v[4:7], off, s[8:11], 0 offset:1696; GFX6-NEXT:    s_mov_b32 s4, s097; GFX6-NEXT:    s_mov_b32 s5, s198; GFX6-NEXT:    s_waitcnt vmcnt(0)99; GFX6-NEXT:    v_or_b32_e32 v3, v3, v7100; GFX6-NEXT:    v_or_b32_e32 v2, v2, v6101; GFX6-NEXT:    v_or_b32_e32 v1, v1, v5102; GFX6-NEXT:    v_or_b32_e32 v0, v0, v4103; GFX6-NEXT:    buffer_store_dwordx4 v[0:3], off, s[4:7], 0104; GFX6-NEXT:    s_endpgm105;106; GFX8-LABEL: or_v4i32:107; GFX8:       ; %bb.0:108; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24109; GFX8-NEXT:    s_mov_b32 s7, 0xf000110; GFX8-NEXT:    s_mov_b32 s6, -1111; GFX8-NEXT:    s_mov_b32 s10, s6112; GFX8-NEXT:    s_mov_b32 s11, s7113; GFX8-NEXT:    s_waitcnt lgkmcnt(0)114; GFX8-NEXT:    s_mov_b32 s8, s2115; GFX8-NEXT:    s_mov_b32 s9, s3116; GFX8-NEXT:    buffer_load_dwordx4 v[0:3], off, s[8:11], 0117; GFX8-NEXT:    buffer_load_dwordx4 v[4:7], off, s[8:11], 0 offset:16118; GFX8-NEXT:    s_mov_b32 s4, s0119; GFX8-NEXT:    s_mov_b32 s5, s1120; GFX8-NEXT:    s_waitcnt vmcnt(0)121; GFX8-NEXT:    v_or_b32_e32 v3, v3, v7122; GFX8-NEXT:    v_or_b32_e32 v2, v2, v6123; GFX8-NEXT:    v_or_b32_e32 v1, v1, v5124; GFX8-NEXT:    v_or_b32_e32 v0, v0, v4125; GFX8-NEXT:    buffer_store_dwordx4 v[0:3], off, s[4:7], 0126; GFX8-NEXT:    s_endpgm127  %b_ptr = getelementptr <4 x i32>, ptr addrspace(1) %in, i32 1128  %a = load <4 x i32>, ptr addrspace(1) %in129  %b = load <4 x i32>, ptr addrspace(1) %b_ptr130  %result = or <4 x i32> %a, %b131  store <4 x i32> %result, ptr addrspace(1) %out132  ret void133}134 135define amdgpu_kernel void @scalar_or_i32(ptr addrspace(1) %out, i32 %a, i32 %b) {136; GFX6-LABEL: scalar_or_i32:137; GFX6:       ; %bb.0:138; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9139; GFX6-NEXT:    s_waitcnt lgkmcnt(0)140; GFX6-NEXT:    s_mov_b64 s[4:5], s[2:3]141; GFX6-NEXT:    s_or_b32 s4, s4, s5142; GFX6-NEXT:    s_mov_b32 s3, 0xf000143; GFX6-NEXT:    s_mov_b32 s2, -1144; GFX6-NEXT:    v_mov_b32_e32 v0, s4145; GFX6-NEXT:    buffer_store_dword v0, off, s[0:3], 0146; GFX6-NEXT:    s_endpgm147;148; GFX8-LABEL: scalar_or_i32:149; GFX8:       ; %bb.0:150; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24151; GFX8-NEXT:    s_waitcnt lgkmcnt(0)152; GFX8-NEXT:    s_mov_b64 s[4:5], s[2:3]153; GFX8-NEXT:    s_or_b32 s4, s4, s5154; GFX8-NEXT:    s_mov_b32 s3, 0xf000155; GFX8-NEXT:    s_mov_b32 s2, -1156; GFX8-NEXT:    v_mov_b32_e32 v0, s4157; GFX8-NEXT:    buffer_store_dword v0, off, s[0:3], 0158; GFX8-NEXT:    s_endpgm159  %or = or i32 %a, %b160  store i32 %or, ptr addrspace(1) %out161  ret void162}163 164define amdgpu_kernel void @vector_or_i32(ptr addrspace(1) %out, ptr addrspace(1) %a, i32 %b) {165; GFX6-LABEL: vector_or_i32:166; GFX6:       ; %bb.0:167; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9168; GFX6-NEXT:    s_load_dword s12, s[4:5], 0xd169; GFX6-NEXT:    s_mov_b32 s7, 0xf000170; GFX6-NEXT:    s_mov_b32 s6, -1171; GFX6-NEXT:    s_mov_b32 s10, s6172; GFX6-NEXT:    s_waitcnt lgkmcnt(0)173; GFX6-NEXT:    s_mov_b32 s8, s2174; GFX6-NEXT:    s_mov_b32 s9, s3175; GFX6-NEXT:    s_mov_b32 s11, s7176; GFX6-NEXT:    buffer_load_dword v0, off, s[8:11], 0177; GFX6-NEXT:    s_mov_b32 s4, s0178; GFX6-NEXT:    s_mov_b32 s5, s1179; GFX6-NEXT:    s_waitcnt vmcnt(0)180; GFX6-NEXT:    v_or_b32_e32 v0, s12, v0181; GFX6-NEXT:    buffer_store_dword v0, off, s[4:7], 0182; GFX6-NEXT:    s_endpgm183;184; GFX8-LABEL: vector_or_i32:185; GFX8:       ; %bb.0:186; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24187; GFX8-NEXT:    s_load_dword s12, s[4:5], 0x34188; GFX8-NEXT:    s_mov_b32 s7, 0xf000189; GFX8-NEXT:    s_mov_b32 s6, -1190; GFX8-NEXT:    s_mov_b32 s10, s6191; GFX8-NEXT:    s_waitcnt lgkmcnt(0)192; GFX8-NEXT:    s_mov_b32 s8, s2193; GFX8-NEXT:    s_mov_b32 s9, s3194; GFX8-NEXT:    s_mov_b32 s11, s7195; GFX8-NEXT:    buffer_load_dword v0, off, s[8:11], 0196; GFX8-NEXT:    s_mov_b32 s4, s0197; GFX8-NEXT:    s_mov_b32 s5, s1198; GFX8-NEXT:    s_waitcnt vmcnt(0)199; GFX8-NEXT:    v_or_b32_e32 v0, s12, v0200; GFX8-NEXT:    buffer_store_dword v0, off, s[4:7], 0201; GFX8-NEXT:    s_endpgm202  %loada = load i32, ptr addrspace(1) %a203  %or = or i32 %loada, %b204  store i32 %or, ptr addrspace(1) %out205  ret void206}207 208define amdgpu_kernel void @scalar_or_literal_i32(ptr addrspace(1) %out, i32 %a) {209; GFX6-LABEL: scalar_or_literal_i32:210; GFX6:       ; %bb.0:211; GFX6-NEXT:    s_load_dword s6, s[4:5], 0xb212; GFX6-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9213; GFX6-NEXT:    s_mov_b32 s3, 0xf000214; GFX6-NEXT:    s_mov_b32 s2, -1215; GFX6-NEXT:    s_waitcnt lgkmcnt(0)216; GFX6-NEXT:    s_or_b32 s4, s6, 0x1869f217; GFX6-NEXT:    v_mov_b32_e32 v0, s4218; GFX6-NEXT:    buffer_store_dword v0, off, s[0:3], 0219; GFX6-NEXT:    s_endpgm220;221; GFX8-LABEL: scalar_or_literal_i32:222; GFX8:       ; %bb.0:223; GFX8-NEXT:    s_load_dword s6, s[4:5], 0x2c224; GFX8-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24225; GFX8-NEXT:    s_mov_b32 s3, 0xf000226; GFX8-NEXT:    s_mov_b32 s2, -1227; GFX8-NEXT:    s_waitcnt lgkmcnt(0)228; GFX8-NEXT:    s_or_b32 s4, s6, 0x1869f229; GFX8-NEXT:    v_mov_b32_e32 v0, s4230; GFX8-NEXT:    buffer_store_dword v0, off, s[0:3], 0231; GFX8-NEXT:    s_endpgm232  %or = or i32 %a, 99999233  store i32 %or, ptr addrspace(1) %out, align 4234  ret void235}236 237define amdgpu_kernel void @scalar_or_literal_i64(ptr addrspace(1) %out, [8 x i32], i64 %a) {238; GFX6-LABEL: scalar_or_literal_i64:239; GFX6:       ; %bb.0:240; GFX6-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x13241; GFX6-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9242; GFX6-NEXT:    s_mov_b32 s3, 0xf000243; GFX6-NEXT:    s_mov_b32 s2, -1244; GFX6-NEXT:    s_waitcnt lgkmcnt(0)245; GFX6-NEXT:    s_or_b32 s4, s7, 0xf237b246; GFX6-NEXT:    s_or_b32 s5, s6, 0x3039247; GFX6-NEXT:    v_mov_b32_e32 v0, s5248; GFX6-NEXT:    v_mov_b32_e32 v1, s4249; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0250; GFX6-NEXT:    s_endpgm251;252; GFX8-LABEL: scalar_or_literal_i64:253; GFX8:       ; %bb.0:254; GFX8-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x4c255; GFX8-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24256; GFX8-NEXT:    s_mov_b32 s3, 0xf000257; GFX8-NEXT:    s_mov_b32 s2, -1258; GFX8-NEXT:    s_waitcnt lgkmcnt(0)259; GFX8-NEXT:    s_or_b32 s4, s7, 0xf237b260; GFX8-NEXT:    s_or_b32 s5, s6, 0x3039261; GFX8-NEXT:    v_mov_b32_e32 v0, s5262; GFX8-NEXT:    v_mov_b32_e32 v1, s4263; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0264; GFX8-NEXT:    s_endpgm265  %or = or i64 %a, 4261135838621753266  store i64 %or, ptr addrspace(1) %out267  ret void268}269 270define amdgpu_kernel void @scalar_or_literal_multi_use_i64(ptr addrspace(1) %out, [8 x i32], i64 %a, [8 x i32], i64 %b) {271; GFX6-LABEL: scalar_or_literal_multi_use_i64:272; GFX6:       ; %bb.0:273; GFX6-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9274; GFX6-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x13275; GFX6-NEXT:    s_load_dwordx2 s[4:5], s[4:5], 0x1d276; GFX6-NEXT:    s_movk_i32 s8, 0x3039277; GFX6-NEXT:    s_mov_b32 s9, 0xf237b278; GFX6-NEXT:    s_mov_b32 s3, 0xf000279; GFX6-NEXT:    s_waitcnt lgkmcnt(0)280; GFX6-NEXT:    s_or_b64 s[6:7], s[6:7], s[8:9]281; GFX6-NEXT:    v_mov_b32_e32 v0, s6282; GFX6-NEXT:    s_mov_b32 s2, -1283; GFX6-NEXT:    v_mov_b32_e32 v1, s7284; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0285; GFX6-NEXT:    s_add_u32 s0, s4, 0x3039286; GFX6-NEXT:    s_addc_u32 s1, s5, 0xf237b287; GFX6-NEXT:    s_waitcnt expcnt(0)288; GFX6-NEXT:    v_mov_b32_e32 v0, s0289; GFX6-NEXT:    v_mov_b32_e32 v1, s1290; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0291; GFX6-NEXT:    s_waitcnt vmcnt(0)292; GFX6-NEXT:    s_endpgm293;294; GFX8-LABEL: scalar_or_literal_multi_use_i64:295; GFX8:       ; %bb.0:296; GFX8-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x4c297; GFX8-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24298; GFX8-NEXT:    s_load_dwordx2 s[4:5], s[4:5], 0x74299; GFX8-NEXT:    s_movk_i32 s8, 0x3039300; GFX8-NEXT:    s_mov_b32 s9, 0xf237b301; GFX8-NEXT:    s_waitcnt lgkmcnt(0)302; GFX8-NEXT:    s_or_b64 s[6:7], s[6:7], s[8:9]303; GFX8-NEXT:    v_mov_b32_e32 v0, s6304; GFX8-NEXT:    s_mov_b32 s3, 0xf000305; GFX8-NEXT:    s_mov_b32 s2, -1306; GFX8-NEXT:    v_mov_b32_e32 v1, s7307; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0308; GFX8-NEXT:    s_add_u32 s0, s4, 0x3039309; GFX8-NEXT:    s_addc_u32 s1, s5, 0xf237b310; GFX8-NEXT:    v_mov_b32_e32 v0, s0311; GFX8-NEXT:    v_mov_b32_e32 v1, s1312; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0313; GFX8-NEXT:    s_waitcnt vmcnt(0)314; GFX8-NEXT:    s_endpgm315  %or = or i64 %a, 4261135838621753316  store i64 %or, ptr addrspace(1) %out317 318  %foo = add i64 %b, 4261135838621753319  store volatile i64 %foo, ptr addrspace(1) poison320  ret void321}322 323define amdgpu_kernel void @scalar_or_inline_imm_i64(ptr addrspace(1) %out, [8 x i32], i64 %a) {324; GFX6-LABEL: scalar_or_inline_imm_i64:325; GFX6:       ; %bb.0:326; GFX6-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x13327; GFX6-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9328; GFX6-NEXT:    s_mov_b32 s3, 0xf000329; GFX6-NEXT:    s_mov_b32 s2, -1330; GFX6-NEXT:    s_waitcnt lgkmcnt(0)331; GFX6-NEXT:    s_or_b32 s4, s6, 63332; GFX6-NEXT:    v_mov_b32_e32 v0, s4333; GFX6-NEXT:    v_mov_b32_e32 v1, s7334; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0335; GFX6-NEXT:    s_endpgm336;337; GFX8-LABEL: scalar_or_inline_imm_i64:338; GFX8:       ; %bb.0:339; GFX8-NEXT:    s_load_dwordx2 s[6:7], s[4:5], 0x4c340; GFX8-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24341; GFX8-NEXT:    s_mov_b32 s3, 0xf000342; GFX8-NEXT:    s_mov_b32 s2, -1343; GFX8-NEXT:    s_waitcnt lgkmcnt(0)344; GFX8-NEXT:    s_or_b32 s4, s6, 63345; GFX8-NEXT:    v_mov_b32_e32 v0, s4346; GFX8-NEXT:    v_mov_b32_e32 v1, s7347; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0348; GFX8-NEXT:    s_endpgm349  %or = or i64 %a, 63350  store i64 %or, ptr addrspace(1) %out351  ret void352}353 354define amdgpu_kernel void @scalar_or_inline_imm_multi_use_i64(ptr addrspace(1) %out, i64 %a, i64 %b) {355; GFX6-LABEL: scalar_or_inline_imm_multi_use_i64:356; GFX6:       ; %bb.0:357; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9358; GFX6-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0xd359; GFX6-NEXT:    s_mov_b32 s7, 0xf000360; GFX6-NEXT:    s_mov_b32 s6, -1361; GFX6-NEXT:    s_waitcnt lgkmcnt(0)362; GFX6-NEXT:    s_mov_b32 s4, s0363; GFX6-NEXT:    s_or_b32 s0, s2, 63364; GFX6-NEXT:    s_mov_b32 s5, s1365; GFX6-NEXT:    v_mov_b32_e32 v0, s0366; GFX6-NEXT:    v_mov_b32_e32 v1, s3367; GFX6-NEXT:    s_add_u32 s0, s8, 63368; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0369; GFX6-NEXT:    s_addc_u32 s1, s9, 0370; GFX6-NEXT:    s_waitcnt expcnt(0)371; GFX6-NEXT:    v_mov_b32_e32 v0, s0372; GFX6-NEXT:    v_mov_b32_e32 v1, s1373; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0374; GFX6-NEXT:    s_waitcnt vmcnt(0)375; GFX6-NEXT:    s_endpgm376;377; GFX8-LABEL: scalar_or_inline_imm_multi_use_i64:378; GFX8:       ; %bb.0:379; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24380; GFX8-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0x34381; GFX8-NEXT:    s_mov_b32 s7, 0xf000382; GFX8-NEXT:    s_mov_b32 s6, -1383; GFX8-NEXT:    s_waitcnt lgkmcnt(0)384; GFX8-NEXT:    s_mov_b32 s4, s0385; GFX8-NEXT:    s_or_b32 s0, s2, 63386; GFX8-NEXT:    s_mov_b32 s5, s1387; GFX8-NEXT:    v_mov_b32_e32 v0, s0388; GFX8-NEXT:    v_mov_b32_e32 v1, s3389; GFX8-NEXT:    s_add_u32 s0, s8, 63390; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0391; GFX8-NEXT:    s_addc_u32 s1, s9, 0392; GFX8-NEXT:    v_mov_b32_e32 v0, s0393; GFX8-NEXT:    v_mov_b32_e32 v1, s1394; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0395; GFX8-NEXT:    s_waitcnt vmcnt(0)396; GFX8-NEXT:    s_endpgm397  %or = or i64 %a, 63398  store i64 %or, ptr addrspace(1) %out399  %foo = add i64 %b, 63400  store volatile i64 %foo, ptr addrspace(1) poison401  ret void402}403 404define amdgpu_kernel void @scalar_or_neg_inline_imm_i64(ptr addrspace(1) %out, [8 x i32], i64 %a) {405; GFX6-LABEL: scalar_or_neg_inline_imm_i64:406; GFX6:       ; %bb.0:407; GFX6-NEXT:    s_load_dword s6, s[4:5], 0x13408; GFX6-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9409; GFX6-NEXT:    s_mov_b32 s3, 0xf000410; GFX6-NEXT:    s_mov_b32 s2, -1411; GFX6-NEXT:    v_mov_b32_e32 v1, -1412; GFX6-NEXT:    s_waitcnt lgkmcnt(0)413; GFX6-NEXT:    s_or_b32 s4, s6, -8414; GFX6-NEXT:    v_mov_b32_e32 v0, s4415; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0416; GFX6-NEXT:    s_endpgm417;418; GFX8-LABEL: scalar_or_neg_inline_imm_i64:419; GFX8:       ; %bb.0:420; GFX8-NEXT:    s_load_dword s6, s[4:5], 0x4c421; GFX8-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24422; GFX8-NEXT:    s_mov_b32 s3, 0xf000423; GFX8-NEXT:    s_mov_b32 s2, -1424; GFX8-NEXT:    v_mov_b32_e32 v1, -1425; GFX8-NEXT:    s_waitcnt lgkmcnt(0)426; GFX8-NEXT:    s_or_b32 s4, s6, -8427; GFX8-NEXT:    v_mov_b32_e32 v0, s4428; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[0:3], 0429; GFX8-NEXT:    s_endpgm430  %or = or i64 %a, -8431  store i64 %or, ptr addrspace(1) %out432  ret void433}434 435define amdgpu_kernel void @vector_or_literal_i32(ptr addrspace(1) %out, ptr addrspace(1) %a, ptr addrspace(1) %b) {436; GFX6-LABEL: vector_or_literal_i32:437; GFX6:       ; %bb.0:438; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9439; GFX6-NEXT:    s_mov_b32 s7, 0xf000440; GFX6-NEXT:    s_mov_b32 s6, -1441; GFX6-NEXT:    s_mov_b32 s10, s6442; GFX6-NEXT:    s_mov_b32 s11, s7443; GFX6-NEXT:    s_waitcnt lgkmcnt(0)444; GFX6-NEXT:    s_mov_b32 s8, s2445; GFX6-NEXT:    s_mov_b32 s9, s3446; GFX6-NEXT:    buffer_load_dword v0, off, s[8:11], 0447; GFX6-NEXT:    s_mov_b32 s4, s0448; GFX6-NEXT:    s_mov_b32 s5, s1449; GFX6-NEXT:    s_waitcnt vmcnt(0)450; GFX6-NEXT:    v_or_b32_e32 v0, 0xffff, v0451; GFX6-NEXT:    buffer_store_dword v0, off, s[4:7], 0452; GFX6-NEXT:    s_endpgm453;454; GFX8-LABEL: vector_or_literal_i32:455; GFX8:       ; %bb.0:456; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24457; GFX8-NEXT:    s_mov_b32 s7, 0xf000458; GFX8-NEXT:    s_mov_b32 s6, -1459; GFX8-NEXT:    s_mov_b32 s10, s6460; GFX8-NEXT:    s_mov_b32 s11, s7461; GFX8-NEXT:    s_waitcnt lgkmcnt(0)462; GFX8-NEXT:    s_mov_b32 s8, s2463; GFX8-NEXT:    s_mov_b32 s9, s3464; GFX8-NEXT:    buffer_load_dword v0, off, s[8:11], 0465; GFX8-NEXT:    s_mov_b32 s4, s0466; GFX8-NEXT:    s_mov_b32 s5, s1467; GFX8-NEXT:    s_waitcnt vmcnt(0)468; GFX8-NEXT:    v_or_b32_e32 v0, 0xffff, v0469; GFX8-NEXT:    buffer_store_dword v0, off, s[4:7], 0470; GFX8-NEXT:    s_endpgm471  %loada = load i32, ptr addrspace(1) %a, align 4472  %or = or i32 %loada, 65535473  store i32 %or, ptr addrspace(1) %out, align 4474  ret void475}476 477define amdgpu_kernel void @vector_or_inline_immediate_i32(ptr addrspace(1) %out, ptr addrspace(1) %a, ptr addrspace(1) %b) {478; GFX6-LABEL: vector_or_inline_immediate_i32:479; GFX6:       ; %bb.0:480; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9481; GFX6-NEXT:    s_mov_b32 s7, 0xf000482; GFX6-NEXT:    s_mov_b32 s6, -1483; GFX6-NEXT:    s_mov_b32 s10, s6484; GFX6-NEXT:    s_mov_b32 s11, s7485; GFX6-NEXT:    s_waitcnt lgkmcnt(0)486; GFX6-NEXT:    s_mov_b32 s8, s2487; GFX6-NEXT:    s_mov_b32 s9, s3488; GFX6-NEXT:    buffer_load_dword v0, off, s[8:11], 0489; GFX6-NEXT:    s_mov_b32 s4, s0490; GFX6-NEXT:    s_mov_b32 s5, s1491; GFX6-NEXT:    s_waitcnt vmcnt(0)492; GFX6-NEXT:    v_or_b32_e32 v0, 4, v0493; GFX6-NEXT:    buffer_store_dword v0, off, s[4:7], 0494; GFX6-NEXT:    s_endpgm495;496; GFX8-LABEL: vector_or_inline_immediate_i32:497; GFX8:       ; %bb.0:498; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24499; GFX8-NEXT:    s_mov_b32 s7, 0xf000500; GFX8-NEXT:    s_mov_b32 s6, -1501; GFX8-NEXT:    s_mov_b32 s10, s6502; GFX8-NEXT:    s_mov_b32 s11, s7503; GFX8-NEXT:    s_waitcnt lgkmcnt(0)504; GFX8-NEXT:    s_mov_b32 s8, s2505; GFX8-NEXT:    s_mov_b32 s9, s3506; GFX8-NEXT:    buffer_load_dword v0, off, s[8:11], 0507; GFX8-NEXT:    s_mov_b32 s4, s0508; GFX8-NEXT:    s_mov_b32 s5, s1509; GFX8-NEXT:    s_waitcnt vmcnt(0)510; GFX8-NEXT:    v_or_b32_e32 v0, 4, v0511; GFX8-NEXT:    buffer_store_dword v0, off, s[4:7], 0512; GFX8-NEXT:    s_endpgm513  %loada = load i32, ptr addrspace(1) %a, align 4514  %or = or i32 %loada, 4515  store i32 %or, ptr addrspace(1) %out, align 4516  ret void517}518 519define amdgpu_kernel void @scalar_or_i64(ptr addrspace(1) %out, i64 %a, i64 %b) {520; GFX6-LABEL: scalar_or_i64:521; GFX6:       ; %bb.0:522; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9523; GFX6-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0xd524; GFX6-NEXT:    s_mov_b32 s7, 0xf000525; GFX6-NEXT:    s_mov_b32 s6, -1526; GFX6-NEXT:    s_waitcnt lgkmcnt(0)527; GFX6-NEXT:    s_mov_b32 s4, s0528; GFX6-NEXT:    s_mov_b32 s5, s1529; GFX6-NEXT:    s_or_b64 s[0:1], s[2:3], s[8:9]530; GFX6-NEXT:    v_mov_b32_e32 v0, s0531; GFX6-NEXT:    v_mov_b32_e32 v1, s1532; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0533; GFX6-NEXT:    s_endpgm534;535; GFX8-LABEL: scalar_or_i64:536; GFX8:       ; %bb.0:537; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24538; GFX8-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0x34539; GFX8-NEXT:    s_mov_b32 s7, 0xf000540; GFX8-NEXT:    s_mov_b32 s6, -1541; GFX8-NEXT:    s_waitcnt lgkmcnt(0)542; GFX8-NEXT:    s_mov_b32 s4, s0543; GFX8-NEXT:    s_mov_b32 s5, s1544; GFX8-NEXT:    s_or_b64 s[0:1], s[2:3], s[8:9]545; GFX8-NEXT:    v_mov_b32_e32 v0, s0546; GFX8-NEXT:    v_mov_b32_e32 v1, s1547; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0548; GFX8-NEXT:    s_endpgm549  %or = or i64 %a, %b550  store i64 %or, ptr addrspace(1) %out551  ret void552}553 554define amdgpu_kernel void @vector_or_i64(ptr addrspace(1) %out, ptr addrspace(1) %a, ptr addrspace(1) %b) {555; GFX6-LABEL: vector_or_i64:556; GFX6:       ; %bb.0:557; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9558; GFX6-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0xd559; GFX6-NEXT:    s_mov_b32 s7, 0xf000560; GFX6-NEXT:    s_mov_b32 s6, -1561; GFX6-NEXT:    s_mov_b32 s10, s6562; GFX6-NEXT:    s_mov_b32 s11, s7563; GFX6-NEXT:    s_waitcnt lgkmcnt(0)564; GFX6-NEXT:    s_mov_b32 s12, s2565; GFX6-NEXT:    s_mov_b32 s13, s3566; GFX6-NEXT:    s_mov_b32 s14, s6567; GFX6-NEXT:    s_mov_b32 s15, s7568; GFX6-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0569; GFX6-NEXT:    buffer_load_dwordx2 v[2:3], off, s[12:15], 0570; GFX6-NEXT:    s_mov_b32 s4, s0571; GFX6-NEXT:    s_mov_b32 s5, s1572; GFX6-NEXT:    s_waitcnt vmcnt(0)573; GFX6-NEXT:    v_or_b32_e32 v0, v2, v0574; GFX6-NEXT:    v_or_b32_e32 v1, v3, v1575; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0576; GFX6-NEXT:    s_endpgm577;578; GFX8-LABEL: vector_or_i64:579; GFX8:       ; %bb.0:580; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24581; GFX8-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0x34582; GFX8-NEXT:    s_mov_b32 s7, 0xf000583; GFX8-NEXT:    s_mov_b32 s6, -1584; GFX8-NEXT:    s_mov_b32 s10, s6585; GFX8-NEXT:    s_mov_b32 s11, s7586; GFX8-NEXT:    s_waitcnt lgkmcnt(0)587; GFX8-NEXT:    s_mov_b32 s12, s2588; GFX8-NEXT:    s_mov_b32 s13, s3589; GFX8-NEXT:    s_mov_b32 s14, s6590; GFX8-NEXT:    s_mov_b32 s15, s7591; GFX8-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0592; GFX8-NEXT:    buffer_load_dwordx2 v[2:3], off, s[12:15], 0593; GFX8-NEXT:    s_mov_b32 s4, s0594; GFX8-NEXT:    s_mov_b32 s5, s1595; GFX8-NEXT:    s_waitcnt vmcnt(0)596; GFX8-NEXT:    v_or_b32_e32 v0, v2, v0597; GFX8-NEXT:    v_or_b32_e32 v1, v3, v1598; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0599; GFX8-NEXT:    s_endpgm600  %loada = load i64, ptr addrspace(1) %a, align 8601  %loadb = load i64, ptr addrspace(1) %b, align 8602  %or = or i64 %loada, %loadb603  store i64 %or, ptr addrspace(1) %out604  ret void605}606 607define amdgpu_kernel void @scalar_vector_or_i64(ptr addrspace(1) %out, ptr addrspace(1) %a, i64 %b) {608; GFX6-LABEL: scalar_vector_or_i64:609; GFX6:       ; %bb.0:610; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9611; GFX6-NEXT:    s_load_dwordx2 s[12:13], s[4:5], 0xd612; GFX6-NEXT:    s_mov_b32 s7, 0xf000613; GFX6-NEXT:    s_mov_b32 s6, -1614; GFX6-NEXT:    s_mov_b32 s10, s6615; GFX6-NEXT:    s_waitcnt lgkmcnt(0)616; GFX6-NEXT:    s_mov_b32 s8, s2617; GFX6-NEXT:    s_mov_b32 s9, s3618; GFX6-NEXT:    s_mov_b32 s11, s7619; GFX6-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0620; GFX6-NEXT:    s_mov_b32 s4, s0621; GFX6-NEXT:    s_mov_b32 s5, s1622; GFX6-NEXT:    s_waitcnt vmcnt(0)623; GFX6-NEXT:    v_or_b32_e32 v0, s12, v0624; GFX6-NEXT:    v_or_b32_e32 v1, s13, v1625; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0626; GFX6-NEXT:    s_endpgm627;628; GFX8-LABEL: scalar_vector_or_i64:629; GFX8:       ; %bb.0:630; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24631; GFX8-NEXT:    s_load_dwordx2 s[12:13], s[4:5], 0x34632; GFX8-NEXT:    s_mov_b32 s7, 0xf000633; GFX8-NEXT:    s_mov_b32 s6, -1634; GFX8-NEXT:    s_mov_b32 s10, s6635; GFX8-NEXT:    s_waitcnt lgkmcnt(0)636; GFX8-NEXT:    s_mov_b32 s8, s2637; GFX8-NEXT:    s_mov_b32 s9, s3638; GFX8-NEXT:    s_mov_b32 s11, s7639; GFX8-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0640; GFX8-NEXT:    s_mov_b32 s4, s0641; GFX8-NEXT:    s_mov_b32 s5, s1642; GFX8-NEXT:    s_waitcnt vmcnt(0)643; GFX8-NEXT:    v_or_b32_e32 v0, s12, v0644; GFX8-NEXT:    v_or_b32_e32 v1, s13, v1645; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0646; GFX8-NEXT:    s_endpgm647  %loada = load i64, ptr addrspace(1) %a648  %or = or i64 %loada, %b649  store i64 %or, ptr addrspace(1) %out650  ret void651}652 653define amdgpu_kernel void @vector_or_i64_loadimm(ptr addrspace(1) %out, ptr addrspace(1) %a, ptr addrspace(1) %b) {654; GFX6-LABEL: vector_or_i64_loadimm:655; GFX6:       ; %bb.0:656; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9657; GFX6-NEXT:    s_mov_b32 s7, 0xf000658; GFX6-NEXT:    s_mov_b32 s6, -1659; GFX6-NEXT:    s_mov_b32 s10, s6660; GFX6-NEXT:    s_mov_b32 s11, s7661; GFX6-NEXT:    s_waitcnt lgkmcnt(0)662; GFX6-NEXT:    s_mov_b32 s8, s2663; GFX6-NEXT:    s_mov_b32 s9, s3664; GFX6-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0665; GFX6-NEXT:    s_mov_b32 s4, s0666; GFX6-NEXT:    s_mov_b32 s5, s1667; GFX6-NEXT:    s_waitcnt vmcnt(0)668; GFX6-NEXT:    v_or_b32_e32 v1, 0x146f, v1669; GFX6-NEXT:    v_or_b32_e32 v0, 0xdf77987f, v0670; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0671; GFX6-NEXT:    s_endpgm672;673; GFX8-LABEL: vector_or_i64_loadimm:674; GFX8:       ; %bb.0:675; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24676; GFX8-NEXT:    s_mov_b32 s7, 0xf000677; GFX8-NEXT:    s_mov_b32 s6, -1678; GFX8-NEXT:    s_mov_b32 s10, s6679; GFX8-NEXT:    s_mov_b32 s11, s7680; GFX8-NEXT:    s_waitcnt lgkmcnt(0)681; GFX8-NEXT:    s_mov_b32 s8, s2682; GFX8-NEXT:    s_mov_b32 s9, s3683; GFX8-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0684; GFX8-NEXT:    s_mov_b32 s4, s0685; GFX8-NEXT:    s_mov_b32 s5, s1686; GFX8-NEXT:    s_waitcnt vmcnt(0)687; GFX8-NEXT:    v_or_b32_e32 v1, 0x146f, v1688; GFX8-NEXT:    v_or_b32_e32 v0, 0xdf77987f, v0689; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0690; GFX8-NEXT:    s_endpgm691  %loada = load i64, ptr addrspace(1) %a, align 8692  %or = or i64 %loada, 22470723082367693  store i64 %or, ptr addrspace(1) %out694  ret void695}696 697; FIXME: The or 0 should really be removed.698define amdgpu_kernel void @vector_or_i64_imm(ptr addrspace(1) %out, ptr addrspace(1) %a, ptr addrspace(1) %b) {699; GFX6-LABEL: vector_or_i64_imm:700; GFX6:       ; %bb.0:701; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9702; GFX6-NEXT:    s_mov_b32 s7, 0xf000703; GFX6-NEXT:    s_mov_b32 s6, -1704; GFX6-NEXT:    s_mov_b32 s10, s6705; GFX6-NEXT:    s_mov_b32 s11, s7706; GFX6-NEXT:    s_waitcnt lgkmcnt(0)707; GFX6-NEXT:    s_mov_b32 s8, s2708; GFX6-NEXT:    s_mov_b32 s9, s3709; GFX6-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0710; GFX6-NEXT:    s_mov_b32 s4, s0711; GFX6-NEXT:    s_mov_b32 s5, s1712; GFX6-NEXT:    s_waitcnt vmcnt(0)713; GFX6-NEXT:    v_or_b32_e32 v0, 8, v0714; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0715; GFX6-NEXT:    s_endpgm716;717; GFX8-LABEL: vector_or_i64_imm:718; GFX8:       ; %bb.0:719; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24720; GFX8-NEXT:    s_mov_b32 s7, 0xf000721; GFX8-NEXT:    s_mov_b32 s6, -1722; GFX8-NEXT:    s_mov_b32 s10, s6723; GFX8-NEXT:    s_mov_b32 s11, s7724; GFX8-NEXT:    s_waitcnt lgkmcnt(0)725; GFX8-NEXT:    s_mov_b32 s8, s2726; GFX8-NEXT:    s_mov_b32 s9, s3727; GFX8-NEXT:    buffer_load_dwordx2 v[0:1], off, s[8:11], 0728; GFX8-NEXT:    s_mov_b32 s4, s0729; GFX8-NEXT:    s_mov_b32 s5, s1730; GFX8-NEXT:    s_waitcnt vmcnt(0)731; GFX8-NEXT:    v_or_b32_e32 v0, 8, v0732; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0733; GFX8-NEXT:    s_endpgm734  %loada = load i64, ptr addrspace(1) %a, align 8735  %or = or i64 %loada, 8736  store i64 %or, ptr addrspace(1) %out737  ret void738}739 740define amdgpu_kernel void @vector_or_i64_neg_inline_imm(ptr addrspace(1) %out, ptr addrspace(1) %a, ptr addrspace(1) %b) {741; GFX6-LABEL: vector_or_i64_neg_inline_imm:742; GFX6:       ; %bb.0:743; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9744; GFX6-NEXT:    s_mov_b32 s7, 0xf000745; GFX6-NEXT:    s_mov_b32 s6, -1746; GFX6-NEXT:    s_mov_b32 s10, s6747; GFX6-NEXT:    s_mov_b32 s11, s7748; GFX6-NEXT:    s_waitcnt lgkmcnt(0)749; GFX6-NEXT:    s_mov_b32 s8, s2750; GFX6-NEXT:    s_mov_b32 s9, s3751; GFX6-NEXT:    buffer_load_dword v0, off, s[8:11], 0752; GFX6-NEXT:    s_mov_b32 s4, s0753; GFX6-NEXT:    s_mov_b32 s5, s1754; GFX6-NEXT:    v_mov_b32_e32 v1, -1755; GFX6-NEXT:    s_waitcnt vmcnt(0)756; GFX6-NEXT:    v_or_b32_e32 v0, -8, v0757; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0758; GFX6-NEXT:    s_endpgm759;760; GFX8-LABEL: vector_or_i64_neg_inline_imm:761; GFX8:       ; %bb.0:762; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24763; GFX8-NEXT:    s_mov_b32 s7, 0xf000764; GFX8-NEXT:    s_mov_b32 s6, -1765; GFX8-NEXT:    s_mov_b32 s10, s6766; GFX8-NEXT:    s_mov_b32 s11, s7767; GFX8-NEXT:    s_waitcnt lgkmcnt(0)768; GFX8-NEXT:    s_mov_b32 s8, s2769; GFX8-NEXT:    s_mov_b32 s9, s3770; GFX8-NEXT:    buffer_load_dword v0, off, s[8:11], 0771; GFX8-NEXT:    s_mov_b32 s4, s0772; GFX8-NEXT:    s_mov_b32 s5, s1773; GFX8-NEXT:    v_mov_b32_e32 v1, -1774; GFX8-NEXT:    s_waitcnt vmcnt(0)775; GFX8-NEXT:    v_or_b32_e32 v0, -8, v0776; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0777; GFX8-NEXT:    s_endpgm778  %loada = load i64, ptr addrspace(1) %a, align 8779  %or = or i64 %loada, -8780  store i64 %or, ptr addrspace(1) %out781  ret void782}783 784define amdgpu_kernel void @vector_or_i64_neg_literal(ptr addrspace(1) %out, ptr addrspace(1) %a, ptr addrspace(1) %b) {785; GFX6-LABEL: vector_or_i64_neg_literal:786; GFX6:       ; %bb.0:787; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9788; GFX6-NEXT:    s_mov_b32 s7, 0xf000789; GFX6-NEXT:    s_mov_b32 s6, -1790; GFX6-NEXT:    s_mov_b32 s10, s6791; GFX6-NEXT:    s_mov_b32 s11, s7792; GFX6-NEXT:    s_waitcnt lgkmcnt(0)793; GFX6-NEXT:    s_mov_b32 s8, s2794; GFX6-NEXT:    s_mov_b32 s9, s3795; GFX6-NEXT:    buffer_load_dword v0, off, s[8:11], 0796; GFX6-NEXT:    s_mov_b32 s4, s0797; GFX6-NEXT:    s_mov_b32 s5, s1798; GFX6-NEXT:    v_mov_b32_e32 v1, -1799; GFX6-NEXT:    s_waitcnt vmcnt(0)800; GFX6-NEXT:    v_or_b32_e32 v0, 0xffffff38, v0801; GFX6-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0802; GFX6-NEXT:    s_endpgm803;804; GFX8-LABEL: vector_or_i64_neg_literal:805; GFX8:       ; %bb.0:806; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24807; GFX8-NEXT:    s_mov_b32 s7, 0xf000808; GFX8-NEXT:    s_mov_b32 s6, -1809; GFX8-NEXT:    s_mov_b32 s10, s6810; GFX8-NEXT:    s_mov_b32 s11, s7811; GFX8-NEXT:    s_waitcnt lgkmcnt(0)812; GFX8-NEXT:    s_mov_b32 s8, s2813; GFX8-NEXT:    s_mov_b32 s9, s3814; GFX8-NEXT:    buffer_load_dword v0, off, s[8:11], 0815; GFX8-NEXT:    s_mov_b32 s4, s0816; GFX8-NEXT:    s_mov_b32 s5, s1817; GFX8-NEXT:    v_mov_b32_e32 v1, -1818; GFX8-NEXT:    s_waitcnt vmcnt(0)819; GFX8-NEXT:    v_or_b32_e32 v0, 0xffffff38, v0820; GFX8-NEXT:    buffer_store_dwordx2 v[0:1], off, s[4:7], 0821; GFX8-NEXT:    s_endpgm822  %loada = load i64, ptr addrspace(1) %a, align 8823  %or = or i64 %loada, -200824  store i64 %or, ptr addrspace(1) %out825  ret void826}827 828define amdgpu_kernel void @trunc_i64_or_to_i32(ptr addrspace(1) %out, [8 x i32], i64 %a, [8 x i32], i64 %b) {829; GFX6-LABEL: trunc_i64_or_to_i32:830; GFX6:       ; %bb.0:831; GFX6-NEXT:    s_load_dword s6, s[4:5], 0x13832; GFX6-NEXT:    s_load_dword s7, s[4:5], 0x1d833; GFX6-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x9834; GFX6-NEXT:    s_mov_b32 s3, 0xf000835; GFX6-NEXT:    s_mov_b32 s2, -1836; GFX6-NEXT:    s_waitcnt lgkmcnt(0)837; GFX6-NEXT:    s_or_b32 s4, s7, s6838; GFX6-NEXT:    v_mov_b32_e32 v0, s4839; GFX6-NEXT:    buffer_store_dword v0, off, s[0:3], 0840; GFX6-NEXT:    s_endpgm841;842; GFX8-LABEL: trunc_i64_or_to_i32:843; GFX8:       ; %bb.0:844; GFX8-NEXT:    s_load_dword s6, s[4:5], 0x4c845; GFX8-NEXT:    s_load_dword s7, s[4:5], 0x74846; GFX8-NEXT:    s_load_dwordx2 s[0:1], s[4:5], 0x24847; GFX8-NEXT:    s_mov_b32 s3, 0xf000848; GFX8-NEXT:    s_mov_b32 s2, -1849; GFX8-NEXT:    s_waitcnt lgkmcnt(0)850; GFX8-NEXT:    s_or_b32 s4, s7, s6851; GFX8-NEXT:    v_mov_b32_e32 v0, s4852; GFX8-NEXT:    buffer_store_dword v0, off, s[0:3], 0853; GFX8-NEXT:    s_endpgm854  %add = or i64 %b, %a855  %trunc = trunc i64 %add to i32856  store i32 %trunc, ptr addrspace(1) %out, align 8857  ret void858}859 860define amdgpu_kernel void @or_i1(ptr addrspace(1) %out, ptr addrspace(1) %in0, ptr addrspace(1) %in1) {861; GFX6-LABEL: or_i1:862; GFX6:       ; %bb.0:863; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x9864; GFX6-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0xd865; GFX6-NEXT:    s_mov_b32 s7, 0xf000866; GFX6-NEXT:    s_mov_b32 s6, -1867; GFX6-NEXT:    s_mov_b32 s10, s6868; GFX6-NEXT:    s_mov_b32 s11, s7869; GFX6-NEXT:    s_waitcnt lgkmcnt(0)870; GFX6-NEXT:    s_mov_b32 s12, s2871; GFX6-NEXT:    s_mov_b32 s13, s3872; GFX6-NEXT:    s_mov_b32 s14, s6873; GFX6-NEXT:    s_mov_b32 s15, s7874; GFX6-NEXT:    buffer_load_dword v0, off, s[8:11], 0875; GFX6-NEXT:    buffer_load_dword v1, off, s[12:15], 0876; GFX6-NEXT:    s_mov_b32 s4, s0877; GFX6-NEXT:    s_mov_b32 s5, s1878; GFX6-NEXT:    s_waitcnt vmcnt(1)879; GFX6-NEXT:    v_mul_f32_e32 v0, 1.0, v0880; GFX6-NEXT:    s_waitcnt vmcnt(0)881; GFX6-NEXT:    v_mul_f32_e32 v1, 1.0, v1882; GFX6-NEXT:    v_max_f32_e32 v0, v1, v0883; GFX6-NEXT:    v_cmp_le_f32_e32 vcc, 0, v0884; GFX6-NEXT:    v_cndmask_b32_e64 v0, 0, 1, vcc885; GFX6-NEXT:    buffer_store_dword v0, off, s[4:7], 0886; GFX6-NEXT:    s_endpgm887;888; GFX8-LABEL: or_i1:889; GFX8:       ; %bb.0:890; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x24891; GFX8-NEXT:    s_load_dwordx2 s[8:9], s[4:5], 0x34892; GFX8-NEXT:    s_mov_b32 s7, 0xf000893; GFX8-NEXT:    s_mov_b32 s6, -1894; GFX8-NEXT:    s_mov_b32 s10, s6895; GFX8-NEXT:    s_mov_b32 s11, s7896; GFX8-NEXT:    s_waitcnt lgkmcnt(0)897; GFX8-NEXT:    s_mov_b32 s12, s2898; GFX8-NEXT:    s_mov_b32 s13, s3899; GFX8-NEXT:    s_mov_b32 s14, s6900; GFX8-NEXT:    s_mov_b32 s15, s7901; GFX8-NEXT:    buffer_load_dword v0, off, s[8:11], 0902; GFX8-NEXT:    buffer_load_dword v1, off, s[12:15], 0903; GFX8-NEXT:    s_mov_b32 s4, s0904; GFX8-NEXT:    s_mov_b32 s5, s1905; GFX8-NEXT:    s_waitcnt vmcnt(1)906; GFX8-NEXT:    v_mul_f32_e32 v0, 1.0, v0907; GFX8-NEXT:    s_waitcnt vmcnt(0)908; GFX8-NEXT:    v_mul_f32_e32 v1, 1.0, v1909; GFX8-NEXT:    v_max_f32_e32 v0, v1, v0910; GFX8-NEXT:    v_cmp_le_f32_e32 vcc, 0, v0911; GFX8-NEXT:    v_cndmask_b32_e64 v0, 0, 1, vcc912; GFX8-NEXT:    buffer_store_dword v0, off, s[4:7], 0913; GFX8-NEXT:    s_endpgm914  %a = load float, ptr addrspace(1) %in0915  %b = load float, ptr addrspace(1) %in1916  %acmp = fcmp oge float %a, 0.000000e+00917  %bcmp = fcmp oge float %b, 0.000000e+00918  %or = or i1 %acmp, %bcmp919  %result = zext i1 %or to i32920  store i32 %result, ptr addrspace(1) %out921  ret void922}923 924define amdgpu_kernel void @s_or_i1(ptr addrspace(1) %out, i32 %a, i32 %b, i32 %c, i32 %d) {925; GFX6-LABEL: s_or_i1:926; GFX6:       ; %bb.0:927; GFX6-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0xb928; GFX6-NEXT:    s_load_dwordx2 s[4:5], s[4:5], 0x9929; GFX6-NEXT:    s_mov_b32 s7, 0xf000930; GFX6-NEXT:    s_mov_b32 s6, -1931; GFX6-NEXT:    s_waitcnt lgkmcnt(0)932; GFX6-NEXT:    s_cmp_eq_u32 s0, s1933; GFX6-NEXT:    s_cselect_b64 s[0:1], -1, 0934; GFX6-NEXT:    s_cmp_eq_u32 s2, s3935; GFX6-NEXT:    s_cselect_b64 s[2:3], -1, 0936; GFX6-NEXT:    s_or_b64 s[0:1], s[0:1], s[2:3]937; GFX6-NEXT:    v_cndmask_b32_e64 v0, 0, 1, s[0:1]938; GFX6-NEXT:    buffer_store_byte v0, off, s[4:7], 0939; GFX6-NEXT:    s_endpgm940;941; GFX8-LABEL: s_or_i1:942; GFX8:       ; %bb.0:943; GFX8-NEXT:    s_load_dwordx4 s[0:3], s[4:5], 0x2c944; GFX8-NEXT:    s_load_dwordx2 s[4:5], s[4:5], 0x24945; GFX8-NEXT:    s_mov_b32 s7, 0xf000946; GFX8-NEXT:    s_mov_b32 s6, -1947; GFX8-NEXT:    s_waitcnt lgkmcnt(0)948; GFX8-NEXT:    s_cmp_eq_u32 s0, s1949; GFX8-NEXT:    s_cselect_b64 s[0:1], -1, 0950; GFX8-NEXT:    s_cmp_eq_u32 s2, s3951; GFX8-NEXT:    s_cselect_b64 s[2:3], -1, 0952; GFX8-NEXT:    s_or_b64 s[0:1], s[0:1], s[2:3]953; GFX8-NEXT:    v_cndmask_b32_e64 v0, 0, 1, s[0:1]954; GFX8-NEXT:    buffer_store_byte v0, off, s[4:7], 0955; GFX8-NEXT:    s_endpgm956  %cmp0 = icmp eq i32 %a, %b957  %cmp1 = icmp eq i32 %c, %d958  %or = or i1 %cmp0, %cmp1959  store i1 %or, ptr addrspace(1) %out960  ret void961}962