2016-09-03 02:52:28 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
|
2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
|
2015-02-04 05:53:27 +08:00
|
|
|
; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
|
|
|
|
; RUN: llc -march=r600 -mcpu=cayman < %s | FileCheck -check-prefix=CM -check-prefix=FUNC %s
|
2013-04-06 07:31:51 +08:00
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_i1:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT MSKOR
|
2016-09-03 03:07:06 +08:00
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
|
|
|
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT MSKOR
|
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_byte
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_i1(i1 addrspace(1)* %out) {
|
2014-03-08 04:12:33 +08:00
|
|
|
entry:
|
|
|
|
store i1 true, i1 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2013-08-16 09:12:06 +08:00
|
|
|
|
|
|
|
; i8 store
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_i8:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT MSKOR T[[RW_GPR:[0-9]]].XW, T{{[0-9]}}.X
|
2016-09-03 03:07:06 +08:00
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
2014-12-12 08:00:24 +08:00
|
|
|
|
2013-09-05 03:53:46 +08:00
|
|
|
; IG 0: Get the byte index and truncate the value
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: AND_INT * T{{[0-9]}}.[[BI_CHAN:[XYZW]]], KC0[2].Y, literal.x
|
|
|
|
; EG: LSHL T{{[0-9]}}.[[SHIFT_CHAN:[XYZW]]], PV.[[BI_CHAN]], literal.x
|
|
|
|
; EG: AND_INT * T{{[0-9]}}.[[TRUNC_CHAN:[XYZW]]], KC0[2].Z, literal.y
|
|
|
|
; EG-NEXT: 3(4.203895e-45), 255(3.573311e-43)
|
2014-12-12 08:00:24 +08:00
|
|
|
|
|
|
|
|
2013-09-05 03:53:46 +08:00
|
|
|
; IG 1: Truncate the calculated the shift amount for the mask
|
2014-12-12 08:00:24 +08:00
|
|
|
|
2013-08-16 09:12:06 +08:00
|
|
|
; IG 2: Shift the value and the mask
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: LSHL T[[RW_GPR]].X, PS, PV.[[SHIFT_CHAN]]
|
|
|
|
; EG: LSHL * T[[RW_GPR]].W, literal.x, PV.[[SHIFT_CHAN]]
|
|
|
|
; EG-NEXT: 255
|
2013-08-16 09:12:06 +08:00
|
|
|
; IG 3: Initialize the Y and Z channels to zero
|
|
|
|
; XXX: An optimal scheduler should merge this into one of the prevous IGs.
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MOV T[[RW_GPR]].Y, 0.0
|
|
|
|
; EG: MOV * T[[RW_GPR]].Z, 0.0
|
2013-08-16 09:12:06 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_byte
|
2013-08-16 09:12:06 +08:00
|
|
|
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_i8(i8 addrspace(1)* %out, i8 %in) {
|
2013-08-16 09:12:06 +08:00
|
|
|
entry:
|
|
|
|
store i8 %in, i8 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; i16 store
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_i16:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT MSKOR T[[RW_GPR:[0-9]]].XW, T{{[0-9]}}.X
|
2016-09-03 03:07:06 +08:00
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
2014-12-12 08:00:24 +08:00
|
|
|
|
2013-09-05 03:53:46 +08:00
|
|
|
; IG 0: Get the byte index and truncate the value
|
2014-12-12 08:00:24 +08:00
|
|
|
|
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: AND_INT * T{{[0-9]}}.[[BI_CHAN:[XYZW]]], KC0[2].Y, literal.x
|
|
|
|
; EG-NEXT: 3(4.203895e-45),
|
2014-12-12 08:00:24 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: LSHL T{{[0-9]}}.[[SHIFT_CHAN:[XYZW]]], PV.[[BI_CHAN]], literal.x
|
|
|
|
; EG: AND_INT * T{{[0-9]}}.[[TRUNC_CHAN:[XYZW]]], KC0[2].Z, literal.y
|
2014-12-12 08:00:24 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG-NEXT: 3(4.203895e-45), 65535(9.183409e-41)
|
2013-09-05 03:53:46 +08:00
|
|
|
; IG 1: Truncate the calculated the shift amount for the mask
|
2014-12-12 08:00:24 +08:00
|
|
|
|
2013-08-16 09:12:06 +08:00
|
|
|
; IG 2: Shift the value and the mask
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: LSHL T[[RW_GPR]].X, PS, PV.[[SHIFT_CHAN]]
|
|
|
|
; EG: LSHL * T[[RW_GPR]].W, literal.x, PV.[[SHIFT_CHAN]]
|
|
|
|
; EG-NEXT: 65535
|
2013-08-16 09:12:06 +08:00
|
|
|
; IG 3: Initialize the Y and Z channels to zero
|
|
|
|
; XXX: An optimal scheduler should merge this into one of the prevous IGs.
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MOV T[[RW_GPR]].Y, 0.0
|
|
|
|
; EG: MOV * T[[RW_GPR]].Z, 0.0
|
2013-08-16 09:12:06 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_short
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_i16(i16 addrspace(1)* %out, i16 %in) {
|
2013-08-16 09:12:06 +08:00
|
|
|
entry:
|
|
|
|
store i16 %in, i16 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-07-02 06:47:50 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_i24:
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: s_lshr_b32 s{{[0-9]+}}, s{{[0-9]+}}, 16
|
|
|
|
; GCN-DAG: buffer_store_byte
|
|
|
|
; GCN-DAG: buffer_store_short
|
2016-09-03 03:07:06 +08:00
|
|
|
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: MEM_RAT MSKOR
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_i24(i24 addrspace(1)* %out, i24 %in) {
|
2016-07-02 06:47:50 +08:00
|
|
|
entry:
|
|
|
|
store i24 %in, i24 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; FUNC-LABEL: {{^}}store_i25:
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: s_and_b32 [[AND:s[0-9]+]], s{{[0-9]+}}, 0x1ffffff{{$}}
|
|
|
|
; GCN: v_mov_b32_e32 [[VAND:v[0-9]+]], [[AND]]
|
|
|
|
; GCN: buffer_store_dword [[VAND]]
|
2016-09-03 03:07:06 +08:00
|
|
|
|
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
; EG-NOT: MEM_RAT
|
|
|
|
|
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
; CM-NOT: MEM_RAT
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_i25(i25 addrspace(1)* %out, i25 %in) {
|
2016-07-02 06:47:50 +08:00
|
|
|
entry:
|
|
|
|
store i25 %in, i25 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v2i8:
|
2016-09-03 03:07:06 +08:00
|
|
|
; v2i8 is naturally 2B aligned
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 03:07:06 +08:00
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT MSKOR
|
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_short
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v2i8(<2 x i8> addrspace(1)* %out, <2 x i32> %in) {
|
2013-08-16 09:12:11 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <2 x i32> %in to <2 x i8>
|
|
|
|
store <2 x i8> %0, <2 x i8> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-09-03 03:07:06 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v2i8_unaligned:
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
|
|
|
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT MSKOR
|
|
|
|
|
|
|
|
; SI: buffer_store_byte
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v2i8_unaligned(<2 x i8> addrspace(1)* %out, <2 x i32> %in) {
|
2016-09-03 03:07:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <2 x i32> %in to <2 x i8>
|
|
|
|
store <2 x i8> %0, <2 x i8> addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-08-16 09:12:11 +08:00
|
|
|
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v2i16:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dword
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v2i16(<2 x i16> addrspace(1)* %out, <2 x i32> %in) {
|
2013-08-16 09:12:11 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <2 x i32> %in to <2 x i16>
|
|
|
|
store <2 x i16> %0, <2 x i16> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-09-03 03:07:06 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v2i16_unaligned:
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
|
|
|
|
; SI: buffer_store_short
|
|
|
|
; SI: buffer_store_short
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v2i16_unaligned(<2 x i16> addrspace(1)* %out, <2 x i32> %in) {
|
2016-09-03 03:07:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <2 x i32> %in to <2 x i16>
|
|
|
|
store <2 x i16> %0, <2 x i16> addrspace(1)* %out, align 2
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v4i8:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dword
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v4i8(<4 x i8> addrspace(1)* %out, <4 x i32> %in) {
|
2013-08-16 09:12:11 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <4 x i32> %in to <4 x i8>
|
|
|
|
store <4 x i8> %0, <4 x i8> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-09-03 03:07:06 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v4i8_unaligned:
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
|
|
|
|
; SI: buffer_store_byte
|
|
|
|
; SI: buffer_store_byte
|
|
|
|
; SI: buffer_store_byte
|
|
|
|
; SI: buffer_store_byte
|
|
|
|
; SI-NOT: buffer_store_dword
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v4i8_unaligned(<4 x i8> addrspace(1)* %out, <4 x i32> %in) {
|
2016-09-03 03:07:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <4 x i32> %in to <4 x i8>
|
|
|
|
store <4 x i8> %0, <4 x i8> addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; FUNC-LABEL: {{^}}store_v4i8_halfaligned:
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT MSKOR
|
|
|
|
; EG-NOT: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT MSKOR
|
|
|
|
; CM-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
|
|
|
|
; SI: buffer_store_short
|
|
|
|
; SI: buffer_store_short
|
|
|
|
; SI-NOT: buffer_store_dword
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v4i8_halfaligned(<4 x i8> addrspace(1)* %out, <4 x i32> %in) {
|
2016-09-03 03:07:06 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <4 x i32> %in to <4 x i8>
|
|
|
|
store <4 x i8> %0, <4 x i8> addrspace(1)* %out, align 2
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-04-19 10:10:53 +08:00
|
|
|
; floating-point store
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_f32:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+\.X, T[0-9]+\.X}}, 1
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD T{{[0-9]+\.X, T[0-9]+\.X}}
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dword
|
2013-04-06 07:31:51 +08:00
|
|
|
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_f32(float addrspace(1)* %out, float %in) {
|
2013-04-06 07:31:51 +08:00
|
|
|
store float %in, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2013-06-25 10:39:35 +08:00
|
|
|
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v4i16:
|
2016-09-03 03:07:06 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.XY
|
|
|
|
|
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD T{{[0-9]+}}
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dwordx2
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v4i16(<4 x i16> addrspace(1)* %out, <4 x i32> %in) {
|
2013-08-16 09:12:11 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc <4 x i32> %in to <4 x i16>
|
|
|
|
store <4 x i16> %0, <4 x i16> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-19 05:43:42 +08:00
|
|
|
; vec2 floating-point stores
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v2f32:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dwordx2
|
2013-07-19 05:43:42 +08:00
|
|
|
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v2f32(<2 x float> addrspace(1)* %out, float %a, float %b) {
|
2013-07-19 05:43:42 +08:00
|
|
|
entry:
|
|
|
|
%0 = insertelement <2 x float> <float 0.0, float 0.0>, float %a, i32 0
|
2013-08-15 07:24:32 +08:00
|
|
|
%1 = insertelement <2 x float> %0, float %b, i32 1
|
2013-07-19 05:43:42 +08:00
|
|
|
store <2 x float> %1, <2 x float> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v3i32:
|
|
|
|
; GCN-DAG: buffer_store_dwordx2
|
2016-11-03 01:24:54 +08:00
|
|
|
; GCN-DAG: buffer_store_dword v
|
2016-09-03 02:52:28 +08:00
|
|
|
|
|
|
|
; EG-DAG: MEM_RAT_CACHELESS STORE_RAW {{T[0-9]+\.[XYZW]}}, {{T[0-9]+\.[XYZW]}},
|
|
|
|
; EG-DAG: MEM_RAT_CACHELESS STORE_RAW {{T[0-9]+\.XY}}, {{T[0-9]+\.[XYZW]}},
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v3i32(<3 x i32> addrspace(1)* %out, <3 x i32> %a) nounwind {
|
2016-09-03 02:52:28 +08:00
|
|
|
store <3 x i32> %a, <3 x i32> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v4i32:
|
2016-09-03 02:52:28 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW {{T[0-9]+\.XYZW}}
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG-NOT: MEM_RAT_CACHELESS STORE_RAW
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
; CM-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dwordx4
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> %in) {
|
2013-08-16 09:12:00 +08:00
|
|
|
entry:
|
|
|
|
store <4 x i32> %in, <4 x i32> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-09-03 03:07:06 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_v4i32_unaligned:
|
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW {{T[0-9]+\.XYZW}}
|
|
|
|
; EG-NOT: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
|
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
; CM-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
|
|
|
|
; SI: buffer_store_dwordx4
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v4i32_unaligned(<4 x i32> addrspace(1)* %out, <4 x i32> %in) {
|
2016-09-03 03:07:06 +08:00
|
|
|
entry:
|
|
|
|
store <4 x i32> %in, <4 x i32> addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; v4f32 store
|
|
|
|
; FUNC-LABEL: {{^}}store_v4f32:
|
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+\.XYZW, T[0-9]+\.X}}, 1
|
|
|
|
; EG-NOT: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
|
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
; CM-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
|
|
|
|
; GCN: buffer_store_dwordx4
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_v4f32(<4 x float> addrspace(1)* %out, <4 x float> addrspace(1)* %in) {
|
2016-09-03 02:52:28 +08:00
|
|
|
%1 = load <4 x float>, <4 x float> addrspace(1) * %in
|
|
|
|
store <4 x float> %1, <4 x float> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_i64_i8:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT MSKOR
|
2016-09-03 03:07:06 +08:00
|
|
|
|
|
|
|
; CM: MEM_RAT MSKOR
|
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_byte
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_i64_i8(i8 addrspace(1)* %out, i64 %in) {
|
2014-05-02 23:41:46 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc i64 %in to i8
|
|
|
|
store i8 %0, i8 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}store_i64_i16:
|
2015-02-04 05:53:27 +08:00
|
|
|
; EG: MEM_RAT MSKOR
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_short
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_i64_i16(i16 addrspace(1)* %out, i64 %in) {
|
2014-05-02 23:41:46 +08:00
|
|
|
entry:
|
|
|
|
%0 = trunc i64 %in to i16
|
|
|
|
store i16 %0, i16 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-06-25 10:39:35 +08:00
|
|
|
; The stores in this function are combined by the optimizer to create a
|
2016-09-03 03:07:06 +08:00
|
|
|
; 64-bit store with 32-bit alignment. This is legal and the legalizer
|
2013-06-25 10:39:35 +08:00
|
|
|
; should not try to split the 64-bit store back into 2 32-bit stores.
|
|
|
|
|
2015-03-22 03:15:46 +08:00
|
|
|
; FUNC-LABEL: {{^}}vecload2:
|
2016-09-03 03:07:06 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+\.XY, T[0-9]+\.X}}, 1
|
|
|
|
; EG-NOT: MEM_RAT_CACHELESS STORE_RAW
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2015-02-04 05:53:27 +08:00
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD
|
2016-09-03 03:07:06 +08:00
|
|
|
; CM-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
2015-03-22 03:15:46 +08:00
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dwordx2
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @vecload2(i32 addrspace(1)* nocapture %out, i32 addrspace(2)* nocapture %mem) #0 {
|
2013-06-25 10:39:35 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load i32, i32 addrspace(2)* %mem, align 4
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%arrayidx1.i = getelementptr inbounds i32, i32 addrspace(2)* %mem, i64 1
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i32, i32 addrspace(2)* %arrayidx1.i, align 4
|
2013-10-01 02:17:35 +08:00
|
|
|
store i32 %0, i32 addrspace(1)* %out, align 4
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %out, i64 1
|
2013-10-01 02:17:35 +08:00
|
|
|
store i32 %1, i32 addrspace(1)* %arrayidx1, align 4
|
2013-06-25 10:39:35 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-04-18 05:00:11 +08:00
|
|
|
; When i128 was a legal type this program generated cannot select errors:
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}"i128-const-store":
|
2016-02-23 05:04:16 +08:00
|
|
|
; EG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.XYZW, T{{[0-9]+}}.X, 1
|
|
|
|
|
|
|
|
; CM: MEM_RAT_CACHELESS STORE_DWORD T{{[0-9]+}}, T{{[0-9]+}}.X
|
|
|
|
|
2016-09-03 02:52:28 +08:00
|
|
|
; GCN: buffer_store_dwordx4
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @i128-const-store(i32 addrspace(1)* %out) {
|
2014-04-18 05:00:11 +08:00
|
|
|
entry:
|
|
|
|
store i32 1, i32 addrspace(1)* %out, align 4
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%arrayidx2 = getelementptr inbounds i32, i32 addrspace(1)* %out, i64 1
|
2014-04-18 05:00:11 +08:00
|
|
|
store i32 1, i32 addrspace(1)* %arrayidx2, align 4
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%arrayidx4 = getelementptr inbounds i32, i32 addrspace(1)* %out, i64 2
|
2014-04-18 05:00:11 +08:00
|
|
|
store i32 2, i32 addrspace(1)* %arrayidx4, align 4
|
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
llvm-svn: 230786
2015-02-28 03:29:02 +08:00
|
|
|
%arrayidx6 = getelementptr inbounds i32, i32 addrspace(1)* %out, i64 3
|
2014-04-18 05:00:11 +08:00
|
|
|
store i32 2, i32 addrspace(1)* %arrayidx6, align 4
|
|
|
|
ret void
|
|
|
|
}
|
2016-02-23 05:04:16 +08:00
|
|
|
|
2016-07-12 07:35:48 +08:00
|
|
|
attributes #0 = { nounwind }
|