Skip to content

[RISCV] Added test case for PR119527. NFC #121816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 7, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions llvm/test/CodeGen/RISCV/add_sext_shl_constant.ll
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,28 @@ define i64 @add_shl_moreOneUse_sh3add(i64 %x) {
ret i64 %add
}

define ptr @add_shl_sext_inttoptr(ptr %0, i32 %1) {
; RV64-LABEL: add_shl_sext_inttoptr:
; RV64: # %bb.0:
; RV64-NEXT: addi a2, a1, 3
; RV64-NEXT: sllw a1, a2, a1
; RV64-NEXT: li a0, 0
; RV64-NEXT: ret
%3 = add i32 %1, 3
%4 = shl i32 %3, %1
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to ptr
%7 = icmp ugt ptr %0, %6
br i1 %7, label %10, label %8

8:
%9 = load i8, ptr null, align 1
br label %10

10:
ret ptr null
}

define i64 @add_shl_moreOneUse_sh4add(i64 %x) {
; RV64-LABEL: add_shl_moreOneUse_sh4add:
; RV64: # %bb.0:
Expand Down
Loading