1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -O3 < %s | FileCheck %s
4 ; Disable the dagcombine if operand has multi use
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
19 %0 = load i16, i16* @g, align 4
21 %tobool = icmp ne i16 %1, 0
22 %lor.ext = zext i1 %tobool to i32
25 %srl = zext i16 %sub to i32
26 %and = and i32 %srl, %lor.ext