LiveIntervalAnalysis: fix a crash in repairOldRegInRange
Summary:
See the new test case for one that was (non-deterministically) crashing
on trunk and deterministically hit the assertion that I added in D23302.
Basically, the machine function contains a sequence
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
%vreg14:sub1<def> = COPY %vreg14:sub0
and SILoadStoreOptimizer::mergeWrite2Pair merges the two DS_WRITE_B32
instructions into one before calling repairIntervalsInRange.
Now repairIntervalsInRange wants to repair %vreg14, in particular, and
ends up trying to repair %vreg14:sub1 as well, but that only becomes
active _after_ the range that is to be repaired, hence the crash due
to LR.find(...) == LR.begin() at the start of repairOldRegInRange.
I believe that just skipping those subrange is fine, but again, not too
familiar with that code.
Reviewers: MatzeB, kparzysz, tstellarAMD
Subscribers: llvm-commits, MatzeB
Differential Revision: https://reviews.llvm.org/D23303
llvm-svn: 278268
2016-08-11 02:51:14 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck %s
|
|
|
|
|
|
|
|
; This is used to crash in LiveIntervalAnalysis via SILoadStoreOptimizer
|
|
|
|
; while fixing up the merge of two ds_write instructions.
|
|
|
|
|
|
|
|
@tess_lds = external addrspace(3) global [8192 x i32]
|
|
|
|
|
|
|
|
; CHECK-LABEL: {{^}}main:
|
|
|
|
; CHECK: ds_write2_b32
|
|
|
|
; CHECK: v_mov_b32_e32 v1, v0
|
|
|
|
; CHECK: tbuffer_store_format_xyzw v[0:3],
|
|
|
|
define amdgpu_vs void @main(i32 inreg %arg) {
|
|
|
|
main_body:
|
|
|
|
%tmp = load float, float addrspace(3)* undef, align 4
|
|
|
|
%tmp1 = load float, float addrspace(3)* undef, align 4
|
|
|
|
store float %tmp, float addrspace(3)* null, align 4
|
|
|
|
%tmp2 = bitcast float %tmp to i32
|
|
|
|
%tmp3 = add nuw nsw i32 0, 1
|
|
|
|
%tmp4 = zext i32 %tmp3 to i64
|
|
|
|
%tmp5 = getelementptr [8192 x i32], [8192 x i32] addrspace(3)* @tess_lds, i64 0, i64 %tmp4
|
|
|
|
%tmp6 = bitcast i32 addrspace(3)* %tmp5 to float addrspace(3)*
|
|
|
|
store float %tmp1, float addrspace(3)* %tmp6, align 4
|
|
|
|
%tmp7 = bitcast float %tmp1 to i32
|
|
|
|
%tmp8 = insertelement <4 x i32> undef, i32 %tmp2, i32 0
|
|
|
|
%tmp9 = insertelement <4 x i32> %tmp8, i32 %tmp7, i32 1
|
|
|
|
%tmp10 = insertelement <4 x i32> %tmp9, i32 undef, i32 2
|
|
|
|
%tmp11 = insertelement <4 x i32> %tmp10, i32 undef, i32 3
|
2017-06-23 00:29:22 +08:00
|
|
|
call void @llvm.amdgcn.tbuffer.store.v4i32(<4 x i32> %tmp11, <4 x i32> undef, i32 undef, i32 0, i32 %arg, i32 0, i32 14, i32 4, i1 1, i1 1)
|
LiveIntervalAnalysis: fix a crash in repairOldRegInRange
Summary:
See the new test case for one that was (non-deterministically) crashing
on trunk and deterministically hit the assertion that I added in D23302.
Basically, the machine function contains a sequence
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
%vreg14:sub1<def> = COPY %vreg14:sub0
and SILoadStoreOptimizer::mergeWrite2Pair merges the two DS_WRITE_B32
instructions into one before calling repairIntervalsInRange.
Now repairIntervalsInRange wants to repair %vreg14, in particular, and
ends up trying to repair %vreg14:sub1 as well, but that only becomes
active _after_ the range that is to be repaired, hence the crash due
to LR.find(...) == LR.begin() at the start of repairOldRegInRange.
I believe that just skipping those subrange is fine, but again, not too
familiar with that code.
Reviewers: MatzeB, kparzysz, tstellarAMD
Subscribers: llvm-commits, MatzeB
Differential Revision: https://reviews.llvm.org/D23303
llvm-svn: 278268
2016-08-11 02:51:14 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
2017-06-23 00:29:22 +08:00
|
|
|
declare void @llvm.amdgcn.tbuffer.store.v4i32(<4 x i32>, <4 x i32>, i32, i32, i32, i32, i32, i32, i1, i1) #0
|
LiveIntervalAnalysis: fix a crash in repairOldRegInRange
Summary:
See the new test case for one that was (non-deterministically) crashing
on trunk and deterministically hit the assertion that I added in D23302.
Basically, the machine function contains a sequence
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
%vreg14:sub1<def> = COPY %vreg14:sub0
and SILoadStoreOptimizer::mergeWrite2Pair merges the two DS_WRITE_B32
instructions into one before calling repairIntervalsInRange.
Now repairIntervalsInRange wants to repair %vreg14, in particular, and
ends up trying to repair %vreg14:sub1 as well, but that only becomes
active _after_ the range that is to be repaired, hence the crash due
to LR.find(...) == LR.begin() at the start of repairOldRegInRange.
I believe that just skipping those subrange is fine, but again, not too
familiar with that code.
Reviewers: MatzeB, kparzysz, tstellarAMD
Subscribers: llvm-commits, MatzeB
Differential Revision: https://reviews.llvm.org/D23303
llvm-svn: 278268
2016-08-11 02:51:14 +08:00
|
|
|
|
|
|
|
attributes #0 = { nounwind }
|