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(
1353
1353
}
1354
1354
1355
1355
bool 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
+
1356
1361
int UsesInLoop = 0 ;
1357
1362
for (User *U : V->users ()) {
1358
1363
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
425
425
; CHECK-NEXT: [[TMP25]] = add nuw nsw i32 [[TMP13]], 1
426
426
; CHECK-NEXT: [[TMP0:%.*]] = sext i32 [[TMP13]] to i64
427
427
; 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]]
430
430
; CHECK-NEXT: [[TMP28:%.*]] = load i32, ptr addrspace(1) [[UGLYGEP2]], align 4
431
431
; CHECK-NEXT: [[TMP29:%.*]] = add i32 [[TMP24]], [[TMP12]]
432
432
; CHECK-NEXT: [[TMP30]] = add i32 [[TMP29]], [[TMP28]]
You can’t perform that action at this time.
0 commit comments