2017-02-04 08:10:22 +08:00
|
|
|
# RUN: llc -march=amdgcn -run-pass simple-register-coalescing -o - %s | FileCheck %s
|
|
|
|
|
|
|
|
# Test that register coalescing does not allow a call to
|
|
|
|
# LIS->getInstructionIndex with a DBG_VALUE instruction, which does not have
|
|
|
|
# a slot index.
|
|
|
|
|
2017-10-25 02:04:54 +08:00
|
|
|
# CHECK: %13.sub2:sgpr_128 = S_MOV_B32 0
|
2018-10-31 07:28:27 +08:00
|
|
|
# CHECK: DBG_VALUE{{.*}} %13.sub2
|
2017-02-04 08:10:22 +08:00
|
|
|
|
|
|
|
--- |
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test(i32 addrspace(1)* %out) { ret void }
|
2017-10-25 02:04:54 +08:00
|
|
|
|
2017-02-04 08:10:22 +08:00
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !4, producer: "llvm", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4)
|
|
|
|
!1 = !DILocalVariable(name: "a", scope: !2, file: !4, line: 126, type: !6)
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!2 = distinct !DISubprogram(name: "test", scope: !4, file: !4, line: 1, type: !3, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !5)
|
2017-02-04 08:10:22 +08:00
|
|
|
!3 = !DISubroutineType(types: !4)
|
|
|
|
!4 = !{null}
|
|
|
|
!5 = !{!1}
|
|
|
|
!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 32)
|
|
|
|
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
|
|
!8 = !DIExpression()
|
|
|
|
!9 = !DILocation(line: 126, column: 9, scope: !2)
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test
|
|
|
|
tracksRegLiveness: true
|
2017-10-25 02:04:54 +08:00
|
|
|
registers:
|
2017-02-04 08:10:22 +08:00
|
|
|
- { id: 0, class: sgpr_64 }
|
|
|
|
- { id: 1, class: sreg_32_xm0 }
|
|
|
|
- { id: 2, class: sgpr_32 }
|
|
|
|
- { id: 3, class: vgpr_32 }
|
|
|
|
- { id: 4, class: sreg_64_xexec }
|
|
|
|
- { id: 5, class: sreg_32_xm0_xexec }
|
|
|
|
- { id: 6, class: sreg_32 }
|
|
|
|
- { id: 7, class: sreg_32 }
|
|
|
|
- { id: 8, class: sreg_32_xm0 }
|
|
|
|
- { id: 9, class: sreg_64 }
|
|
|
|
- { id: 10, class: sreg_32_xm0 }
|
|
|
|
- { id: 11, class: sreg_32_xm0 }
|
|
|
|
- { id: 12, class: sgpr_64 }
|
|
|
|
- { id: 13, class: sgpr_128 }
|
|
|
|
- { id: 14, class: sreg_32_xm0 }
|
|
|
|
- { id: 15, class: sreg_64 }
|
|
|
|
- { id: 16, class: vgpr_32 }
|
|
|
|
- { id: 17, class: vreg_64 }
|
|
|
|
- { id: 18, class: vgpr_32 }
|
|
|
|
- { id: 19, class: vreg_64 }
|
|
|
|
- { id: 20, class: vreg_64 }
|
2017-10-25 02:04:54 +08:00
|
|
|
liveins:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { reg: '$sgpr0_sgpr1', virtual-reg: '%0' }
|
|
|
|
- { reg: '$vgpr0', virtual-reg: '%3' }
|
2017-02-04 08:10:22 +08:00
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $sgpr0_sgpr1, $vgpr0
|
2017-10-25 02:04:54 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
%3 = COPY killed $vgpr0
|
|
|
|
%0 = COPY killed $sgpr0_sgpr1
|
2019-05-01 06:08:23 +08:00
|
|
|
%4 = S_LOAD_DWORDX2_IMM %0, 9, 0, 0 :: (non-temporal dereferenceable invariant load 8 from `i64 addrspace(4)* undef`)
|
|
|
|
%5 = S_LOAD_DWORD_IMM killed %0, 13, 0, 0 :: (non-temporal dereferenceable invariant load 4 from `i32 addrspace(4)* undef`)
|
2018-02-01 06:04:26 +08:00
|
|
|
%18 = V_ASHRREV_I32_e32 31, %3, implicit $exec
|
2017-02-04 08:10:22 +08:00
|
|
|
undef %19.sub0 = COPY killed %3
|
|
|
|
%19.sub1 = COPY killed %18
|
|
|
|
%10 = S_MOV_B32 61440
|
|
|
|
%11 = S_MOV_B32 0
|
2018-02-01 06:04:26 +08:00
|
|
|
DBG_VALUE debug-use %11, debug-use $noreg, !1, !8, debug-location !9
|
2017-02-04 08:10:22 +08:00
|
|
|
undef %12.sub0 = COPY killed %11
|
|
|
|
%12.sub1 = COPY killed %10
|
|
|
|
undef %13.sub0_sub1 = COPY killed %4
|
|
|
|
%13.sub2_sub3 = COPY killed %12
|
2018-02-01 06:04:26 +08:00
|
|
|
%20 = V_LSHL_B64 killed %19, 2, implicit $exec
|
2017-02-04 08:10:22 +08:00
|
|
|
%16 = COPY killed %5
|
[AMDGPU] Extend buffer intrinsics with swizzling
Summary:
Extend cachepolicy operand in the new VMEM buffer intrinsics
to supply information whether the buffer data is swizzled.
Also, propagate this information to MIR.
Intrinsics updated:
int_amdgcn_raw_buffer_load
int_amdgcn_raw_buffer_load_format
int_amdgcn_raw_buffer_store
int_amdgcn_raw_buffer_store_format
int_amdgcn_raw_tbuffer_load
int_amdgcn_raw_tbuffer_store
int_amdgcn_struct_buffer_load
int_amdgcn_struct_buffer_load_format
int_amdgcn_struct_buffer_store
int_amdgcn_struct_buffer_store_format
int_amdgcn_struct_tbuffer_load
int_amdgcn_struct_tbuffer_store
Furthermore, disable merging of VMEM buffer instructions
in SI Load/Store optimizer, if the "swizzled" bit on the instruction
is on.
The default value of the bit is 0, meaning that data in buffer
is linear and buffer instructions can be merged.
There is no difference in the generated code with this commit.
However, in the future it will be expected that front-ends
use buffer intrinsics with correct "swizzled" bit set.
Reviewers: arsenm, nhaehnle, tpr
Reviewed By: nhaehnle
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, arphaman, jfb, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68200
llvm-svn: 373491
2019-10-03 01:22:36 +08:00
|
|
|
BUFFER_STORE_DWORD_ADDR64 killed %16, killed %20, killed %13, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (store 4 into %ir.out)
|
[AMDGPU] Add support for immediate operand for S_ENDPGM
Summary:
Add support for immediate operand in S_ENDPGM
Change-Id: I0c56a076a10980f719fb2a8f16407e9c301013f6
Reviewers: alexshap
Subscribers: qcolombet, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, eraman, arphaman, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59213
llvm-svn: 355902
2019-03-12 17:52:58 +08:00
|
|
|
S_ENDPGM 0
|
2017-02-04 08:10:22 +08:00
|
|
|
|
|
|
|
...
|