Skip to content

Commit 862a31e

Browse files
vladimirradosavljevicakiramenai
authored andcommitted
[EraVM] Add pre-commit test for Add memref to instructions with constant pool operand
Add test where and instruction is not sink to its use. Signed-off-by: Vladimir Radosavljevic <[email protected]>
1 parent 9f3d109 commit 862a31e

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2+
; RUN: llc -O3 < %s | FileCheck %s
3+
4+
target datalayout = "E-p:256:256-i256:256:256-S32-a:256:256"
5+
target triple = "eravm"
6+
7+
declare void @use(i256)
8+
9+
define i256 @test(i256 %in, i1 %cond) {
10+
; CHECK-LABEL: test:
11+
; CHECK: ; %bb.0: ; %entry
12+
; CHECK-NEXT: and @CPI0_0[0], r1, r1
13+
; CHECK-NEXT: sub! r2, r0, r2
14+
; CHECK-NEXT: jump.eq @.BB0_2
15+
; CHECK-NEXT: ; %bb.1: ; %bb1
16+
; CHECK-NEXT: near_call r0, @use, @DEFAULT_UNWIND
17+
; CHECK-NEXT: add r0, r0, r1
18+
; CHECK-NEXT: ret
19+
; CHECK-NEXT: .BB0_2: ; %bb2
20+
; CHECK-NEXT: add 5, r0, r1
21+
; CHECK-NEXT: near_call r0, @use, @DEFAULT_UNWIND
22+
; CHECK-NEXT: add 1, r0, r1
23+
; CHECK-NEXT: ret
24+
entry:
25+
%and = and i256 %in, 123456789
26+
br i1 %cond, label %bb1, label %bb2
27+
28+
bb1:
29+
call void @use(i256 %and)
30+
ret i256 0
31+
32+
bb2:
33+
call void @use(i256 5)
34+
ret i256 1
35+
}

0 commit comments

Comments
 (0)