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 all 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
13 changes: 13 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,19 @@ define i64 @add_shl_moreOneUse_sh3add(i64 %x) {
ret i64 %add
}

;; Covers a case which previously crashed (pr119527)
define i64 @add_shl_sext(i32 %1) {
; RV64-LABEL: add_shl_sext:
; RV64: # %bb.0:
; RV64-NEXT: addi a1, a0, 3
; RV64-NEXT: sllw a0, a1, a0
; RV64-NEXT: ret
%3 = add i32 %1, 3
%4 = shl i32 %3, %1
%5 = sext i32 %4 to i64
ret i64 %5
}

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