1 ; RUN: llc -mtriple=hexagon < %s | FileCheck %s
3 ; This patch corrects the order of operands in the pattern that lowers funnel
6 ; CHECK: r[[R17:[0-9]+]]:[[R16:[0-9]+]] = combine
8 ; CHECK: r[[R1:[0-9]+]]:[[R0:[0-9]+]] = asl(r[[R1]]:[[R0]],#63)
9 ; CHECK: r[[R1]]:[[R0]] |= lsr(r[[R17]]:[[R16]],#1)
11 target triple = "hexagon-unknown-unknown-elf"
13 define dso_local i64 @fshl(i64 %x, i64 %y) {
15 %x.addr = alloca i64, align 8
16 %y.addr = alloca i64, align 8
17 store i64 %x, ptr %x.addr, align 8
18 store i64 %y, ptr %y.addr, align 8
19 %0 = load i64, ptr %x.addr, align 8
21 %1 = load i64, ptr %x.addr, align 8
22 %2 = load i64, ptr %y.addr, align 8
23 %call = call i64 @parity(i64 %1, i64 %2)
24 %shl = shl i64 %call, 63
25 %or = or i64 %shr, %shl
26 store i64 %or, ptr %x.addr, align 8
27 %3 = load i64, ptr %x.addr, align 8
31 declare dso_local i64 @parity(i64, i64)