Skip to content

Commit 9790a2a

Browse files
vfdffPeilin Guo
authored andcommitted
[tests] precommit tests for D107692
1 parent 8f5e9d6 commit 9790a2a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc -mtriple=aarch64-linux-gnu -O3 < %s | FileCheck %s
3+
4+
; Disable the dagcombine if operand has multi use
5+
6+
@g = global i16 0, align 4
7+
define i32 @srl_and() {
8+
; CHECK-LABEL: srl_and:
9+
; CHECK: // %bb.0: // %entry
10+
; CHECK-NEXT: adrp x8, :got:g
11+
; CHECK-NEXT: ldr x8, [x8, :got_lo12:g]
12+
; CHECK-NEXT: mov w9, #50
13+
; CHECK-NEXT: ldrh w8, [x8]
14+
; CHECK-NEXT: eor w8, w8, w9
15+
; CHECK-NEXT: sub w8, w8, #1
16+
; CHECK-NEXT: and w0, w8, w8, lsr #16
17+
; CHECK-NEXT: ret
18+
entry:
19+
%0 = load i16, i16* @g, align 4
20+
%1 = xor i16 %0, 50
21+
%tobool = icmp ne i16 %1, 0
22+
%lor.ext = zext i1 %tobool to i32
23+
%sub = add i16 %1, -1
24+
25+
%srl = zext i16 %sub to i32
26+
%and = and i32 %srl, %lor.ext
27+
28+
ret i32 %and
29+
}

0 commit comments

Comments
 (0)