llvm.org GIT mirror llvm / 655ba25
R600: Begin private memory at the second GPR. This way private memory does not over-write work group information stored in GPRs 0 and 1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199824 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 6 years ago
2 changed file(s) with 29 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
7373 int AMDGPUFrameLowering::getFrameIndexOffset(const MachineFunction &MF,
7474 int FI) const {
7575 const MachineFrameInfo *MFI = MF.getFrameInfo();
76 unsigned Offset = 0;
76 // Start the offset at 2 so we don't overwrite work group information.
77 // XXX: We should only do this when the shader actually uses this
78 // information.
79 unsigned Offset = 2;
7780 int UpperBound = FI == -1 ? MFI->getNumObjects() : FI;
7881
7982 for (int i = MFI->getObjectIndexBegin(); i < UpperBound; ++i) {
155155 ret void
156156
157157 }
158
159 ; Make sure we don't overwrite workitem information with private memory
160
161 ; FUNC-LABEL: @work_item_info
162 ; R600-CHECK-NOT: MOV T0.X
163 ; Additional check in case the move ends up in the last slot
164 ; R600-CHECK-NOT: MOV * TO.X
165
166 ; SI-CHECK-NOT: V_MOV_B32_e{{(32|64)}} v0
167 define void @work_item_info(i32 addrspace(1)* %out, i32 %in) {
168 entry:
169 %0 = alloca [2 x i32]
170 %1 = getelementptr [2 x i32]* %0, i32 0, i32 0
171 %2 = getelementptr [2 x i32]* %0, i32 0, i32 1
172 store i32 0, i32* %1
173 store i32 1, i32* %2
174 %3 = getelementptr [2 x i32]* %0, i32 0, i32 %in
175 %4 = load i32* %3
176 %5 = call i32 @llvm.r600.read.tidig.x()
177 %6 = add i32 %4, %5
178 store i32 %6, i32 addrspace(1)* %out
179 ret void
180 }
181
182 declare i32 @llvm.r600.read.tidig.x() nounwind readnone