[PATCH] D37230: Set hasSideEffects=0 for TargetOpcode::BUNDLE
Alex Bradbury via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 11 08:22:44 PDT 2017
asb added a comment.
I'm trying to update this patch to reflect the latest upstream changes in the test files, and am having a terrible time updating the AMDGPU tests. I'd really appreciate a second pair of eyes here.
Command line:
`./bin/llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -verify-machineinstrs < ../test/CodeGen/AMDGPU/byval-frame-setup.ll | ./bin/FileCheck -enable-var-scope -check-prefixes=GCN,VI ../test/CodeGen/AMDGPU/byval-frame-setup.ll`
This complains:
../test/CodeGen/AMDGPU/byval-frame-setup.ll:83:8: error: expected string not found in input
; GCN: buffer_load_dword [[LOAD0:v[0-9]+]], off, s[0:3], s5 offset:8
^
<stdin>:111:2: note: scanning from here
buffer_load_dword v2, off, s[0:3], s5 offset:16
^
<stdin>:124:2: note: possible intended match here
buffer_load_dword v0, off, s[0:3], s5 offset:24
^
The relevant part of the test is:
; GCN-LABEL: {{^}}call_void_func_byval_struct_func:
; GCN: s_mov_b32 s5, s32
; GCN-DAG: s_add_u32 s32, s32, 0xc00{{$}}
; GCN-DAG: v_writelane_b32
; GCN-DAG: v_mov_b32_e32 [[NINE:v[0-9]+]], 9
; GCN-DAG: v_mov_b32_e32 [[THIRTEEN:v[0-9]+]], 13
; GCN-DAG: buffer_store_dword [[NINE]], off, s[0:3], s5 offset:8
; GCN-DAG: buffer_store_dword [[THIRTEEN]], off, s[0:3], s5 offset:24
; GCN: buffer_load_dword [[LOAD0:v[0-9]+]], off, s[0:3], s5 offset:8
; GCN: buffer_load_dword [[LOAD1:v[0-9]+]], off, s[0:3], s5 offset:12
; GCN: buffer_load_dword [[LOAD2:v[0-9]+]], off, s[0:3], s5 offset:16
; GCN: buffer_load_dword [[LOAD3:v[0-9]+]], off, s[0:3], s5 offset:20
; GCN-NOT: s_add_u32 s32, s32, 0x800
; GCN-DAG: buffer_store_dword [[LOAD0]], off, s[0:3], s32 offset:4{{$}}
; GCN-DAG: buffer_store_dword [[LOAD1]], off, s[0:3], s32 offset:8
; GCN-DAG: buffer_store_dword [[LOAD2]], off, s[0:3], s32 offset:12
; GCN-DAG: buffer_store_dword [[LOAD3]], off, s[0:3], s32 offset:16
The function in question:
call_void_func_byval_struct_func: ; @call_void_func_byval_struct_func
; BB#0: ; %entry
s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
s_mov_b32 s5, s32
buffer_store_dword v32, off, s[0:3], s5 offset:40
s_waitcnt expcnt(0)
v_writelane_b32 v32, s33, 0
v_writelane_b32 v32, s34, 1
v_mov_b32_e32 v0, 9
v_mov_b32_e32 v1, 13
v_writelane_b32 v32, s35, 2
buffer_store_dword v0, off, s[0:3], s5 offset:8
buffer_store_dword v1, off, s[0:3], s5 offset:24
s_waitcnt expcnt(1)
buffer_load_dword v0, off, s[0:3], s5 offset:8
s_waitcnt expcnt(0)
buffer_load_dword v1, off, s[0:3], s5 offset:12
s_add_u32 s32, s32, 0xc00
buffer_load_dword v2, off, s[0:3], s5 offset:16
buffer_load_dword v3, off, s[0:3], s5 offset:20
s_getpc_b64 s[6:7]
s_add_u32 s6, s6, void_func_byval_struct at rel32@lo+4
s_addc_u32 s7, s7, void_func_byval_struct at rel32@hi+4
s_mov_b64 s[34:35], s[30:31]
s_mov_b32 s33, s5
s_waitcnt vmcnt(0)
buffer_store_dword v3, off, s[0:3], s32 offset:16
buffer_store_dword v2, off, s[0:3], s32 offset:12
buffer_store_dword v1, off, s[0:3], s32 offset:8
buffer_store_dword v0, off, s[0:3], s32 offset:4
s_waitcnt expcnt(0)
buffer_load_dword v0, off, s[0:3], s5 offset:24
buffer_load_dword v1, off, s[0:3], s5 offset:28
buffer_load_dword v2, off, s[0:3], s5 offset:32
buffer_load_dword v3, off, s[0:3], s5 offset:36
s_waitcnt vmcnt(0)
buffer_store_dword v3, off, s[0:3], s32 offset:32
buffer_store_dword v2, off, s[0:3], s32 offset:28
buffer_store_dword v1, off, s[0:3], s32 offset:24
buffer_store_dword v0, off, s[0:3], s32 offset:20
s_swappc_b64 s[30:31], s[6:7]
s_mov_b32 s5, s33
s_mov_b64 s[30:31], s[34:35]
v_readlane_b32 s35, v32, 2
v_readlane_b32 s34, v32, 1
v_readlane_b32 s33, v32, 0
buffer_load_dword v32, off, s[0:3], s5 offset:40
s_sub_u32 s32, s32, 0xc00
s_waitcnt vmcnt(0) expcnt(0)
s_setpc_b64 s[30:31]
.Lfunc_end2:
.size call_void_func_byval_struct_func, .Lfunc_end2-call_void_func_byval_struct_func
; -- End function
Now unless I'm going crazy here, I really can't see the problem matching `buffer_load_dword v0, off, s[0:3], s5 offset:8`. Am I missing something obvious, or misunderstanding -DAG in FileCheck?
https://reviews.llvm.org/D37230
More information about the llvm-commits
mailing list