Skip to content

Commit 20a1b18

Browse files
Added test case
1 parent 1332db3 commit 20a1b18

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2+
; RUN: llc -mtriple=riscv64 < %s | FileCheck -check-prefixes=NO-ZBA %s
3+
; RUN: llc -mtriple=riscv64 -mattr=+zba < %s | FileCheck -check-prefixes=ZBA %s
4+
5+
define ptr @g(ptr %0, i32 %1) {
6+
; NO-ZBA-LABEL: g:
7+
; NO-ZBA: # %bb.0:
8+
; NO-ZBA-NEXT: slli a2, a1, 1
9+
; NO-ZBA-NEXT: add a2, a2, a1
10+
; NO-ZBA-NEXT: sllw a1, a2, a1
11+
; NO-ZBA-NEXT: li a0, 0
12+
; NO-ZBA-NEXT: ret
13+
;
14+
; ZBA-LABEL: g:
15+
; ZBA: # %bb.0:
16+
; ZBA-NEXT: sh1add a2, a1, a1
17+
; ZBA-NEXT: sllw a1, a2, a1
18+
; ZBA-NEXT: li a0, 0
19+
; ZBA-NEXT: ret
20+
%3 = mul i32 %1, 3
21+
%4 = shl i32 %3, %1
22+
%5 = sext i32 %4 to i64
23+
%6 = inttoptr i64 %5 to ptr
24+
%7 = icmp ugt ptr %0, %6
25+
br i1 %7, label %10, label %8
26+
27+
8: ; preds = %2
28+
%9 = load i8, ptr null, align 1
29+
br label %10
30+
31+
10: ; preds = %8, %2
32+
ret ptr null
33+
}

0 commit comments

Comments
 (0)