File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
test/Transforms/SeparateConstOffsetFromGEP/AMDGPU Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1353,6 +1353,11 @@ bool SeparateConstOffsetFromGEP::isLegalToSwapOperand(
13531353}
13541354
13551355bool SeparateConstOffsetFromGEP::hasMoreThanOneUseInLoop (Value *V, Loop *L) {
1356+ // TODO: Could look at uses of globals, but we need to make sure we are
1357+ // looking at the correct function.
1358+ if (isa<Constant>(V))
1359+ return false ;
1360+
13561361 int UsesInLoop = 0 ;
13571362 for (User *U : V->users ()) {
13581363 if (Instruction *User = dyn_cast<Instruction>(U))
Original file line number Diff line number Diff line change @@ -425,8 +425,8 @@ define amdgpu_kernel void @multi_use_in_loop_global_base_address(ptr addrspace(1
425425; CHECK-NEXT: [[TMP25]] = add nuw nsw i32 [[TMP13]], 1
426426; CHECK-NEXT: [[TMP0:%.*]] = sext i32 [[TMP13]] to i64
427427; CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[TMP0]], 2
428- ; CHECK-NEXT: [[UGLYGEP:%.*]] = getelementptr i8, ptr addrspace(1) @extern_array_1, i64 [[TMP1]]
429- ; CHECK-NEXT: [[UGLYGEP2:%.*]] = getelementptr i8, ptr addrspace(1) [[UGLYGEP]], i64 4
428+ ; CHECK-NEXT: [[UGLYGEP:%.*]] = getelementptr i8, ptr addrspace(1) @extern_array_1, i64 4
429+ ; CHECK-NEXT: [[UGLYGEP2:%.*]] = getelementptr i8, ptr addrspace(1) [[UGLYGEP]], i64 [[TMP1]]
430430; CHECK-NEXT: [[TMP28:%.*]] = load i32, ptr addrspace(1) [[UGLYGEP2]], align 4
431431; CHECK-NEXT: [[TMP29:%.*]] = add i32 [[TMP24]], [[TMP12]]
432432; CHECK-NEXT: [[TMP30]] = add i32 [[TMP29]], [[TMP28]]
You can’t perform that action at this time.
0 commit comments