Skip to content

Commit 14d9bb2

Browse files
Added slightly different test case
1 parent 20a1b18 commit 14d9bb2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

llvm/test/CodeGen/RISCV/add_sext_shl_constant.ll

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,28 @@ define i64 @add_shl_moreOneUse_sh3add(i64 %x) {
320320
ret i64 %add
321321
}
322322

323+
define ptr @add_shl_sext_inttoptr(ptr %0, i32 %1) {
324+
; RV64-LABEL: add_shl_sext_inttoptr:
325+
; RV64: # %bb.0:
326+
; RV64-NEXT: addi a2, a1, 3
327+
; RV64-NEXT: sllw a1, a2, a1
328+
; RV64-NEXT: li a0, 0
329+
; RV64-NEXT: ret
330+
%3 = add i32 %1, 3
331+
%4 = shl i32 %3, %1
332+
%5 = sext i32 %4 to i64
333+
%6 = inttoptr i64 %5 to ptr
334+
%7 = icmp ugt ptr %0, %6
335+
br i1 %7, label %10, label %8
336+
337+
8:
338+
%9 = load i8, ptr null, align 1
339+
br label %10
340+
341+
10:
342+
ret ptr null
343+
}
344+
323345
define i64 @add_shl_moreOneUse_sh4add(i64 %x) {
324346
; RV64-LABEL: add_shl_moreOneUse_sh4add:
325347
; RV64: # %bb.0:

0 commit comments

Comments
 (0)